1 | # $Id: errmsgcom.sed 1 1970-01-01 00:00:00Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # InnoTek Portable Runtime - SED script for converting COM errors
|
---|
4 | #
|
---|
5 |
|
---|
6 | # Copyright (C) 2006 InnoTek Systemberatung 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 | # If you received this file as part of a commercial VirtualBox
|
---|
17 | # distribution, then only the terms of your commercial VirtualBox
|
---|
18 | # license agreement apply instead of the previous paragraph.
|
---|
19 | #
|
---|
20 |
|
---|
21 | # we only care about message definitions
|
---|
22 | \/\/ MessageId: /b messageid
|
---|
23 | d
|
---|
24 | b end
|
---|
25 |
|
---|
26 |
|
---|
27 | # Everything else is deleted!
|
---|
28 | d
|
---|
29 | b end
|
---|
30 |
|
---|
31 |
|
---|
32 | #
|
---|
33 | # A message ID we care about
|
---|
34 | #
|
---|
35 | :messageid
|
---|
36 | # concatenate the next four lines to the string
|
---|
37 | N
|
---|
38 | N
|
---|
39 | N
|
---|
40 | N
|
---|
41 | {
|
---|
42 | # remove DOS <CR>.
|
---|
43 | s/\r//g
|
---|
44 | # remove the message ID
|
---|
45 | s/\/\/ MessageId: //g
|
---|
46 | # remove the stuff in between
|
---|
47 | s/\/\/\n\/\/ MessageText:\n\/\/\n\/\/ //g
|
---|
48 | # backslashes have to be escaped
|
---|
49 | s/\\/\\\\/g
|
---|
50 | # double quotes have to be escaped, too
|
---|
51 | s/"/\\"/g
|
---|
52 | # output C array entry
|
---|
53 | s/\([a-zA-Z0-9_]*\)[\t ]*\n\(.*\)[\t ]*$/{ "\2", "\1", \1 }, /
|
---|
54 | }
|
---|
55 | b end
|
---|
56 |
|
---|
57 | # next expression
|
---|
58 | :end
|
---|