Commit Graph

122 Commits

Author SHA1 Message Date
Jack Jansen 09eef173b2 Enable optional "const" argument to _New routines. 2005-11-21 13:24:25 +00:00
Jack Jansen 2190f8c47e Added a class MallocHeapOutputBufferType for types that are passed
as &buffer, &size and allocated by the called function.
2005-09-20 21:11:19 +00:00
Jack Jansen b53355ad77 Added support for (optionally) bracketing calls with
Py_{BEGIN,END}_ALLOW_THREADS.
2005-09-20 15:13:53 +00:00
Tim Peters f5f32b4712 Whitespace normalization. 2005-07-17 23:16:17 +00:00
Jack Jansen 149787e7c5 Added an option to the scanner to generated marked-up HTML from the input
file. This should make it a lot easier (I hope) to get the regular
expressions right.
2005-07-17 00:15:46 +00:00
Tim Peters 7d66b00f29 Whitespace normalization. 2005-07-10 20:37:51 +00:00
Jack Jansen 6d394d9b68 Handle argref so it can be overridden more easily in a subclass. 2005-07-08 15:03:37 +00:00
Jack Jansen 0257424a2a Allow for (optional) const declaration. 2005-07-05 10:00:57 +00:00
Jack Jansen a6af76cbe4 Factored out the code that creates argument lists and formats for PyArg_Parse
and Py_BuildValue.
2005-07-03 20:58:08 +00:00
Jack Jansen 7b8f0a1843 Sigh, changed the argument names in the tp_init function: to make them be
more in line with other methods "self" and "args" had to be renamed "_self"
and "_args". Did "_kwds" too, for consistency.
2005-07-03 20:57:26 +00:00
Jack Jansen a660caf351 Added methods mkvaluePreCheck and getargsPreCheck, which are called (for
each variable) before calling Py_BuildValue and PyArg_Parse.
2005-07-01 20:23:27 +00:00
Jack Jansen 62cc1233f9 More factorization: added a method getrvforcallit(). This allows a C++
bridge to combine declaration and assignment to the return value
temporary, allowing us to handle functions returning const values.
2005-06-30 15:00:13 +00:00
Jack Jansen d4128f397d Added optional suppport for storage modifiers (virtual/static/inline/etc)
and conditional generation of objects and methods.
2005-06-29 14:17:05 +00:00
Jack Jansen b6216dd2e7 More factorization to help C++ support. 2005-06-28 15:14:35 +00:00
Tim Peters 527c46996f Normalize whitespace to avoid offending Bug Day volunteers. 2005-06-24 19:46:53 +00:00
Jack Jansen c700110735 Added a missing newline Output(). 2005-06-23 22:32:59 +00:00
Jack Jansen ab16c35f46 Revamped type declaration so the basic routines return a list of strings.
This allows variables to be declared as formal arguments. The bgenType.declare
method now simply outputs all declarations on separate lines ending
in semicolons.
2005-06-22 20:35:23 +00:00
Jack Jansen 8ceeaba012 Added support for optional modifiers to functions/methods (such as C++ const,
static for methods, inline, etc).
2005-06-21 20:54:51 +00:00
Jack Jansen 2ab0ae6a54 More factorization. 2005-06-16 21:26:24 +00:00
Jack Jansen d6d2c0d08b More tweaks for C++ support. Still doesn't seem to break anything:-) 2005-06-14 21:32:51 +00:00
Jack Jansen bf7255fffb Minor tweaks, to allow some (out-of-tree, until successful) tinkering
with C++.
2005-06-10 10:46:40 +00:00
Tim Peters 182b5aca27 Whitespace normalization, via reindent.py. 2004-07-18 06:16:08 +00:00
Jack Jansen c572e42fb4 Call the correct tp_dealloc. 2004-07-15 21:24:07 +00:00
Walter Dörwald 70a6b49821 Replace backticks with repr() or "%r"
From SF patch #852334.
2004-02-12 17:35:32 +00:00
Jack Jansen 7107c1aff3 Got rid of macglue.h, replacing it by pymactoolbox.h where relevant.
Cleaned up various things in the toolbox modules.
2003-11-20 13:31:00 +00:00
Walter Dörwald f0dfc7ac5c Fix a bunch of typos in documentation, docstrings and comments.
(From SF patch #810751)
2003-10-20 14:01:56 +00:00
Jack Jansen c9713874ba Updated the doc strings to refer to PyArg_Parse and Py_BuildValue in stead
of getargs() and mkvalue().
2003-01-24 09:23:13 +00:00
Jack Jansen 2cf08ab4c2 Sigh, due to sloppiness on my part bgen has become pretty mixed up wrt. tabs
and spaces. Detabbed the lot.
2003-01-19 21:53:57 +00:00
Jack Jansen 15721c5c45 Oops, old-style types don't have a tp_free slot. Call PyObject_Free
directly in that case.
2002-12-23 22:33:49 +00:00
Jack Jansen 77e8ad4684 Always use self->ob_type->tp_free when freeing an object. 2002-12-19 23:34:40 +00:00
Jack Jansen 5bb2f6497f Always output an inheritance-aware version of the xxxx_Check() macro. Also
fixed that macro to actually work:-)
2002-12-19 20:37:32 +00:00
Jack Jansen ff38505f1a Added an optional longname argument to Module, which gives the full,
externally visible name of the module. This is so that type names can be
shown as "Carbon.File.FSSpec" even though the real name of the module is
"_File".
2002-12-17 22:08:48 +00:00
Jack Jansen dd888a6cff Fixed typo. 2002-12-05 23:20:12 +00:00
Jack Jansen 99899b92b8 Added PEP253 support. 2002-12-03 23:35:22 +00:00
Jack Jansen 27a4450239 Fixed two silly bugs in the PEP252 support code, added an assert
that basechain isn't set, and made the output a bit prettier.
2002-11-28 23:23:14 +00:00
Jack Jansen 3d654d6dff Added a class PEP252Mixin. By adding this to your ObjectDefinition you
get PEP-252 style objects in stead of old-fashioned objects.
In stead of defining a GetattrHook you declare a class variable getsetlist,
which contains tuples (name, getcode, setcode, docstring).
Only lightly tested: the code still works if you don't inherit PEP252Mixin
and the code works if you inherit it but don't define any getters
or setters. Also, this will not work together with the "poor mans inheritance"
offered by method chains, so the CF module will remain with old-style
objects until PEP253 is supported too.
2002-11-25 16:36:49 +00:00
Walter Dörwald aaab30e00c Apply diff2.txt from SF patch http://www.python.org/sf/572113
(with one small bugfix in bgen/bgen/scantools.py)

