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
Jack Jansen
89dbd97279
Some structures should be passed to Py_BuildValue by reference, not by value,
...
notably FSSpec and FSRef objects. First half of fix for #531291 .
2.2.1 candidate.
2002-03-18 15:24:22 +00:00
Jack Jansen
dcfc20282b
Added some support for Uicode arguments. Still leaves something to be desired, especially because of poor unicode support in PyArg_ParseTuple.
2002-01-01 22:40:08 +00:00
Jack Jansen
f1472384dc
Updated to current pathnames.
2002-01-01 22:39:07 +00:00
Jack Jansen
6f4f8c7fe1
Small change to allow for generation of QuickTime module for Windows.
2001-12-18 15:48:28 +00:00
Just van Rossum
b48f1d3f8a
OSX tweak: recognize both EXTERN_API_C and EXTERN_API declarations.
...
Jack: I hope I didn't break anything for you!
2001-12-12 20:51:22 +00:00
Jack Jansen
5801a2d8e3
The module generator now tells its object generators about the module name (through the new setmodulename() method). If the module name has been set the object generators output it as part of the tp_name field for the object type.
2001-12-09 23:25:00 +00:00
Jack Jansen
b3be216b41
Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
...
changes from start of branch upto r22b2 were already merged, of course).
2001-11-30 14:16:36 +00:00
Jack Jansen
1062e706e5
Don't initialize tp_type statically, it won't work on Windows. Spotted
...
by Thomas Heller (patch 459442).
2001-11-14 15:48:13 +00:00
Jack Jansen
fc6a89270e
Don't override asplit_pat in Scanner_UH3. No reason to do so, and it broke
...
generating Waste.
2001-10-30 13:11:24 +00:00
Jack Jansen
5a1516bce5
Only output the buffer size error label if it is used.
...
Shuts up another couple of gcc warnings.
2001-09-05 10:27:53 +00:00
Jack Jansen
d157b3795b
Don't use a default "int" return type, gcc gives a warning about it.
2001-09-04 22:16:33 +00:00
Jack Jansen
9403591014
Fixes by Thomas Heller:
...
- make the selftests work again (they were apparently not used since
very early in bgen's development), with some minor cleanup by me
- make emacs python mode happier
2001-08-27 14:30:55 +00:00
Jack Jansen
3d3a91c188
Oops, left in a debug statement. It's gone now.
2001-07-17 20:44:50 +00:00
Jack Jansen
b2a1de4679
Allow [] after a parameter name. We currently take this to be the same as * in front, which isn't 100% correct but good enough.
2001-07-13 22:28:36 +00:00
Jack Jansen
eefac35594
Added WeakLink...Generator classes (should have done that ages ago). These check the c-function pointer for being NULL before calling it and raise UnimplementedError if it is.
...
This allows system libs to be weak-linked, thereby allowing us to generate functions that are only available on some OS versions without getting a NULL dereference if the function isn't available.
2001-07-01 22:09:29 +00:00
Jack Jansen
1319abf745
Make basechain a class variable in stead of initializing it in __init__. That way it's more easily overridden.
2001-06-28 22:07:30 +00:00
Jack Jansen
4f0f1584fb
Added a couple more types that Apple has taken a fancy to.
2001-06-27 21:58:40 +00:00
Jack Jansen
ff1cc902fe
Added a Parser_OSX class that can parse new-style (C-only) headers,
...
such as the Core Foundation ones.
2001-06-26 21:53:25 +00:00
Jack Jansen
656fe69383
Generate prototype-style function headers in stead of K&R style. Makes life easier with gcc -Wstrict-function-prototypes.
2001-05-19 13:59:18 +00:00
Jack Jansen
8a69373664
Dialog and Window objects are (finally) different beasts.
2001-02-27 11:05:00 +00:00
Jack Jansen
d67566b0f0
Use the filename, not the pathname, in the definitions file
...
comment. This way the generated files are identical when generated on
different machines.
2001-02-27 11:04:20 +00:00
Jack Jansen
27489d4c8c
Optionally weed out duplicate prototypes for the same function (which
...
happens because the scanner ignores preprocessor #ifs).
2000-12-12 22:24:35 +00:00
Jack Jansen
c1a4a04792
Adapted to new standard for initmodule() routine: don't call
...
Py_FatalError on errors.
2000-12-12 22:22:59 +00:00
Jack Jansen
7e0c0050a8
Various new standard types.
2000-12-12 22:21:39 +00:00
Jack Jansen
b8c68634b3
Added support for generating a single module from multiple .h files.
...
Allow /* */ comments within function prototypes.
2000-12-12 22:21:11 +00:00
Jack Jansen
c8081e9bfa
Modified the standard mac preamble so we include pymactoolbox.h in
...
stead of defining lots of function prototypes in each module.
2000-07-15 22:29:30 +00:00
Jack Jansen
629eee0636
ScannerPREUH3.initpatterns() should call Scanner.initpatterns() so the
...
new comment patterns get included.
2000-07-15 22:27:47 +00:00
Jack Jansen
e3889da076
Make a distinction between shorts and unsigned shorts.
2000-07-06 15:17:52 +00:00