Robotran C Documentation
mbs_path.h
Go to the documentation of this file.
1 
2 #ifndef _MBS_PATH_H
3 #define _MBS_PATH_H
4 
12 int mbs_unix_separator(char *path);
13 
22 char* find_user_path(const char* mbsfile);
23 
43 int find_project_path(const char* mbsfile, char* prjpath);
44 
61 char *find_project_path_from_cwd(const char *optionnal_path, int verbose);
62 
80 char *explore_dir_for_project_path(const char *optionnal_path, int verbose);
81 
96 char* mbs_basename(const char* path, int verbose);
97 
116 char* mbs_dirname(const char *path, int verbose);
117 
138 int mbs_splitext(const char* path, char **root, char **ext);
139 
152 int remove_prjpath(char **path, char *project_source_dir);
153 
165 char* mbs_getcwd();
166 
181 int mbs_is_dir_or_file(const char *path);
182 
196 int mbs_makedirs(char *path);
197 
198 #endif
find_user_path
char * find_user_path(const char *mbsfile)
Find the user folder corresponding to the given *.mbs file.
Definition: mbs_path.c:49
mbs_unix_separator
int mbs_unix_separator(char *path)
In-place replacement of windows-style path separator (\) by Unix separator (/).
Definition: mbs_path.c:34
mbs_splitext
int mbs_splitext(const char *path, char **root, char **ext)
Split the path into a pair (root, ext).
Definition: mbs_path.c:460
MBS_INFO_FAILURE
#define MBS_INFO_FAILURE
Definition: mbs_define.h:31
mbs_msg
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
get_char_cpy
char * get_char_cpy(const char *fmt,...)
Copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:196
useful_functions.h
mbs_dirname
char * mbs_dirname(const char *path, int verbose)
mbs_dirname returns the leading part of the path (UNIX and MAC).
Definition: mbs_path.c:407
_MBS_ERR_LOW_FILES
#define _MBS_ERR_LOW_FILES
Low Level error number Error during opening/writing files = -9.
Definition: mbs_errors_names.h:157
mbs_define.h
mbs_getcwd
char * mbs_getcwd()
Return the Current Working Directory (cwd).
Definition: mbs_path.c:131
mbs_strcmp
int mbs_strcmp(const char *__s1, const char *__s2)
Compare two char with strcmp.
Definition: useful_functions.c:388
mbs_splitext
int mbs_splitext(const char *path, char **prefix, char **extension)
Split the path into a pair (root, ext).
Definition: mbs_path.c:460
explore_dir_for_project_path
char * explore_dir_for_project_path(const char *optionnal_path, int verbose)
Find the project directory from current working directory (cwd) or provided path.
Definition: mbs_path.c:235
mbs_dirname
char * mbs_dirname(const char *path, int verbose)
mbs_dirname returns the leading part of the path (UNIX and MAC).
Definition: mbs_path.c:407
S_ISREG
#define S_ISREG(m)
Definition: mbs_path.c:28
find_project_path_from_cwd
char * find_project_path_from_cwd(const char *optionnal_path, int verbose)
Find the project directory from current working directory (cwd) or provided path.
Definition: mbs_path.c:157
ERR_PRE
#define ERR_PRE
Definition: mbs_path.c:32
mbs_getcwd
char * mbs_getcwd()
Return the Current Working Directory (cwd).
Definition: mbs_path.c:131
mbs_msg_v
void mbs_msg_v(int v_opt, int v_lvl, const char *msg,...)
Send a message only of the message level is lower than the verbosity option.
Definition: mbs_message.c:143
explore_dir_for_project_path
char * explore_dir_for_project_path(const char *optionnal_path, int verbose)
Find the project directory from current working directory (cwd) or provided path.
Definition: mbs_path.c:235
remove_prjpath
int remove_prjpath(char **path, char *project_source_dir)
If the path start with PRJPATH, an new path is allocated replacing it.
Definition: mbs_path.c:524
mbs_basename
char * mbs_basename(const char *path, int verbose)
mbs_basename returns the trailing part of the path (UNIX and MAC).
Definition: mbs_path.c:359
MBS_VERBOSE_ERROR
#define MBS_VERBOSE_ERROR
Definition: mbs_define.h:44
find_project_path
int find_project_path(const char *mbsfile, char *prjpath)
Find the project directory (containing dataR, symbolicR, ...) from Mbs filepath.
Definition: mbs_path.c:74
mbs_unix_separator
int mbs_unix_separator(char *path)
In-place replacement of windows-style path separator (\) by Unix separator (/).
Definition: mbs_path.c:34
mbs_message.h
ERR_MSG
#define ERR_MSG
Definition: mbs_path.c:31
mbs_makedirs
int mbs_makedirs(char *path)
Create (recursively) the specified directory.
Definition: mbs_path.c:586
MBS_VERBOSE_WARNING
#define MBS_VERBOSE_WARNING
Definition: mbs_define.h:45
mbs_is_dir_or_file
int mbs_is_dir_or_file(const char *path)
Check if the path is valid and lead to a file or directory.
Definition: mbs_path.c:547
find_user_path
char * find_user_path(const char *mbsfile)
Find the user folder corresponding to the given *.mbs file.
Definition: mbs_path.c:49
mbs_basename
char * mbs_basename(const char *path, int verbose)
mbs_basename returns the trailing part of the path (UNIX and MAC).
Definition: mbs_path.c:359
find_project_path_from_cwd
char * find_project_path_from_cwd(const char *optionnal_path, int verbose)
Find the project directory from current working directory (cwd) or provided path.
Definition: mbs_path.c:157
mbs_path.h
MBS_INFO_SUCCESS
#define MBS_INFO_SUCCESS
Definition: mbs_define.h:29
mbs_makedirs
int mbs_makedirs(char *path)
Create (recursively) the specified directory.
Definition: mbs_path.c:586
remove_prjpath
int remove_prjpath(char **path, char *project_source_dir)
If the path start with PRJPATH, an new path is allocated replacing it.
Definition: mbs_path.c:524
S_ISDIR
#define S_ISDIR(m)
Definition: mbs_path.c:25
mbs_is_dir_or_file
int mbs_is_dir_or_file(const char *path)
Check if the path is valid and lead to a file or directory.
Definition: mbs_path.c:547
find_project_path
int find_project_path(const char *mbsfile, char *prjpath)
Find the project directory (containing dataR, symbolicR, ...) from Mbs filepath.
Definition: mbs_path.c:74
mbs_errors_names.h