/* ***************************************************************************** * * * 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. ________________!_______!______________________________________________________ */ /****************************************************************/ /* */ /* ADD_COMMENTS appends an end of line comment to the end of */ /* the output buffer. */ /* */ /****************************************************************/ add_comments: proc(cur_node,buf) ; /********************/ /* */ /* ADD_COMMENTS */ /* */ /********************/ /* include files */ %include 'sdl$library:sdlnodef.in'; /* definition of the tree node structure */ /* declare variables */ declare cur_node pointer, /* pointer to the current node */ buf char(1024) var, /* output buffer */ comment char(1024) var, /* buffer to hold the comment */ pos fixed binary(31), /* position of special characters */ based_string char(1024) var BASED, /* ??????????????????????????? */ comment_opt bit(1) external, /* comment option flag */ global_db fixed binary(7) external, /* for debugging */ local_db fixed binary(7) initial(1); /* for debugging */ /* declare external routines */ DCL FILL ENTRY ( character(*) VARYING , fixed binary(31)) RETURNS (character(132) VARYING ); if( global_db = 1 ) then if ( local_db = 1 ) then put skip list ('in add_comments'); /* * If there is attached comment, then append it to end of line and * output it */ if( cur_node->nod$a_comment^=null() & comment_opt ) then do; if( buf ^= '' ) then buf= fill(buf,40); /* * Exclaimation points '!' and ampersands '&' are special characters * within comments so change them to question marks '?' * */ comment = cur_node->nod$a_comment->based_string; pos = index(comment,'!'); do while( pos > 0 ); substr(comment,pos,1) = '?'; pos = index(comment,'!'); end; pos = index(comment,'&'); do while( pos > 0 ); substr(comment,pos,1) = '?'; pos = index(comment,'!'); end; buf = buf || ' ! ' || comment; end; /* * If This node is part of a paramenter list then append an ampersand * */ if (cur_node->nod$a_parent ^= null()) then if( cur_node->nod$a_parent->nod$b_type = nod$k_entrynode ) then buf = buf || ' &'; if( global_db = 1 ) then if ( local_db = 1 ) then put skip list ('end of add_comments'); end add_comments;