Logo AND Algorithmique Numérique Distribuée

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