| 1 | # $Id: kPrf2WinApi-genimp.sed 11 2008-04-20 09:18:23Z bird $
 | 
|---|
| 2 | ##
 | 
|---|
| 3 | # Generate imports from normalized dumpbin output.
 | 
|---|
| 4 | #
 | 
|---|
| 5 | 
 | 
|---|
| 6 | #
 | 
|---|
| 7 | # Copyright (c) 2008 knut st. osmundsen <bird-src-spam@anduin.net>
 | 
|---|
| 8 | #
 | 
|---|
| 9 | # This file is part of kProfiler.
 | 
|---|
| 10 | #
 | 
|---|
| 11 | # kProfiler is free software; you can redistribute it and/or
 | 
|---|
| 12 | # modify it under the terms of the GNU Lesser General Public
 | 
|---|
| 13 | # License as published by the Free Software Foundation; either
 | 
|---|
| 14 | # version 2.1 of the License, or (at your option) any later version.
 | 
|---|
| 15 | #
 | 
|---|
| 16 | # kProfiler is distributed in the hope that it will be useful,
 | 
|---|
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
|---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
|---|
| 19 | # Lesser General Public License for more details.
 | 
|---|
| 20 | #
 | 
|---|
| 21 | # You should have received a copy of the GNU Lesser General Public
 | 
|---|
| 22 | # License along with kProfiler; if not, write to the Free Software
 | 
|---|
| 23 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 | 
|---|
| 24 | #
 | 
|---|
| 25 | 
 | 
|---|
| 26 | # Normalize the input a bit.
 | 
|---|
| 27 | s/[[:space:]][[:space:]]*/ /g
 | 
|---|
| 28 | s/^[[:space:]]//
 | 
|---|
| 29 | s/[[:space:]]$//
 | 
|---|
| 30 | /^$/b drop_line
 | 
|---|
| 31 | 
 | 
|---|
| 32 | # Expects a single name - no ordinals yet.
 | 
|---|
| 33 | /\@/b have_at
 | 
|---|
| 34 | 
 | 
|---|
| 35 | s/^\(.*\)$/  \1=kPrf2Wrap_\1/
 | 
|---|
| 36 | b end
 | 
|---|
| 37 | 
 | 
|---|
| 38 | :have_at
 | 
|---|
| 39 | h
 | 
|---|
| 40 | s/^\([^ ]\)\(@[0-9]*\)$/  \1\2=kPrf2Wrap_\1/
 | 
|---|
| 41 | p
 | 
|---|
| 42 | g
 | 
|---|
| 43 | s/^\([^ ]\)\(@[0-9]*\)$/  \1=kPrf2Wrap_\1/
 | 
|---|
| 44 | b end
 | 
|---|
| 45 | 
 | 
|---|
| 46 | :drop_line
 | 
|---|
| 47 | d
 | 
|---|
| 48 | b end
 | 
|---|
| 49 | 
 | 
|---|
| 50 | :end
 | 
|---|