home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume22 / undel2 / part01 / directories.h < prev    next >
C/C++ Source or Header  |  1990-06-07  |  2KB  |  62 lines

  1. /*
  2.  * $Source: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/directories.h,v $
  3.  * $Author: jik $
  4.  * $Header: /afs/athena.mit.edu/user/j/jik/src/delete/RCS/directories.h,v 1.8 89/11/06 19:54:20 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.  
  14. #include "mit-copyright.h"
  15.  
  16. typedef short Boolean;
  17. #define True            (Boolean) 1
  18. #define False            (Boolean) 0
  19.  
  20.  
  21. #define blk_to_k(x)        (x * DEV_BSIZE / 1024)
  22.  
  23. #define FOLLOW_LINKS        1
  24. #define DONT_FOLLOW_LINKS    0
  25.  
  26. #define DIR_MATCH        1
  27. #define DIR_NO_MATCH        0
  28.      
  29. typedef struct filrec {
  30.      char name[MAXNAMLEN];
  31.      struct filrec *previous;
  32.      struct filrec *parent;
  33.      struct filrec *dirs;
  34.      struct filrec *files;
  35.      struct filrec *next;
  36.      Boolean specified;
  37.      Boolean freed;
  38.      struct stat specs;
  39. } filerec;
  40.  
  41.  
  42.  
  43. int add_directory_to_parent();
  44. int add_file_to_parent();
  45. int add_path_to_tree();
  46. int find_child();
  47. filerec *first_in_directory();
  48. filerec *first_specified_in_directory();
  49. filerec *get_cwd_tree();
  50. filerec *get_root_tree();
  51. filerec *next_directory();
  52. filerec *next_in_directory();
  53. filerec *next_leaf();
  54. filerec *next_specified_directory();
  55. filerec *next_specified_in_directory();
  56. filerec *next_specified_leaf();
  57.  
  58. int get_leaf_path();
  59. int accumulate_names();
  60.  
  61. void free_leaf();
  62.