scilab: add missing helper and init functions in gateway XML
This commit is contained in:
parent
7b2af1de70
commit
27a9fe476e
1 changed files with 17 additions and 11 deletions
|
|
@ -196,7 +196,7 @@ public:
|
||||||
Printf(moduleInitFunctionName, "%s_Init", moduleName);
|
Printf(moduleInitFunctionName, "%s_Init", moduleName);
|
||||||
|
|
||||||
/* Add initialization function to builder table */
|
/* Add initialization function to builder table */
|
||||||
addFunctionInBuilder(moduleInitFunctionName, moduleInitFunctionName);
|
addFunctionToScilab(moduleInitFunctionName, moduleInitFunctionName);
|
||||||
|
|
||||||
// Add helper functions to builder table
|
// Add helper functions to builder table
|
||||||
addHelperFunctions();
|
addHelperFunctions();
|
||||||
|
|
@ -466,16 +466,12 @@ public:
|
||||||
|
|
||||||
/* Update builder.sce contents */
|
/* Update builder.sce contents */
|
||||||
if (isLastOverloaded) {
|
if (isLastOverloaded) {
|
||||||
addFunctionInBuilder(functionName, wrapperName);
|
addFunctionToScilab(functionName, wrapperName);
|
||||||
dispatchFunction(node);
|
dispatchFunction(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isOverloaded) {
|
if (!isOverloaded) {
|
||||||
addFunctionInBuilder(functionName, wrapperName);
|
addFunctionToScilab(functionName, wrapperName);
|
||||||
}
|
|
||||||
|
|
||||||
if (gatewayID) {
|
|
||||||
Printf(gatewayXML, "<PRIMITIVE gatewayId=\"%s\" primitiveId=\"%d\" primitiveName=\"%s\"/>\n", gatewayID, primitiveID++, functionName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tidy up */
|
/* tidy up */
|
||||||
|
|
@ -561,7 +557,7 @@ public:
|
||||||
Wrapper_print(getFunctionWrapper, wrappersSection);
|
Wrapper_print(getFunctionWrapper, wrappersSection);
|
||||||
|
|
||||||
/* Add function to builder table */
|
/* Add function to builder table */
|
||||||
addFunctionInBuilder(getFunctionName, getFunctionName);
|
addFunctionToScilab(getFunctionName, getFunctionName);
|
||||||
|
|
||||||
/* Manage SET function */
|
/* Manage SET function */
|
||||||
if (is_assignable(node)) {
|
if (is_assignable(node)) {
|
||||||
|
|
@ -727,8 +723,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void addHelperFunctions() {
|
void addHelperFunctions() {
|
||||||
addFunctionInBuilder("swig_this", "swig_this");
|
addFunctionToScilab("swig_this", "swig_this");
|
||||||
addFunctionInBuilder("swig_ptr", "swig_ptr");
|
addFunctionToScilab("swig_ptr", "swig_ptr");
|
||||||
}
|
}
|
||||||
|
|
||||||
void createBuilderFile() {
|
void createBuilderFile() {
|
||||||
|
|
@ -855,10 +851,20 @@ public:
|
||||||
Delete(gatewayXMLFile);
|
Delete(gatewayXMLFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -----------------------------------------------------------------------
|
||||||
|
* addFunctionToScilab: add a function in Scilab (builder, XML, ...)
|
||||||
|
* ----------------------------------------------------------------------- */
|
||||||
|
void addFunctionToScilab(const_String_or_char_ptr scilabFunctionName, const_String_or_char_ptr wrapperFunctionName)
|
||||||
|
{
|
||||||
|
addFunctionInBuilder(scilabFunctionName, wrapperFunctionName);
|
||||||
|
if (gatewayID) {
|
||||||
|
Printf(gatewayXML, "<PRIMITIVE gatewayId=\"%s\" primitiveId=\"%d\" primitiveName=\"%s\"/>\n", gatewayID, primitiveID++, scilabFunctionName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------
|
/* -----------------------------------------------------------------------
|
||||||
* addFunctionInBuilder(): add a new function wrapper in builder.sce file
|
* addFunctionInBuilder(): add a new function wrapper in builder.sce file
|
||||||
* ----------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
void addFunctionInBuilder(const_String_or_char_ptr scilabFunctionName, const_String_or_char_ptr wrapperFunctionName) {
|
void addFunctionInBuilder(const_String_or_char_ptr scilabFunctionName, const_String_or_char_ptr wrapperFunctionName) {
|
||||||
if (generateBuilder) {
|
if (generateBuilder) {
|
||||||
if (++builderFunctionCount % 10 == 0) {
|
if (++builderFunctionCount % 10 == 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue