cctools
path.h
1 /*
2  * Copyright (C) 2013- The University of Notre Dame
3  * This software is distributed under the GNU General Public License.
4  * See the file COPYING for details.
5  */
6 
7 #ifndef PATH_H
8 #define PATH_H
9 
10 #include "buffer.h"
11 
12 void path_absolute (const char *src, char *dest, int exist);
13 const char *path_basename (const char * path);
14 const char *path_extension (const char *path);
15 void path_collapse (const char *l, char *s, int remove_dotdot);
16 void path_dirname (const char *path, char *dir);
17 
25 int path_lookup (char *search_path, const char *exe, char *dest, size_t destlen);
26 
30 char *path_getcwd (void);
31 
32 void path_remove_trailing_slashes (char *path);
33 void path_split (const char *input, char *first, char *rest);
34 void path_split_multi (const char *input, char *first, char *rest);
35 
36 int path_find (buffer_t *B, const char *dir, const char *pattern, int recursive);
37 
38 int path_within_dir( const char *path, const char *dir );
39 
40 
41 /*
42 Returns the first absolute path for executable exec as found in PATH.
43 Returns NULL if none is found.
44 */
45 char *path_which(const char *exec);
46 
47 #endif
String Buffer Operations.
Definition: buffer.h:26