Z88 Developers' Notes
Contents   Contents of System Calls

GN_Fcm, compress a filename

RST 20H, DEFW $4E09

IN:

     BHL = source pointer
     HL = 0, not allowed
     HL = 1, not allowed
     HL = 2, not allowed
     String should be terminated by a control character
     (HL > 255, B = 0 means local pointer)

     DE = destination (local) pointer
          0: result to stream IX handle
          1: result to filter IX handle
          > 255: place string at (DE)
     C = limit of space to use
OUT, if call successful:
     Fc = 0
     DE = points to the character after the last one written
     (if DE(in) > 255)

     B = number of filename segments returned
     C = number of characters in compressed space
OUT, if call failed:
     Fc = 1
     A = error code:
          RC_BAD ($04), bad parameters, fatal error
Registers changed after return:
     ......HL/IXIY same
     AFBCDE../.... different
Notes:
If the filename cannot be reproduced in the space available, ie. C(in), then on exit C =1, B = 0 and the expansion buffer (stream or filter) will be given a NULL. Setting C(in) = 18 will guarantee the return of a filename and extension.
Bugs:
If the source is in segment 2 then problems may occur.

Related calls:
GN_Esa, read & write to filename segments
GN_Fex, expand a filename
GN_Opw, Open wildcard handler
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