home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Editor / Edge1721.DMS / Edge1721.adf / ExtraStuff / Edge_SasC.lha / rexx / hn_addprotos_sc5.edge next >
Encoding:
Text File  |  1993-11-09  |  1.0 KB  |  52 lines

  1. /* Edge macro: hn_addprotos
  2. **
  3. ** $VER: hn_addprotos_sc5.edge 1.4 (16-Feb-93 01:12:11)
  4. **
  5. ** Usage:    hn_addprotos
  6. **
  7. ** Synopsis: Add prototypes to SAS/C file
  8. **           (at cursor, if not done before)
  9. **
  10. ** Author:   Henrik Nordström
  11. **           Ängsvägen 1
  12. **           756 45 Uppsala
  13. **           Sweden
  14. */
  15.  
  16. options results
  17.  
  18. call pragma(d,'edge:')
  19.  
  20. startstr='"/** Prototypes for "'
  21. endstr='"/** Prototypes END **/*n"'
  22.  
  23. /* Find if done before */
  24. firsttime=0
  25. 'find find startstr circular 1 words 0'
  26. if RC=0 then do
  27.     'blockoff'
  28.     'markblock'
  29.     'cursor up 1'
  30.     'find find endstr forward 1'
  31.     'cursor down 1'
  32.     'erase'
  33.     'blockoff'
  34. end
  35. else firsttime=1
  36.  
  37. 'getenvvar _fe_name'
  38. fullname = result
  39. parse var fullname name '.' type
  40. address command 'lc >echo:t:proto_'name' -pr -j30i -o"t:protos_'name'" "'name'"'
  41. call hn_readerr_c('t:proto_'name,fullname,1)
  42. if RESULT<10 then do
  43.    'position sol'
  44.    'include "t:protos_'name'"'
  45.    'text "'endstr'" RAW'
  46.    if firsttime then 'text "*n"'
  47.    'find find startstr forward 0'
  48. end
  49. else 'undo'
  50.  
  51. exit(RC)
  52.