1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/config/pathsub.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,42 @@ 1.4 +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef pathsub_h___ 1.10 +#define pathsub_h___ 1.11 +/* 1.12 +** Pathname subroutines. 1.13 +** 1.14 +** Brendan Eich, 8/29/95 1.15 +*/ 1.16 +#include <limits.h> 1.17 +#include <sys/types.h> 1.18 + 1.19 +#ifndef PATH_MAX 1.20 +#define PATH_MAX 1024 1.21 +#endif 1.22 + 1.23 +/* 1.24 + * Just prevent stupidity 1.25 + */ 1.26 +#undef NAME_MAX 1.27 +#define NAME_MAX 256 1.28 + 1.29 +extern char *program; 1.30 + 1.31 +extern void fail(char *format, ...); 1.32 +extern char *getcomponent(char *path, char *name); 1.33 +extern char *ino2name(ino_t ino); 1.34 +extern void *xmalloc(size_t size); 1.35 +extern char *xstrdup(char *s); 1.36 +extern char *xbasename(char *path); 1.37 +extern void xchdir(char *dir); 1.38 + 1.39 +/* Relate absolute pathnames from and to returning the result in outpath. */ 1.40 +extern int relatepaths(char *from, char *to, char *outpath); 1.41 + 1.42 +/* XXX changes current working directory -- caveat emptor */ 1.43 +extern void reversepath(char *inpath, char *name, int len, char *outpath); 1.44 + 1.45 +#endif /* pathsub_h___ */