home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / rom / dos / dos_intern.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-09  |  3.4 KB  |  139 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: dos_intern.h,v 1.5 1996/10/24 15:50:26 aros Exp $
  4.     $Log: dos_intern.h,v $
  5.     Revision 1.5  1996/10/24 15:50:26  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.4  1996/09/21 14:14:23  digulla
  9.     Hand DOSBase to DoName()
  10.  
  11.     Revision 1.3  1996/09/11 12:57:32  digulla
  12.     Pattern support by M. Fleischer
  13.  
  14.     Revision 1.2  1996/08/01 17:40:49  digulla
  15.     Added standard header for all files
  16.  
  17.     Desc:
  18.     Lang:
  19. */
  20. #ifndef DOS_INTERN_H
  21. #define DOS_INTERN_H
  22.  
  23. #include <dos/dosextens.h>
  24. #include <dos/filesystem.h>
  25.  
  26. #ifdef SysBase
  27. #undef SysBase
  28. #endif
  29. #define SysBase (DOSBase->dl_SysBase)
  30. #ifdef UtilityBase
  31. #undef UtilityBase
  32. #endif
  33. #define UtilityBase (DOSBase->dl_UtilityBase)
  34.  
  35. /* Needed for close() */
  36. #define expunge() \
  37. AROS_LC0(BPTR, expunge, struct DosLibrary *, DOSBase, 3, Dos)
  38.  
  39. struct DAList
  40. {
  41.     STRPTR *ArgBuf;
  42.     UBYTE *StrBuf;
  43.     STRPTR *MultVec;
  44. };
  45.  
  46. struct EString
  47. {
  48.     LONG Number;
  49.     STRPTR String;
  50. };
  51.  
  52. extern struct EString EString[];
  53.  
  54. #ifndef EOF
  55. #define EOF -1
  56. #endif
  57. #ifndef IOBUFSIZE
  58. #define IOBUFSIZE 4096
  59. #endif
  60.  
  61. struct vfp
  62. {
  63.     BPTR file;
  64.     LONG count;
  65. };
  66.  
  67. #define FPUTC(f,c) \
  68. (((struct FileHandle *)BADDR(f))->fh_Flags&FHF_WRITE&& \
  69.  ((struct FileHandle *)BADDR(f))->fh_Pos<((struct FileHandle *)BADDR(f))->fh_End? \
  70. *((struct FileHandle *)BADDR(f))->fh_Pos++=c,0:FPutC(f,c))
  71.  
  72. LONG DoName(struct IOFileSys *iofs, STRPTR name, struct DosLibrary * DOSBase);
  73.  
  74. struct marker
  75. {
  76.     UBYTE type; /* 0: Split 1: MP_NOT */
  77.     STRPTR pat; /* Pointer into pattern */
  78.     STRPTR str; /* Pointer into string */
  79. };
  80.  
  81. struct markerarray
  82. {
  83.     struct markerarray *next;
  84.     struct markerarray *prev;
  85.     struct marker marker[128];
  86. };
  87.  
  88. #define PUSH(t,p,s)                                                     \
  89. {                                    \
  90.     if(macnt==128)                                                      \
  91.     {                                    \
  92.     if(macur->next==NULL)                                           \
  93.     {                                \
  94.         macur->next=AllocMem(sizeof(struct markerarray),MEMF_ANY);  \
  95.         if(macur->next==NULL)                                       \
  96.         ERROR(ERROR_NO_FREE_STORE);                             \
  97.         macur->next->prev=macur;                    \
  98.     }                                \
  99.     macur=macur->next;                        \
  100.     macnt=0;                            \
  101.     }                                    \
  102.     macur->marker[macnt].type=(t);                                      \
  103.     macur->marker[macnt].pat=(p);                                       \
  104.     macur->marker[macnt].str=(s);                                       \
  105.     macnt++;                                \
  106. }
  107.  
  108. #define POP(t,p,s)                      \
  109. {                    \
  110.     macnt--;                \
  111.     if(macnt<0)                         \
  112.     {                    \
  113.     macnt=127;            \
  114.     macur=macur->prev;        \
  115.     if(macur==NULL)                 \
  116.         ERROR(0);                   \
  117.     }                    \
  118.     (t)=macur->marker[macnt].type;      \
  119.     (p)=macur->marker[macnt].pat;       \
  120.     (s)=macur->marker[macnt].str;       \
  121. }
  122.  
  123. #define MP_ESCAPE    0x81 /* Before characters in [0x81;0x8a] */
  124. #define MP_MULT     0x82 /* _#(_a) */
  125. #define MP_MULT_END    0x83 /* #(a_)_ */
  126. #define MP_NOT        0x84 /* _~(_a) */
  127. #define MP_NOT_END    0x85 /* ~(a_)_ */
  128. #define MP_OR        0x86 /* _(_a|b) */
  129. #define MP_OR_NEXT    0x87 /* (a_|_b) */
  130. #define MP_OR_END    0x88 /* (a|b_)_ */
  131. #define MP_SINGLE    0x89 /* ? */
  132. #define MP_ALL        0x8a /* #? or * */
  133. #define MP_SET        0x8b /* _[_ad-g] */
  134. #define MP_NOT_SET    0x8c /* _[~_ad-g] */
  135. #define MP_DASH     0x8d /* [ad_-g_] */
  136. #define MP_SET_END    0x8e /* [ad-g_]_ */
  137.  
  138. #endif
  139.