GN_Opw, Open wildcard handler

Register parameters

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. The full path option means that all filename segment are returned. eg. :ram.0/def/*.def returns all def files then :ram.0/def, then:ram.0

Bugs

OZ V2.2 - OZ V4.7: 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).
OZ V5.0: Local address segment 2+3 bug has been fixed (B = 0). Application code may now use GN_Opw + GN_Wfn in full 64K local address space successfully.


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