VirtualBox

source: vbox/trunk/src/VBox/Runtime/common/err/errmsg.sed@ 47443

Last change on this file since 47443 was 47443, checked in by vboxsync, 11 years ago

Use a loop for executing the N command.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1# $Id: errmsg.sed 47443 2013-07-28 16:58:01Z vboxsync $
2## @file
3# IPRT - SED script for converting */err.h.
4#
5
6#
7# Copyright (C) 2006-2011 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17# The contents of this file may alternatively be used under the terms
18# of the Common Development and Distribution License Version 1.0
19# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20# VirtualBox OSE distribution, in which case the provisions of the
21# CDDL are applicable instead of those of the GPL.
22#
23# You may elect to license modified versions of this file under the
24# terms and conditions of either the GPL or the CDDL or both.
25#
26
27# Handle text inside the markers.
28/SED-START/,/SED-END/{
29
30# if (#define) goto defines
31/^[[:space:]]*#[[:space:]]*define/b defines
32
33# if (/**) goto description
34/\/\*\*/b description
35
36}
37
38# Everything else is deleted!
39d
40b end
41
42
43##
44# Convert the defines
45:defines
46s/^[[:space:]]*#[[:space:]]*define[[:space:]]*\([[:alnum:]_]*\)[[:space:]]*\(.*\)[[:space:]]*$/ "\1",\n \1 }, /
47b end
48
49##
50# Convert descriptive comments. /** desc */
51:description
52
53# Read all the lines belonging to the comment into the buffer.
54:look-for-end-of-comment
55/\*\//bend-of-comment
56N
57blook-for-end-of-comment
58:end-of-comment
59
60# anything with @{ and @} is skipped
61/@[\{\}]/d
62
63# Fix double spaces
64s/[[:space:]][[:space:]]/ /g
65
66# Fix \# sequences (doxygen needs them, we don't).
67s/\\#/#/g
68
69# insert punctuation.
70s/\([^.[:space:]]\)[[:space:]]*\*\//\1. \*\//
71
72# convert /** short. more
73s/[[:space:]]*\/\*\*[[:space:]]*/ { NULL, \"/
74s/ { NULL, \"\([^.!?"]*[.!?][.!?]*\)/ { \"\1\",\n \"\1/
75
76# terminate the string
77s/[[:space:]]*\*\//\"\,/
78
79# translate empty lines into new-lines (only one, please).
80s/[[:space:]]*[[:space:]]\*[[:space:]][[:space:]]*\*[[:space:]][[:space:]]*/\\n/g
81
82# remove asterics.
83s/[[:space:]]*[[:space:]]\*[[:space:]][[:space:]]*/ /g
84b end
85
86
87# next expression
88:end
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette