>>>>>>>>>>>>>>>>|<<<<<<<<<<<<<<< >> MFILE << >>>>>>>>>>>>>>>>|<<<<<<<<<<<<<<< >>>>AUTHORS<<<< Copyright Colin McCormack (Tangled Web Software Pty. Ltd.). Peter Gron. Australian Federal Government. (Australian Tax Office). (W ha a applicatio whic neede 4 file a onc an tha i wh w wrot mfile.) >>>>PURPOSE<<<< Mfil i languag utilit designe t overcom th limitation man package an operatin system impos o th maximu numbe o file progra ca hav ope concurrently. Mfil wil permi a arbitrar numbe o file t b accesse b program withou th program(mer havin t explicitl ope o clos any file t mak roo fo others. >>>>INTERFACE DETAILS<<<< progra whic use mfile accesse file vi th macro define i mfile. whic ma (hopefull universal se o system fil primitive ont a identica se whic look afte th temporar closin an transparen re-openin o file whic th progra need t acces wit fin graine interleavin o access. See mfile.h for interface detail. >>>>INTERNAL DETAILS<<<< Th wor mfil doe i minima i th cas tha reference fil i actuall current mfil simpl check tha an returns I th othe case th fil i reopene afte anothe i potentiall closed I practic w fin th overhea acceptable wher th alternativ woul b les clea cod an possibl les efficien ad-ho cod t perfor th sam function. Mfil keep lis o al file currentl open i orde o reference mos recentl reference first Whe mfil i requeste t ope ne file i wil firs clos th leas recentl use fil (i necessary t mak roo fo th newl opene file Th techniqu use i commo amongs application whic requir th distributio o scarc resourc (i thi cas fil descriptors amongs potentiall large numbe o consumer (i thi cas concurrentl ope files). Th lis o ope file i actuall doubl linke lis o typ calle ( think dequeue Thi implementatio permit additio t th to an deletion fro an plac i th list a wel a traversa i eithe order Th lis i kep i revers orde o expecte probabilit o nex reference. Th routine whic manag th queu unde insertio an deletio ar presente i dequeue.[ch an ar probabl suitabl fo othe application requirin manipulatio o thi dat structure. >>>>PORTABILITY<<<< Th desig objective wer Transparency Efficienc an Reliability Th cod shoul b fairl portable wit th cavea tha eac fil syste i likel t hav som variatio i th synta an functio o it syste leve fil system Thi modificatio wil hopefull b trivia i almos al cases. >>>>SYSTEM DEPENDANT ENHANCEMENT<<<< Th assumption mad fo currenc ar minimal Mfil assume tha upo creatio o file it nam i known I furthe assume tha eac fil has a al point wher i ca b used know positio fro whic th nex rea o writ wil occur Th mean o determinin file' curren positio i lseek(). I yo hav acces t you compiler' ru tim librar source yo ma b abl t ge thi informatio int th mfil fil descripto mor efficientl b referenc t th hos fil descriptor Thi i straightforwar an probabl advisable. The effected functions are mSave() and mRestore() - and of course the file descriptor data type MFD. >>>>LEGALESE<<<< Permission is granted to use and freely distribute any software herewith enclosed on the following conditions: 1 Copyrigh statu i no misrepresente an copyrigh remain wit th authors 2) Authorship not misrepresented and is fully attributed. 3) No commercial profit is to be gained by resale or repackaging or translation of this software (unless we get a cut). Thi doesn' mea w won' le yo *use i i somethin yo writ fo sale bu i yo distribut th source yo can' tak mone fo ou labour. 8th June 1987. Colin McCormack, colinm@runx.oz <-- UUCP 061 (02) 808 1951 <-- Telecom 5/1A McPherson St. <-- Post Meadowbank, 2114. Sydney, New South Wales. Australia.