* mipsread.c: Pass NULL name pointer to init_type, not 0.
[deliverable/binutils-gdb.git] / bfd / sedscript-p
CommitLineData
90f3f3e2
SC
1# SED script for preprocessing embedded headers from source
2# (S. Chamberlain markup)
3# middle pass; most of the work is done here.
4#
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\*/\/*/
9#
10# *-*/ is an alternative (older) comment-block end. Remap for uniformity:
11s/^\*-\*\//\*\//
12#
13# {* and *} are standins for comment markers (originally embedded in .c
14# comments)---turn into real comment markers:
15s/{\*/\/\*/
16s/\*}/\*\//
17#
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.
22/\*\+\+\+/d
23/\*---/d
24#
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.
29/^\$/i\
30*/
31/^\$/a\
32/*
33#
34# Now delete the '$' markers themselves:
35/^\$/s/\$//
36#
37# *+ and *- delimit larger blocks of code, treated the same as '$' lines
38/^\*\+$/c\
39*/
40/^\*-$/c\
41/*
42#
43# '*;' introduces code which may have a single line or multiple lines;
44# it extends until the next semicolon (which is also printed).
45#
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
48# a semicolon)
49/^\*;.*;$/{
50s/^\*;/*\/\
51/
52s/;$/;\
53\/*\
54/
55}
56# Multi-line case:
57/^\*;/,/.*;$/{
58s/^\*;/*\/\
59/
60s/;$/;\
61\/*\
62/
63}
This page took 0.048081 seconds and 4 git commands to generate.