This replaces string module functions with string methods
for the stuff in the Tools directory. Several uses of
string.letters etc. are still remaining.
2002-09-11 20:36:02 +00:00
Jack Jansen f34a8bced2 Moved CoreFoundation type support to bgen/macsupport. 2002-08-22 23:30:49 +00:00
Jack Jansen 44b99e0a1f iUse PyDoc_STR() around docstrings. 2002-08-16 09:07:42 +00:00
Jack Jansen 11845e00b2 Be a lot less verbose by default. 2002-08-05 21:15:22 +00:00
Jack Jansen ac7cb05415 Fixed to run better in unix-Python, and to cater for bgenlocations
possibly being missing.
2002-08-05 15:32:30 +00:00
Jack Jansen 6573f31874 Moved bgenlocations to the Mac/Lib directory. Not perfect, but better than
where it was: it is really a configuration file, not a normal module.

By moving it into Mac/Lib we can now also store the location of bgen
itself in there, which is needed because bgen isn't installed.
2002-08-05 14:56:04 +00:00
Jack Jansen 7ea8143fe5 Specify pathnames in a way that works on both OS9 and OSX.
You'll still have to manually edit it, though...
2002-08-04 21:56:12 +00:00
Jack Jansen bae7734eef Use universal newline input when scanning header files. 2002-08-04 21:55:25 +00:00
Jeremy Hylton 938ace69a0 staticforward bites the dust.
The staticforward define was needed to support certain broken C
compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the
static keyword when it was used with a forward declaration of a static
initialized structure.  Standard C allows the forward declaration with
static, and we've decided to stop catering to broken C compilers.  (In
fact, we expect that the compilers are all fixed eight years later.)

I'm leaving staticforward and statichere defined in object.h as
static.  This is only for backwards compatibility with C extensions
that might still use it.

XXX I haven't updated the documentation.
2002-07-17 16:30:39 +00:00
Just van Rossum ec5d6b908c escape 8-bit chars when generating .py files. fixes bug #566302 2002-06-09 09:08:53 +00:00
Jack Jansen 3adf8d1dae Converted to use re in stead of regex and regsub (finally:-). 2002-04-23 22:43:37 +00:00
Jack Jansen a6aa71deec Oops: we used PyMem_DEL() to clean up objects, and that's a problem since
pymalloc, apparently. Fixed, but this means all bgen-generated modules will
have to be re-generated.

I hope (and expect) that the pymalloc fixes aren't bugfix candidates, because
if they are this is one too.
2002-04-19 14:29:47 +00:00
Jack Jansen ededa90f67 - Added support for inherent pointer types (typedefs of arrays)
- Added a debug class variable to enable parser debugging.
2002-04-12 13:21:49 +00:00
Jack Jansen da70485694 Give type name when complaining about using input-only type for output
or v.v.
2002-04-12 13:14:54 +00:00