#include <stdio.h>#include <stdlib.h>#include <string.h>#include "mbs_load_libraries.h"#include "mbs_define.h"#include "mbs_message.h"#include "mbs_errors_names.h"#include "mbs_path.h"#include "mbs_project_interface.h"#include "useful_functions.h"Macros | |
| #define | MSG_ERR ">> LIBRARIES >> " |
| #define | MSG_PRE " >> " |
Functions | |
| void | mbs_close_dynamic_library (MbsDataLibInfo *li) |
| Close the library pointed by MbsDataLibInfo and free the memory associated to the given MbsDataLibInfo. More... | |
| MbsDataLibInfo * | mbs_load_dynamic_library (char *libpath) |
| Load the library in a MbsDataLibInfo. More... | |
| char * | get_library_path (const char *lib_path, const char *lib_name, int verbose) |
| Try to locate the library file. More... | |
| int | mbs_load_symbolic_functions (MbsData *mbs_data, const char *symbolicLib_path, const char *symbolicLib_name, int nb_loop, int nb_link, int nb_3d_link, int nb_ext_forces, int nb_sensors, int verbose) |
| Loads the symbolic functions from library into MbsData structure. More... | |
| int | mbs_load_user_functions (MbsData *mbs_data, const char *userfctLib_path, const char *userfctLib_name, int verbose) |
| mbs_load_function: dynamic loading of a function from a given library. More... | |
| void | mbs_close_libraries (MbsData *mbs_data) |
| Close the symbolic and userfct libraries associated to the given MbsData. More... | |
| #define MSG_ERR ">> LIBRARIES >> " |
| #define MSG_PRE " >> " |
| char* get_library_path | ( | const char * | lib_path, |
| const char * | lib_name, | ||
| int | verbose | ||
| ) |
Try to locate the library file.
The goal of this function is to handle the case where the user provided the full path to the library (ie: including prefix and extension).
The caller must free the returned memory
| [in] | lib_path | The folder containing the library. |
| [in] | lib_name | The name of the library or the library filename. |
| [in] | verbose | Verbosity level. |
| void mbs_close_dynamic_library | ( | MbsDataLibInfo * | li | ) |
Close the library pointed by MbsDataLibInfo and free the memory associated to the given MbsDataLibInfo.
| li | the structure to be freed. |
| void mbs_close_libraries | ( | MbsData * | mbs_data | ) |
Close the symbolic and userfct libraries associated to the given MbsData.
| mbs_data | the project structure to be cleared from libraries. |
| MbsDataLibInfo* mbs_load_dynamic_library | ( | char * | libpath | ) |
Load the library in a MbsDataLibInfo.
Utility functions.
| libpath | library path. |
| int mbs_load_symbolic_functions | ( | MbsData * | mbs_data, |
| const char * | symbolic_path, | ||
| const char * | symbolicLib_name, | ||
| int | nb_loop, | ||
| int | nb_link, | ||
| int | nb_3d_link, | ||
| int | nb_ext_forces, | ||
| int | nb_sensors, | ||
| int | verbose | ||
| ) |
Loads the symbolic functions from library into MbsData structure.
| [in,out] | mbs_data | the project structure to be filled. |
| [in] | symbolic_path | the directory of the library. |
| [in] | symbolicLib_name | the name of the library to load. |
| [in] | nb_loop | Number of loop constraints in the system. The exact number is not required it is used as a on/off triggering. |
| [in] | nb_link | Number of link forces in the system. The exact number is not required it is used as a on/off triggering. |
| [in] | nb_3d_link | Number of 3D link forces in the system. The exact number is not required it is used as a on/off triggering. |
| [in] | nb_ext_forces | Number of external forces in the system. The exact number is not required it is used as a on/off triggering. |
| [in] | nb_sensors | Number of link forces in the system. The exact number is not required it is used as a on/off triggering. |
| [in] | verbose | The verbosity level. |
| int mbs_load_user_functions | ( | MbsData * | mbs_data, |
| const char * | user_path, | ||
| const char * | userfctLib_name, | ||
| int | verbose | ||
| ) |
mbs_load_function: dynamic loading of a function from a given library.
Produce an error message if the function does not exist.
| [in] | li | The libray where to load the function. |
| [in] | fct_name | The name of the function to load. |
| [in] | lib_full_path | The path to the loaded library to inform in case of error. |
mbs_load_function: dynamic loading of a function from a given library. Return NULL if the function does not exist
| li | the libray where to load the function |
| fct_name | the name of the function to load |
Loads the user functions from library into MbsData structure.
| [in,out] | mbs_data | the project structure to be filled. |
| [in] | user_path | the directory of the library. |
| [in] | userfctLib_name | the name of the library to load. |
| [in] | verbose | The verbosity level. |
1.8.17