From: SMTP%"chris@ccastat.demon.co.uk" 23-MAY-1996 12:06:30.40 To: everhart@star.zko.dec.com, ARNE@ko.hhs.dk, canellis@apache.brooks.af.mil, SCANDORA@cmt.anl.gov CC: Subj: SDLIFDL.5-OF-8 -+-+-+-+-+-+-+-+ START OF PART 5 -+-+-+-+-+-+-+-+ X`20`20`20`20set(`20output_file,`20mms_old_buffer,`20mmsfile`20); X X`20`20`20`20fname`20:=`20file_parse(infile,'','',name); X`20`20`20`20edit(fname,`20lower); X`20`20`20`20mms`20:=`20fname+'.form`20:`20'+fname+'.ifdl'; X X!`20find`20existing`20description`20for`20compare`20and`20replace X!`20desc_exists`20is`20set`20to`200`20or`20range. X X`20`20`20`20if`20mms_exists`20then X`09i`20:=`20search_quietly(line_begin`20`26`20mms,`20forward,`20exact, X`09`09`09`09`09mms_old_buffer); X`09if`20(i<>0)`20then X`09`20`20`20`20position(i); X`09`20`20`20`20move_horizontal(1); X`09`20`20`20`20pat`20:=`20line_end`20+`20spanl('')`20+`20line_begin;`20!`20bla Vnk`20lines X`09`20`20`20`20desc_exists`20:=`20search_quietly(pat,`20reverse); X`09`20`20`20`20if`20desc_exists=0`20then X`09`09desc_exists`20:=`20beginning_of(mms_old_buffer); X`09`20`20`20`20else X`09`09position(desc_exists); X`09`09move_horizontal(1); X`09`09desc_exists`20:=`20mark(none); X`09`09position(i); X`09`20`20`20`20endif; X`09`20`20`20`20i`20:=`20search_quietly(pat,`20forward); X`09`20`20`20`20if`20i=0`20then X`09`09desc_exists`20:=`20create_range(desc_exists,`20end_of(mms_old_buffer), X`09`09`09`09`09`09none); X`09`20`20`20`20else X`09`09desc_exists`20:=`20create_range(desc_exists,`20end_of(i),`20none); X`09`20`20`20`20endif; X`09else X`09`20`20`20`20desc_exists`20:=`200; X`09endif; X`20`20`20`20endif; X`20`20`20`20trivial_case`20:=`201; X`20`20`20`20position(mms_buffer); X`20`20`20`20split_line;`09`20`20`20`20!`20start`20with`20blank`20line X`20`20`20`20copy_text(mms); X`20`20`20`20mms`20:=`20mark(none); X`20`20`20`20position(here); X`20`20`20`20procs`20:=`20create_array; X X!`20Loop`20round`20finding`20all`20COPY`20clauses`20-`20store`20in`20array X X`20`20`20`20loop X`09here`20:=`20search_quietly('copy',`20forward,`20no_exact); X`09exitif`20here=0; X`09if`20outside_comment(here)`20then X`09`20`20`20`20position(end_of(here)); X`09`20`20`20`20here`20:=`20search_quietly('end'`20+`20space`20+`20'copy',`20fo Vrward,`20no_exact); X`09`20`20`20`20copy_body`20:= X`09`09str(`20create_range(mark(none),beginning_of(here),none),`20'`20'); X`09`20`20`20`20copy_body`20:=`20substr(copy_body,`202,`20length(copy_body)`20- V`202); X`09`20`20`20`20edit(copy_body,`20lower,`20trim,`20compress,`20off); X`09`20`20`20`20if`20((substr(copy_body,1,1)='"')`20and X`09`09`20`20`20`20(substr(copy_body,length(copy_body),1)='"'))`20or X`09`09`20`20`20((substr(copy_body,1,1)="'")`20and X`09`09`20`20`20`20(substr(copy_body,length(copy_body),1)="'"))`20then X`09`09copy_body`20:=`20substr(copy_body,2,length(copy_body)-2); X`09`09if`20file_parse(copy_body,'.*;*','',type,version)='.*;*'`20then X`09`09`20`20`20`20copy_body`20:=`20copy_body`20+`20'.ifdl'; X`09`09endif; X`09`09cf`20:=`20cf`20+`201; X`09`20`20`20`20else`20if`20(substr(copy_body,length(copy_body)-15,16)= X`09`09`09`09'`20from`20dictionary')`20then X`09`09`20`20`20`20copy_body`20:=`20substr(copy_body,1,length(copy_body)-16)`20 V+`20'`5E'; X!`20if`20dictionary`20path`20uses`20logical`20not`20followed`20by`20directory V`20(eg`20CDD_FILES:...) X!`20change`20to`20preferred`20syntax`20CDD_FILES... X X`09`09`20`20`20`20i`20:=`20index(copy_body,`20':'); X`09`09`20`20`20`20if`20(i<>0)`20then X`09`09`09if`20((substr(copy_body,i+1,1)<>'`5B')`20and X`09`09`09`09(substr(copy_body,i+1,1)<>'<'))`20then X`09`09`09`20`20`20`20copy_body`20:=`20substr(copy_body,1,i-1)`20+`20'.'`20+ X`09`09`09`09`09`09substr(copy_body,i+1,255); X`09`09`09`20`20`20`20position(search(':',forward,exact)); X`09`09`09`20`20`20`20erase_character(1); X`09`09`09`20`20`20`20copy_text('.'); X`09`09`09endif; X`09`09`20`20`20`20endif; X`09`09`20`20`20`20cd`20:=`20cd`20+`201; X`09`09else X`09`09`20`20`20`20copy_body`20:=`20'<`20'`20+`20copy_body`20+`20'`20>'; X`09`09`20`20`20`20co`20:=`20co`20+`201; X`09`09endif; X`09`20`20`20`20endif; X`09`20`20`20`20if`20procs`7Bcopy_body`7D=tpu$k_unspecified`20then X`09`09procs`7Bcopy_body`7D`20:=`201; X`09`20`20`20`20else X`09`09procs`7Bcopy_body`7D`20:=`20procs`7Bcopy_body`7D`20+`201; X`09`20`20`20`20endif; X`09`20`20`20`20position(end_of(here)); X`09`20`20`20`20move_horizontal(-1); X`09endif; X`20`20`20`20endloop; X X!`20Loop`20round`20putting`20all`20stored`20dependencies`20in`20MMS`20descript Vion. X!`20It's`20important`20to`20do`20it`20in`202`20passes`20because`20FORMS`20tend Vs`20to`20COPY`20the`20same X!`20dictionary`20record`20several`20times`20in`20a`20FORM.`20An`20additional V`20(unsupported`20by`20DEC) X!`20benefit`20is`20that`20we`20get`20the`20results`20alphabetically`20sorted. V X X`20`20`20`20position(mms); X`20`20`20`20copy_body`20:=`20get_info(procs,"first"); X`20`20`20`20trivial_case`20:=`20trivial_case`20and`20(copy_body=tpu$k_unspecif Vied); X`20`20`20`20loop X`09exitif`20copy_body=tpu$k_unspecified; X`09copy_text(',-'); X`09split_line; X`09copy_text(fao('!_!_!AS',`20copy_body)); X`09copy_body`20:=`20get_info(procs,"next"); X`20`20`20`20endloop; X`20`20`20`20split_line;`09!`20end`20with`20blank`20line X`20`20`20`20message( X`09fao('!UL`20file`20include!%S,`20!UL`20dictionary`20reference!%S,`20!UL`20ot Vher!%S', X`09`09cf,`20cd,`20co)); X`20`20`20`20position(startbuf); X`20`20`20`20delete(procs); X X!`20Now`20search`20out`20all`20the`20CALL`20clauses`20-`20these`20don't`20dire Vctly`20translate`20to`20MMS X!`20dependencies,`20but`20are`20put`20in`20a`20comment`20in`20the`20descriptio Vn`20file`20-`20this`20is X!`20valuable`20to`20the`20programmer`20in`20the`20LINK. X!`20Use`20the`20same`20technique`20with`20an`20array`20to`20remove`20multiple V`20invocations`20of`20the X!`20same`20procedure,`20and`20sort`20the`20names X X`20`20`20`20procs`20:=`20create_array; X`20`20`20`20loop X`09here`20:=`20search_quietly('call',`20forward,`20no_exact); X`09exitif`20here=0; X`09if`20outside_comment(here)`20then X`09`20`20`20`20position(end_of(here)); X`09`20`20`20`20here`20:=`20search_quietly(anchor`26`20space`20`26`20("'"`7C'"' V),`20forward,`20exact); X`09`20`20`20`20position(end_of(here)); X`09`20`20`20`20here`20:=`20search_quietly(arb(1)`20`26`20("'"`7C'"'),`20forwar Vd,`20exact); X`09`20`20`20`20copy_body`20:= X`09`09str(`20create_range(mark(none),beginning_of(here),none),`20'`20'); X`09`20`20`20`20copy_body`20:=`20substr(copy_body,`202,`20length(copy_body)`20- V`201); X`09`20`20`20`20edit(copy_body,`20upper,`20trim,`20compress,`20off); X`09`20`20`20`20if`20procs`7Bcopy_body`7D=tpu$k_unspecified`20then X`09`09procs`7Bcopy_body`7D`20:=`201; X`09`20`20`20`20else X`09`09procs`7Bcopy_body`7D`20:=`20procs`7Bcopy_body`7D`20+`201; X`09`20`20`20`20endif; X`09endif; X`20`20`20`20endloop; X`20`20`20`20position(mms); X`20`20`20`20copy_body`20:=`20get_info(procs,"first"); X`20`20`20`20if`20(copy_body<>tpu$k_unspecified)`20then X`09trivial_case`20:=`200; X`09position(beginning_of(mms_buffer));`20!`20in`20opening`20blank`20line X`09split_line; X`09copy_text('!`20Calls`20'+copy_body); X`09loop X`09`20`20`20`20copy_body`20:=`20get_info(procs,"next"); X`09`20`20`20`20exitif`20copy_body=tpu$k_unspecified; X`09`20`20`20`20if`20(current_offset+2+length(copy_body)`20>`2078)`20then X`09`09copy_text(','); X`09`09split_line; X`09`09copy_text('!`20`20'+copy_body); X`09`20`20`20`20else X`09`09copy_text(',`20'+copy_body); X`09`20`20`20`20endif; X`09endloop; X`20`20`20`20endif; X`20`20`20`20delete(procs); X`20`20`20`20position(startbuf); X X!`20Decide`20whether`20we're`20writing`20out`20anything`20worthwhile X X`20`20`20`20if`20trivial_case`20then X`09if`20(desc_exists<>0)`20then X`09`20`20`20`20position(desc_exists); X`09`20`20`20`20erase(desc_exists); X`09`20`20`20`20split_line; X`09`20`20`20`20message('Modifying`20MMS`20file`20'+mmsfile+ascii(7)); X`09`20`20`20`20message('No`20additional`20dependencies`20found`20-`20removing V`20description.'); X`09else X`09`20`20`20`20message('No`20MMS`20description`20-`20no`20additional`20depende Vncies'); X`09`20`20`20`20delete(mms_buffer); X`09endif; X`20`20`20`20else X`09if`20mms_exists`20then X`09`20`20`20`20if`20(desc_exists<>0)`20then X`09`09if`20(str(desc_exists)<>str(mms_buffer))`20then X`09`09`20`20`20`20position(desc_exists); X`09`09`20`20`20`20erase(desc_exists); X`09`09`20`20`20`20copy_text(mms_buffer); X`09`09`20`20`20`20message('Modifying`20MMS`20file`20'+mmsfile+ascii(7)); X`09`09`20`20`20`20message('Dependencies`20changed`20-`20replacing`20descriptio Vn.'); X`09`09else X`09`09`20`20`20`20message('MMS`20dependencies`20unchanged'); X`09`09endif; X`09`20`20`20`20else X`09`09position(end_of(mms_old_buffer)); X`09`09copy_text(mms_buffer); X`09`09message('Appending`20to`20MMS`20file`20'+mmsfile+ascii(7)); X`09`09message('Dependencies`20found`20-`20adding`20description.'); X`09`20`20`20`20endif; X`09else X`09`20`20`20`20message('Creating`20MMS`20file`20'+mmsfile+ascii(7)); X`09`20`20`20`20message('Dependencies`20found`20-`20description`20built.'); X`09endif; X`20`20`20`20endif; Xendprocedure; X Xprocedure`20do_batch X!`20This`20procedure`20gets`20called`20with`20the`20current`20position`20at`20 Vthe`20top`20of`20the X!`20main`20buffer,`20which`20contains`20the`20input`20file.`20The`20output`20f Vile`20has`20already`20been X!`20set,`20and`20when`20this`20procedure`20exits,`20the`20file`20will`20be`20w Vritten. X!`20This`20procedure`20should`20not`20create`20writeable`20buffers`20without V`20specifying`20where X!`20they`20should`20be`20written`20to. X X`20`20`20`20position`20(`20beginning_of`20(`20main_buffer`20)`20);`20remove_in Vcluded_modules; X`20`20`20`20position`20(`20beginning_of`20(`20main_buffer`20)`20);`20generate_ Vmms_description; X`20`20`20`20position`20(`20beginning_of`20(`20main_buffer`20)`20);`20do_ff_and V_comments; X`20`20`20`20position`20(`20beginning_of`20(`20main_buffer`20)`20);`20insert_ff V; X`20`20`20`20position`20(`20beginning_of`20(`20main_buffer`20)`20);`20!`20compr Vess_lines; Xendprocedure; X Xinfile`20:=`20file_parse(get_info`20(`20command_line,`20'file_name'),`20'.ifdl V'); Xoutfile`20:=`20get_info`20(`20command_line,`20'output_file'`20); Xif`20outfile=''`20then X`09outfile`20:=`20infile; Xelse X`09outfile`20:=`20file_parse(outfile,`20'.ifdl'); Xendif; X Xmain_buffer`20:=`20create_buffer`20(`20'main',`20infile`20); Xset(`20output_file,`20main_buffer,`20outfile`20); X Xdo_batch; Xexit;`20!`20This`20won't`20work`20if`20there`20are`20modified`20writeable`20bu Vffers`20without X`09!`20output`20files`20specified $ call unpack IFDL.TPU;28 2101883101 "" 35 4 6 $! $ create 'f' X`00`00`00`00`02`07SDLIFDL`08V1.00-0123-May-1996`2012:5523-May-1996`2012:55 X`00`01DEC`20Pascal`20V5.4-41 X`05`F1`0E`BC`00`06`00`00`00`07SDLIFDL X`02`04`00`00P`EF`00`00`00`00A`00`00`00`01`00`00`00`04OUTFQ`03`00`00`00`EE`00 V`00`00`00A`00`00`00`01`00`00`00`05OUTF1Q`02`00`00`00`FA`04`00rootQ`04`00`00`00 V`F7`07`00commentQ`01`00`00`00`F9`05`00constQ`03`00`00`00`F9`05`00entryQ`03`00 V`00`00`FA`04`00itemQ`04`00`00`00`F8`06`00moduleQ`02`00`00`00`FA`04`00parmQ`04 V`00`00`00`F9`05`00dummyQ`03`00`00`00`FB`03`00objQ`05`00`00`00`FA`04`00headQ`04 V`00`00`00`FA`04`00typeQ`04`00`00`00`FB`03`00endQ`05`00`00`00`FA`04`00condQ`04 V`00`00`00`F7`07`00literalQ`01`00`00`00`FA`04`00symbQ`06`00`00`00`F7`20Created V`20Q`03`00`00`00`E3`20by`20OpenVMS`20SDL`20IFDL`20V1.00-01Q`03`00`00`00`F7`20S Vource:`20Q`03`00`00`00`FB.IFDLQ`03`00`00`00`E7`7B###Module/0/SDL_Include:Q`03 V`00`00`00`CA###`7D*Unk(`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00 V`00`00`00`00`00`00`00`00`00`00`00`00`00`20(*unknown*)`20(Q`02`00`00`00`F2`20Va Vrying`20`7B`20`7D`20`7DQ`02`00`00`00`F3`20Occurs`20*Var*Q`03`00`00`00`F2`20Occ Vurs`20`20Base`20Q`02`00`00`00`E1`20Occurs`20*UnkIFDLdeclaredforwardQ`01`00`00 V`00`F9see`20`7B## X`02`E6#End_Module/0/SDL_Include:Q`03`00`00`00`BA###`7D`04@`00`00`00`00`00`00 V`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00FD`00 V`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00`00 V`00`00`00`7B`20Q`02`00`00`00`FA`20node`20Q`02`00`00`00`CE`7B`20*Unsupported* V`20`20node`20`20(`20`7D`7B`20Group`20`7B`20End`20Group`20`7B`20`20`7DQ`02`00 V`00`00`F2`7B`20Union`20Group`20Q`02`00`00`00`F7subfield`20Q`03`00`00`00`E5End V`20Group`20`7B`20`20`7D`01`01`FC`07`9E`CE`C8`FE`5E`D4`AD`F8`9E`00`0BPAS$HANDLE VR`1C`80m`D0`AC`0CP`B1`60`8F`FF`00`1B`00`00`09`B0`60`CD`C8`FE(`60`A0`02`CD`CA V`FE`D1l`04`1F`00`7D`BC`10`AD`F0<`AD`F0P`C0`02P`C2P`5E`D0`AD`F4P`D0`5EQ`B0`60a( V`81`A0`02a`D0`5E`AD`F4`D1l`05`1F`00`7D`BC`14`AD`E8<`AD`E8P`C0`02P`C2P`5E`D0`AD V`ECP`D0`5EQ`B0`60a(`81`A0`02a`D0`5E`AD`EC`D1l`06`1F`00`90`BC`18V`D0`5EW`DD`00 V`DD`00`D0`8F`11`00`0E`01`AD`E0`F4`9E`AD`CC`AD`E4`9F`AD`E0`DD`00`FB`04`00`0ASYS V$ASCTIM`1C`D9`D1l`06`1F`00`D1`06l`1B`00`00`0F`E9V`00`D0`AC`04R`D1`04l`1B`00`00 V`0F`D0`AD`F4P`9F`A0`02`DD`60`DDR`FB`03`00`10PAS$WRITE_STRING`1C`FC`DDR`FB`01 V`00`0CPAS$WRITELN2`1C`ED`D1`04l`1B`00`00`0F`B1`00`AD`F0`1B`00`00`09`D0`AD`F4P V X`02`80`B4`60(`80n`60`B4`CD`C8`FE(`00n`CD`CA`FE`11`00`01`D1l`05`1F`00`D1`05l`1B V`00`00`0F`D0`AD`ECP-`60`A0`02`20`00n`13`00`D1`05l`1B`00`00`0F`D0`AD`ECX Subject: SDLIFDL.5-OF-8