errmsg.sed revision e64031e20c39650a7bc902a3e1aba613b9415dee
2N/A# $Id$
2N/A## @file
2N/A# IPRT - SED script for converting */err.h.
2N/A#
2N/A
2N/A# Copyright (C) 2006-2009 Oracle Corporation
2N/A#
2N/A# This file is part of VirtualBox Open Source Edition (OSE), as
2N/A# available from http://www.virtualbox.org. This file is free software;
2N/A# you can redistribute it and/or modify it under the terms of the GNU
2N/A# General Public License (GPL) as published by the Free Software
2N/A# Foundation, in version 2 as it comes in the "COPYING" file of the
2N/A# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
2N/A# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
2N/A#
2N/A# The contents of this file may alternatively be used under the terms
2N/A# of the Common Development and Distribution License Version 1.0
2N/A# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
2N/A# VirtualBox OSE distribution, in which case the provisions of the
2N/A# CDDL are applicable instead of those of the GPL.
2N/A#
2N/A# You may elect to license modified versions of this file under the
2N/A# terms and conditions of either the GPL or the CDDL or both.
2N/A#
2N/A
2N/A# Handle text inside the markers.
2N/A/SED-START/,/SED-END/{
2N/A
2N/A# if (#define) goto defines
2N/A/^[[:space:]]*#[[:space:]]*define/b defines
2N/A
2N/A# if (/**) goto description
2N/A/\/\*\*/b description
2N/A
2N/A}
2N/A
2N/A# Everything else is deleted!
2N/Ad
2N/Ab end
2N/A
2N/A
2N/A##
2N/A# Convert the defines
2N/A:defines
2N/As/^[[:space:]]*#[[:space:]]*define[[:space:]]*\([[:alnum:]_]*\)[[:space:]]*\(.*\)[[:space:]]*$/ "\1",\n \1 }, /
2N/Ab end
2N/A
2N/A##
2N/A# Convert descriptive comments. /** desc */
2N/A:description
2N/A# arg! how to do N until end of comment?
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
2N/A/\*\//!N
/\*\//!N
/\*\//!N
# anything with @{ and @} is skipped
/@[\{\}]/d
# Fix double spaces
s/[[:space:]][[:space:]]/ /g
# Fix \# sequences (doxygen needs them, we don't).
s/\\#/#/g
# insert punctuation.
s/\([^.[:space:]]\)[[:space:]]*\*\//\1. \*\//
# convert /** short. more
s/[[:space:]]*\/\*\*[[:space:]]*/ { NULL, \"/
s/ { NULL, \"\([^.!?"]*[.!?][.!?]*\)/ { \"\1\",\n \"\1/
# terminate the string
s/[[:space:]]*\*\//\"\,/
s/[[:space:]]*[[:space:]]\*[[:space:]][[:space:]]*/ /g
b end
# next expression
:end