/* ***************************************************************************** * * * Copyright 1978 Compaq Computer Corporation * * * * Compaq and the Compaq logo Registered in U.S. Patent and Trademark Office.* * * * Confidential computer software. Valid license from Compaq required for * * possession, use or copying. Consistent with FAR 12.211 and 12.212, * * Commercial Computer Software, Computer Software Documentation, and * * Technical Data for Commercial Items are licensed to the U.S. Government * * under vendors standard commercial license. * * * ***************************************************************************** facility: SDL (Structure Definition Language) author: Paul A. Calato */ /* C H A N G E L O G Date ! Name ! Description ________________!_______!______________________________________________________ ! ! 23-Nov-1985 | pc | Adding copyright header and change log. ________________!_______!______________________________________________________ 8-Dec-2000 | LJK | EV1-65 Change copyright notice to Compaq format. ________________|_______|______________________________________________________ */ /****************************************************************/ /* */ /* OUTPUT_BUF outputs a buffer to a file. */ /* */ /****************************************************************/ output_buf: proc(buf); /********************/ /* */ /* OUTPUT_BUF */ /* */ /********************/ %replace len by 127; /* leave room for the begining and end of line characters */ /*decalre variables */ declare output_file file record output sequential external, buf char(1024) var, bol_ch char(3) init (''), delimiters char(3) static init (' ,'), /* space,tab, comma */ t_buf char(1024) var, tmpbuf char(1024) var; dcl (i,j) fixed bin; /* declare external functions and subroutines */ DCL SDL$PUTLINE ENTRY ( any, character(1024) VARYING , fixed binary(31)); /********* change SYSIN and 132 ********/ /************ WHAT ABOUT WHEN AN END OF LINE COMMENT RUNS PAST COLUMN 132 ************* SDL$PUTLINE MUST START THE NEXT LINE WITH A COMMNENT MARKER *************/ /**** call sdl$putline (SYSIN, buf, line_length); ******/ t_buf = buf; do i=1 to length(t_buf) by len; if length(t_buf)<=len then do; t_buf = bol_ch || t_buf; write file(output_file) from(t_buf); end; else do; tmpbuf=substr(t_buf,1,len); do j=len to 1 by -1; if index(delimiters,substr(tmpbuf,j,1))^=0 then goto l1; end; l1: tmpbuf=substr(tmpbuf,1,j); tmpbuf = bol_ch || tmpbuf || ' &' ; write file(output_file) from(tmpbuf); if( index(tmpbuf,'!') ^= 0 ) then bol_ch = ' ! '; t_buf=substr(t_buf,j+1); end; end; end output_buf;