Robotran C Documentation
Functions
mbs_load_libraries.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mbs_load_libraries.h"
#include "mbs_message.h"
#include "mbs_errors_names.h"
#include "mbs_project_interface.h"
#include "useful_functions.h"

Functions

void mbs_close_dynamic_library (MbsDataLibInfo *li)
 Close the library pointed by MbsDataLibInfo and free the memory associated to the given MbsDataLibInfo. More...
 
MbsDataLibInfombs_load_dynamic_library (char *libpath)
 Load the library in a MbsDataLibInfo. 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)
 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)
 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...
 

Function Documentation

◆ mbs_close_dynamic_library()

void mbs_close_dynamic_library ( MbsDataLibInfo li)

Close the library pointed by MbsDataLibInfo and free the memory associated to the given MbsDataLibInfo.

Parameters
lithe structure to be freed.

◆ mbs_close_libraries()

void mbs_close_libraries ( MbsData mbs_data)

Close the symbolic and userfct libraries associated to the given MbsData.

Parameters
mbs_datathe project structure to be cleared from libraries.

◆ mbs_load_dynamic_library()

MbsDataLibInfo* mbs_load_dynamic_library ( char *  libpath)

Load the library in a MbsDataLibInfo.

Utility functions.

Parameters
libpathlibrary path.
Returns
An allocated MbsDataLibInfo structure or NULL ptr in case of failure.

◆ mbs_load_symbolic_functions()

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 
)

Loads the symbolic functions from library into MbsData structure.

Parameters
[in,out]mbs_datathe project structure to be filled.
[in]symbolic_paththe directory of the library.
[in]symbolicLib_namethe name of the library to load.
[in]nb_loopNumber of loop constraints in the system. The exact number is not required it is used as a on/off triggering.
[in]nb_linkNumber of link forces in the system. The exact number is not required it is used as a on/off triggering.
[in]nb_3d_linkNumber of 3D link forces in the system. The exact number is not required it is used as a on/off triggering.
[in]nb_ext_forcesNumber of external forces in the system. The exact number is not required it is used as a on/off triggering.
[in]nb_sensorsNumber of link forces in the system. The exact number is not required it is used as a on/off triggering.
Returns
error status, < 0 in case of failure, 0 for success.

◆ mbs_load_user_functions()

int mbs_load_user_functions ( MbsData mbs_data,
const char *  user_path,
const char *  userfctLib_name 
)

mbs_load_function: dynamic loading of a function from a given library.

Produce an error message if the function does not exist.

Parameters
[in]liThe libray where to load the function.
[in]fct_nameThe name of the function to load.
[in]lib_full_pathThe path to the loaded library to inform in case of error.
Returns
The pointer to the loaded function, NULL in case of error.

mbs_load_function: dynamic loading of a function from a given library. Return NULL if the function does not exist

Parameters
lithe libray where to load the function
fct_namethe name of the function to load
Returns
the pointer to the loaded function specific functions

Loads the user functions from library into MbsData structure.

Parameters
mbs_datathe project structure to be filled.
user_paththe directory of the library.
userfctLib_namethe name of the library to load.
Returns
error status, < 0 in case of failure