    

 ## On this page

  

 

 # sos\_capi\_script

 Last update: 22.02.2024 

[Go to the documentation of this file.](sos__capi__script_8h.xhtml)<a id="l00001" name="l00001"></a> 1 

<a id="l00002" name="l00002"></a> 2 \#ifndef DYNARDO\_SOS\_SCRIPT\_H

<a id="l00003" name="l00003"></a> 3  #define DYNARDO\_SOS\_SCRIPT\_H

<a id="l00004" name="l00004"></a> 4 

<a id="l00005" name="l00005"></a> 5 \#include "[sos\_capi\_common.h](sos__capi__common_8h.xhtml)"

<a id="l00006" name="l00006"></a> 6 

<a id="l00026" name="l00026"></a> 26 

<a id="l00027" name="l00027"></a> 27 \#ifdef \_\_cplusplus

<a id="l00028" name="l00028"></a> 28 extern "C" {

<a id="l00029" name="l00029"></a> 29 \#endif

<a id="l00030" name="l00030"></a> 30 

<a id="l00031" name="l00031"></a> 31 /\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

<a id="l00032" name="l00032"></a> 32 

<a id="l00041" name="l00041"></a> 41 \#ifdef DYNARDO\_FMOP\_DLL\_EXPORTS

<a id="l00042" name="l00042"></a> 42 typedef class FMOP_ScriptInterpreter* [fmop\_script\_handle\_t](sos__capi__script_8h.xhtml#aab8ff16aaa9cf05fccc70920f4b62bfb);

<a id="l00043" name="l00043"></a> 43 \#else

<a id="l00044" name="l00044"></a>[ 44](sos__capi__script_8h.xhtml#aab8ff16aaa9cf05fccc70920f4b62bfb) typedef void* [fmop\_script\_handle\_t](sos__capi__script_8h.xhtml#aab8ff16aaa9cf05fccc70920f4b62bfb);

<a id="l00045" name="l00045"></a> 45 \#endif

<a id="l00046" name="l00046"></a> 46 

<a id="l00047" name="l00047"></a> 47 

<a id="l00048" name="l00048"></a> 48 /\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

<a id="l00054" name="l00054"></a> 54 

<a id="l00055" name="l00055"></a> 55 

<a id="l00056" name="l00056"></a> 56 /\*

<a id="l00057" name="l00057"></a> 57  \*

<a id="l00058" name="l00058"></a> 58 \#ifndef DOXYGEN\_IGNORE

<a id="l00078" name="l00078"></a> 78 DYNARDO\_FMOP\_API fmop\_error\_t FMOP\_loadDbBuf

<a id="l00079" name="l00079"></a> 79  ( fmop\_db\_handle\_t \* database, const char\* buffer, const size\_t \* length );

<a id="l00080" name="l00080"></a> 80  

<a id="l00081" name="l00081"></a> 81 // FMOP\_saveDbBuf

<a id="l00082" name="l00082"></a> 82  

<a id="l00083" name="l00083"></a> 83 \#endif

<a id="l00084" name="l00084"></a> 84  

<a id="l00085" name="l00085"></a> 85  

<a id="l00086" name="l00086"></a> 86 \*/

<a id="l00087" name="l00087"></a> 87 

<a id="l00088" name="l00088"></a> 88 

<a id="l00089" name="l00089"></a> 89 

<a id="l00098" name="l00098"></a>[ 98](sos__capi__script_8h.xhtml#ace6f8c522f626dddbf5fc12d4d1d7a11) DYNARDO_FMOP_API [fmop\_script\_handle\_t](sos__capi__script_8h.xhtml#aab8ff16aaa9cf05fccc70920f4b62bfb) [FMOP\_globalScriptEngine](sos__capi__script_8h.xhtml#ace6f8c522f626dddbf5fc12d4d1d7a11)();

<a id="l00099" name="l00099"></a> 99 

<a id="l00113" name="l00113"></a>[ 113](sos__capi__script_8h.xhtml#a585497e6891f11a032944d26f3b0d9c0) DYNARDO_FMOP_API [fmop\_error\_t](sos__capi__common_8h.xhtml#a4847f3fa2943ffd694eb6cbe169a8bec) [FMOP\_script\_execute](sos__capi__script_8h.xhtml#a585497e6891f11a032944d26f3b0d9c0)([fmop\_script\_handle\_t](sos__capi__script_8h.xhtml#aab8ff16aaa9cf05fccc70920f4b62bfb) context,

<a id="l00114" name="l00114"></a> 114 const char * const script);

<a id="l00115" name="l00115"></a> 115 

<a id="l00130" name="l00130"></a>[ 130](sos__capi__script_8h.xhtml#a86518674fc7aa5571d44f5d8544879f0) DYNARDO_FMOP_API [fmop\_error\_t](sos__capi__common_8h.xhtml#a4847f3fa2943ffd694eb6cbe169a8bec) [FMOP\_script\_createMatrix](sos__capi__script_8h.xhtml#a86518674fc7aa5571d44f5d8544879f0)([fmop\_script\_handle\_t](sos__capi__script_8h.xhtml#aab8ff16aaa9cf05fccc70920f4b62bfb) context,

<a id="l00131" name="l00131"></a> 131 const char * const ident,

<a id="l00132" name="l00132"></a> 132 int rows, int cols, const double * const data);

<a id="l00133" name="l00133"></a> 133 

<a id="l00150" name="l00150"></a>[ 150](sos__capi__script_8h.xhtml#afe7c32369056cdee19411d3924538d5d) DYNARDO_FMOP_API [fmop\_error\_t](sos__capi__common_8h.xhtml#a4847f3fa2943ffd694eb6cbe169a8bec) [FMOP\_script\_getMatrix](sos__capi__script_8h.xhtml#afe7c32369056cdee19411d3924538d5d)([fmop\_script\_handle\_t](sos__capi__script_8h.xhtml#aab8ff16aaa9cf05fccc70920f4b62bfb) context,

<a id="l00151" name="l00151"></a> 151 const char * const ident,

<a id="l00152" name="l00152"></a> 152 int * rows, int *cols, const double **data);

<a id="l00153" name="l00153"></a> 153 

<a id="l00165" name="l00165"></a>[ 165](sos__capi__script_8h.xhtml#acd830885fbde66f6d3133d7f1e943796) DYNARDO_FMOP_API [fmop\_error\_t](sos__capi__common_8h.xhtml#a4847f3fa2943ffd694eb6cbe169a8bec) [FMOP\_script\_createNumber](sos__capi__script_8h.xhtml#acd830885fbde66f6d3133d7f1e943796)([fmop\_script\_handle\_t](sos__capi__script_8h.xhtml#aab8ff16aaa9cf05fccc70920f4b62bfb) context,

<a id="l00166" name="l00166"></a> 166 const char * const ident,

<a id="l00167" name="l00167"></a> 167 double data);

<a id="l00168" name="l00168"></a> 168 

<a id="l00169" name="l00169"></a> 169 

<a id="l00182" name="l00182"></a>[ 182](sos__capi__script_8h.xhtml#a6b01058d679a651d52882f928caa14e7) DYNARDO_FMOP_API [fmop\_error\_t](sos__capi__common_8h.xhtml#a4847f3fa2943ffd694eb6cbe169a8bec) [FMOP\_script\_getNumber](sos__capi__script_8h.xhtml#a6b01058d679a651d52882f928caa14e7)([fmop\_script\_handle\_t](sos__capi__script_8h.xhtml#aab8ff16aaa9cf05fccc70920f4b62bfb) context,

<a id="l00183" name="l00183"></a> 183 const char * const ident,

<a id="l00184" name="l00184"></a> 184 double * const data);

<a id="l00185" name="l00185"></a> 185 

<a id="l00196" name="l00196"></a>[ 196](sos__capi__script_8h.xhtml#a31383b3c0eb3e408c74430b1cd610183) DYNARDO_FMOP_API [fmop\_error\_t](sos__capi__common_8h.xhtml#a4847f3fa2943ffd694eb6cbe169a8bec) [FMOP\_script\_createString](sos__capi__script_8h.xhtml#a31383b3c0eb3e408c74430b1cd610183)([fmop\_script\_handle\_t](sos__capi__script_8h.xhtml#aab8ff16aaa9cf05fccc70920f4b62bfb) context,

<a id="l00197" name="l00197"></a> 197 const char * const ident,

<a id="l00198" name="l00198"></a> 198 const char * const data);

<a id="l00199" name="l00199"></a> 199 

<a id="l00211" name="l00211"></a>[ 211](sos__capi__script_8h.xhtml#ac1304b306d77e15fcfd1e99603bbff62) DYNARDO_FMOP_API [fmop\_error\_t](sos__capi__common_8h.xhtml#a4847f3fa2943ffd694eb6cbe169a8bec) [FMOP\_script\_getString](sos__capi__script_8h.xhtml#ac1304b306d77e15fcfd1e99603bbff62)([fmop\_script\_handle\_t](sos__capi__script_8h.xhtml#aab8ff16aaa9cf05fccc70920f4b62bfb) context,

<a id="l00212" name="l00212"></a> 212 const char * const ident,

<a id="l00213" name="l00213"></a> 213 const char **data);

<a id="l00214" name="l00214"></a> 214 

<a id="l00223" name="l00223"></a>[ 223](sos__capi__script_8h.xhtml#adaf34349f4a16e537f5fe8a5ceb52856) DYNARDO_FMOP_API bool [FMOP\_script\_identExists](sos__capi__script_8h.xhtml#adaf34349f4a16e537f5fe8a5ceb52856)([fmop\_script\_handle\_t](sos__capi__script_8h.xhtml#aab8ff16aaa9cf05fccc70920f4b62bfb) context, const char * const ident);

<a id="l00224" name="l00224"></a> 224 

<a id="l00226" name="l00226"></a> 226 

<a id="l00227" name="l00227"></a> 227 \#ifdef \_\_cplusplus

<a id="l00228" name="l00228"></a> 228 }

<a id="l00229" name="l00229"></a> 229 \#endif

<a id="l00230" name="l00230"></a> 230 

<a id="l00231" name="l00231"></a> 231 \#endif // DYNARDO\_SOS\_SCRIPT\_H

<a id="l00232" name="l00232"></a> 232 

<a id="l00233" name="l00233"></a> 233 // (c) 2018, DYNARDO Austria GmbH (proprietary license)

[sos\_capi\_common.h](sos__capi__common_8h.xhtml)

C-API for utility functions (load/unload library, license management, error handling)



[fmop\_error\_t](sos__capi__common_8h.xhtml#a4847f3fa2943ffd694eb6cbe169a8bec)

fmop_error_t

Error code definitions.

**Definition:** sos_capi_common.h:80



[FMOP\_script\_createString](sos__capi__script_8h.xhtml#a31383b3c0eb3e408c74430b1cd610183)

DYNARDO_FMOP_API fmop_error_t FMOP_script_createString(fmop_script_handle_t context, const char *const ident, const char *const data)

Create a string variable in the Lua script context.



[FMOP\_script\_execute](sos__capi__script_8h.xhtml#a585497e6891f11a032944d26f3b0d9c0)

DYNARDO_FMOP_API fmop_error_t FMOP_script_execute(fmop_script_handle_t context, const char *const script)

Execute Lua script code. The script engine has the ability to parse and execute:



[FMOP\_script\_getNumber](sos__capi__script_8h.xhtml#a6b01058d679a651d52882f928caa14e7)

DYNARDO_FMOP_API fmop_error_t FMOP_script_getNumber(fmop_script_handle_t context, const char *const ident, double *const data)

Retrieve the pointer to a number variable in the Lua script context. The number is is stored in doubl...



[FMOP\_script\_createMatrix](sos__capi__script_8h.xhtml#a86518674fc7aa5571d44f5d8544879f0)

DYNARDO_FMOP_API fmop_error_t FMOP_script_createMatrix(fmop_script_handle_t context, const char *const ident, int rows, int cols, const double *const data)

Creates a tmath.Matrix in Lua script context. This version may be more efficient than creating a matr...



[fmop\_script\_handle\_t](sos__capi__script_8h.xhtml#aab8ff16aaa9cf05fccc70920f4b62bfb)

void * fmop_script_handle_t

Contains the data required to post-process any Field-MOP.

**Definition:** sos_capi_script.h:44



[FMOP\_script\_getString](sos__capi__script_8h.xhtml#ac1304b306d77e15fcfd1e99603bbff62)

DYNARDO_FMOP_API fmop_error_t FMOP_script_getString(fmop_script_handle_t context, const char *const ident, const char **data)

Retrieve the char array pointer to a string variable in the Lua script context. The data can be retri...



[FMOP\_script\_createNumber](sos__capi__script_8h.xhtml#acd830885fbde66f6d3133d7f1e943796)

DYNARDO_FMOP_API fmop_error_t FMOP_script_createNumber(fmop_script_handle_t context, const char *const ident, double data)

Creates a double precision floating point number variable in the Lua script context.



[FMOP\_globalScriptEngine](sos__capi__script_8h.xhtml#ace6f8c522f626dddbf5fc12d4d1d7a11)

DYNARDO_FMOP_API fmop_script_handle_t FMOP_globalScriptEngine()

Get the handle to the global script engine from the initialized library. The routine checks if the Lu...



[FMOP\_script\_identExists](sos__capi__script_8h.xhtml#adaf34349f4a16e537f5fe8a5ceb52856)

DYNARDO_FMOP_API bool FMOP_script_identExists(fmop_script_handle_t context, const char *const ident)

Check whether a variable exists in the Lua script context.



[FMOP\_script\_getMatrix](sos__capi__script_8h.xhtml#afe7c32369056cdee19411d3924538d5d)

DYNARDO_FMOP_API fmop_error_t FMOP_script_getMatrix(fmop_script_handle_t context, const char *const ident, int *rows, int *cols, const double **data)

Retrieves the binary data of a tmath.Matrix existing in the Lua script context The matrix must be sav...