home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip531.zip / os2 / os2data.h < prev    next >
C/C++ Source or Header  |  1996-11-10  |  4KB  |  140 lines

  1. /*---------------------------------------------------------------------------
  2.  
  3.   os2data.h
  4.  
  5.   OS/2-specific structures and data to be included in the global data struc-
  6.   ture.
  7.  
  8.   ---------------------------------------------------------------------------*/
  9.  
  10.  
  11. #define MAXNAMLEN  256
  12. #define MAXPATHLEN 256
  13. #define MAXLEN     256    /* temporary buffer length */
  14. #define IBUF_LEN   4096   /* input buffer length */
  15.  
  16. #define INCL_NOPM
  17. #define INCL_DOSNLS
  18. #define INCL_DOSPROCESS
  19. #define INCL_DOSDEVICES
  20. #define INCL_DOSDEVIOCTL
  21. #define INCL_DOSERRORS
  22. #define INCL_DOSMISC
  23.  
  24. #if (defined(OS2DLL) && !defined(DLL))
  25. #  undef OS2DLL
  26. #endif
  27.  
  28. #ifdef OS2DLL
  29. #  define INCL_REXXSAA
  30. #  include <rexxsaa.h>
  31. #endif
  32.  
  33. #include <os2.h>
  34.  
  35.  
  36. struct direct
  37. {
  38.   ino_t    d_ino;                   /* a bit of a farce */
  39.   int      d_reclen;                /* more farce */
  40.   int      d_namlen;                /* length of d_name */
  41.   char     d_name[MAXNAMLEN + 1];   /* null terminated */
  42.   /* nonstandard fields */
  43.   long     d_size;                  /* size in bytes */
  44.   unsigned d_mode;                  /* MS-DOS or OS/2 file attributes */
  45.   unsigned d_time;
  46.   unsigned d_date;
  47. };
  48.  
  49. /* The fields d_size and d_mode are extensions by me (Kai Uwe Rommel).  The
  50.  * find_first and find_next calls deliver these data without any extra cost.
  51.  * If these data are needed, the fields save a lot of extra calls to stat()
  52.  * (each stat() again performs a find_first call !).
  53.  */
  54.  
  55. struct _dircontents
  56. {
  57.   char *_d_entry;
  58.   long _d_size;
  59.   unsigned _d_mode, _d_time, _d_date;
  60.   struct _dircontents *_d_next;
  61. };
  62.  
  63. typedef struct _dirdesc
  64. {
  65.   int  dd_id;                   /* uniquely identify each open directory */
  66.   long dd_loc;                  /* where we are in directory entry is this */
  67.   struct _dircontents *dd_contents;   /* pointer to contents of dir */
  68.   struct _dircontents *dd_cp;         /* pointer to current position */
  69. }
  70. DIR;
  71.  
  72.  
  73. struct os2Global {
  74.  
  75. #ifndef SFX
  76.    HDIR hdir;
  77. #ifdef __32BIT__
  78.    ULONG count;
  79.    FILEFINDBUF3 find;
  80. #else
  81.    USHORT count;
  82.    FILEFINDBUF find;
  83. #endif
  84. #endif /* !SFX */
  85.   
  86.    int created_dir;        /* used by mapname(), checkdir() */
  87.    int renamed_fullpath;   /* ditto */
  88.    int fnlen;              /* ditto */
  89. #ifdef __32BIT__
  90.    ULONG nLabelDrive;      /* ditto */
  91. #else
  92.    USHORT nLabelDrive;
  93. #endif
  94.    int longnameEA;         /* checkdir(), close_outfile() */
  95.    char *lastpathcomp;     /* ditto */
  96.   
  97.    struct direct dp;
  98.    int lower;
  99.    USHORT nLastDrive, nResult;
  100.   
  101.    DIR *dir;
  102.    char *dirname, *wildname, matchname[FILNAMSIZ];
  103.    int firstcall, have_dirname, dirnamelen;
  104.   
  105.    int rootlen;          /* length of rootpath */
  106.    char *rootpath;       /* user's "extract-to" directory */
  107.    char *buildpathHPFS;  /* full path (so far) to extracted file, */
  108.    char *buildpathFAT;   /*  both HPFS/EA (main) and FAT versions */
  109.    char *endHPFS;        /* corresponding pointers to end of */
  110.    char *endFAT;         /*  buildpath ('\0') */
  111.  
  112. #ifdef OS2DLL
  113.    char buffer[IBUF_LEN];
  114.    char output_var[MAXLEN];
  115.    char getvar_buf[MAXLEN];
  116.    int getvar_len;
  117.   
  118.    int output_idx;
  119.    int stem_len;
  120.    int putchar_idx;
  121.    int rexx_error;
  122.    char *rexx_mes;
  123.  
  124.    SHVBLOCK request;
  125. #endif
  126. };
  127.  
  128.  
  129. #define SYSTEM_SPECIFIC_GLOBALS struct os2Global os2;
  130. #define SYSTEM_SPECIFIC_CTOR    os2GlobalsCtor
  131.  
  132. #ifdef OS2DLL
  133. #  ifdef API_DOC
  134. #    define SYSTEM_API_BRIEF    REXXBrief
  135. #    define SYSTEM_API_DETAILS  REXXDetails
  136.      extern char *REXXBrief;
  137.      extern APIDocStruct REXXDetails[];
  138. #  endif
  139. #endif
  140.