ZCPR2-Specific File Name String Parser (ZFNAME) and Support
Initialize Named Directory FCB
Directory Name File Loader
DIR: Prefix Evaluator
Extended File Name Scanner
:Introduction

    Thi� se� o� routine� i� specifi� t� th� ZCPR2-Specifi� Name� �
Director� Structure��  Thes� routine� provid� th� programme� wit� �
� se� o� routine� whic� resolv� th� name� director�� reference� �
fo� him� translatin� � name� director� int� th� disk/use� are� i� �
refers to.

    Five routines are included in this set:
         o ZFNINIT -- Initialize Named Directory Buffers
         o ZCPRQ2  -- Status Return
         o ZDNFIND -- Scan for Disk Directory Name
         o ZDNAME  -- Load All Disk Directory Name Data
         o ZFNAME  -- Named Directory File Name Scanner

:Initialize Named Directory FCB

    Routine Name:  ZFNINIT
    Function�
         ZFNINIԠ allow� th� use� t� initializ� th� nam� o� th� �
name� director�� fil� (defaul� nam� o� NAMES.DIR� t� som� othe� �
nam� an� t� chang� th� numbe� o� name� permitte� i� � director� �
fil� (defaul� o� 64)��  I� i� als� use� t� defin� wher� i� memor� �
the ZCPR2 disk names buffer resides.

    Inputs:  DE pts to FCB containing the new file name
             HL contains the address of the memory-resident
                   disk names buffer
             C is the new maximum number of directory names
             A is a flag indicating values to set as follows:
                   Bit 7 -- Set to 1 to load default FCB fm DE
                   Bit 6 -- Set to 1 to load name count fm C
                   Bi� � -- Se� t� � t� loa� bu� addres� f� HL

    Outputs:  None
    Registers Affected:  None
    SYSLIB Routines Called:  MOVEB
    Specia� Erro� Conditions�  None

    Note���  I� thi� routin� i� no� called�� th� followin� �
assumptions are made:
         o Name of Directory Names File -- NAMES.DIR
         o Max Number of Directory Names -- 64
         o No Memory-Resident Names Buffer Exists

:Status Return

    Routine Name:  ZCPRQ2
    Function:
         Return� � pointe� i� H� t� th� firs� byt� o� th� ZCPR� �
buffe� are� i� th� 2n� ZCPR� modul� i� SYSLIB��  Thi� buffe� i� �
structured as follows:
              Byte 0:  Max Number of Directory Names
              Bytes 1-2:  Address of Memory-Resident Names
                   Buffer or 0000H if none exists
              Bytes 3-38:  FCB of Directory Names File

    Inputs:  None
    Outputs:  HL pts to Byte 0 as described above
    Registers Affected:  HL
    SYSLIB Routines Called:  None
    Special Error Conditions:  None

:Directory Name File Loader

    Routine Name:  ZDNAME
    Function:
         ZDNAMŠ load� th� content� o� th� NAMES.DIҠ fil� int� �
th� memor� buffe� pointe� t� b� HL�  Eac� entr� i� thi� buffe� i� �
structured as follows:
              Byte 0:  Disk Number (A=0)
              Byte 1:  User Number
              Bytes 2-9:  Directory Name, 8 Chars Max, Space
                   Fill at End

    Inputs:  HL pts to the memory buffer extending to the base
              of the BDOS

    Outputs:  HL pts to the first entry in the buffer
              C is the number of valid entries, B=0
              A is the error flag (A=0 and Z if error)


    Registers Affected:  HL, BC, PSW

    SYSLIB Routines Called:  INITFCB, ZPFIND, FI3$OPEN, F3$GET

    Specia� Erro� Conditions��  A=�� ma�� mea� eithe� memor� �
overflow or NAMES.DIR not found.


:DIR: Prefix Evaluator

    Routine Name:  ZDNFIND
    Function�
         ZDNFIN� examine� th� DIR�� prefi� fo� eithe� � DU� for� �
o� � director� name�  I� i� i� determine� tha� th� DIR� prefi� i� �
no� o� th� DU�� form�� the� th� memory-residen� name� buffer�� i� �
any�� i� scanne� fo� th� name� and� i� n� suc� buffe� o� nam� no� �
found� th� NAMES.DI� fil� i� sough� alon� th� ZCPR� path� loaded� �
an� scanne� fo� � correspondin� name��  I� found� th� correspond-�
in� use� an� dis� value� ar� returned�� i� no� found�� a� erro� �
cod� i� returned.

    Inputs:  HL pts to first byte of DIR: prefix
             A=� i� DU� for� NO� allowed

    Outputs:  B=Disk (B=1 if Disk A, B=0FFH if Current Disk),
              C=User (C=0FFH if Current User), HL pts to colon,
              Zer� Fla� Clea� (NZ� i� n� error� Zer� Fla� Se�
              (Z) if error, and no valid values returned


    Registers Affected:  BC, HL, PSW

    SYSLIB Routines Called:  INITFCB, ZPFIND, FI3$OPEN,
                             FI3$CLOSE, F3$GET

    Specia� Erro� Conditions�  Not� tha� ZDNFIN� use� Inpu� Fil� �
3�� s� Inpu� Fil� � shoul� no� b� opene� whe� thi� routin� i� �
called��  Also�� ZPFIN� i� used� s� th� programme� mus� b� sur� � �
proper external path is specified if needed by calling ZINIEXT.

:Extended File Name Scanner

    Routine Name:  ZFNAME
    Function�
         ZFNAMŠ i� � fil� nam� scanner��  Pointin� t� th� firs� �
characte� o栠 ᠠ fil� nam堠 specificatio o栠 th堠 for� �
'DIR:FILENAME.TYP'�� wher� an�� par� o� thi� specificatio� i� �
optional�� thi� routin� fill� i� a� FC  wit� zeroes�� properl� �
initialize� th� F� an� F� (Fil� Nam� an� Fil� Type�� field� i� �
'FILENAME.TYP�� o� an� par� thereo� i� present�� an� return� th� �
valu� o� dis� an� use� i� the� ar� specifie� (o� 0FF� i� not).

    Th� director� indicato� 'DIR:'�� i� specified� ma� b� o� on� �
of four forms:
         DIRECT: -- A named directory, of up to 8 chars long
         d:      -- A disk drive letter
         u:      -- A user number
         du:     -- A disk drive letter and a user number

    Th� du�� for� i� checke� first� s� unnecessar� dis� activit� �
in looking for the NAMES.DIR file is avoided.

    Examples of valid input strings:
         HELP:*.HLP     A5:TEST.TXT    C?:ABC.*  PASCAL:*.COM

    Inputs:  DE pts to FCB to fill, HL pts to first byte of
              targe� string; FCB is 36 bytes long

    Outputs:  B=Disk (B=1 for Disk A), C=User
              B=0FFH if no disk specified (current disk)
              C=0FFH if no user specified (current user)
              C=? if all user areas specified
              HL pts to terminating character
              A=0 and Zero Flag Set (Z) if error in disk
                   or user numbers; A=0FFH and NZ if no error

    Registers Affected:  BC, HL, PSW


    SYSLIB Routines Called:  ZDNFIND

    Specia젠 Erro� Conditions���  Se堠 FNAMŠ� routin堠 fo� �
similarities