pathsub.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * 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>
  14. #ifndef PATH_MAX
  15. #define PATH_MAX 1024
  16. #endif
  17. /*
  18. * Just prevent stupidity
  19. */
  20. #undef NAME_MAX
  21. #define NAME_MAX 256
  22. extern char *program;
  23. extern void fail(const char *format, ...);
  24. extern char *getcomponent(char *path, char *name);
  25. extern char *ino2name(ino_t ino);
  26. extern void *xmalloc(size_t size);
  27. extern char *xstrdup(char *s);
  28. extern char *xbasename(char *path);
  29. extern void xchdir(const char *dir);
  30. /* Relate absolute pathnames from and to returning the result in outpath. */
  31. extern int relatepaths(char *from, char *to, char *outpath);
  32. /* XXX changes current working directory -- caveat emptor */
  33. extern void reversepath(char *inpath, char *name, int len, char *outpath);
  34. #endif /* pathsub_h___ */