home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 534.lha / sregexp.library_v11.1 / sregexpbase.i < prev    next >
Text File  |  1991-08-08  |  3KB  |  164 lines

  1.     IFND        LIBRARIES_SREGEXPBASE_I
  2. LIBRARIES_SREGEXPBASE_I set    1
  3.  
  4. *********************************************************************
  5. *                                    *
  6. * sregbase.i -- asm include file for sreg.library            *
  7. *                                    *
  8. * Copyright (C) 1991, Jon Spencer.                                  *
  9. *                                    *
  10. * Created: April 20,1991                        *
  11. *                                    *
  12. *********************************************************************
  13.  
  14.     IFND        EXEC_TYPES_I
  15.     INCLUDE     "exec/types.i"
  16.     ENDC
  17.  
  18.     IFND        EXEC_LISTS_I
  19.     INCLUDE     "exec/lists.i"
  20.     ENDC
  21.  
  22.     IFND        EXEC_LIBRARIES_I
  23.     INCLUDE     "exec/libraries.i"
  24.     ENDC
  25.  
  26.     IFND        LIBRARIES_DOS_I
  27.     INCLUDE     "libraries/dos.i"
  28.     ENDC
  29.  
  30.  
  31.  
  32. ;
  33. ;
  34. ; Library base structure, all of these fields are private, and
  35. ; should not be accessed.
  36. ;
  37. ;
  38.  
  39.     STRUCTURE    SregExpBase,LIB_SIZE
  40.     APTR        sb_SysBase
  41.     APTR        sb_DOSBase
  42.     ULONG        sb_SegList
  43.     LABEL    SregExpBase_SIZE
  44.  
  45.  
  46.  
  47. SREGEXPNAME    macro
  48.         dc.b        "sregexp.library",0
  49.         endm
  50.  
  51. ;
  52. ;
  53. ; Here are the equates for the structures used and returned by
  54. ; the various sreg functions.  They should probably not be
  55. ; accessed for there contents, unless you have really good
  56. ; reason...
  57. ;
  58. ;
  59.     STRUCTURE    SregExp,0
  60.     BYTE            sre_Type
  61.     BYTE            sre_Flag
  62.     SHORT            sre_MinLen
  63.     ULONG            sre_Data
  64.     APTR            sre_List
  65.     LABEL    SregExp_SIZE
  66.  
  67.  
  68. ; sre_Data is a union, here are its elements.
  69. sre_onechar     EQU         sre_Data
  70. sre_setchar     EQU         sre_Data
  71. sre_string     EQU         sre_Data
  72. sre_number     EQU         sre_Data
  73.  
  74.  
  75. ; This is an internal structure for a singly linked list of sregexp's
  76.  
  77.     STRUCTURE    SregList,0
  78.     APTR            srl_sreg
  79.     APTR            srl_next
  80.     LABEL    SregList_SIZE
  81.  
  82.  
  83. ; various types of wildcard pattern elements.  Goes in spat_t.type
  84.  
  85. SRP_SETCHAR  EQU         1
  86. SRP_ANYCHAR  EQU         2
  87. SRP_ONECHAR  EQU         3
  88. SRP_STRING   EQU         4
  89. SRP_NULL     EQU         5
  90. SRP_OR         EQU         6
  91. SRP_SUM      EQU         7
  92.  
  93. ; various flags to mark special properties of patterns.
  94. ; Goes in SregExp.sre_Flag
  95.  
  96.     BITDEF    SR,NOT,0
  97.     BITDEF    SR,REPEAT,1
  98.     BITDEF    SR,FIXLEN,2
  99.     BITDEF    SR,JUSTDIRS,6
  100.     BITDEF    SR,RECURSE,7
  101.  
  102. ; equates for the wildcard characters
  103.  
  104. CHR_REPEAT    EQU        '#'
  105. CHR_NOT     EQU        '~'
  106. CHR_OPENBRACE    EQU        '('
  107. CHR_CLOSEBRACE    EQU        ')'
  108. CHR_OPENSET    EQU        '['
  109. CHR_CLOSESET    EQU        ']'
  110. CHR_ANYCHAR    EQU        '?'
  111. CHR_NULL    EQU        '%'
  112. CHR_OR        EQU        '|'
  113. CHR_ESCAPE    EQU        "'"
  114. CHR_RANGE    EQU        '-'
  115. CHR_STAR    EQU        '*'
  116.  
  117.  
  118. ;
  119. ; These are the structures used for the path matching routines.
  120. ;
  121.  
  122.     STRUCTURE    SpathInfo,0
  123.     APTR        spi_Head
  124.     APTR        spi_Tail
  125.     APTR        spi_TailPred
  126.     APTR        spi_SregList;
  127.     LABEL    SpathInfo_SIZE
  128.  
  129.  
  130. ; Note: because of the fileinfoblock, this whole structure MUST
  131. ; be longword aligned.
  132.  
  133.     STRUCTURE    SpathNode,0
  134.     APTR        spn_Succ
  135.     APTR        spn_Pred
  136.     STRUCT        spn_FIB,fib_SIZEOF
  137.     BPTR        spn_Lock
  138.     APTR        spn_SregList
  139.     APTR        spn_NodeName
  140.     SHORT        spn_Flags
  141.     LABEL    SpathNode_SIZE
  142.  
  143. ; flags used in spn_Flags, which is  really library private.
  144.  
  145.     BITDEF  SP,DECEND,0
  146.     BITDEF  SP,DONEONCE,1
  147.     BITDEF  SP,NEXTPARENT,2
  148.  
  149. ; These are the possible error returns sent by NextFile and BuildPath
  150.  
  151. SPE_ALL_DONE    EQU    -1
  152. SPE_ERROR    EQU    -2
  153. SPE_BUFF_FULL    EQU    -3
  154. SPE_SIGBREAK    EQU    -4
  155.  
  156.  
  157. ; Some defines for what kind of events we match to.
  158.  
  159. SP_DIRS_ONLY    EQU    1
  160. SP_BOTH     EQU    0
  161. SP_FILES_ONLY    EQU    -1
  162.  
  163.     ENDC
  164.