home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 25 / nopv25.iso / 040A / PBL30SRC.ZIP / COMPILER.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-13  |  3.1 KB  |  106 lines

  1. /*
  2.  * This file is part of PB-Lib v3.0 C++ Programming Library
  3.  *
  4.  * Copyright (c) 1995, 1997 by Branislav L. Slantchev
  5.  * A fine product of Silicon Creations, Inc. (gargoyle)
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the License which accompanies this
  9.  * software. This library is distributed in the hope that it will
  10.  * be useful, but without any warranty; without even the implied
  11.  * warranty of merchantability or fitness for a particular purpose.
  12.  *
  13.  * You should have received a copy of the License along with this
  14.  * library, in the file LICENSE.DOC; if not, write to the address
  15.  * below to receive a copy via electronic mail.
  16.  *
  17.  * You can reach Branislav L. Slantchev (Silicon Creations, Inc.)
  18.  * at bslantch@cs.angelo.edu. The file SUPPORT.DOC has the current
  19.  * telephone numbers and the postal address for contacts.
  20. */
  21.  
  22. #ifndef INCLUDED_COMPILER_H
  23. #define INCLUDED_COMPILER_H
  24.  
  25. /*
  26.  * c r o s s - c o m p i l e r   d e f i n i t i o n s
  27.  * ──────────────────────────────────────────────────────────────────────────
  28.  * these macros port several important routines across some ms-dos compilers
  29. */
  30.  
  31. /*
  32.  * generic MS-DOS filesearch record (ffblk and find_t-compatible)
  33.  * this should be aligned on byte-boundary. DJGPP assumes #pragma align 1
  34.  * as default (and it cannot be turned off anyway).
  35. */
  36. #if defined( __TURBOC__ )
  37.     #pragma option -a-
  38. #elif defined( __ZTC__ )
  39.     #pragma ZTC align 1
  40. #elif defined( __SC__ )
  41.     #pragma SC align 1
  42. #elif defined( _MSC_VER ) || defined( __WATCOMC__ )
  43.     #pragma pack(1)
  44. #endif
  45.  
  46. typedef struct{
  47.     char     reserved[21];
  48.     char     attrib;
  49.     unsigned time;
  50.     unsigned date;
  51.     long     size;
  52.     char     name[13];
  53. } zDosFile;
  54.  
  55. /*
  56.  * restore the default alignment here
  57. */
  58. #if defined( __TURBOC__ )
  59.     #pragma option -a.
  60. #elif defined( __ZTC__ )
  61.     #pragma ZTC align
  62. #elif defined( __SC__ )
  63.     #pragma SC align
  64. #elif defined( _MSC_VER ) || defined( __WATCOMC__ )
  65.     #pragma pack ()
  66. #endif
  67.  
  68. /*
  69.  * map the find_first, find_next combo onto the provided library functions
  70. */
  71. #ifdef PB_SDK
  72.     #define FindFirst(p,a,ff)   dos_findfirst(p,a,(struct find_t *)ff)
  73.     #define FindNext(ff)        dos_findnext((struct find_t *)ff)
  74. #elif defined( __DJGPP__ )
  75.     #include <dir.h>
  76.     #define FindFirst(path,attr,ff)  findfirst(path,(struct ffblk *)ff,attr)
  77.     #define FindNext(ff)             findnext((struct ffblk *)ff)
  78. #else
  79.     #if defined( __ZTC__ )
  80.     #define MSDOS 1
  81.     #endif
  82.     #include <dos.h>
  83.     #define FindFirst(p,a,ff)  _dos_findfirst(p,a,(struct find_t *)ff)
  84.     #define FindNext(ff)       _dos_findnext((struct find_t *)ff)
  85. #endif
  86.  
  87. #ifndef PB_SDK
  88.     #if defined( __WATCOMC__ ) || defined ( _MSC_VER )
  89.         #define FA_NORMAL  _A_NORMAL
  90.         #define FA_RDONLY  _A_RDONLY
  91.         #define FA_HIDDEN  _A_HIDDEN
  92.         #define FA_SYSTEM  _A_SYSTEM
  93.         #define FA_LABEL   _A_VOLID
  94.         #define FA_DIREC   _A_SUBDIR
  95.         #define FA_ARCH    _A_ARCH
  96.         #define FA_ALL     0x37
  97.     #else
  98.         #define FA_NORMAL  0x00
  99.         #define FA_ALL     0x37
  100.     #endif
  101. #else /* the other SDK values are defined in PBLIBC.H */
  102.     #define FA_ALL     0x37
  103. #endif
  104.  
  105. #endif  /* INCLUDED_COMPILER_H */
  106.