Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Last corrections of Tesh tool.
[simgrid.git] / tools / tesh2 / include / getpath.h
1 #ifndef __GETPATH_H\r
2 #define __GETPATH_H\r
3 \r
4 \r
5 \r
6 #ifdef __cplusplus\r
7 extern "C" {\r
8 #endif\r
9 \r
10 /* getpath th     --    get the path of the file name specified by the first parameter\r
11  *                                              of the function and store the path in its second parmater.\r
12  *                                              the function returns the length of the path of the file.                                 \r
13  *\r
14  * param file_name              The file name to get the path\r
15  * param path                   The address of the path of the file\r
16  * \r
17  * return                               If successful, the function returns the len of the path.\r
18  *                                              Otherwise the function returns -1 and sets errno to indicate\r
19  *                                              the error.\r
20  *\r
21  * errors\r
22  *\r
23  *                                              [ENOENT]        the file name specified as parameter does not exist.\r
24  *                              \r
25  *                                              [ENOMEM]        because this function use calloc, errno can be set with\r
26  *                                                                      this error code.                                \r
27  *\r
28  */\r
29 int\r
30 getpath(const char* file_name, char** path);\r
31 \r
32 /* translatepath   --   path translation\r
33  *\r
34  * param totranslate    The path to translate.\r
35  * param transled               The address of the translated path.\r
36  *\r
37  * return                               If successful the function returns the len of the translated path.\r
38  *                                              0therwise the function returns -1 and sets the global variable errno\r
39  *                                              to indicate the error.\r
40  *\r
41  * errors                               [ENOTDIR]       the path to translate is not a directory.\r
42  \r
43  *                                              [ENOMEM]        because this function use calloc, errno can be set with\r
44  *                                                                      this error code.                                \r
45  */\r
46 int\r
47 translatepath(const char* totranslate, char** translated);\r
48 \r
49 #ifdef __cplusplus\r
50 }\r
51 #endif\r
52 \r
53 \r
54 #endif /* !__GETPATH_H */\r