pathsub.h (1163B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #ifndef pathsub_h___ 6 #define pathsub_h___ 7 /* 8 ** Pathname subroutines. 9 ** 10 ** Brendan Eich, 8/29/95 11 */ 12 #include <limits.h> 13 #include <sys/types.h> 14 15 #ifndef PATH_MAX 16 #define PATH_MAX 1024 17 #endif 18 19 /* 20 * Just keep sane lengths 21 */ 22 #undef NAME_MAX 23 #define NAME_MAX 256 24 25 extern char *program; 26 27 extern void fail(char *format, ...); 28 extern char *getcomponent(char *path, char *name); 29 extern char *ino2name(ino_t ino, char *dir); 30 extern void *xmalloc(size_t size); 31 extern char *xstrdup(char *s); 32 extern char *xbasename(char *path); 33 extern void xchdir(char *dir); 34 35 /* Relate absolute pathnames from and to returning the result in outpath. */ 36 extern int relatepaths(char *from, char *to, char *outpath); 37 38 /* NOTE: changes current working directory -- caveat emptor */ 39 extern void reversepath(char *inpath, char *name, int len, char *outpath); 40 41 /* stats every directory in path, reports results. */ 42 extern void diagnosePath(const char * path); 43 44 #endif /* pathsub_h___ */