    

 ## On this page

  

 

 # sos\_capi\_script

 Last update: 10.02.2025 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<a name="l00223"></a> 223 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 name="l00224"></a> 224

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

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

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

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

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

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

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

<a 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\_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\_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\_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...



[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\_error\_t](group__types.xhtml#ga4847f3fa2943ffd694eb6cbe169a8bec)

fmop_error_t

Error code definitions. 

**Definition:** sos_capi_common.h:80



[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\_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\_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\_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.