USAGE AND RECOMPILATION DOCUMENTATION FOR: 7/18/81 SQ.COM 1.3 File squeezer USQ.COM 1.4 File unsqueezer FLS.COM 1.1 Ambiguous file name expander DISTRIBUTION RIGHTS: ɠ allo unrestricte non-profi distributio o栠 thi softwar an invit user group t sprea i around However an distributio fo profi require m permissio i advance Thi applie onl t th abov liste program an thei progra sourc an documentatio files d sel othe software. PURPOSE: Th fil squeezer SQ compresse file int mor compac for. This provides: 1. Faster transmission by modem. 2 Fewe diskette t distribut progra package (Include USQ.COM and instructions, both unsqueezed.) 3. Fewer diskettes for archival storage. An fil ca b squeezed bu progra sourc file an tex file benefi th most typicall shrinkin b 35% File containin onl limite characte set suc a dictionar files ma shrin a muc a 48% Squeeze file loo lik gibbers an mus b unsqueeze befor the ca b used. Th unsqueezer USQ expand squeeze file int exac duplicate o th origina o provide quick unsqueeze displa o th top o (o al of squeeze䠠 files Unsqueezin require onl singl pass. Bot S an US accep batche o wor specifie b list o fil name (wit drive i needed an䠠 miscellaneou options. They accept these parameters in any of three ways: 1. On the CP/M command line. 2. From the console keyboard. 3. From a file. Th FL progra ca b use (o th sam comman line! t expan paramete list containin wild-car (ambiguous fil name int list wit th specifi fil name require b S an USQ. Thi combinatio o program allow yo t issu singl comman whic wil produc man squeeze o unsqueeze file fro an t variou diskettes Fo example t unsqueez al squeeze AS file o driv an sen th result t driv à an als unsqueez al squeeze TX file o driv an sen th result t driv D: A>fls c: b:*.aqm d: *.tqt |usq For detailed instructions see USAGE. Thi DOEӠ ru unde plai ol vanill CP/M Man o th smart ar burie i th CO file i th for o librar routine provide wit th BD packag (availabl fro Lifeboat). Th abov exampl simulate "pipe (indicate b th "|" b sendin th "console outpu o th fls.co progra t temporar fil an the runnin th sq.co progra wit option whic caus i t rea it parameter fro it "console input whic i reall redirecte t com fro th temporar file. THEORY: Th dat i th fil i treate a th byt leve rathe the th wor level an ca contai absolutel anything Th compressio i i tw stages firs repeate byt value ar compresse an the Huffma cod i dynamicall generate t matc th propertie o eac particula file Thi require tw passe ove th source data. Th decodin tabl i include i th squeeze file s squeezin shor file ca actuall lengthe them Fixe decodin table ar no use becaus Englis an variou compute language var greatl a t uppe an lowe cas proportion an us o specia characters Muc o th saving come fro no assignin code t unuse byt values. Mor detaile comment ar include i th sourc files. USAGE TUTORIAL: A usual yo hav t lear ho t tel th program wha t d (i.e. wha parameter t typ afte th progra name) Firs wil introduc th variou possibilitie b example Then I will summarize the rules. I th simples cas eithe S o US ca simpl b give on o mor fil name (wit o withou driv names): A>sq xyz.asm A>sq thisfile.doc b:thatfile.doc wil젠 creat squeeze file xyz.aqm thisfile.dqc an thatfile.dqc al o th curren drive A Th origina file ar no disturbed Not tha th name o th squeeze files are generated by rules - you don't specify them. Likewise, A>usq xyz.aqm wil creat fil xyz.as o th drive overwritin th original (Th origina nam i recreate fro informatio store i th squeeze version. Th squeeze versio i no disturbed. Eac fil nam i processe i order an yo ca lis al th file yo ca fi i command Th fil name give t S an US mus b specific Yo wil lear belo ho t us th FL progra t expan pattern lik *.as (al file o typ asm int lis o specifi name an fee the int SQ or USQ. Th abov example le th destinatio driv defaul t th curren logge drive whic wa show i th promp t b A Yo ca chang th destinatio driv a ofte a yo lik i the parameter list. For example, A>sq x.asm b: y.asm z.asm c: d:s.asm wil creat x.aq o th curren drive A y.aq an z.aq o th driv an s.aq o th drive Not tha th firs thre original ar o driv an th las on i o driv D Remembe tha eac paramete i processe i order s yo mus chang th destinatio driv befor yo specif th files to be created on that drive. Eventuall yo wil hav diskette wit man squeeze file o the an yo wil wonde wha i i whic file I the weren' squeeze yo woul us th TYP comman t loo a th comment a th beginnin o th files Bu squeeze file jus mak mes o you CR scree whe yo TYP them s hav provide th require featur a previe optio t th US program. A>usq -10 x.bas b:y.asm wil no tak th tim t creat unsqueeze files Instea i wil unsqueez th firs 1 line o eac fil an displa the o you console Th displa fro eac fil consists of the file names, the data and a formfeed (FF). Also, A>usq - c:xyz.mac wil unsqueez an displa th firs 65,53 line o an file listed That' th bigges numbe yo ca giv it an is intended to display the whole file. Thi previe optio als ensure tha th堠 datᠠ i displayable Th parit bi i strippe of (som Wordsta file us i fo forma control an an unusua contro character ar converte t periods You'l se som o thes a th en o th file a th CP/ en o fil i treate a dat an th remainde o th secto i displayed. Yo ar no familia wit al o th operationa parameter o S an USQ Bu s fa yo hav alway type the o th comman lin whic cause th progra t b run Fo reason whic wil becom apparen later hav als provide a interactiv mode I ther ar n parameter (excep directe i/ parameters describe later o th comman line SѠ an US wil promp wit a asteris an accep parameter fro th consol keyboard Eac paramete mus b followe b RETUR an wil b processe immediately A empt comman (jus RETURN wil caus th progra t exi bac t CP/M Tr i - i wil hel yo understan wha follows. No let ge int directe i/o whic wil b ne t mos o you bu wil sav yo s muc wor yo wil wonde ho yo eve go alon withou it. Perhap yo frequentl squeez o unsqueez th sam lis o file an yo woul lik t typ th lis onc an b don wit it Us a edito (o FLS describe below t creat fil wit on paramete pe line Fo exampl cal i commands.lst. Then, A>sq sq out wil sen th progres comment t th fil "out" whic yo ca TYP later Th routin displa o th progra nam an version etc. wil stil g t th console. mor practica exampl i t sen tha informatio t th consol an t th file. A>sq fls c: x.asm y*.asm >temp.$$$ wil simpl pas th firs tw parameter throug t th consol output whic i bein redirecte t fil calle temp.$$$ Bu th thir paramete wil b replace b al th file o th curren driv whic ar o typ as an have names beginning with y. FLӠ i smar enoug t kno tha lette followe b colo an nothin els i destinatio driv nam intende fo S o USQ I wil als trea an paramete beginnin wit - (minu sign a a optio t b passe through Anythin els i considere fil nam o patter an i checke agains th director o th appropriat drive. Therefore you could use: A>fls b: c:*.aqm *.aqm -10 stuff.dqc >temp.$$$ A>usq era temp.$$$ t unsqueez al file o typ aq o drive an an pu th unsqueeze file o driv B an the previe th firs 10 lines of file stuff.dqc. Her i wher th pip come in Th abov thre command can be abbreviated as: A>fls b: c:*.aqm *.aqm -10 stuff.dqc |usq Tha littl "| i th pip optio an i cause th FL outpu t b redirecte t temporar fil an whe tha i don i actuall run US fo yo wit th prope inpu redirection and then erases the temporary file. I tha isn' enough yo ca stil us th o redirectio optio a th en o tha lin t captur th console output from USQ. A>fls b: c:*.aqm *.aqm -10 stuff.dqc |usq >out I yo pla you comment carefull yo ca produc singl fil containin a abstrac o a entir librar o squeeze files in one step! A>fls -25 *.?q? |usq >abstract On fina point Anywher yo specif fil nam yo ca specif driv i fron o it Tha applie t redirectio an wel a file t b squeeze an unsqueezed I nam begin wit - (minu sign i wil loo lik a optio t FL unles yo pu driv nam i fron o i (b:-sq.077). USAGE SUMMARY: Th previou sectio graduall presente th variou option b example Thi sectio give condense an mor abstrac descriptio an i intende fo reference I yo couldn' se th fores fo th trees mayb thi wil giv yo better view. Th paramete handlin o thes program i straightforward Parameter fal int tw classes directe i/ option an operationa parameters Not tha parameter rea fro file o fro th consol ar no force t uppe case bu th interna fil handlin routine al trea lowe cas a uppe case. Whe fil t b writte alread exists i i quietl overwritten. Directe I/O parameters Th firs actio take b thes program i t proces directe i/ parameter fro th CP/ comman line Thes parameter ar optiona an tak th forms: file send most console output to file +file send most console output to file and console |pgm ... send most console output to a temporary file then run PGM.COM and take console input from the temporary file. "..." represent the parameters for PGM. This is called "piping". Onl on inpu an on outpu redirectio ca appl t eac program Afte th progra ha arrange fo an directe i/ parameter t b obeye the ar delete fro th paramete lis see b th res o th program. Operationa parameters Th堠 progra the check i ther ar an remainin parameter fro th CP/ comman line I ther are the ar obeyed I an onl i ther ar n remainin parameter o th comman line th progra prompt fo the a th console I consol inpu ha bee directe t fil on paramete i rea an obeye fro eac lin o th file Otherwise th use follow eac type paramete wit RETUR an a empt comman exit th program. Eac operationa paramete i obeye withou lookin ahea t othe parameters s option shoul preced th fil names to which they apply. SQ operational parameters are a list of the following types: drive: set the current destination drive filename file to be squeezed drive:filename " " " " S doe no chang th file bein squeezed New squeeze file ar create o th destinatio driv (default t th curren drive wit name derive fro th origina nam bu wit th secon lette o th fil typ (extention change t Q Whe ther i n type QQ i used Th origina nam i save i th squeeze file. USѠ operationa parameter ar lis o th followin types: drive: set the current destination drive filename file to be squeezed drive:filename " " " " -count Preview (display on the console) the first "count line o eac蠠 file wher "count" is a number from 1 to 65535. I th -coun optio I NO i effec the USѠ create unsqueeze version o th liste file o th destinatio drive whic default t th curren logge drive Eac unsqueeze fil i CR checke agains th CR valu o th origina file whic i par o th squeeze file. Th -coun optio i fo previewin squeeze files I allow yo t ski throug grou o squeeze files peekin a th firs "count line i each Th o outpu redirectio optio coul b use t captur thi informatio i file alon wit th correspondin fil names thu formin a abstrac o th file o disk. Whe th -coun optio i use th CR chec i cancelle an th outpu i force int printabl for b strippin th parit bi an changin mos unprintabl character t periods Th exception ar CR LF TA an FF Th outpu fro eac fil i terminate b a FF PI ca b use t stri FF an provid formatte printin i desired "Count default t th maximu value 65,535 i cas yo wan t loo a whol file. FL operationa parameters FL i "filter" whic mean i accept inpu fro th consol inpu o comman lin an transform th inpu accordin t se o rule t produc consol output That' fin fo gettin familia wit FLS bu t mak i usefu yo "pipe it outpu t th inpu o S o USQ. An FL paramete whic i o th form: drive: or -anything i copie t consol outpu unchanged An othe FL operationa paramete i treate a fil nam an i checke agains th director o th appropriat drive I i contain o i i replace b lis o al th file whic fi th pattern I nothin i foun i th director a erro commen i sen t th console eve i norma consol outpu ha bee redirecte t file. IMPORTANT whe usin pip fro FL o an othe inpu redirectio t ge th fil list etc. o whic US o S ar t operat yo mus NO pu an parameter othe tha redirectio followin th progra name The mus b al togethe i th inpu paramete list Example: A>fls -10 b:*.cq |usq +saveout i th prope wa t previe th to (firs 1 lines o eac squeeze . fil o th drive Th -1 i passe throug FLӠ t USQ Th result wil b displaye o th consol an save i fil "saveout o th drive Th saveou fil let yo confir th lis o processe file eve i th displa scroll of th scree whil runnin unattended. I summary i/ redirectio parameter (thos prefixe b + < > o | alway follo th comman t whic the apply bu operationa parameter (destinatio drive -options mus b wit th fil nam list. EXAMPLES: 1 Unsqueez al squeeze file o th curren driv an pu th resultin unsqueeze file o th sam drive. A>fls *.?q? |usq 2 Loo a th firs 1 line o ever squeeze fil o driv B. A>fls -10 b:*.?Q? |usq not tha sinc th fil name fo US cam fro FLS th coun optio ha t com fro ther too. 4 Squeez al .AS file o th an drive an pu th squeeze file o th drive. A>fls d: b:*.asm c:*.asm |sq Not tha i d ha no bee firs th squeeze file woul hav gon t th drive. 5 Squeez fil xyz. o th driv an pu th result o th drive. A>sq xyz.c 6 Buil paramete lis o al AS file o driv à i fil XX.PA an vie i o th console. A>fls c:*.asm +xx.par 7 Us th abov lis t squeez th file t th drive. A>sq b: B>a:sq fls b: *.asm *.c |sq >out 10 Previe th firs 2 line o eac squeeze AS͠ fil THE unsqueez the (unles stoppe vi cntl-C). A>fls -24 *.aqm a: *.aqm |usq Not tha specificatio o destinatio driv cancel previewing. RECOMPILATION: Thes program ar writte i an th instruction ar fo th BD compiler Th librarie mus hav bee adapte fo directed i/o as described in DIO2.C. Th procedure belo indicat th variou languag sourc file (fil typ .C require t recompile Thos file contai #includ statement whic caus heade file (fil typ .H t b rea an compiled Th BDSCIO. heade fil contain informatio abou you system includin ho muc spac t reserv fo fil buffers Yo shoul us you ow versio o thi file. Th sourc file DIO2.C SQDIO. an USQDIO. ar identical I yo onl ge one jus us PI t creat th rest The ar separate onl t provid separate CR files whic ar neede becaus o th differen externa variabl options Not tha the d no includ al th heade files therefor th othe sourc file mus includ th di relate header first. DIO. i supplie wit BD C Th abov thre file diffe fro th officia versio onl b chang t th dioflus functio t ensur TEMPIN.$$ i delete befor anothe fil i rename t tha name (CP/ i stupi enoug t mak tw file o th sam name!). Th procedur fo buildin th SQ.CO an USQ.CO file fro thei sourc file follows Not tha hav rename th firs phas o th BD compile t CC.COM Als ɠ wil assum th BD packag i o driv an th SѠ an US relate file ar o alon wit BDSCIO. an DIO.H. Eac C comman produce CR fil wit specifi addresse fo externa variables I yo recompil fil wit th sam valu i th - optio yo don' hav t recompil th othe files jus d th desire C an the repea th entir CLINK. CLINK' - optio print statistics To o memor mean th curren TPA Stac spac i what' lef over Thes program requir stac spac fo loca variables includin som health i/ buffers Als som function ar recursive I S doesn' hav severa o stac spac i wil probabl g craz an d almos anything. For SQ (note not all use -o): D>cc b:sq.c -o -e3200 D>cc b:sqdio.c -e3200 D>cc b:tr1.c -o -e3200 D>cc b:tr2.c -o -e3200 D>cc b:io.c -o -e3200 D>clink b:sq sqdio tr2 tr1 io -s Th linke wil displa som statistics Chec tha th las cod addres i les tha th star addres o th externa variable (320 i thi example) I not repea th abov wit highe addres i th - options. Fo US (note -e280 ma b enough Not no al use -o): D>cc b:usq.c -o -e2900 D>cc b:usqdio.c -e2900 D>cc b:utr.c -o -e2900 D>clink b:usq usqdio utr -s Check the addresses as described above. For FLS: D>cc b:fls.c D>cc b:dio2.c D>clink b:fls dio2 IN CASE OF TROUBLE: ɠ welcom suggestion an bu reports bu yo mus understan tha som o th idea ge woul involv almos a muc progra developmen a th origina package hav wha wan an ( hope wha mos user want s a no motivate t spen man mor month creatin somethin entirel differen whic jus happen t involv dat compression Th dat compressio routine ar probabl les tha hal o thi package an ar designe t operat o larg block o data suc a files. Dick Greenlaw 251 Colony Ct. Gahanna, Ohio 43230 614-475-0172 weekends and evenings  .