home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / ramfs102.zip / src / util.h < prev    next >
C/C++ Source or Header  |  2002-09-28  |  2KB  |  62 lines

  1. #define INT3    _asm{int 3}
  2.  
  3. /* return values for UtilLocate() */
  4. #define LOC_NOPATH    0
  5. #define LOC_DIRENTRY    1
  6. #define LOC_NOENTRY    2
  7. #define LOC_FILEENTRY    3
  8.  
  9. /* size of the "." and ".." entries that are at the beginning of a dir */
  10. #define DIR_DOTSSIZE    (FIELDOFFSET(DIRENTRY,achName)+1 + FIELDOFFSET(DIRENTRY,achName)+2)
  11.  
  12. /* round up to nearest 4K multiple */
  13. #define ROUNDUP(a)  (((a) + 0x00000FFFlu) & 0xFFFFF000lu)
  14.  
  15. extern USHORT   _pascal DOS32FLATDS;
  16. extern PFN near DevHlp;
  17. extern PGINFOSEG near pGiseg;
  18.  
  19.  
  20. #ifdef DEBUG
  21.  
  22.   extern char debugging;
  23.  
  24.   int _cdecl debug_printf (const char _ds *format, ...);
  25.  
  26.   #define DEBUG_PRINTF0(fmt)              debug_printf (fmt)
  27.   #define DEBUG_PRINTF1(fmt,a)            debug_printf (fmt,a)
  28.   #define DEBUG_PRINTF2(fmt,a,b)          debug_printf (fmt,a,b)
  29.   #define DEBUG_PRINTF3(fmt,a,b,c)        debug_printf (fmt,a,b,c)
  30.   #define DEBUG_PRINTF4(fmt,a,b,c,d)      debug_printf (fmt,a,b,c,d)
  31.   #define DEBUG_PRINTF5(fmt,a,b,c,d,e)    debug_printf (fmt,a,b,c,d,e)
  32.   #define DEBUG_PRINTF6(fmt,a,b,c,d,e,f)  debug_printf (fmt,a,b,c,d,e,f)
  33.  
  34. #else
  35.  
  36.   #define DEBUG_PRINTF0(fmt)
  37.   #define DEBUG_PRINTF1(fmt,a)
  38.   #define DEBUG_PRINTF2(fmt,a,b)
  39.   #define DEBUG_PRINTF3(fmt,a,b,c)
  40.   #define DEBUG_PRINTF4(fmt,a,b,c,d)
  41.   #define DEBUG_PRINTF5(fmt,a,b,c,d,e)
  42.   #define DEBUG_PRINTF6(fmt,a,b,c,d,e,f)
  43.  
  44. #endif
  45.  
  46.  
  47. ULONG UtilGetDateTime (void);
  48.  
  49. int  UtilLocate (FLAT _ss *pflatBlkDir, FLAT _ss *pflatEntry, PDIRENTRY pEntry,
  50.          PSZ pszPath);
  51.  
  52. int  UtilAttrMatch (USHORT usPattern, USHORT usAttr);
  53.  
  54. int  UtilInsertEntry (PVOLUME pVolume, FLAT flatBlkDir, PDIRENTRY pEntry,
  55.               FLAT _ss *pflatEntry);
  56.  
  57. void UtilDeleteEntry (PVOLUME pVolume, FLAT flatBlkDir, PDIRENTRY pEntry,
  58.               FLAT flatEntry);
  59.  
  60. void UtilEnterRamfs (void);
  61. void UtilExitRamfs  (void);
  62.