Thi documen detail th function containe i th Z3FUNC.CR module The ar liste i orde o th sourc modul tha contain them Ze scrip i provide t re-creat th librar onc th individua module hav bee compiled. Thes routine fal int thre classes Th firs clas o routine i ZCPR3. specific Thes ar detaile i th Z3FUNCx sections Th secon clas o routine ar specifi t ZSDO an ZDDOS Thes ar detaile i ZSUTI an TDUTIL Th thir clas o routine ar genera purpos an ar detaile i STR an ITOA. T lin th neede routine fro thi library us th - optio o clin o th - optio o l a in: CLIN yourpro - z3func L yourpro - z3func Al routine i thi librar ar copyrigh (c 198 b Camero W Cotril al right reserved Permissio t utilize thes routine i non-commercia application i granted. Z3FUNC01 Th routine i thi modul ar fo manipulatin drive/use area an name directories T b consistan wit drive/use representation (unlik cp/m) singl in valu refere t a th encode d i use b routine i thes modules Thi valu i alway full resolve t particula driv an user. in dir2du(dir) cha *dir; Conver director nam t encode du If n matc i foun an duo i true th nam i parse a DU specification I bot conversio attempt fai o i th drive/use are wa rejecte b duvalid() - i returned. cha *du2dir(du,dir) in du; cha *dir; Conver encode d t dir Return strin i di whic mus b byte lon minimum I th d i found th nam i simpl copie t di an nul terminated nul strin indicate n name director exist fo th specifie du. in dudecode(du,drive,user) in du *drive *user; Decod packe d int driv an user Not tha argument fo driv an use ar pointer t ints Thi functio als return th use t th caller. in duencode(d,u) in d,u; Encod driv an use int singl int Th lo byt o th in i th drive th hig byt i th user N rang chackin i done. in duvalid(du) in du; Chec encode d agains ma drive ma user an vali drive vector Return d i ok otherwis - i returned. in getfdu(fcb) struc zfc *fcb; Return th encode d b readin th value fro th fcb Thi allow th us o zsetfcb( t pars drive/use specificatio int a fcb the cal getfdu( t retur th driv an user. cha *getpass(du,pass) cha *pass; Ge passwor fo directory Return passwor i pass I n name director entr wa foun fo th du th strin i null I th d wa foun bu ther i n password pas i returne as spaces. in setfdu(fcb,du) struc zfc *fcb; in du; Se fc driv an use field fro encode du Returns du. Z3FUNC02 Thi modul contain shel manipulatio routine fo Z3. in shempty() Tes fo shel stac empty Return TRU i shel stac i empty otherwis FALS i returned. in shfull() Tes fo shel stac full Return TRU i shel stac i full otherwis FALS i returned. in shpop() Po shel stack Return TRU i successful. in shpush(cl) cha *cl; Pus nul terminate comman ont shel stack Return TRU i successful. Z3FUNC03 Assorte routine t ge o pu value fro th environment. in getduok() Retur d o flag. struc zfc *getefcb() Ge Zcpr externa fc pointer. in getetype() Retur environmen type. cha *getfnx(offset) unsigne offset; Retur pointe t syste fil wher x=[0..4] Th shel variabl fil i 0 an 1.. ar th traditiona syste files I offse i ou o range nul i returned. cha *getmsg() Ge messag buffe pointer. cha *getpath() Ge pat pointer. in getquiet() Retur quie flag. in getspath() Ge pat siz i elements. in getwhl() Ge whee byt status Return TRU i use i wheel. in putquiet(i) in i; Se quie fla t i Return i. voi setfnx(offset,fcb) unsigne offset; struc zfc *fcb; Se syste fil fro fcb Fil numbe i th same a define i getfnx(). in setwhl(i) in i; Se whee byt status Return setting. Z3FUNC04 MC manipulatio routines. in appcl(cmd) cha *cmd; Appen t en o mcl Retur TRU i successful FALS i buffe didn' hav enoug room. voi clrcl() Clea multipl comman line Remove an pendin command fro th multipl comman lin b resettin th nex characte pointe t th beginnin o th buffe an placin nul a th firs characte i th buffer. struc mc *packmcl() Pack th multipl comman lin buffer Return pointe t th mc structure Thi routin i use b appcl( an putcl(). in putcl(cmd) cha *cmd; Inser a star o mcl Retur TRU i successful FALS i buffe didn' hav enoug room. struc mc *getcl1() Retur pointe t th mc structure. cha *getcl2() Retur pointe t nex comman i mcl. Z3FUNC05 Filenam t strin conversion. cha *dir2a(du,s) in du; cha *s; Conver d t asci alon wit director nam i any D suppresse i duo i false Strin i o th for A0\ROOT. cha *fn2a(fcb,s) struc zfc *fcb; cha *s; Conver filenam fro fc t string Strip spac padding Attribut bit ar stripped. cha *fn2as(fcb,s) struc zfc *fcb; cha *s; Conver filenam fro fc t string Retain spac padding Attribut bit ar stripped. ZSUTI Zs/Zddo specifi utilit routines. Thes routine ar specifi to ZSDO an ZDDO becaus the dea directl wit o assum th presenc o certai feature uniqu t thes dosses Cal zsvers( an b sur i return non-zer valu befor usin thes routines. in getflags() Retur Zs/Zddo flag to application. in getfs(fcb,buffer) cha *fcb *buffer; Rea fil stam usin Zs/Zddo functio call Retur TRU i ok els FALSE Th 1 byt packe BC stam i returne i buffer. in logud(fcb) cha *fcb; Lo drive an use fro fcb Assume fc parse b zsetfcb( o an othe full z3 complian parser Require driv i fcb+ an use i fcb+13. cha *rdtd(buf) cha *buf; Rea cloc int byt buffe i ZSDOS/DateStampe format I n clock return 0' i th buffer Calle ca determin i tim i vali b lookin a th month I wil NEVE b i th cloc rea wa don properly Functio return pointe t buf in setdrv(drive) in drive; Se driv [0..1 - A..P a default. voi setflags(flags) in flags; Se Zs/Zddo flags. in setfs(fcb,buffer) cha *fcb buffer; Writ fil stam usin Zs/Zddo functio call Retur TRU i ok els FALSE Th 1 byt packe BC stam i writte t dis fro th buffer. voi setusr(user) in user; Se defaul use area. in zsvers() Retur do i (h)/versio (l o zs/zddo o i no zs/zddos Cal thi functio an b sur i return non-zer befor usin an o th routine i thi module. TDUTI time/dat an fil stam utilities Thes routine format dat returne fro Zsdo an Zddo cloc call an tim stam call int norma asci string fo display. cha *fm24clk(clkbuf,clks) cha *clkbuf,*clks; Retur tim fro universa forma dat i clkbu a formatte asci strin 23:59:59. cha *fm244clk(clkbuf,clks) cha *clkbuf,*clks; Retur tim fro universa forma dat i clkbu a formatte asci strin 23:59. cha *_fm24(clkbuf,clks,ndigit) cha *clkbuf,*clks; unsigne ndigit; Generalize tim strin decode/format Thi routin i calle b bot fm24clk( an fm244clk() Ndigi i th inde o th las bc digi t process I additio t norma 2 hou tim conversion thi routin wil recogniz relativ cloc dat an outpu i i +000 format. cha *fmdate(clkbuf,dates) cha *clkbuf,*dates; Retur dat fro universa forma dat i clkbu a formatte strin mm/dd/yy. cha *unpack(bcd,buff) int bcd; char *buff; Unpac bc t asci char i buff Retur buf pointe pointin pas lo orde asci char. ITO in t decima asci strin conversio routines cha *itoa(s,value) in value; cha *s; Retur u t digi asci representatio o signe value I th valu i negative '- i printe befor th number Leadin 0' ar supressed Th buffe pointe t b mus b character lon i orde t fi th nul terminator Functio return pointe t s Thi routin run faste tha th traditiona K&R implementation. cha *_2dc(s,value,digits,sign) cha *s; in value; unsigne in digits,sign; Generalize decima conversio routine Ca conver a in o unsigne in t fixe o variabl siz asci representation Digit i th numbe o digit t produc o t allo leadin supressio an floatin fiel width Sig i TRU i in i bein converted FALS i unsigne in i bein converted Functio return pointe t s. in atoi(string) cha *string; Conver asci numeri strin t int Leadin space ar ignored '+ o '- ca precee th number Conversio stop whe th firs non-digi i reached. STR Standar utilit routine fe thin t provide cha *capstr(src) cha *src; Fol cas o strin t upper Return pointe t th string. cha *strncat(s,t,n) cha *s,*t; int n; Concatinat a mos n- character fro strin t strin s Strin mus b byte lon t accomidat th nul terminator. strncmp(s1 s2 i) cha *s1 *s2; unsigne i; Compar a mos characters Retur value th sam a strcmp(). cha *strncpy(dest,src,n) cha *src *dest; unsigne n; Cop a mos n- character fro sr t dest Des mus b buffe o byte i siz i orde t allo fo th nul terminator.