[Python-modules-commits] [sip4] 01/01: Import sip4_4.19+dfsg.orig.tar.gz
Dmitry Shachnev
mitya57 at moszumanska.debian.org
Mon Jan 2 09:04:16 UTC 2017
This is an automated email from the git hooks/post-receive script.
mitya57 pushed a commit to branch upstream
in repository sip4.
commit 8e03dd307385eb6f42d30c1959514765a6b4250c
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date: Fri Dec 30 23:38:10 2016 +0300
Import sip4_4.19+dfsg.orig.tar.gz
---
ChangeLog | 445 +++-
NEWS | 25 +
README | 5 -
configure.py | 11 +-
sipgen/export.c | 4 +
sipgen/gencode.c | 2183 ++++++++++----------
sipgen/lexer.c | 2584 ++++++++++++------------
sipgen/metasrc/lexer.l | 3 +
sipgen/metasrc/parser.y | 370 ++--
sipgen/parser.c | 4358 +++++++++++++++++++++-------------------
sipgen/parser.h | 103 +-
sipgen/sip.h | 79 +-
sipgen/transform.c | 1012 ++++++----
sipgen/type_hints.c | 4 +
siplib/apiversions.c | 3 +-
siplib/array.c | 3 +-
siplib/array.h | 4 +-
siplib/descriptors.c | 3 +-
siplib/objmap.c | 11 +-
siplib/qtlib.c | 9 +-
siplib/sip.h.in | 577 ++++--
siplib/sipint.h | 7 +-
siplib/siplib.c.in | 1095 ++++++++--
siplib/threads.c | 3 +-
siplib/voidptr.c | 3 +-
sphinx/c_api.rst | 497 ++++-
sphinx/conf.py | 8 +-
sphinx/directives.rst | 53 +-
sphinx/incompatibilities.rst | 29 +
sphinx/installation.rst | 20 +-
sphinx/introduction.rst | 2 +-
sphinx/python_api.rst | 14 +
sphinx/specification_files.rst | 22 +-
sphinx/using.rst | 6 +-
34 files changed, 8118 insertions(+), 5437 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8739135..23efedb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,451 @@
+2016-12-25 Phil Thompson <phil at riverbankcomputing.com>
+
+ * .hgtags:
+ Added tag 4.19 for changeset 0a4ee5a5511f
+ [245c1ac3c34e] [tip]
+
+ * NEWS:
+ Released as v4.19.
+ [0a4ee5a5511f] [4.19]
+
+2016-12-17 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/transform.c:
+ Fixed a problem importing the required types for protected methods
+ without the public/protected hack.
+ [ccf3d8f3cc59]
+
+2016-12-14 Phil Thompson <phil at riverbankcomputing.com>
+
+ * siplib/sip.h.in.in, siplib/siplib.c.in, sphinx/python_api.rst:
+ Implemented sip.assign() to invoke the C++ assignment operator.
+ [4324a0bc03a4]
+
+2016-11-27 Phil Thompson <phil at riverbankcomputing.com>
+
+ * configure.py.in, sphinx/installation.rst:
+ Added the --no-stubs and --stubsdir options to configure.py to be
+ consistent with other configuration scripts.
+ [70e0d9d09265]
+
+2016-11-22 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/transform.c:
+ Fixed the incomplete tidy-up.
+ [69aaa13a1883]
+
+2016-11-21 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/transform.c:
+ Fix a warning message.
+ [5d7b73925360]
+
+ * sipgen/gencode.c, sipgen/sip.h.in, sipgen/transform.c:
+ Reverted to pre-4.18 handling of the generated cast function. There
+ are cases where a C++ derived class does not have the same address
+ as its single base class.
+ [8e9e02f1bea0]
+
+2016-11-11 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/metasrc/parser.y:
+ Fixed a regression (related to scoped names) that meant that header
+ code for template arguments wasn't being included.
+ [04796a24e981]
+
+2016-10-28 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/gencode.c:
+ iHandwritten code to be included in the sipAPI*.h file is now placed
+ at the end so that it can make use of the generated macros and
+ types.
+ [ed446493da18]
+
+2016-10-26 Phil Thompson <phil at riverbankcomputing.com>
+
+ * siplib/siplib.c.in:
+ Fixed some compiler warnings when building for Python v2.
+ [264793ee3fb0]
+
+2016-10-25 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/transform.c:
+ Fixed a regression in the handling of abstratc classes.
+ [ce1042e83d1a]
+
+ * sipgen/gencode.c, sipgen/transform.c:
+ More namespace related fixes.
+ [73d456c2f5cc]
+
+2016-10-18 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/gencode.c, sipgen/metasrc/parser.y, sipgen/sip.h.in,
+ sipgen/transform.c, siplib/siplib.c.in:
+ Implemented 'final' support. More fixes for the handling of scopes.
+ [1d0d5c659b92]
+
+2016-10-17 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/metasrc/lexer.l, sipgen/metasrc/parser.y, sipgen/sip.h.in,
+ sphinx/specification_files.rst:
+ Added parser support for the 'final' keyword.
+ [373d57302d56]
+
+2016-10-16 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/gencode.c, sipgen/metasrc/parser.y, sipgen/transform.c:
+ Refactored the support for scopes so that types hav a leading '::'.
+ [1f498dfe2888]
+
+2016-10-09 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/gencode.c, sipgen/metasrc/parser.y, sipgen/sip.h.in,
+ sipgen/transform.c:
+ Fixed the generation of the scope of an operator moved from a
+ namespace to a class.
+ [f697ee13a3aa]
+
+2016-10-06 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sphinx/directives.rst:
+ Documented the %HideNamespace directive.
+ [b45a86055567]
+
+ * sipgen/gencode.c, sipgen/metasrc/lexer.l, sipgen/metasrc/parser.y,
+ sipgen/sip.h.in, sipgen/transform.c:
+ Implemented the %HideNamespace directive.
+ [6b1f471385df]
+
+2016-10-05 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/gencode.c:
+ Make sure the underlying types are generated in tuple builders.
+ [0507dfae0588]
+
+ * sipgen/gencode.c:
+ Virtual handlers use typedef names like all the rest of the
+ generated code.
+ [c732f0460bc3]
+
+2016-10-04 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/transform.c:
+ Refactored the name lookup code.
+ [8bd669cf535f]
+
+2016-09-29 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/gencode.c:
+ Variable getters/setters now only keep a hidden reference for C
+ character strings.
+ [6ec87337d5e2]
+
+ * sipgen/gencode.c:
+ Fixed a bad indentation in the generated code.
+ [cb1d8e948a2b]
+
+2016-09-25 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/gencode.c, sipgen/metasrc/parser.y, sipgen/sip.h.in,
+ sipgen/transform.c, siplib/qtlib.c, siplib/sip.h.in.in,
+ siplib/siplib.c.in, sphinx/using.rst:
+ Removed anll code generator support for PyQt3.
+ [a9cc0cc567aa]
+
+2016-09-24 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/transform.c:
+ A class that sub-classes an abstract class and doesn't provide an
+ implementation of an abstract method is itself abstract.
+ [472469f1d7ad]
+
+ * sipgen/gencode.c, sipgen/metasrc/parser.y, sipgen/sip.h.in,
+ sipgen/transform.c:
+ Fixes for imported types that have multiple implementations.
+ [dc02dc4430ec]
+
+ * sipgen/transform.c, siplib/sip.h.in.in:
+ Fixed the selection of a virtual handler.
+ [d6c07e82a3d2]
+
+2016-09-23 Phil Thompson <phil at riverbankcomputing.com>
+
+ * siplib/sip.h.in.in, siplib/sipint.h:
+ Fixed some regressions when building with the limited API disabled.
+ [8118a2156d11]
+
+ * siplib/sip.h.in.in, siplib/sipint.h:
+ Exposed some missing macros.
+ [d12bb44a9d7d]
+
+ * sipgen/gencode.c, siplib/sip.h.in.in, siplib/siplib.c.in,
+ sphinx/c_api.rst:
+ Added sipGetUserObject() and sipSetUserObject() to the public API.
+ [e0352cc51b67]
+
+ * sipgen/gencode.c, siplib/sip.h.in.in, siplib/sipint.h,
+ siplib/siplib.c.in:
+ Added sipIsOwnedByPython() and sipIsDerivedClass() to the private
+ API to remove more binary dependencies.
+ [17ed5300e0dc]
+
+ * sipgen/metasrc/parser.y, siplib/objmap.c, siplib/sip.h.in.in,
+ siplib/siplib.c.in:
+ Fix some warnings.
+ [d0dcc6cd73b9]
+
+ * sipgen/gencode.c, siplib/sip.h.in.in:
+ Refactored how the plugin-specific generated tables are handled.
+ [a0fcb2bc14ca]
+
+2016-09-22 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/transform.c:
+ Fixed the auto-generation of default copy ctors.
+ [508f9dd396f9]
+
+ * sipgen/gencode.c, siplib/sip.h.in.in, siplib/siplib.c.in:
+ Implemented the sipCallProcedureMethod() optimisation.
+ [948be90a3f5e]
+
+ * sipgen/transform.c, siplib/sip.h.in.in:
+ Class based exceptions should now have their type structure
+ included.
+ [64ac366b669f]
+
+ * siplib/sip.h.in.in, siplib/siplib.c.in:
+ Reorganised the C API structure.
+ [a08c7533a799]
+
+ * sipgen/gencode.c, siplib/sip.h.in.in, siplib/siplib.c.in:
+ Completed the refactoring to eliminate binary dependencies.
+ [fb3b72523947]
+
+ * sipgen/gencode.c, sipgen/metasrc/parser.y, sipgen/sip.h.in,
+ sipgen/transform.c, siplib/sip.h.in.in, siplib/siplib.c.in:
+ Refactored the implementation of exceptions to eliminate the binary
+ dependencies.
+ [aeb733f23126]
+
+ * sipgen/gencode.c, sipgen/metasrc/parser.y, sipgen/sip.h.in,
+ sipgen/transform.c, siplib/sip.h.in.in, siplib/siplib.c.in:
+ Refactored the handling of virtual error handlers to reduce binary
+ dependencies.
+ [b08f6f3325e8]
+
+2016-09-21 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/gencode.c, sipgen/sip.h.in, sipgen/transform.c:
+ Genearte the needed types table at the right time.
+ [26331d156a87]
+
+ * sipgen/gencode.c, sipgen/sip.h.in, sipgen/transform.c:
+ Refactoring of the code that inspects a class for its visible
+ virtuals.
+ [082c756c263d]
+
+2016-09-20 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/transform.c:
+ Fixes for regressions using the type header files in the right
+ place.
+ [0b1a09bbde7a]
+
+ * sipgen/gencode.c, sipgen/metasrc/parser.y, sipgen/sip.h.in,
+ sipgen/transform.c, siplib/sip.h.in.in:
+ Initial refactoring of virtual handlers.
+ [d454a9b02d26]
+
+2016-09-19 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/gencode.c, siplib/siplib.c.in:
+ Generate the correct type names for template based types.
+ [1f17d1688231]
+
+ * sipgen/gencode.c, sipgen/metasrc/parser.y, sipgen/sip.h.in,
+ sipgen/transform.c, siplib/sip.h.in.in, siplib/siplib.c.in,
+ sphinx/c_api.rst, sphinx/incompatibilities.rst:
+ Refactored the handling of generated type structures so that they
+ are only referenced by name by an importing module rather than by an
+ index into a table. This reduces the binary dependencies between
+ modules.
+ [667720dbc42d]
+
+2016-09-15 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/gencode.c, sipgen/metasrc/parser.y, sipgen/sip.h.in,
+ siplib/sip.h.in.in, siplib/siplib.c.in, sphinx/directives.rst:
+ Removed the support for module version numbers.
+ [685029cadb52]
+
+2016-09-12 Phil Thompson <phil at riverbankcomputing.com>
+
+ * siplib/siplib.c.in:
+ Fixed silly bugs in the previous change.
+ [7df5236aa50f]
+
+ * siplib/sip.h.in.in, siplib/siplib.c.in:
+ Improved the implementation of sipGetBufferInfo().
+ [7a606d0daf37]
+
+2016-09-09 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/export.c, sipgen/type_hints.c:
+ Fixed the type hint for unsigned const char *.
+ [19f9b9eea667]
+
+ * siplib/sip.h.in.in, siplib/siplib.c.in, sphinx/c_api.rst:
+ Updated sipGetBufferInfo() to optionally check the type.
+ sipGetBufferInfo() only supports 1-dimensional arrays.
+ [985d7877b3a1]
+
+2016-09-08 Phil Thompson <phil at riverbankcomputing.com>
+
+ * siplib/siplib.c.in:
+ Further fixes for invoking the new type handler.
+ [ecdcfc0f0558]
+
+ * siplib/objmap.c, siplib/sip.h.in.in, siplib/siplib.c.in:
+ Fixes for the invocation of the new user type handler.
+ [a95c68d37f6e]
+
+ * siplib/siplib.c.in:
+ Fixed the invocation of the new user type handler.
+ [d484574b76e9]
+
+2016-09-07 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/gencode.c, siplib/sip.h.in.in, siplib/siplib.c.in,
+ sphinx/c_api.rst:
+ Added sipGetBufferInfo() and sipReleaseBufferInfo() to the public
+ API.
+ [c23d7cb8b06e]
+
+2016-09-06 Phil Thompson <phil at riverbankcomputing.com>
+
+ * siplib/siplib.c.in, sphinx/c_api.rst:
+ Documented the new Unicode-related functions.
+ [c8408349d43c]
+
+2016-09-05 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/gencode.c, siplib/sip.h.in.in, siplib/siplib.c.in:
+ Added sipUnicodeNew(), sipUnicodeWrite() and sipUnicodeData() to the
+ public API.
+ [e05849602bef]
+
+2016-08-30 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/gencode.c, siplib/sip.h.in.in, siplib/siplib.c.in,
+ sphinx/c_api.rst:
+ Added sipGetMethod(), sipFromMethod() and sipGetCFunction() ot the
+ public API.
+ [28f7daaa7542]
+
+ * sipgen/gencode.c, sipgen/metasrc/parser.y, siplib/sip.h.in.in,
+ siplib/siplib.c.in, sphinx/c_api.rst:
+ Added sipCheckPluginForType() ot the public API.
+ sipSetNewUserTypeHandler() now returns the old handler to allow
+ chaining.
+ [7e8e4447431b]
+
+2016-08-29 Phil Thompson <phil at riverbankcomputing.com>
+
+ * siplib/descriptors.c, siplib/objmap.c, siplib/sip.h.in.in,
+ siplib/siplib.c.in:
+ Renamed some structure fields.
+ [cb8478e5895d]
+
+ * sipgen/gencode.c, siplib/sip.h.in.in, siplib/siplib.c.in,
+ sphinx/c_api.rst:
+ Added sipPyTypeDict() to the public API.
+ [7f25c1fe8296]
+
+ * sipgen/gencode.c, siplib/sip.h.in.in, siplib/siplib.c.in,
+ sphinx/c_api.rst:
+ Added sipGetFrame() to the public API.
+ [a34c213208b2]
+
+ * sipgen/gencode.c, siplib/sip.h.in.in, siplib/siplib.c.in,
+ sphinx/c_api.rst:
+ Added sipIsUserType() to the public API.
+ [d2477eb9265e]
+
+ * sipgen/gencode.c, siplib/sip.h.in.in, siplib/siplib.c.in,
+ sphinx/c_api.rst:
+ Added the data and time functions to the public API.
+ [7739c16f94c9]
+
+2016-08-28 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sphinx/c_api.rst:
+ Documented sipPyTypeName().
+ [c7098cf08c3a]
+
+ * sipgen/gencode.c, siplib/sip.h.in.in, siplib/siplib.c.in:
+ Added sipPyTypeName() to the public API.
+ [319512a38c50]
+
+ * siplib/sip.h.in.in:
+ Fixed the new macros.
+ [c361a6924e82]
+
+ * siplib/sip.h.in.in:
+ Implemented additional portablity macros for the limited API.
+ [120e916e8608]
+
+ * .hgignore, sipgen/gencode.c, siplib/sip.h.in.in, siplib/siplib.c.in,
+ sphinx/c_api.rst, sphinx/using.rst:
+ Implemented sipSetNewUserTypeFunc() sipSetTypeUserData() and
+ sipGetTypeUserData().
+ [1f180cf4a42a]
+
+2016-08-25 Phil Thompson <phil at riverbankcomputing.com>
+
+ * siplib/apiversions.c, siplib/array.c, siplib/array.h,
+ siplib/descriptors.c, siplib/objmap.c, siplib/qtlib.c,
+ siplib/sip.h.in.in, siplib/sipint.h, siplib/threads.c,
+ siplib/voidptr.c, sphinx/c_api.rst, sphinx/directives.rst:
+ Added the user field to the sipWrapperType structure as an
+ alternative to defining a super-type of sipWrapperType (which isn't
+ possible with the limited API). Bumped the major ABI version number.
+ [5e9de8cde212]
+
+2016-08-24 Phil Thompson <phil at riverbankcomputing.com>
+
+ * sipgen/gencode.c, sipgen/metasrc/lexer.l, sipgen/metasrc/parser.y,
+ sipgen/sip.h.in, siplib/sip.h.in.in, siplib/siplib.c.in,
+ sphinx/directives.rst:
+ Added the use_limited_api argument to the %Module directive. Changed
+ the API of %BIGetBufferCode when using the limited API.
+ [10d7121c07e3]
+
+2016-08-23 Phil Thompson <phil at riverbankcomputing.com>
+
+ * rbproduct.py:
+ Merged the 4.18-maint branch into the trunk.
+ [d92384aa5baf]
+
+ * sipgen/gencode.c:
+ Fixed the handling of global unsigned constants.
+ [a45bec408ec2] <4.18-maint>
+
+ * sphinx/conf.py.in:
+ Fixed the copyright notice in the docs.
+ [17475357a153] <4.18-maint>
+
+2016-08-08 Phil Thompson <phil at riverbankcomputing.com>
+
+ * README, build.py:
+ Removed the old internal build system leaving the minimum needed to
+ build from hg without the new build system.
+ [dbbced5689a8] <4.18-maint>
+
2016-07-25 Phil Thompson <phil at riverbankcomputing.com>
* .hgtags:
Added tag 4.18.1 for changeset 81021a5690ce
- [8f5b6c8fe5f1] [tip] <4.18-maint>
+ [8f5b6c8fe5f1] <4.18-maint>
* NEWS:
Released as v4.18.1.
diff --git a/NEWS b/NEWS
index 3c07b64..2d553e7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,28 @@
+v4.19 25th December 2016
+ - Added support for the 'final' keyword.
+ - Added the 'use_limited_api' argument to the %Module directive.
+ - Added the %HideNamespace directive.
+ - Added the assign() function to the sip module.
+ - Added sipCallProcedureMethod() to the C API.
+ - Added sipCheckPluginForType() to the C API.
+ - Added sipGetBufferInfo() and sipReleaseBufferInfo() to the C API.
+ - Added sipGetCFunction() to the C API.
+ - Added sipGetDate() and sipFromDate() to the C API.
+ - Added sipGetDatetime() and sipFromDatetime() to the C API.
+ - Added sipGetFrame() to the C API.
+ - Added sipGetMethod() and sipFromMethod() to the C API.
+ - Added sipGetTime() and sipFromTime() to the C API.
+ - Added sipGetTypeUserData() and sipSetTypeUserData() to the C API.
+ - Added sipGetUserObject() and sipSetUserObject() to the C API.
+ - Added sipIsUserType() to the C API.
+ - Added sipPyTypeDict() and sipPyTypeName() to the C API.
+ - Added sipSetNewUserTypeHandler() to the C API.
+ - Added sipUnicodeData(), sipUnicodeNew() and sipUnicodeWrite() to the C
+ API.
+ - Removed the support for module version numbers.
+ - Removed all code generator support for PyQt3.
+ - Bug fixes.
+
v4.18.1 25th July 2016
- Bug fixes.
diff --git a/README b/README
index e9adfeb..59f3c1c 100644
--- a/README
+++ b/README
@@ -25,9 +25,4 @@ To prepare run the following::
python build.py prepare
-Note that ``build.py`` is a Python v2 script.
-
Now you can follow the normal installation instructions.
-
-The ``build.py`` script has other useful commands, use the ``--help`` option to
-see the details.
diff --git a/configure.py b/configure.py
index a88443e..4a1fba8 100644
--- a/configure.py
+++ b/configure.py
@@ -30,8 +30,8 @@ import siputils
# Initialise the globals.
-sip_version = 0x041201
-sip_version_str = "4.18.1"
+sip_version = 0x041300
+sip_version_str = "4.19"
py_version = sys.hexversion >> 8
py_platform = sys.platform
plat_py_site_dir = None
@@ -729,10 +729,11 @@ def create_optparser(sdk_dir):
metavar="DIR", dest="sipsipdir", callback=store_abspath,
help="where .sip files are normally installed [default: "
"%s]" % plat_sip_dir)
- g.add_option("--no-pyi", action="store_false", default=True, dest="pyi",
+ g.add_option("--no-stubs", "--no-pyi", action="store_false", default=True,
+ dest="pyi",
help="do not install the sip.pyi stub file")
- g.add_option("--pyidir", action="callback", type="string", metavar="DIR",
- dest="pyidir", callback=store_abspath,
+ g.add_option("--stubsdir", "--pyidir", action="callback", type="string",
+ metavar="DIR", dest="pyidir", callback=store_abspath,
help="where the sip.pyi stub file will be installed [default: "
"%s]" % plat_py_site_dir)
p.add_option_group(g)
diff --git a/sipgen/export.c b/sipgen/export.c
index 909348c..e402a48 100644
--- a/sipgen/export.c
+++ b/sipgen/export.c
@@ -963,6 +963,10 @@ static const char *pyType(sipSpec *pt, argDef *ad, int sec, classDef **scope)
break;
case ustring_type:
+ /* Correct for Python v3. */
+ type_name = "bytes";
+ break;
+
case string_type:
case sstring_type:
case wstring_type:
diff --git a/sipgen/gencode.c b/sipgen/gencode.c
index c5707ef..2cac9ef 100644
--- a/sipgen/gencode.c
+++ b/sipgen/gencode.c
@@ -89,12 +89,11 @@ static void generateModDocstring(moduleDef *mod, FILE *fp);
static void generateIfaceCpp(sipSpec *, ifaceFileDef *, int, const char *,
const char *, FILE *, int);
static void generateMappedTypeCpp(mappedTypeDef *mtd, sipSpec *pt, FILE *fp);
-static void generateImportedMappedTypeAPI(mappedTypeDef *mtd, sipSpec *pt,
- moduleDef *mod, FILE *fp);
+static void generateImportedMappedTypeAPI(mappedTypeDef *mtd, moduleDef *mod,
+ FILE *fp);
static void generateMappedTypeAPI(sipSpec *pt, mappedTypeDef *mtd, FILE *fp);
static void generateClassCpp(classDef *cd, sipSpec *pt, FILE *fp);
-static void generateImportedClassAPI(classDef *cd, sipSpec *pt, moduleDef *mod,
- FILE *fp);
+static void generateImportedClassAPI(classDef *cd, moduleDef *mod, FILE *fp);
static void generateClassAPI(classDef *cd, sipSpec *pt, FILE *fp);
static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd,
FILE *fp);
@@ -120,25 +119,22 @@ static void gc_ellipsis(signatureDef *sd, FILE *fp);
static void generateCallArgs(moduleDef *, signatureDef *, signatureDef *,
FILE *);
static void generateCalledArgs(moduleDef *, ifaceFileDef *, signatureDef *,
- funcArgType, int, FILE *);
+ funcArgType, FILE *);
static void generateVariable(moduleDef *, ifaceFileDef *, argDef *, int,
FILE *);
static void generateNamedValueType(ifaceFileDef *, argDef *, char *, FILE *);
-static void generateBaseType(ifaceFileDef *, argDef *, int, FILE *);
+static void generateBaseType(ifaceFileDef *, argDef *, int, int, FILE *);
static void generateNamedBaseType(ifaceFileDef *, argDef *, const char *, int,
- FILE *);
+ int, FILE *);
static void generateTupleBuilder(moduleDef *, signatureDef *, FILE *);
-static void generatePyQt3Emitters(moduleDef *mod, classDef *cd, FILE *fp);
-static void generatePyQt3Emitter(moduleDef *, classDef *, visibleList *,
- FILE *);
-static void generatePyQt5Emitters(moduleDef *mod, classDef *cd, FILE *fp);
+static void generatePyQt5Emitters(classDef *cd, FILE *fp);
static void generateVirtualHandler(moduleDef *mod, virtHandlerDef *vhd,
FILE *fp);
static void generateDefaultInstanceReturn(argDef *res, const char *indent,
FILE *fp);
-static void generateVirtualCatcher(sipSpec *pt, moduleDef *mod, classDef *cd,
- int virtNr, virtOverDef *vod, FILE *fp);
-static void generateVirtHandlerCall(sipSpec *pt, moduleDef *mod, classDef *cd,
+static void generateVirtualCatcher(moduleDef *mod, classDef *cd, int virtNr,
+ virtOverDef *vod, FILE *fp);
+static void generateVirtHandlerCall(moduleDef *mod, classDef *cd,
virtOverDef *vod, argDef *res, const char *indent, FILE *fp);
static void generateProtectedEnums(sipSpec *, classDef *, FILE *);
static void generateProtectedDeclarations(classDef *, FILE *);
@@ -232,7 +228,8 @@ static FILE *createFile(moduleDef *mod, const char *fname,
static void closeFile(FILE *);
static void prScopedName(FILE *fp, scopedNameDef *snd, char *sep);
static void prTypeName(FILE *fp, argDef *ad);
-static void prScopedClassName(FILE *fp, ifaceFileDef *scope, classDef *cd);
+static void prScopedClassName(FILE *fp, ifaceFileDef *scope, classDef *cd,
+ int remove_global_scope);
static int isMultiArgSlot(memberDef *md);
static int isIntArgSlot(memberDef *md);
static int isInplaceSequenceSlot(memberDef *md);
@@ -265,14 +262,14 @@ static const char *resultOwner(overDef *od);
static void prCachedName(FILE *fp, nameDef *nd, const char *prefix);
static void generateSignalTableEntry(sipSpec *pt, classDef *cd, overDef *sig,
memberDef *md, int membernr, int optional_args, FILE *fp);
-static void generateTypesTable(sipSpec *pt, moduleDef *mod, FILE *fp);
+static void generateTypesTable(moduleDef *mod, FILE *fp);
static int py2OnlySlot(slotType st);
static int py2_5LaterSlot(slotType st);
static int keepPyReference(argDef *ad);
static int isDuplicateProtected(classDef *cd, overDef *target);
static char getEncoding(argType atype);
static void generateTypeDefName(ifaceFileDef *iff, FILE *fp);
-static void generateTypeDefLink(sipSpec *pt, ifaceFileDef *iff, FILE *fp);
+static void generateTypeDefLink(ifaceFileDef *iff, FILE *fp);
static int overloadHasDocstring(sipSpec *pt, overDef *od, memberDef *md);
static int hasDocstring(sipSpec *pt, overDef *od, memberDef *md,
ifaceFileDef *scope);
@@ -284,10 +281,15 @@ static void generateClassDocstring(sipSpec *pt, classDef *cd, FILE *fp);
static void generateExplicitDocstring(codeBlockList *cbl, FILE *fp);
static int copyConstRefArg(argDef *ad);
static void generatePreprocLine(int linenr, const char *fname, FILE *fp);
-static virtErrorHandler *getVirtErrorHandler(sipSpec *pt, overDef *od,
- classDef *cd, moduleDef *mod);
static int hasOptionalArgs(overDef *od);
static int emptyIfaceFile(sipSpec *pt, ifaceFileDef *iff);
+static void declareLimitedAPI(moduleDef *mod, FILE *fp);
+static int generatePluginSignalsTable(sipSpec *pt, classDef *cd,
+ const char *pyqt_prefix, FILE *fp);
+static int generatePyQt5ClassPlugin(sipSpec *pt, classDef *cd, FILE *fp);
+static int generatePyQt4ClassPlugin(sipSpec *pt, classDef *cd, FILE *fp);
+static void generateGlobalFunctionTableEntries(sipSpec *pt, moduleDef *mod,
+ memberDef *members, FILE *fp);
/*
@@ -485,7 +487,7 @@ void generateExpression(valueDef *vd, int in_str, FILE *fp)
case scoped_value:
if (prcode_xml)
- prScopedName(fp, vd->u.vscp, ".");
+ prScopedName(fp, removeGlobalScope(vd->u.vscp), ".");
else
prcode(fp, "%S", vd->u.vscp);
@@ -528,12 +530,16 @@ static void generateInternalAPIHeader(sipSpec *pt, moduleDef *mod,
"\n"
"#ifndef _%sAPI_H\n"
"#define _%sAPI_H\n"
-"\n"
-"\n"
-"#include <sip.h>\n"
, mname
, mname);
+ declareLimitedAPI(mod, fp);
+
+ prcode(fp,
+"\n"
+"#include <sip.h>\n"
+ );
+
if (pluginPyQt4(pt) || pluginPyQt5(pt))
prcode(fp,
"\n"
@@ -597,15 +603,6 @@ static void generateInternalAPIHeader(sipSpec *pt, moduleDef *mod,
"\n"
);
- generateCppCodeBlock(pt->exphdrcode, fp);
- generateCppCodeBlock(mod->hdrcode, fp);
-
- /*
- * Make sure any header code needed by the default exception is included.
- */
- if (mod->defexception != NULL)
- generateCppCodeBlock(mod->defexception->iff->hdrcode, fp);
-
/* Shortcuts that hide the messy detail of the APIs. */
noIntro = TRUE;
@@ -640,6 +637,7 @@ static void generateInternalAPIHeader(sipSpec *pt, moduleDef *mod,
"#define sipFree sipAPI_%s->api_free\n"
"#define sipBuildResult sipAPI_%s->api_build_result\n"
"#define sipCallMethod sipAPI_%s->api_call_method\n"
+"#define sipCallProcedureMethod sipAPI_%s->api_call_procedure_method\n"
"#define sipCallErrorHandler sipAPI_%s->api_call_error_handler\n"
"#define sipParseResultEx sipAPI_%s->api_parse_result_ex\n"
"#define sipParseResult sipAPI_%s->api_parse_result\n"
@@ -735,6 +733,32 @@ static void generateInternalAPIHeader(sipSpec *pt, moduleDef *mod,
"#define sipExportModule sipAPI_%s->api_export_module\n"
"#define sipInitModule sipAPI_%s->api_init_module\n"
"#define sipGetInterpreter sipAPI_%s->api_get_interpreter\n"
+"#define sipSetNewUserTypeHandler sipAPI_%s->api_set_new_user_type_handler\n"
+"#define sipSetTypeUserData sipAPI_%s->api_set_type_user_data\n"
+"#define sipGetTypeUserData sipAPI_%s->api_get_type_user_data\n"
+"#define sipPyTypeDict sipAPI_%s->api_py_type_dict\n"
+"#define sipPyTypeName sipAPI_%s->api_py_type_name\n"
+"#define sipGetCFunction sipAPI_%s->api_get_c_function\n"
+"#define sipGetMethod sipAPI_%s->api_get_method\n"
+"#define sipFromMethod sipAPI_%s->api_from_method\n"
+"#define sipGetDate sipAPI_%s->api_get_date\n"
+"#define sipFromDate sipAPI_%s->api_from_date\n"
+"#define sipGetDateTime sipAPI_%s->api_get_datetime\n"
+"#define sipFromDateTime sipAPI_%s->api_from_datetime\n"
+"#define sipGetTime sipAPI_%s->api_get_time\n"
+"#define sipFromTime sipAPI_%s->api_from_time\n"
+"#define sipIsUserType sipAPI_%s->api_is_user_type\n"
+"#define sipGetFrame sipAPI_%s->api_get_frame\n"
+"#define sipCheckPluginForType sipAPI_%s->api_check_plugin_for_type\n"
+"#define sipUnicodeNew sipAPI_%s->api_unicode_new\n"
+"#define sipUnicodeWrite sipAPI_%s->api_unicode_write\n"
+"#define sipUnicodeData sipAPI_%s->api_unicode_data\n"
+"#define sipGetBufferInfo sipAPI_%s->api_get_buffer_info\n"
+"#define sipReleaseBufferInfo sipAPI_%s->api_release_buffer_info\n"
+"#define sipIsOwnedByPython sipAPI_%s->api_is_owned_by_python\n"
+"#define sipIsDerivedClass sipAPI_%s->api_is_derived_class\n"
+"#define sipGetUserObject sipAPI_%s->api_get_user_object\n"
+"#define sipSetUserObject sipAPI_%s->api_set_user_object\n"
"\n"
"/* These are deprecated. */\n"
"#define sipMapStringToClass sipAPI_%s->api_map_string_to_class\n"
@@ -861,6 +885,33 @@ static void generateInternalAPIHeader(sipSpec *pt, moduleDef *mod,
,mname
,mname
,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
+ ,mname
,mname);
/* The name strings. */
@@ -870,9 +921,6 @@ static void generateInternalAPIHeader(sipSpec *pt, moduleDef *mod,
"extern const char sipStrings_%s[];\n"
, pt->module->name);
- /* The unscoped enum macros. */
- generateEnumMacros(pt, mod, NULL, NULL, fp);
-
generateModuleAPI(pt, mod, fp);
prcode(fp,
@@ -883,13 +931,29 @@ static void generateInternalAPIHeader(sipSpec *pt, moduleDef *mod,
, mname
, mname, mname);
+ if (mod->nr_needed_types > 0)
+ prcode(fp,
+"extern sipTypeDef *sipExportedTypes_%s[];\n"
+ , mname);
+
for (mld = mod->allimports; mld != NULL; mld = mld->next)
{
generateImportedModuleAPI(pt, mod, mld->module, fp);
- prcode(fp,
-"extern const sipExportedModuleDef *sipModuleAPI_%s_%s;\n"
- , mname, mld->module->name);
+ if (mld->module->nr_needed_types > 0)
+ prcode(fp,
+"extern sipImportedTypeDef sipImportedTypes_%s_%s[];\n"
+ , mname, mld->module->name);
+
+ if (mld->module->nrvirterrorhandlers > 0)
+ prcode(fp,
+"extern sipImportedVirtErrorHandlerDef sipImportedVirtErrorHandlers_%s_%s[];\n"
+ , mname, mld->module->name);
+
+ if (mld->module->nrexceptions > 0)
+ prcode(fp,
+"extern sipImportedExceptionDef sipImportedExceptions_%s_%s[];\n"
+ , mname, mld->module->name);
}
if (pluginPyQt4(pt) || pluginPyQt5(pt))
@@ -919,6 +983,16 @@ static void generateInternalAPIHeader(sipSpec *pt, moduleDef *mod,
, mname);
}
+ /* Handwritten code. */
+ generateCppCodeBlock(pt->exphdrcode, fp);
+ generateCppCodeBlock(mod->hdrcode, fp);
+
+ /*
+ * Make sure any header code needed by the default exception is included.
+ */
+ if (mod->defexception != NULL)
+ generateCppCodeBlock(mod->defexception->iff->hdrcode, fp);
+
/*
* Note that we don't forward declare the virtual handlers. This is
* because we would need to #include everything needed for their argument
@@ -963,6 +1037,8 @@ static void generateCompositeCpp(sipSpec *pt, const char *codeDir,
fp = createCompilationUnit(pt->module, cppfile, "Composite module code.",
timestamp);
+ declareLimitedAPI(NULL, fp);
+
prcode(fp,
"\n"
"#include <Python.h>\n"
@@ -1326,12 +1402,13 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir,
{
char *cppfile;
const char *mname = mod->name;
- int nrSccs = 0, files_in_part, max_per_part, this_part, mod_nr, enum_idx;
+ int nrSccs = 0, files_in_part, max_per_part, this_part, enum_idx;
int is_inst_class, is_inst_voidp, is_inst_char, is_inst_string;
int is_inst_int, is_inst_long, is_inst_ulong, is_inst_longlong;
int is_inst_ulonglong, is_inst_double, nr_enummembers, is_api_versions;
int is_versioned_functions;
int hasexternal = FALSE, slot_extenders = FALSE, ctor_extenders = FALSE;
+ int hasvirterrorhandlers = FALSE;
FILE *fp;
moduleListDef *mld;
classDef *cd;
@@ -1398,12 +1475,12 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir,
generateCppCodeBlock(mod->cppcode, fp);
/* Generate any virtual handlers. */
- for (vhd = mod->virthandlers; vhd != NULL; vhd = vhd->next)
- if (!isDuplicateVH(vhd))
- generateVirtualHandler(mod, vhd, fp);
+ for (vhd = pt->virthandlers; vhd != NULL; vhd = vhd->next)
+ generateVirtualHandler(mod, vhd, fp);
/* Generate any virtual error handlers. */
for (veh = pt->errorhandlers; veh != NULL; veh = veh->next)
+ {
if (veh->mod == mod)
{
prcode(fp,
@@ -1419,11 +1496,15 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir,
"}\n"
);
}
+ }
/* Generate the global functions. */
for (md = mod->othfuncs; md != NULL; md = md->next)
+ {
if (md->slot == no_slot)
+ {
generateOrdinaryFunction(pt, mod, NULL, NULL, md, fp);
+ }
else
{
overDef *od;
@@ -1433,13 +1514,29 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir,
* them all to classes.
*/
for (od = mod->overs; od != NULL; od = od->next)
+ {
if (od->common == md)
{
generateSlot(mod, NULL, NULL, md, fp);
slot_extenders = TRUE;
break;
}
+ }
+ }
+ }
+
+ /* Generate the global functions for any hidden namespaces. */
+ for (cd = pt->classes; cd != NULL; cd = cd->next)
+ {
+ if (cd->iff->module == mod && isHiddenNamespace(cd))
+ {
+ for (md = cd->members; md != NULL; md = md->next)
+ {
+ if (md->slot == no_slot)
+ generateOrdinaryFunction(pt, mod, cd, NULL, md, fp);
+ }
}
+ }
/* Generate any class specific ctor or slot extenders. */
for (cd = mod->proxies; cd != NULL; cd = cd->next)
@@ -1602,7 +1699,7 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir,
prcode(fp,
" {%d, \"", cd->iff->ifacenr);
- prScopedName(fp, classFQCName(cd), ".");
+ prScopedName(fp, removeGlobalScope(classFQCName(cd)), ".");
prcode(fp,"\"},\n"
);
}
@@ -1713,7 +1810,7 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir,
else
prcode(fp, "0");
- prcode(fp, ", 0, SIP_TYPE_ENUM, %n, {0}}, %n, %d, ", ed->cname, ed->pyname, type_nr);
+ prcode(fp, ", 0, SIP_TYPE_ENUM, %n, {0}, 0}, %n, %d, ", ed->cname, ed->pyname, type_nr);
if (ed->slots != NULL)
prcode(fp, "slots_%C", ed->fqcname);
@@ -1732,8 +1829,8 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir,
nr_enummembers = generateEnumMemberTable(pt, mod, NULL, NULL, fp);
/* Generate the types table. */
- if (mod->nrtypes > 0)
- generateTypesTable(pt, mod, fp);
+ if (mod->nr_needed_types > 0)
+ generateTypesTable(mod, fp);
if (mod->nrtypedefs > 0)
{
@@ -1754,7 +1851,7 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir,
continue;
prcode(fp,
-" {\"%S\", \"", td->fqname);
+" {\"%V\", \"", td->fqname);
/* The default behaviour isn't right in a couple of cases. */
if (td->type.atype == longlong_type)
@@ -1762,7 +1859,7 @@ static void generateCpp(sipSpec *pt, moduleDef *mod, const char *codeDir,
else if (td->type.atype == ulonglong_type)
prcode(fp, "unsigned long long");
else
- generateBaseType(NULL, &td->type, FALSE, fp);
+ generateBaseType(NULL, &td->type, FALSE, TRUE, fp);
... 20999 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/sip4.git
More information about the Python-modules-commits
mailing list