Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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/. */
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>
15 #if SUNOS4
16 #include "sunos4.h"
17 #endif
19 #ifndef PATH_MAX
20 #define PATH_MAX 1024
21 #endif
23 /*
24 * Just keep sane lengths
25 */
26 #undef NAME_MAX
27 #define NAME_MAX 256
29 extern char *program;
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);
39 /* Relate absolute pathnames from and to returning the result in outpath. */
40 extern int relatepaths(char *from, char *to, char *outpath);
42 /* NOTE: changes current working directory -- caveat emptor */
43 extern void reversepath(char *inpath, char *name, int len, char *outpath);
45 /* stats every directory in path, reports results. */
46 extern void diagnosePath(const char * path);
48 #endif /* pathsub_h___ */