1 # SED script for preprocessing embedded headers from source
2 # (S. Chamberlain markup)
3 # middle pass; most of the work is done here.
5 # First, get rid of /*proto* markers; they've done their job in the first pass.
6 # (They remain comment-introducers)
7 /^\/\*proto\*/s/^\/\*proto\*/\/*/
8 /^\/\*proto-internal\*/s/^\/\*proto-internal\*/\/*/
10 # *-*/ is an alternative (older) comment-block end. Remap for uniformity:
13 # {* and *} are standins for comment markers (originally embedded in .c
14 # comments)---turn into real comment markers:
18 # '*+++' and '*---' span a block of text that includes both header lines
19 # (marked by leading '$') and explanatory text (to be comments).
20 # No need to start comment at "*+++", or end it at "*---", since we're
21 # already in a *proto* comment block. Just delete.
25 # Any line beginning with '$' is made a line of code in the header;
26 # stuff in between is comments, so *precede* each '$' line with
27 # END-comment, *follow* each '$' line with START-comment; third pass later
28 # eliminates empty comment blocks.
34 # Now delete the '$' markers themselves:
37 # *+ and *- delimit larger blocks of code, treated the same as '$' lines
43 # '*;' introduces code which may have a single line or multiple lines;
44 # it extends until the next semicolon (which is also printed).
46 # One-line case: (do this first; else second line address for multi-line case
47 # will include random text til we happen to end a line in a proto comment with