Skip to main content

optiSLang C API of FMOPSolver Library 2025 R1

sos_capi_common

Last update: 10.02.2025
Go to the documentation of this file.
1 
2 #ifndef DYNARDO_SOS_CAPI_COMMON_H
3  #define DYNARDO_SOS_CAPI_COMMON_H
4 
6 
7 // Generic helper definitions for shared library support
8 //#if (defined _WIN32 || defined __CYGWIN__) && (not defined MINGW)
9 #if defined _WIN32 || defined __CYGWIN__
10  #define DYNARDO_HELPER_DLL_IMPORT __declspec(dllimport)
11  #define DYNARDO_HELPER_DLL_EXPORT __declspec(dllexport)
12  #define DYNARDO_HELPER_DLL_LOCAL
13 #else
14  #if __GNUC__ >= 4
15  #define DYNARDO_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
16  #define DYNARDO_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
17  #define DYNARDO_HELPER_DLL_LOCAL __attribute__ ((visibility ("hidden")))
18  #else
19  #define DYNARDO_HELPER_DLL_IMPORT
20  #define DYNARDO_HELPER_DLL_EXPORT
21  #define DYNARDO_HELPER_DLL_LOCAL
22  #endif
23 #endif
24 
25 // Now we use the generic helper definitions above to define DYNARDO_FMOP_API and DYNARDO_FMOP_LOCAL.
26 // DYNARDO_FMOP_API is used for the public API symbols. It either DLL imports or DLL exports (or does nothing
27 // for static build)
28 // DYNARDO_FMOP_LOCAL is used for non-api symbols.
29 
30 #ifdef DYNARDO_DLL // defined if the library is compiled as a DLL
31  #ifdef DYNARDO_FMOP_DLL_EXPORTS // defined if we are building the DYNARDO DLL (instead of using it)
32  #define DYNARDO_FMOP_API DYNARDO_HELPER_DLL_EXPORT
33  #else
34  #define DYNARDO_FMOP_API DYNARDO_HELPER_DLL_IMPORT
35  #endif // DYNARDO_FMOP_DLL_EXPORTS
36  #define DYNARDO_FMOP_LOCAL DYNARDO_HELPER_DLL_LOCAL
37 #else // DYNARDO_DLL is not defined: this means we compile a static lib.
38  #define DYNARDO_FMOP_API
39  #define DYNARDO_FMOP_LOCAL
40 #endif // DYNARDO_DLL
41 
42 #ifndef __cplusplus
43  #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
44  #include <stdbool.h>
45  #elif !defined(false) && !defined(true)
46  typedef int bool;
47  #define false 0
48  #define true 1
49  #endif
50  #include <stddef.h>
51 #else
52  #include <cstddef>
53 #endif
54 
55 
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
62 
67 
68 /*********************************************/
75 
80 typedef enum
81 {
91 
93 
94  fmop_const_max = 16383
95 
96 } fmop_error_t;
97 
101 typedef enum
102 {
103  // Mesh related features
104  // Predefined feature combinations
108 
112 typedef enum
113 {
118 
119 
121 
122 /*********************************************/
129 
131 
149 DYNARDO_FMOP_API fmop_error_t FMOP_appendLicenseSearchPath ( const char * abs_path );
160 DYNARDO_FMOP_API fmop_error_t FMOP_acquireLicense ( );
165 DYNARDO_FMOP_API bool FMOP_licenseLocked ();
177 DYNARDO_FMOP_API fmop_error_t FMOP_releaseLicense ();
178 
180 
181 
182 /*********************************************/
189 
191 
206 DYNARDO_FMOP_API const char* FMOP_getLastErrorString ();
212 DYNARDO_FMOP_API fmop_error_t FMOP_getLastErrno ();
222 DYNARDO_FMOP_API const char* FMOP_getLastErrnoString ();
223 
236 DYNARDO_FMOP_API const char* FMOP_getLastLogString ();
253 DYNARDO_FMOP_API int FMOP_setLogLevel ( int log_level );
254 
266 DYNARDO_FMOP_API const char* FMOP_getErrnoString ( fmop_error_t error_num );
267 
269 
270 /*********************************************/
276 
278 
285 DYNARDO_FMOP_API const char* FMOP_getVersionString ();
286 
288 
289 /*********************************************/
295 
297 
302 DYNARDO_FMOP_API fmop_error_t FMOP_initializeLibrary();
306 DYNARDO_FMOP_API fmop_error_t FMOP_unloadLibrary();
307 
308 #ifdef __cplusplus
309 }
310 #endif
311 
312 #endif // DYNARDO_SOS_CAPI_COMMON_H
313 
314 // (c) 2017, DYNARDO Austria GmbH (proprietary license)
Input argument(s) is invalid or missing.
Definition: sos_capi_common.h:85
DYNARDO_FMOP_API const char * FMOP_getLastLogString()
Returns internal log messages of log levels defined by FMOP_setLogLevel. Serves as debug logger...
DYNARDO_FMOP_API const char * FMOP_getLastErrorString()
Returns internal log messages of level warning and above.
An error appeare while executing Lua script.
Definition: sos_capi_common.h:88
Unlocks all mesh features.
Definition: sos_capi_common.h:106
DYNARDO_FMOP_API const char * FMOP_getErrnoString(fmop_error_t error_num)
Returns a string description for the error number given.
Function execution returned successfully.
Definition: sos_capi_common.h:82
This function is yet not implemented or has been removed.
Definition: sos_capi_common.h:92
DYNARDO_FMOP_API fmop_error_t FMOP_releaseLicense()
Release the acquired license.
DYNARDO_FMOP_API bool FMOP_licenseLocked()
Check whether any license feature was acquired.
The requested model identifier is not known.
Definition: sos_capi_common.h:86
An internal error occurred. Request log messages.
Definition: sos_capi_common.h:84
DYNARDO_FMOP_API fmop_error_t FMOP_unloadLibrary()
Unload the FMOP library Clears the FMOP library from memory. A warning is logged if the library was u...
scalar data (vector of size 1)
Definition: sos_capi_common.h:116
DYNARDO_FMOP_API const char * FMOP_getVersionString()
Returns a version string.
element data (one scalar per element)
Definition: sos_capi_common.h:115
Object with ident has wrong type.
Definition: sos_capi_common.h:90
No valid license available.
Definition: sos_capi_common.h:87
fmop_error_t
Error code definitions.
Definition: sos_capi_common.h:80
DYNARDO_FMOP_API const char * FMOP_getLastErrnoString()
Returns a pointer to a string that describes the error code which has been set at the last library ca...
DYNARDO_FMOP_API fmop_error_t FMOP_getLastErrno()
Returns the error number which has been set at the last library call.
Unlocks signal meshes.
Definition: sos_capi_common.h:105
2^14-1 non-modifiable for each API version
Definition: sos_capi_common.h:94
DYNARDO_FMOP_API fmop_error_t FMOP_initializeLibrary()
Initialize the FMOP library Allocates memory for the global script engine. Call FMOP_unloadLibrary() ...
fmop_license_t
FMOP mesh features which need to be unlocked by a valid license.
Definition: sos_capi_common.h:101
DYNARDO_FMOP_API fmop_error_t FMOP_acquireLicense()
Acquires an optiSLang enterprise license.
The function got an unexpected NULL pointer.
Definition: sos_capi_common.h:83
DYNARDO_FMOP_API fmop_error_t FMOP_appendLicenseSearchPath(const char *abs_path)
Appends another license search path to the default ones.
Object with ident not found in script engine.
Definition: sos_capi_common.h:89
node data (one scalar per node)
Definition: sos_capi_common.h:114
fmop_dataobject_types
Data type definitions.
Definition: sos_capi_common.h:112
DYNARDO_FMOP_API int FMOP_setLogLevel(int log_level)
Defines the new log level filter. Valid for all subsequent library calls until a new log level gets s...

Connect with Ansys