home *** CD-ROM | disk | FTP | other *** search
- /* Edge macro: hn_addprotos
- **
- ** $VER: hn_addprotos_sc6.edge 1.2 (15-Maj-93 14:51:15)
- **
- ** Usage: hn_addprotos
- **
- ** Synopsis: Add prototypes to SAS/C file
- ** (at cursor, if not done before)
- ** SAS/C V6 version
- **
- ** Author: Henrik Nordström
- ** Ängsvägen 1
- ** 756 45 Uppsala
- ** Sweden
- */
-
- options results
-
- call pragma(d,'edge:')
-
- startstr='"/** Prototypes for "'
- endstr='"/** Prototypes END **/*n"'
-
- /*FS:Find if done before */
- firsttime=0
- 'find find 'startstr' circular 1 words 0'
- if RC=0 then do
- 'blockoff'
- 'markblock'
- 'cursor up 1'
- 'find find 'endstr' forward 1'
- 'cursor down 1'
- 'erase'
- 'blockoff'
- end
- else firsttime=1
- /*FE:Find if done before */
-
- /*FS:Start SCMSG */
- if ~show(p,'SC_SCMSG') then do
- address command 'run <>nil: scmsg REXXONLY'
- address command 'waitforport SC_SCMSG'
- end
- /*FE:SCMSG...*/
-
- /*FS:Add prototypes at cursor */
- 'getenvvar _fe_name'
- fullname = result
- parse var fullname name '.' type
- address command 'sc errrexx >"echo:t:proto_'name'" gproto nogpdata gpstat gpfile="t:protos_'name'" "'name'"'
- call hn_readerr_c('t:proto_'name,fullname,1)
- if RESULT<10 then do
- 'position sol'
- 'include "t:protos_'name'"'
- 'delete char back'
- 'text 'endstr' RAW'
- if firsttime then 'text "*n"'
- 'find find 'startstr' forward 0'
- 'position eol'
- 'delete char'
- 'position eol'
- 'delete char'
- 'position eol'
- 'delete char'
- 'position sol'
- end
- else 'undo'
- /*FE:Add prototypes at cursor */
-
- exit(RC)
-