home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / SQDEV200.ZIP / H / FFIND.H < prev    next >
C/C++ Source or Header  |  1994-05-23  |  4KB  |  122 lines

  1. /***************************************************************************
  2.  *                                                                         *
  3.  *  Squish Developers Kit Source, Version 2.00                             *
  4.  *  Copyright 1989-1994 by SCI Communications.  All rights reserved.       *
  5.  *                                                                         *
  6.  *  USE OF THIS FILE IS SUBJECT TO THE RESTRICTIONS CONTAINED IN THE       *
  7.  *  SQUISH DEVELOPERS KIT LICENSING AGREEMENT IN SQDEV.PRN.  IF YOU DO NOT *
  8.  *  FIND THE TEXT OF THIS AGREEMENT IN THE AFOREMENTIONED FILE, OR IF YOU  *
  9.  *  DO NOT HAVE THIS FILE, YOU SHOULD IMMEDIATELY CONTACT THE AUTHOR AT    *
  10.  *  ONE OF THE ADDRESSES LISTED BELOW.  IN NO EVENT SHOULD YOU PROCEED TO  *
  11.  *  USE THIS FILE WITHOUT HAVING ACCEPTED THE TERMS OF THE SQUISH          *
  12.  *  DEVELOPERS KIT LICENSING AGREEMENT, OR SUCH OTHER AGREEMENT AS YOU ARE *
  13.  *  ABLE TO REACH WITH THE AUTHOR.                                         *
  14.  *                                                                         *
  15.  *  You can contact the author at one of the address listed below:         *
  16.  *                                                                         *
  17.  *  Scott Dudley       FidoNet     1:249/106                               *
  18.  *  777 Downing St.    Internet    sjd@f106.n249.z1.fidonet.org            *
  19.  *  Kingston, Ont.     CompuServe  >INTERNET:sjd@f106.n249.z1.fidonet.org  *
  20.  *  Canada  K7M 5N3    BBS         1-613-634-3058, V.32bis                 *
  21.  *                                                                         *
  22.  ***************************************************************************/
  23.  
  24. /*# name=FFIND.C include file.
  25.     credit=Thanks to Peter Fitzsimmons for this module.
  26. */
  27.  
  28. #ifndef __FFIND_H_DEFINED
  29. #define __FFIND_H_DEFINED
  30.  
  31. #include "compiler.h"
  32. #include "typedefs.h"
  33. #include "stamp.h"
  34. #include "prog.h"
  35.  
  36. struct _ffind;
  37. typedef struct _ffind FFIND;
  38.  
  39. #if defined(__MSDOS__)
  40.  
  41.   /* Layout of the DOS Disk Transfer Area */
  42.  
  43.   struct _dosdta
  44.   {
  45.     char achReserved[21];
  46.     byte bAttr;
  47.     word usTime;
  48.     word usDate;
  49.     dword ulSize;
  50.     char achName[13];
  51.   };
  52.  
  53.   unsigned far pascal __dfindfirst(char far *name, unsigned attr, struct _dosdta far *dta);
  54.   unsigned far pascal __dfindnext(struct _dosdta far *dta);
  55.  
  56. #elif defined(NT)
  57.   #include "pwin.h"
  58. #endif
  59.  
  60.  
  61. struct _ffind
  62. {
  63.   word usAttr;
  64.   SCOMBO scCdate;
  65.   SCOMBO scAdate;
  66.   SCOMBO scWdate;
  67.   dword ulSize;
  68.  
  69. #if defined(__MSDOS__)
  70.  
  71.   char szName[13];
  72.   struct _dosdta __dta;
  73.  
  74. #elif defined(NT)
  75.  
  76.   char szName[PATHLEN];
  77.   HANDLE hdir;
  78.  
  79. #elif defined(OS_2)
  80.  
  81.   char szName[PATHLEN];
  82.  
  83.   #ifdef __FLAT__ /* OS/2 2.0 or NT */
  84.     unsigned long hdir;
  85.   #else
  86.     unsigned short hdir;       /* directory handle from DosFindFirst */
  87.   #endif
  88.  
  89. #endif
  90. };
  91.  
  92. FFIND * _fast FindOpen(char *filespec,unsigned short attribute);
  93. FFIND * _fast FindInfo(char *filespec); /*PLF Thu  10-17-1991  18:03:09 */
  94. int _fast FindNext(FFIND *ff);
  95.  
  96. #ifdef NT /* NT's abortion of a naming convention conflicts with our usage! */
  97. #define FindClose FndClose
  98. #endif
  99.  
  100. void _fast FindClose(FFIND *ff);
  101.  
  102. #define ATTR_READONLY  0x01
  103. #define ATTR_HIDDEN    0x02
  104. #define ATTR_SYSTEM    0x04
  105. #define ATTR_VOLUME    0x08
  106. #define ATTR_SUBDIR    0x10
  107. #define ATTR_ARCHIVE   0x20
  108. #define ATTR_RSVD1     0x40
  109. #define ATTR_RSVD2     0x80
  110.  
  111. #define MSDOS_READONLY  ATTR_READONLY
  112. #define MSDOS_HIDDEN    ATTR_HIDDEN
  113. #define MSDOS_SYSTEM    ATTR_SYSTEM
  114. #define MSDOS_VOLUME    ATTR_VOLUME
  115. #define MSDOS_SUBDIR    ATTR_SUBDIR
  116. #define MSDOS_ARCHIVE   ATTR_ARCHIVE
  117. #define MSDOS_RSVD1     ATTR_RSVD1
  118. #define MSDOS_RSVD2     ATTR_RSVD2
  119.  
  120. #endif /* __FFIND_H_DEFINED */
  121.  
  122.