Warning, /sdk/kde-dev-scripts/kde_generate_export_header is written in an unsupported language. File is not indexed.
0001 #! /usr/bin/env python 0002 0003 import os, sys 0004 0005 def help(): 0006 print("Usage: %s foo_export.h FOO_EXPORT libname" % sys.argv[0]) 0007 0008 if len(sys.argv) < 4: 0009 help() 0010 sys.exit() 0011 0012 filename=sys.argv[1] 0013 FOO_EXPORT=sys.argv[2] 0014 LIBNAME=sys.argv[3].upper() 0015 HEADER_PROTECTION=filename.upper().replace('.','_') 0016 0017 file=open(filename,'w') 0018 file.write("\ 0019 /* This file is part of the KDE project\n\ 0020 Copyright (C) 2007 David Faure <faure@kde.org>\n\ 0021 \n\ 0022 This library is free software; you can redistribute it and/or\n\ 0023 modify it under the terms of the GNU Library General Public\n\ 0024 License as published by the Free Software Foundation; either\n\ 0025 version 2 of the License, or (at your option) any later version.\n\ 0026 \n\ 0027 This library is distributed in the hope that it will be useful,\n\ 0028 but WITHOUT ANY WARRANTY; without even the implied warranty of\n\ 0029 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n\ 0030 Library General Public License for more details.\n\ 0031 \n\ 0032 You should have received a copy of the GNU Library General Public License\n\ 0033 along with this library; see the file COPYING.LIB. If not, write to\n\ 0034 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n\ 0035 Boston, MA 02110-1301, USA.\n\ 0036 */\n\ 0037 \n\ 0038 #ifndef %(HEADER_PROTECTION)s\n\ 0039 #define %(HEADER_PROTECTION)s\n\ 0040 \n\ 0041 /* needed for KDE_EXPORT and KDE_IMPORT macros */\n\ 0042 #include <kdemacros.h>\n\ 0043 \n\ 0044 #ifndef %(FOO_EXPORT)s\n\ 0045 # if defined(MAKE_%(LIBNAME)s_LIB)\n\ 0046 /* We are building this library */\n\ 0047 # define %(FOO_EXPORT)s KDE_EXPORT\n\ 0048 # else\n\ 0049 /* We are using this library */\n\ 0050 # define %(FOO_EXPORT)s KDE_IMPORT\n\ 0051 # endif\n\ 0052 #endif\n\ 0053 \n\ 0054 # ifndef %(FOO_EXPORT)s_DEPRECATED\n\ 0055 # define %(FOO_EXPORT)s_DEPRECATED KDE_DEPRECATED %(FOO_EXPORT)s\n\ 0056 # endif\n\ 0057 \n\ 0058 #endif\n" % vars()) 0059 file.close() 0060 0061 os.system("svn add "+filename)