michael@0: /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef pathsub_h___ michael@0: #define pathsub_h___ michael@0: /* michael@0: ** Pathname subroutines. michael@0: ** michael@0: ** Brendan Eich, 8/29/95 michael@0: */ michael@0: #include michael@0: #include michael@0: michael@0: #ifndef PATH_MAX michael@0: #define PATH_MAX 1024 michael@0: #endif michael@0: michael@0: /* michael@0: * Just prevent stupidity michael@0: */ michael@0: #undef NAME_MAX michael@0: #define NAME_MAX 256 michael@0: michael@0: extern char *program; michael@0: michael@0: extern void fail(char *format, ...); michael@0: extern char *getcomponent(char *path, char *name); michael@0: extern char *ino2name(ino_t ino); michael@0: extern void *xmalloc(size_t size); michael@0: extern char *xstrdup(char *s); michael@0: extern char *xbasename(char *path); michael@0: extern void xchdir(char *dir); michael@0: michael@0: /* Relate absolute pathnames from and to returning the result in outpath. */ michael@0: extern int relatepaths(char *from, char *to, char *outpath); michael@0: michael@0: /* XXX changes current working directory -- caveat emptor */ michael@0: extern void reversepath(char *inpath, char *name, int len, char *outpath); michael@0: michael@0: #endif /* pathsub_h___ */