home *** CD-ROM | disk | FTP | other *** search
/ Software Recommendations - 1998 Season 1 / DNBCD4.iso / share / DOS / ipxcopy / SRC.ZIP / SRC / CDIRENT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-12  |  1.3 KB  |  59 lines

  1. /*
  2.  
  3.    CDIRENT.H
  4.  
  5.    (c) 1996 Oliver Kraus
  6.  
  7.    UNIX compatible directory/file access
  8.  
  9. */
  10.  
  11. #ifndef _CDIRENT_H
  12. #define _CDIRENT_H
  13.  
  14. struct c_dirent
  15. {
  16.    unsigned long  d_size;     /* file-size */
  17.    unsigned long  d_ino;      /* directory file number */
  18.    unsigned long  d_off;      /* offset of the next non empty directory */
  19.    unsigned short d_reclen;   /* size of the current dirent record */
  20.    short          d_is_dir;
  21.    char           d_short_name[14];  /* old MSDOS 8.3 filenames */
  22.    char           d_name[1];  /* at most MAXNAMLEN characters */
  23. };
  24.  
  25. struct _CDIR_struct
  26. {
  27.    char *path;
  28.    char *pat;
  29.    char *ptr;
  30.    size_t pos;
  31.    size_t max;
  32.    size_t cnt;
  33.    int (*patmat_fn)(char *, char *);
  34.    int options;
  35. };
  36. typedef struct _CDIR_struct CDIR;
  37.  
  38. #define CDIR_MATCH_CASE (0x0001)
  39. #define CDIR_MATCH_ALL   (0x0002)
  40.  
  41. char *c_strupr(char *s);
  42. CDIR *c_opendir(const char *path, const char *pat, int options);
  43. int c_closedir(CDIR *dirp);
  44. struct c_dirent *c_readdir(CDIR *dirp);
  45. void c_rewinddir(CDIR *dirp);
  46. long c_telldir(CDIR *dirp);
  47. void c_seekdir(CDIR *dirp, long pos);
  48.  
  49. #define c_is_dir(dirent) ((dirent)->d_is_dir)
  50. #define c_get_name(dirent) ((dirent)->d_name)
  51. #define c_get_short_name(dirent) ((dirent)->d_short_name)
  52.  
  53. char *c_strupr(char *s);
  54. int patmat(char *raw, char *pat);
  55. int upatmat(char *raw, char *pat);
  56.  
  57.  
  58. #endif
  59.