/usr/share/sofia-sip/tag_dll.awk is in libsofia-sip-ua-dev 1.12.11+20110422-1build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | #! /usr/bin/env awk
#
# Create reference tags and WIN32 initialization functions for tags.
#
# --------------------------------------------------------------------
#
# This file is part of the Sofia-SIP package
#
# Copyright (C) 2005 Nokia Corporation.
#
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
#
# --------------------------------------------------------------------
#
# Author: Pekka Pessi <Pekka.Pessi@nokia.com>
#
# Created: Tue Feb 26 14:11:25 2002 ppessi
#
BEGIN {
DEFS = 0;
HEADER = 1;
}
HEADER {
HEADER = 0;
if (OUTNAME != "") {
fn = OUTNAME;
} else {
fn = FILENAME;
}
if (REF == "") {
REF = fn;
sub(/[.]c(at)?/, "_ref.c", REF);
}
if (NODLL) DLL = "/dev/null";
if (DLL == "") {
DLL = fn;
sub(/[.]c(at)?/, "_dll.c", DLL);
}
base = fn;
sub(/.*\//, "", base);
printf("#ifdef _WIN32\n"\
"/*\n" \
" * PLEASE NOTE: \n" \
" * \n" \
" * This file is automatically generated by tag_dll.awk.\n"\
" * It contains magic required by Win32 DLLs to initialize\n"\
" * tag_typedef_t variables.\n"\
" * \n"\
" * Do not, repeat, do not edit this file. Edit '%s' instead.\n"\
" * \n"\
" */\n\n"\
"#define EXPORT __declspec(dllexport)\n\n", base) > DLL;
if (DLLREF) {
print \
"#include \"config.h\"\n\n" \
"#include <sofia-sip/su_tag_class.h>\n\n" > DLL;
}
printf("/*\n" \
" * PLEASE NOTE: \n" \
" * \n" \
" * This file is automatically generated by tag_dll.awk.\n"\
" * It contains tag_typedef_t for tag references.\n"\
" * \n"\
" * Do not, repeat, do not edit this file. Edit '%s' instead.\n"\
" * \n"\
" */\n\n"\
"#include \"config.h\"\n\n"\
"#include <sofia-sip/su_tag_class.h>\n"\
"\n"\
"#if defined _WIN32 || defined HAVE_OPEN_C\n"\
"#define EXPORT __declspec(dllexport)\n"\
"#else\n"\
"#define EXPORT\n"\
"#endif\n\n",
base) > REF;
if (LIST) {
print "#include <stddef.h>" >REF;
}
print "" > REF;
}
/^#define TAG_NAMESPACE/ {
print "#undef TAG_NAMESPACE" > REF;
print $0 > REF;
print "" > REF;
print "#undef TAG_NAMESPACE" > DLL;
print $0 > DLL;
print "" > DLL;
}
/SU_HAVE_EXPERIMENTAL/ {
print $0 > REF;
print $0 > DLL;
}
!DEFS && /^tag_typedef_t/ { DEFS = 1; }
DEFS && /tag_typedef_t/ {
tag = $2;
typedefs[tag] = $0;
if ($0 !~ /NSTAG_TYPEDEF/) {
print "extern tag_typedef_t "tag";" > REF;
print "EXPORT tag_typedef_t "tag"_ref;" > DLL;
print "EXPORT tag_typedef_t "tag"_ref = \n REFTAG_TYPEDEF("tag");" > REF;
}
gsub(/ = .*$/, ";");
}
!DLLREF { print $0 > DLL; }
END {
if (LIST) {
print "\nEXPORT tag_type_t " LIST "[] =\n{" > REF;
print "\nEXPORT tag_type_t " LIST "[] =\n{" > DLL;
for (tag in typedefs) {
if (typedefs[tag] !~ /NSTAG_TYPEDEF/) {
print " " tag "," > REF;
print " " tag "," > DLL;
}
}
print " NULL\n};" > REF;
print " NULL\n};" > DLL;
}
printf("\n" \
"#include <windows.h>\n"\
"\n"\
"BOOL WINAPI DllMain(HINSTANCE hInst, DWORD fwdReason, LPVOID fImpLoad)\n"\
"{\n") > DLL;
for (tag in typedefs) {
def = typedefs[tag];
if (!DLLREF) {
sub(/^tag_typedef_t /, " tag_typedef_t _", def);
print def > DLL;
}
else {
print " extern tag_typedef_t "tag";" > DLL;
}
print " tag_typedef_t _"tag"_ref =\n REFTAG_TYPEDEF("tag");" > DLL;
}
print "" > DLL;
for (tag in typedefs) {
if (!DLLREF) {
print " *(struct tag_type_s *)" tag " = *_" tag ";" > DLL;
}
print " *(struct tag_type_s *)" tag "_ref = *_" tag "_ref;" > DLL;
}
print "\n return TRUE;" > DLL;
print "}" > DLL;
print "\n#endif" > DLL;
}
|