VirtualBox

source: vbox/trunk/src/bldprogs/deftoimp.sed@ 47709

Last change on this file since 47709 was 34662, checked in by vboxsync, 14 years ago

Hacking in progress, enclosed in VBOX_ONLY_EXTPACKS_USE_IMPLIBS ifdefs for now.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 1.0 KB
Line 
1# $Id: deftoimp.sed 34662 2010-12-02 21:51:17Z vboxsync $
2## @file
3# SED script for generating a dummy .c from a windows .def file.
4#
5
6#
7#
8# Copyright (C) 2006-2010 Oracle Corporation
9#
10# This file is part of VirtualBox Open Source Edition (OSE), as
11# available from http://www.virtualbox.org. This file is free software;
12# you can redistribute it and/or modify it under the terms of the GNU
13# General Public License (GPL) as published by the Free Software
14# Foundation, in version 2 as it comes in the "COPYING" file of the
15# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17#
18
19#
20# Remove comments and space. Skip empty lines.
21#
22s/;.*$//g
23s/^[[:space:]][[:space:]]*//g
24s/[[:space:]][[:space:]]*$//g
25/^$/d
26
27# Handle text after EXPORTS
28/EXPORTS/,//{
29s/^EXPORTS$//
30/^$/b end
31
32
33/[[:space:]]DATA$/b data
34
35#
36# Function export
37#
38:code
39s/^\(.*\)$/EXPORT\nvoid \1(void);\nvoid \1(void){}/
40b end
41
42
43#
44# Data export
45#
46:data
47s/^\(.*\)[[:space:]]*DATA$/EXPORT_DATA void *\1 = (void *)0;/
48b end
49
50}
51d
52b end
53
54
55# next expression
56:end
57
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