home *** CD-ROM | disk | FTP | other *** search
/ The UNIX CD Bookshelf / OREILLY_TUCB_UNIX_CD.iso / upt / examples / SOURCES / DELETE / PART01.Z / PART01 / util.h < prev   
Encoding:
C/C++ Source or Header  |  1998-07-24  |  1.2 KB  |  45 lines

  1. /*
  2.  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/util.h,v $
  3.  * $Author: jik $
  4.  * $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/util.h,v 1.11 91/02/20 17:28:33 jik Exp $
  5.  * 
  6.  * This file is part of a package including delete, undelete,
  7.  * lsdel, expunge and purge.  The software suite is meant as a
  8.  * replacement for rm which allows for file recovery.
  9.  * 
  10.  * Copyright (c) 1989 by the Massachusetts Institute of Technology.
  11.  * For copying and distribution information, see the file "mit-copyright.h."
  12.  */
  13. #include "mit-copyright.h"
  14.  
  15. #include <sys/stat.h>
  16. #ifndef S_IFLNK
  17. #define lstat stat
  18. #endif
  19.  
  20. char *append();
  21. char *convert_to_user_name();
  22. char *firstpart();
  23. char *lastpart();
  24. char *strindex();
  25. char *strrindex();
  26. #ifdef MALLOC_DEBUG
  27. char *Malloc();
  28. #else
  29. #define Malloc(a) malloc(a)
  30. extern char *malloc();
  31. #endif
  32.  
  33. int is_mountpoint(), is_link();
  34.  
  35. #define is_dotfile(A) ((*A == '.') && \
  36.                ((*(A + 1) == '\0') || \
  37.             ((*(A + 1) == '.') && \
  38.              (*(A + 2) == '\0'))))
  39.  
  40. #define is_deleted(A) ((*A == '.') && (*(A + 1) == '#'))
  41.  
  42.  /* It would be BAD to pass something with a ++ anywhere near it into */
  43.  /* this macro!                               */
  44. #define Opendir(dir) opendir(*(dir) ? (dir) : ".")
  45.