IFND DOS_DOSASL_I DOS_DOSASL_I SET 1 *********************************************************************** * * AmigaDOS Resource Project -- Library Include File (Assembler) * IFND EXEC_TYPES_I INCLUDE "exec/types.i" ENDC IFND EXEC_LIBRARIES_I INCLUDE "exec/libraries.i" ENDC IFND EXEC_LISTS_I INCLUDE "exec/lists.i" ENDC IFND DOS_DOS_I INCLUDE "dos/dos.i" ENDC *---------- Return codes you can get from calling Assign: ASSIGN_OK EQU 0 ; Everything is cool and groovey ASSIGN_NODEV EQU 1 ; "Physical" is not valid for assignment ASSIGN_FATAL EQU 2 ; Something really icky happened ASSIGN_CANCEL EQU 3 ; Tried to cancel something that won't cancel. *--------- Size of buffer you need for ReadLine MaxInputBuf EQU 256 ************************************************************************ ************************ PATTERN MATCHING ****************************** ************************************************************************ * structure expected by FindFirst, FindNext. * Allocate this structure and initialize it as follows: * * Set ap_BreakBits to the signal bits (CDEF) that you want to take a * break on, or NULL, if you don't want to convenience the user. * * If you want to have the FULL PATH NAME of the files you found, * allocate a buffer at the END of this structure, and put the size of * it into ap_Length. If you don't want the full path name, make sure * you set ap_Length to zero. In this case, the name of the file, and stats * are available in the ap_Info, as per usual. * * Then call FindFirst() and then afterwards, FindNext() with this structure. * You should check the return value each time (see below) and take the * appropriate action, ultimately calling FreeAnchorChain() when there are * no more files and you are done. You can tell when you are done by * checking for the normal AmigaDOS return code ERROR_NO_MORE_ENTRIES. * STRUCTURE AnchorPath,0 LABEL ap_First CPTR ap_Base ; pointer to first anchor LABEL ap_Current CPTR ap_Last ; pointer to last anchor LONG ap_BreakBits ; Bits we want to break on LONG ap_FoundBreak ; Bits we broke on. Also returns ERROR_BREAK LABEL ap_Length ; Old compatability for LONGWORD ap_Length BYTE ap_Flags ; New use for extra word. BYTE ap_Reservred WORD ap_Strlen ; This is what ap_Length used to be STRUCT ap_Info,fib_SIZEOF ; FileInfoBlock LABEL ap_Buf ; Buffer for path name, allocated by user LABEL ap_SIZEOF BITDEF AP,DOWILD,0 ; User option ALL BITDEF AP,ITSWILD,1 ; Set by FindFirst, used by FindNext ; Application can test APB_ITSWILD, too. BITDEF AP,DODIR,2 ; Bit is SET if a DIR node should be ; entered. Application can RESET this ; bit after FindFirst/FindNext to AVOID ; entering a dir. BITDEF AP,DIDDIR,3 ; Bit is SET for an "expired" dir node. BITDEF AP,NOMEMERR,4 ; Set on memory error BITDEF AP,DODOT,5 ; If set, allow conversion of '.' to CurrentDir STRUCTURE AChain,0 CPTR an_Child CPTR an_Parent LONG an_Lock STRUCT an_Info,fib_SIZEOF ; FileInfoBlock BYTE an_Flags LABEL an_String LABEL an_SIZEOF BITDEF DD,PatternBit,0 BITDEF DD,ExaminedBit,1 BITDEF DD,Completed,2 BITDEF DD,AllBit,3 BITDEF DD,SINGLE,4 * Constants used by wildcard routines, these are the pre-parsed tokens * referred to by pattern match. It is not necessary for you to do * anything about these, FindFirst() FindNext() handle all these for you. P_ANY EQU $80 ; Token for '*' or '#? P_SINGLE EQU $81 ; Token for '?' P_ORSTART EQU $82 ; Token for '(' P_ORNEXT EQU $83 ; Token for '|' P_OREND EQU $84 ; Token for ')' P_TAG EQU $85 ; Token for '{' P_TAGEND EQU $86 ; Token for '}' P_NOTCLASS EQU $87 ; Token for '^' P_CLASS EQU $88 ; Token for '[]' P_REPBEG EQU $89 ; Token for '[' P_REPEND EQU $8A ; Token for ']' * Values for an_Status, NOTE: These are the actual bit numbers COMPLEX_BIT EQU 1 ; Parsing complex pattern EXAMINE_BIT EQU 2 ; Searching directory * Returns from FindFirst(), FindNext() * You can also get dos error returns, such as ERROR_NO_MORE_ENTRIES, * these are in the dos.h file. * ERROR_BUFFER_OVERFLOW EQU 303 ; User or internal buffer overflow ERROR_BREAK EQU 304 ; A break character was received ERROR_NOT_EXECUTABLE EQU 305 ; A file has E bit cleared ENDC ; DOS_DOSASL_I