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 #if SUNOS4 16 #include "sunos4.h" 17 #endif 18 19 #ifndef PATH_MAX 20 #define PATH_MAX 1024 21 #endif 22 23 /* 24 * Just keep sane lengths 25 */ 26 #undef NAME_MAX 27 #define NAME_MAX 256 28 29 extern char *program; 30 31 extern void fail(char *format, ...); 32 extern char *getcomponent(char *path, char *name); 33 extern char *ino2name(ino_t ino, char *dir); 34 extern void *xmalloc(size_t size); 35 extern char *xstrdup(char *s); 36 extern char *xbasename(char *path); 37 extern void xchdir(char *dir); 38 39 /* Relate absolute pathnames from and to returning the result in outpath. */ 40 extern int relatepaths(char *from, char *to, char *outpath); 41 42 /* NOTE: changes current working directory -- caveat emptor */ 43 extern void reversepath(char *inpath, char *name, int len, char *outpath); 44 45 /* stats every directory in path, reports results. */ 46 extern void diagnosePath(const char * path); 47 48 #endif /* pathsub_h___ */ 49