home *** CD-ROM | disk | FTP | other *** search
- /* Edge macro: hn_addprotos
- **
- ** $VER: hn_addprotos_sc5.edge 1.4 (16-Feb-93 01:12:11)
- **
- ** Usage: hn_addprotos
- **
- ** Synopsis: Add prototypes to SAS/C file
- ** (at cursor, if not done before)
- **
- ** Author: Henrik Nordström
- ** Ängsvägen 1
- ** 756 45 Uppsala
- ** Sweden
- */
-
- options results
-
- call pragma(d,'edge:')
-
- startstr='"/** Prototypes for "'
- endstr='"/** Prototypes END **/*n"'
-
- /* 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
-
- 'getenvvar _fe_name'
- fullname = result
- parse var fullname name '.' type
- address command 'lc >echo:t:proto_'name' -pr -j30i -o"t:protos_'name'" "'name'"'
- call hn_readerr_c('t:proto_'name,fullname,1)
- if RESULT<10 then do
- 'position sol'
- 'include "t:protos_'name'"'
- 'text "'endstr'" RAW'
- if firsttime then 'text "*n"'
- 'find find startstr forward 0'
- end
- else 'undo'
-
- exit(RC)
-