home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 024 / psi110g.zip / DIRUTIL.H < prev    next >
C/C++ Source or Header  |  1994-07-05  |  2KB  |  82 lines

  1. #ifndef _DIRUTIL_H
  2. #define _DIRUTIL_H
  3.   
  4. #ifndef _GLOBAL_H
  5. #include "global.h"
  6. #endif
  7.   
  8. #ifdef UNIX
  9. #include <time.h>
  10.   
  11. struct ffblk
  12. {
  13.     char ff_name[256];        /* current filename result */
  14.     struct tm ff_ftime;       /* modify date/time */
  15.     long ff_fsize;        /* file size */
  16.     int ff_attrib;        /* DOS-style attributes (ugh) */
  17. #ifdef GLOB_INTERNAL      /* ...only visible to internals... */
  18.     char *ff_pfx;     /* prefix for found patterns */
  19.     char *ff_pat;     /* pattern for the current level */
  20.     DIR *ff_dir;      /* directory scan for the current level */
  21.     struct dirent *ff_cur;    /* current path component */
  22.     long ff_sattr;        /* selected attributes */
  23. #else
  24.     long youdontseethis[5];
  25. #endif
  26. };
  27.   
  28. #define FA_NORMAL 0   /* anything except the following: */
  29. #define FA_SYSTEM 1   /* device node or unreadable file */
  30. #define FA_HIDDEN 2   /* dot-files */
  31. #define FA_DIREC  4   /* directory */
  32. #define FA_RDONLY 8   /* read-only file */
  33.   
  34. extern int findfirst(char *pat, struct ffblk *ff, int attr);
  35. extern int findnext(struct ffblk *ff);
  36.   
  37. #else
  38. #include <dir.h>
  39. #endif
  40.   
  41. struct cur_dirs {
  42. #ifndef UNIX
  43.     int drv;
  44.     char * curdir[27];
  45. #endif
  46.     char * dir;
  47. } ;
  48.   
  49. /* In dirutil.c */
  50. FILE *dir __ARGS((char *path,int full));
  51. int filedir __ARGS((char *name,int times,char *ret_str));
  52. int getdir __ARGS((char *path,int full,FILE *file));
  53. void undosify __ARGS((char *s));
  54. char * make_dir_path(int count,char *arg,char* curdir);
  55. char * make_fname(char * curdir, char * fname);
  56. char * init_dirs(struct cur_dirs * dirs);
  57. void free_dirs(struct cur_dirs * dirs);
  58. int dir_ok(char * path,struct cur_dirs * dirs);
  59. int dircmd __ARGS((int argc,char *argv[],void *p));
  60.  
  61. /* Made public for nntp expiry */
  62. int nextname __ARGS((int command, char *name, struct ffblk *sbuf));
  63. char *wildcardize __ARGS((char *path));
  64.  
  65. #ifdef MSDOS
  66. int dosfnchr __ARGS((int ch));
  67. #endif
  68.   
  69.   
  70. /* In pathname.c: */
  71. char *pathname __ARGS((char *cd,char *path));
  72. char *firstpath __ARGS((char *path));
  73.   
  74. /* In pc.c: */
  75. char *Tmpnam __ARGS((char *name));
  76.   
  77. /* In bmutil.c */
  78. long fsize __ARGS((char *name));
  79.   
  80. #endif /* _DIRUTIL_H */
  81.   
  82.