3
# Copyright (C) 2003,2004 Erik de Castro Lopo <erikd@mega-nerd.com>
7
# Redistribution and use in source and binary forms, with or without
8
# modification, are permitted provided that the following conditions are
11
# * Redistributions of source code must retain the above copyright
12
# notice, this list of conditions and the following disclaimer.
13
# * Redistributions in binary form must reproduce the above copyright
14
# notice, this list of conditions and the following disclaimer in
15
# the documentation and/or other materials provided with the
17
# * Neither the author nor the names of any contributors may be used
18
# to endorse or promote products derived from this software without
19
# specific prior written permission.
21
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
#----------------------------------------------------------------
36
# These are all of the public functions exported from libsndfile.
38
# Its important not to change the order they are listed in or
39
# the ordinal values in the second column.
48
( "sf_error_str", 9 ),
49
( "sf_error_number", 10 ),
50
( "sf_format_check", 11 ),
51
( "sf_read_raw", 16 ),
52
( "sf_readf_short", 17 ),
53
( "sf_readf_int", 18 ),
54
( "sf_readf_float", 19 ),
55
( "sf_readf_double", 20 ),
56
( "sf_read_short", 21 ),
57
( "sf_read_int", 22 ),
58
( "sf_read_float", 23 ),
59
( "sf_read_double", 24 ),
60
( "sf_write_raw", 32 ),
61
( "sf_writef_short", 33 ),
62
( "sf_writef_int", 34 ),
63
( "sf_writef_float", 35 ),
64
( "sf_writef_double", 36 ),
65
( "sf_write_short", 37 ),
66
( "sf_write_int", 38 ),
67
( "sf_write_float", 39 ),
68
( "sf_write_double", 40 ),
69
( "sf_strerror", 50 ),
70
( "sf_get_string", 60 ),
71
( "sf_set_string", 61 ),
73
( "sf_open_virtual", 80 ),
74
( "sf_write_sync", 90 )
77
#-------------------------------------------------------------------------------
79
def linux_symbols (progname, version):
80
print "# Auto-generated by %s\n" %progname
81
print "libsndfile.so.%s" % version
84
for name, ordinal in ALL_SYMBOLS:
92
def darwin_symbols (progname, version):
93
print "# Auto-generated by %s\n" %progname
94
for name, ordinal in ALL_SYMBOLS:
99
def win32_symbols (progname, version, name):
100
print "; Auto-generated by %s\n" %progname
101
print "LIBRARY %s-%s.dll" % (name, re.sub ("\..*", "", version))
103
for name, ordinal in ALL_SYMBOLS:
104
print "%-20s @%s" % (name, ordinal)
108
def no_symbols (os_name):
110
print "No known way of restricting exported symbols on '%s'." % os_name
111
print "If you know a way, please contact the author."
115
#-------------------------------------------------------------------------------
117
progname = re.sub (".*[\\/]", "", sys.argv [0])
119
if len (sys.argv) != 3:
121
print "Usage : %s <target OS name> <libsndfile version>." % progname
123
print " Currently supported values for target OS are:"
125
print " darwin (ie MacOSX)"
126
print " win32 (ie wintendo)"
127
print " cygwin (Cygwin on wintendo)"
131
os_name = sys.argv [1]
132
version = re.sub ("\.[a-z0-9]+$", "", sys.argv [2])
134
if os_name == "linux":
135
linux_symbols (progname, version)
136
elif os_name == "darwin":
137
darwin_symbols (progname, version)
138
elif os_name == "win32":
139
win32_symbols (progname, version, "libsndfile")
140
elif os_name == "cygwin":
141
win32_symbols (progname, version, "cygsndfile")
147
# Do not edit or modify anything in this comment block.
148
# The arch-tag line is a file identity tag for the GNU Arch
149
# revision control system.
151
# arch-tag: 5814f35c-318f-4023-a0c3-d9cf7c9e5f6c