|
Robotran C Documentation
|
Go to the documentation of this file.
6 #ifndef _USEFUL_FUNCTIONS_H_
7 #define _USEFUL_FUNCTIONS_H_
13 #define MIN(a,b) (((a)<(b))?(a):(b))
14 #define MAX(a,b) (((a)>(b))?(a):(b))
26 #define DBL_MAX 1.7976931348623158e+308
52 double pow_int(
double basis,
int expo);
67 double sign(
double a);
165 char *
str_replace_char(
char* orig,
const char old_char,
const char *new_str,
int free_orig);
294 int mbs_strcmp(
const char* __s1,
const char* __s2);
304 int mbs_stricmp(
const char* __s1,
const char* __s2);
char * get_char_cpy(const char *fmt,...)
Copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:196
#define MBS_INFO_FAILURE
Definition: mbs_define.h:31
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
char * str_replace_char(char *orig, const char old_char, const char *new_str, int free_orig)
Create a copy of a string with a specific char replaced by a string.
Definition: useful_functions.c:283
void free_d3Darray_1(double ***array3D)
Definition: useful_functions.c:374
char * get_char_cpy(const char *fmt,...)
Copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:196
void free_char_tab(char **mat)
release memory for a matrix of chars
Definition: useful_functions.c:271
int mbs_stricmp(const char *__s1, const char *__s2)
Compare two char with _stricmp (convert strings to lower case, ignoring case sensitive).
Definition: useful_functions.c:404
void mbs_log(char *msg,...)
Function for logging messages in a file called "log" where the program is executed.
Definition: useful_functions.c:29
double sign(double a)
sign function
Definition: useful_functions.c:129
void free_char_vec(char *vec)
release memory for a vector of char
Definition: useful_functions.c:191
int mbs_write_data(MbsData *mbs, char *filename, char *function_name)
Write a source with a function allocating and setting a MbsData copy of the provided.
Definition: mbs_data.c:260
char * str_replace_char(char *orig, const char old_char, const char *new_str, int free_orig)
Create a copy of a string with a specific char replaced by a string.
Definition: useful_functions.c:283
void free_char_vec(char *vec)
release memory for a vector of char
Definition: useful_functions.c:191
int mbs_strcmp(const char *__s1, const char *__s2)
Compare two char with strcmp.
Definition: useful_functions.c:388
void mbs_reset_data(MbsData *s)
Reset all fields of a MbsData structure to initial values.
Definition: mbs_data.c:242
void mbs_warning_msg(const char *msg,...)
Send a warning message.
Definition: mbs_message.c:100
double sign(double a)
sign function
Definition: useful_functions.c:129
double *** get_d3Darray_0(int nb_r, int nb_c, int z)
create (with memory allocation) a [x times y times z] 3D array of doubles, starting at index 0
Definition: useful_functions.c:352
char * get_char_vec(int size)
create (with memory allocation) a vector (length l_v) of char
Definition: useful_functions.c:164
double *** get_d3Darray_1(int x, int y, int z)
create (with memory allocation) a [x times y times z] 3D array of doubles, starting at index 1
Definition: useful_functions.c:344
void free_d3Darray_1(double ***array3D)
Definition: useful_functions.c:374
void free_char_tab(char **mat)
release memory for a matrix of chars
Definition: useful_functions.c:271
double *** get_d3Darray_1(int x, int y, int z)
create (with memory allocation) a [x times y times z] 3D array of doubles, starting at index 1
Definition: useful_functions.c:344
void free_d3Darray_0(double ***array3D)
release memory for a 3D array of doubles, starting at index 0
Definition: useful_functions.c:379
int mbs_strcmp(const char *__s1, const char *__s2)
Compare two char with strcmp.
Definition: useful_functions.c:388
void free_d3Darray_0(double ***array3D)
release memory for a 3D array of doubles, starting at index 1
Definition: useful_functions.c:379
int set_um_string(char **um_str, const char *new_txt)
Redirect the memory of the string user model to a newly allocated char array.
Definition: useful_functions.c:258
char * get_char_vec(int l_v)
create (with memory allocation) a vector (length l_v) of char
Definition: useful_functions.c:164
void mbs_copy_data(MbsData *s, MbsData *s_copy)
Copy all fields between two MBSdata structures.
Definition: mbs_data.c:101
char ** get_char_tab(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of chars WARNING: only the first dimension...
Definition: useful_functions.c:175
void mbs_reset_joints_kine(MbsData *s)
Reset joints kinematics (q, qd, qdd) of a MbsData structure to initial values.
Definition: mbs_data.c:231
double *** get_d3Darray_0(int x, int y, int z)
create (with memory allocation) a [x times y times z] 3D array of doubles, starting at index 0
Definition: useful_functions.c:352
void mbs_print_data(MbsData *mbs_data)
Definition: mbs_data.c:14
char * get_time_machine()
returns the current time as a String
Definition: useful_functions.c:136
char ** get_char_tab(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of chars WARNING: only the first dimension...
Definition: useful_functions.c:175
int set_char_cpy(char **dest, const char *fmt,...)
Set a copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:228
char * get_time_machine()
returns the current time as a String
Definition: useful_functions.c:136
int expo_ten_inf(double nb)
get log with base 10
Definition: useful_functions.c:94
Definition: mbs_data.h:246
void * mbs_free(void *__ptr)
Free the pointor ptr and set it to NULL.
Definition: useful_functions.c:18
int expo_ten_inf(double nb)
get log with base 10
Definition: useful_functions.c:94
double pow_int(double basis, int expo)
compute efficiently pow with an integer exponent
Definition: useful_functions.c:65
#define MBS_INFO_SUCCESS
Definition: mbs_define.h:29
void mbs_log(char *msg,...)
Function for logging messages in a file called "log" where the program is executed.
Definition: useful_functions.c:29
int set_um_string(char **um_str, const char *new_txt)
Redirect the memory of the string user model to a newly allocated char array.
Definition: useful_functions.c:258
int set_char_cpy(char **dest, const char *fmt,...)
Set a copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:228
int mbs_stricmp(const char *__s1, const char *__s2)
Compare two char with _stricmp (convert strings to lower case, ignoring case sensitive).
Definition: useful_functions.c:404
double pow_int(double basis, int expo)
compute efficiently pow with an integer exponent
Definition: useful_functions.c:65
int mbs_compare_data(MbsData *s1, MbsData *s2, int accelred)
Compare two MbsData.
Definition: mbs_data.c:540
void * mbs_free(void *__ptr)
Free the pointor ptr and set it to NULL.
Definition: useful_functions.c:18