scilab: add pointer conversion builtin functions swig_this & swig_ptr

This commit is contained in:
Simon Marchetto 2014-03-28 15:01:01 +01:00
commit 675c4cee0f
5 changed files with 97 additions and 7 deletions

View file

@ -176,6 +176,9 @@ public:
/* Add initialization function to builder table */
addFunctionInBuilder(moduleInitFunctionName, moduleInitFunctionName);
// Add helper functions to builder table
addHelperFunctions();
// Open Scilab wrapper variables creation function
variablesCode = NewString("");
Printf(variablesCode, "int %s() {\n", SWIG_CREATE_VARIABLES_FUNCTION_NAME);
@ -206,6 +209,7 @@ public:
/* Write all to the wrapper file */
SwigType_emit_type_table(runtimeSection, wrappersSection); // Declare pointer types, ... (Ex: SWIGTYPE_p_p_double)
Dump(runtimeSection, beginSection);
Dump(headerSection, beginSection);
Dump(wrappersSection, beginSection);
@ -691,6 +695,11 @@ public:
}
}
void addHelperFunctions() {
addFunctionInBuilder("swig_this", "swig_this");
addFunctionInBuilder("swig_ptr", "swig_ptr");
}
void createBuilderFile() {
String *builderFilename = NewStringf("%sbuilder.sce", SWIG_output_directory());
builderFile = NewFile(builderFilename, "w", SWIG_output_files());