1 | # $Id: errmsg.sed 4071 2007-08-07 17:07:59Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # innotek Portable Runtime - SED script for converting */err.h.
|
---|
4 | #
|
---|
5 |
|
---|
6 | # Copyright (C) 2006-2007 innotek GmbH
|
---|
7 | #
|
---|
8 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | # available from http://www.virtualbox.org. This file is free software;
|
---|
10 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | # General Public License as published by the Free Software Foundation,
|
---|
12 | # in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
13 | # distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
14 | # be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 |
|
---|
16 | # Handle text inside the markers.
|
---|
17 | /SED-START/,/SED-END/{
|
---|
18 |
|
---|
19 | # if (#define) goto defines
|
---|
20 | /^[[:space:]]*#[[:space:]]*define/b defines
|
---|
21 |
|
---|
22 | # if (/**) goto description
|
---|
23 | /\/\*\*/b description
|
---|
24 |
|
---|
25 | }
|
---|
26 |
|
---|
27 | # Everything else is deleted!
|
---|
28 | d
|
---|
29 | b end
|
---|
30 |
|
---|
31 |
|
---|
32 | ##
|
---|
33 | # Convert the defines
|
---|
34 | :defines
|
---|
35 | s/^[[:space:]]*#[[:space:]]*define[[:space:]]*\([a-zA-Z0-9_]*\)[[:space:]]*\(.*\)[[:space:]]*$/ "\1",\n \1 }, /
|
---|
36 | b end
|
---|
37 |
|
---|
38 | ##
|
---|
39 | # Convert descriptive comments. /** desc */
|
---|
40 | :description
|
---|
41 | # arg! how to do N until end of comment?
|
---|
42 | /\*\//!N
|
---|
43 | /\*\//!N
|
---|
44 | /\*\//!N
|
---|
45 | /\*\//!N
|
---|
46 | /\*\//!N
|
---|
47 | /\*\//!N
|
---|
48 | /\*\//!N
|
---|
49 | /\*\//!N
|
---|
50 | /\*\//!N
|
---|
51 | /\*\//!N
|
---|
52 | /\*\//!N
|
---|
53 | /\*\//!N
|
---|
54 | /\*\//!N
|
---|
55 | /\*\//!N
|
---|
56 | /\*\//!N
|
---|
57 | /\*\//!N
|
---|
58 | /\*\//!N
|
---|
59 | /\*\//!N
|
---|
60 | /\*\//!N
|
---|
61 | /\*\//!N
|
---|
62 | /\*\//!N
|
---|
63 | /\*\//!N
|
---|
64 | /\*\//!N
|
---|
65 | /\*\//!N
|
---|
66 | /\*\//!N
|
---|
67 | /\*\//!N
|
---|
68 | # anything with @{ and @} is skipped
|
---|
69 | /@[\{\}]/d
|
---|
70 |
|
---|
71 | # Fix double spaces
|
---|
72 | s/[[:space:]][[:space:]]/ /g
|
---|
73 |
|
---|
74 | # Fix \# sequences (doxygen needs them, we don't).
|
---|
75 | s/\\#/#/g
|
---|
76 |
|
---|
77 | # insert punctuation.
|
---|
78 | s/\([^.[:space:]]\)[[:space:]]*\*\//\1. \*\//
|
---|
79 |
|
---|
80 | # convert /** short. more
|
---|
81 | s/[[:space:]]*\/\*\*[[:space:]]*/ { NULL, \"/
|
---|
82 | s/ { NULL, \"\([^.!?"]*[.!?][.!?]*\)/ { \"\1\",\n \"\1/
|
---|
83 |
|
---|
84 | # terminate the string
|
---|
85 | s/[[:space:]]*\*\//\"\,/
|
---|
86 | s/[[:space:]]*[[:space:]]\*[[:space:]][[:space:]]*/ /g
|
---|
87 | b end
|
---|
88 |
|
---|
89 |
|
---|
90 | # next expression
|
---|
91 | :end
|
---|