Z88 Developers' Notes
Contents   Contents of System Calls

GN_Opw, Open wildcard handler

RST 20H, DEFW $5209

IN:

     BHL = pointer to wildcard string
     HL = 0, 1, 2; not allowed
     (B = 0, HL is local when HL > 255)

     A = wildcard file information specifier
          A0 = 0, forward scan, A returned before A/B
          A0 = 1, backward scan, A/B returned before A
          A1 = 0, do not return full path on each match
          A1 = 1, return full path on each match
          A2->A7 should all be reset
OUT, if call successful:
     Fc = 0
     IX = wildcard handle for this wildcard string
OUT, if call failed:
     Fc = 1
     A = error code:
          RC_ROOM ($07), insufficient memory
          RC_IVF ($17), invalid wildcard string
Registers changed after return:
     ..BCDEHL/..IY same
     AF....../IX.. different
Notes:
The wildcard string must be explicit. Eg. to match "L*" in :RAM.0 you will need ":RAM.0/L*". If necessary use GN_Fex to expand the non-explicit wildcard string before calling GN_Opw.
Bugs:
If HL addresses segment 2 then this call will fail (B=0). Further, using segment 3 will return no matches with GN_Wfn (fetching matches of GN_Opw wildcard search specifier).

Related calls:

GN_Esa, read & write to filename segments
GN_Fcm, compress a filename
GN_Fex, expand a filename
GN_Pfs, parse filename segment
GN_Prs, parse filename
GN_Wcl, close wildcard handle
GN_Wfn, fetch next match for wildcard string (handle)
GN_Wsm, match filename segment to wildcard string