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.