home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / os-include / dos / dosasl.i < prev    next >
Text File  |  1993-10-15  |  4KB  |  130 lines

  1.     IFND DOS_DOSASL_I
  2. DOS_DOSASL_I    SET    1
  3. **
  4. **    $VER: dosasl.i 36.19 (2.5.91)
  5. **    Includes Release 40.15
  6. **
  7. **    pattern-matching structure definitions
  8. **
  9. **    (C) Copyright 1989-1993 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. **
  12.  
  13.     IFND EXEC_LIBRARIES_I
  14.     INCLUDE "exec/libraries.i"
  15.     ENDC
  16.  
  17.     IFND EXEC_LISTS_I
  18.     INCLUDE "exec/lists.i"
  19.     ENDC
  20.  
  21.     IFND DOS_DOS_I
  22.     INCLUDE "dos/dos.i"
  23.     ENDC
  24.  
  25. ************************************************************************
  26. ************************ PATTERN MATCHING ******************************
  27. ************************************************************************
  28.  
  29. * structure expected by MatchFirst, MatchNext.
  30. * Allocate this structure and initialize it as follows:
  31. *
  32. * Set ap_BreakBits to the signal bits (CDEF) that you want to take a
  33. * break on, or NULL, if you don't want to convenience the user.
  34. *
  35. * If you want to have the FULL PATH NAME of the files you found,
  36. * allocate a buffer at the END of this structure, and put the size of
  37. * it into ap_Strlen.  If you don't want the full path name, make sure
  38. * you set ap_Strlen to zero.  In this case, the name of the file, and stats
  39. * are available in the ap_Info, as per usual.
  40. *
  41. * Then call MatchFirst() and then afterwards, MatchNext() with this structure.
  42. * You should check the return value each time (see below) and take the
  43. * appropriate action, ultimately calling MatchEnd() when there are
  44. * no more files and you are done.  You can tell when you are done by
  45. * checking for the normal AmigaDOS return code ERROR_NO_MORE_ENTRIES.
  46. *
  47.  
  48.     STRUCTURE AnchorPath,0
  49.         LABEL    ap_First
  50.         CPTR    ap_Base    ; pointer to first anchor
  51.         LABEL    ap_Current
  52.         CPTR    ap_Last    ; pointer to last anchor
  53.         LONG    ap_BreakBits    ; Bits we want to break on
  54.         LONG    ap_FoundBreak    ; Bits we broke on. Also returns ERROR_BREAK
  55.         LABEL    ap_Length    ; Old compatability for LONGWORD ap_Length
  56.         BYTE    ap_Flags    ; New use for extra word.
  57.         BYTE    ap_Reserved
  58.         WORD    ap_Strlen    ; This is what ap_Length used to be
  59.         STRUCT    ap_Info,fib_SIZEOF    ; FileInfoBlock
  60.         LABEL    ap_Buf        ; Buffer for path name, allocated by user
  61.         LABEL    ap_SIZEOF
  62.  
  63.  
  64.     BITDEF    AP,DOWILD,0        ; User option ALL
  65.     BITDEF    AP,ITSWILD,1        ; Set by MatchFirst, used by MatchNext
  66.                     ; Application can test APB_ITSWILD,
  67.                     ; too (means that there's a wildcard
  68.                     ; in the pattern after calling
  69.                     ; MatchFirst).
  70.     BITDEF    AP,DODIR,2        ; Bit is SET if a DIR node should be
  71.                     ; entered. Application can RESET this
  72.                     ; bit after MatchFirst/MatchNext to
  73.                     ; AVOID entering a dir.
  74.     BITDEF    AP,DIDDIR,3        ; Bit is SET for an "expired" dir node.
  75.     BITDEF    AP,NOMEMERR,4        ; Set on memory error
  76.     BITDEF    AP,DODOT,5        ; If set, allow conversion of '.' to
  77.                     ; CurrentDir
  78.     BITDEF    AP,DirChanged,6        ; ap_Current->an_Lock changed
  79.                     ; since last MatchNext call
  80.  
  81.     BITDEF    AP,FollowHLinks,7      ; follow hardlinks on DODIR - defaults
  82.                        ; to not following hardlinks on a DODIR.
  83.  
  84.     STRUCTURE    AChain,0
  85.         CPTR    an_Child
  86.         CPTR    an_Parent
  87.         LONG    an_Lock
  88.         STRUCT    an_Info,fib_SIZEOF    ; FileInfoBlock
  89.         BYTE    an_Flags
  90.         LABEL    an_String
  91.         LABEL    an_SIZEOF
  92.  
  93.     BITDEF    DD,PatternBit,0
  94.     BITDEF    DD,ExaminedBit,1
  95.     BITDEF    DD,Completed,2
  96.     BITDEF    DD,AllBit,3
  97.     BITDEF    DD,SINGLE,4
  98.  
  99. * Constants used by wildcard routines, these are the pre-parsed tokens
  100. * referred to by pattern match.  It is not necessary for you to do
  101. * anything about these, MatchFirst() MatchNext() handle all these for you.
  102.  
  103. P_ANY        EQU    $80    ; Token for '*' or '#?
  104. P_SINGLE    EQU    $81    ; Token for '?'
  105. P_ORSTART    EQU    $82    ; Token for '('
  106. P_ORNEXT    EQU    $83    ; Token for '|'
  107. P_OREND    EQU    $84    ; Token for ')'
  108. P_NOT        EQU    $85    ; Token for '~'
  109. P_NOTEND    EQU    $86    ; Token for
  110. P_NOTCLASS    EQU    $87    ; Token for '^'
  111. P_CLASS    EQU    $88    ; Token for '[]'
  112. P_REPBEG    EQU    $89    ; Token for '['
  113. P_REPEND    EQU    $8A    ; Token for ']'
  114. P_STOP        EQU    $8B    ; token to force end of evaluation
  115.  
  116. * Values for an_Status, NOTE: These are the actual bit numbers
  117.  
  118. COMPLEX_BIT    EQU    1    ; Parsing complex pattern
  119. EXAMINE_BIT    EQU    2    ; Searching directory
  120.  
  121. * Returns from MatchFirst(), MatchNext()
  122. * You can also get dos error returns, such as ERROR_NO_MORE_ENTRIES,
  123. * these are in the dos.h file.
  124. *
  125. ERROR_BUFFER_OVERFLOW    EQU    303    ; User or internal buffer overflow
  126. ERROR_BREAK        EQU    304    ; A break character was received
  127. ERROR_NOT_EXECUTABLE    EQU    305    ; A file has E bit cleared
  128.  
  129.     ENDC    ; DOS_DOSASL_I
  130.