annotate Mac/Modules/cf/_CFmodule.c @ 27998:e27f58a50737 legacy-trunk

SF bug #690377: Dud footnote reference in distutils docs
author Raymond Hettinger <python@rcn.com>
date Fri, 21 Feb 2003 02:47:09 +0000
parents ad263d268255
children f9b702c52dae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2 /* =========================== Module _CF =========================== */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4 #include "Python.h"
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
5
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
6
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
7
21464
b27599abcc49 Updated to Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
8 #ifdef _WIN32
b27599abcc49 Updated to Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
9 #include "pywintoolbox.h"
b27599abcc49 Updated to Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
10 #else
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
11 #include "macglue.h"
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
12 #include "pymactoolbox.h"
21464
b27599abcc49 Updated to Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
13 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
14
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
15 /* Macro to test whether a weak-loaded CFM function exists */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
16 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
17 PyErr_SetString(PyExc_NotImplementedError, \
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
18 "Not available in this shared library/OS version"); \
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
19 return NULL; \
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
20 }} while(0)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
21
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
22
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
23 #ifdef WITHOUT_FRAMEWORKS
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
24 #include <CFBase.h>
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
25 #include <CFArray.h>
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
26 #include <CFData.h>
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
27 #include <CFDictionary.h>
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
28 #include <CFString.h>
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
29 #include <CFURL.h>
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
30 #include <CFPropertyList.h>
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
31 #include <CFPreferences.h>
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
32 #else
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
33 #include <CoreServices/CoreServices.h>
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
34 #endif
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
35
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
36 #include "pycfbridge.h"
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
37
20877
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
38 #ifdef USE_TOOLBOX_OBJECT_GLUE
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
39 extern PyObject *_CFTypeRefObj_New(CFTypeRef);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
40 extern int _CFTypeRefObj_Convert(PyObject *, CFTypeRef *);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
41 #define CFTypeRefObj_New _CFTypeRefObj_New
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
42 #define CFTypeRefObj_Convert _CFTypeRefObj_Convert
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
43
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
44 extern PyObject *_CFStringRefObj_New(CFStringRef);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
45 extern int _CFStringRefObj_Convert(PyObject *, CFStringRef *);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
46 #define CFStringRefObj_New _CFStringRefObj_New
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
47 #define CFStringRefObj_Convert _CFStringRefObj_Convert
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
48
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
49 extern PyObject *_CFMutableStringRefObj_New(CFMutableStringRef);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
50 extern int _CFMutableStringRefObj_Convert(PyObject *, CFMutableStringRef *);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
51 #define CFMutableStringRefObj_New _CFMutableStringRefObj_New
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
52 #define CFMutableStringRefObj_Convert _CFMutableStringRefObj_Convert
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
53
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
54 extern PyObject *_CFArrayRefObj_New(CFArrayRef);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
55 extern int _CFArrayRefObj_Convert(PyObject *, CFArrayRef *);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
56 #define CFArrayRefObj_New _CFArrayRefObj_New
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
57 #define CFArrayRefObj_Convert _CFArrayRefObj_Convert
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
58
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
59 extern PyObject *_CFMutableArrayRefObj_New(CFMutableArrayRef);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
60 extern int _CFMutableArrayRefObj_Convert(PyObject *, CFMutableArrayRef *);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
61 #define CFMutableArrayRefObj_New _CFMutableArrayRefObj_New
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
62 #define CFMutableArrayRefObj_Convert _CFMutableArrayRefObj_Convert
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
63
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
64 extern PyObject *_CFDataRefObj_New(CFDataRef);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
65 extern int _CFDataRefObj_Convert(PyObject *, CFDataRef *);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
66 #define CFDataRefObj_New _CFDataRefObj_New
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
67 #define CFDataRefObj_Convert _CFDataRefObj_Convert
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
68
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
69 extern PyObject *_CFMutableDataRefObj_New(CFMutableDataRef);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
70 extern int _CFMutableDataRefObj_Convert(PyObject *, CFMutableDataRef *);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
71 #define CFMutableDataRefObj_New _CFMutableDataRefObj_New
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
72 #define CFMutableDataRefObj_Convert _CFMutableDataRefObj_Convert
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
73
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
74 extern PyObject *_CFDictionaryRefObj_New(CFDictionaryRef);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
75 extern int _CFDictionaryRefObj_Convert(PyObject *, CFDictionaryRef *);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
76 #define CFDictionaryRefObj_New _CFDictionaryRefObj_New
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
77 #define CFDictionaryRefObj_Convert _CFDictionaryRefObj_Convert
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
78
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
79 extern PyObject *_CFMutableDictionaryRefObj_New(CFMutableDictionaryRef);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
80 extern int _CFMutableDictionaryRefObj_Convert(PyObject *, CFMutableDictionaryRef *);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
81 #define CFMutableDictionaryRefObj_New _CFMutableDictionaryRefObj_New
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
82 #define CFMutableDictionaryRefObj_Convert _CFMutableDictionaryRefObj_Convert
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
83
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
84 extern PyObject *_CFURLRefObj_New(CFURLRef);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
85 extern int _CFURLRefObj_Convert(PyObject *, CFURLRef *);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
86 extern int _OptionalCFURLRefObj_Convert(PyObject *, CFURLRef *);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
87 #define CFURLRefObj_New _CFURLRefObj_New
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
88 #define CFURLRefObj_Convert _CFURLRefObj_Convert
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
89 #define OptionalCFURLRefObj_Convert _OptionalCFURLRefObj_Convert
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
90 #endif
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
91
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
92 /*
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
93 ** Parse/generate CFRange records
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
94 */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
95 PyObject *CFRange_New(CFRange *itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
96 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
97
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
98 return Py_BuildValue("ll", (long)itself->location, (long)itself->length);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
99 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
100
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
101 int
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
102 CFRange_Convert(PyObject *v, CFRange *p_itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
103 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
104 long location, length;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
105
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
106 if( !PyArg_ParseTuple(v, "ll", &location, &length) )
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
107 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
108 p_itself->location = (CFIndex)location;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
109 p_itself->length = (CFIndex)length;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
110 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
111 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
112
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
113 /* Optional CFURL argument or None (passed as NULL) */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
114 int
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
115 OptionalCFURLRefObj_Convert(PyObject *v, CFURLRef *p_itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
116 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
117 if ( v == Py_None ) {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
118 p_itself = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
119 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
120 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
121 return CFURLRefObj_Convert(v, p_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
122 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
123
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
124
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
125 static PyObject *CF_Error;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
126
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
127 /* --------------------- Object type CFTypeRef ---------------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
128
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
129 PyTypeObject CFTypeRef_Type;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
130
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
131 #define CFTypeRefObj_Check(x) ((x)->ob_type == &CFTypeRef_Type || PyObject_TypeCheck((x), &CFTypeRef_Type))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
132
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
133 typedef struct CFTypeRefObject {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
134 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
135 CFTypeRef ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
136 void (*ob_freeit)(CFTypeRef ptr);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
137 } CFTypeRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
138
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
139 PyObject *CFTypeRefObj_New(CFTypeRef itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
140 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
141 CFTypeRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
142 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
143 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
144 PyErr_SetString(PyExc_RuntimeError, "cannot wrap NULL");
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
145 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
146 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
147 it = PyObject_NEW(CFTypeRefObject, &CFTypeRef_Type);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
148 if (it == NULL) return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
149 it->ob_itself = itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
150 it->ob_freeit = CFRelease;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
151 return (PyObject *)it;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
152 }
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
153 int CFTypeRefObj_Convert(PyObject *v, CFTypeRef *p_itself)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
154 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
155
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
156 if (v == Py_None) { *p_itself = NULL; return 1; }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
157 /* Check for other CF objects here */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
158
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
159 if (!CFTypeRefObj_Check(v))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
160 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
161 PyErr_SetString(PyExc_TypeError, "CFTypeRef required");
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
162 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
163 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
164 *p_itself = ((CFTypeRefObject *)v)->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
165 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
166 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
167
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
168 static void CFTypeRefObj_dealloc(CFTypeRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
169 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
170 if (self->ob_freeit && self->ob_itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
171 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
172 self->ob_freeit((CFTypeRef)self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
173 }
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
174 PyObject_Free((PyObject *)self);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
175 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
176
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
177 static PyObject *CFTypeRefObj_CFGetTypeID(CFTypeRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
178 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
179 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
180 CFTypeID _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
181 #ifndef CFGetTypeID
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
182 PyMac_PRECHECK(CFGetTypeID);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
183 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
184 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
185 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
186 _rv = CFGetTypeID(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
187 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
188 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
189 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
190 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
191
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
192 static PyObject *CFTypeRefObj_CFRetain(CFTypeRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
193 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
194 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
195 CFTypeRef _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
196 #ifndef CFRetain
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
197 PyMac_PRECHECK(CFRetain);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
198 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
199 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
200 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
201 _rv = CFRetain(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
202 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
203 CFTypeRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
204 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
205 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
206
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
207 static PyObject *CFTypeRefObj_CFRelease(CFTypeRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
208 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
209 PyObject *_res = NULL;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
210 #ifndef CFRelease
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
211 PyMac_PRECHECK(CFRelease);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
212 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
213 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
214 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
215 CFRelease(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
216 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
217 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
218 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
219 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
220
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
221 static PyObject *CFTypeRefObj_CFGetRetainCount(CFTypeRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
222 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
223 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
224 CFIndex _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
225 #ifndef CFGetRetainCount
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
226 PyMac_PRECHECK(CFGetRetainCount);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
227 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
228 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
229 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
230 _rv = CFGetRetainCount(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
231 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
232 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
233 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
234 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
235
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
236 static PyObject *CFTypeRefObj_CFEqual(CFTypeRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
237 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
238 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
239 Boolean _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
240 CFTypeRef cf2;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
241 #ifndef CFEqual
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
242 PyMac_PRECHECK(CFEqual);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
243 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
244 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
245 CFTypeRefObj_Convert, &cf2))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
246 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
247 _rv = CFEqual(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
248 cf2);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
249 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
250 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
251 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
252 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
253
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
254 static PyObject *CFTypeRefObj_CFHash(CFTypeRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
255 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
256 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
257 CFHashCode _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
258 #ifndef CFHash
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
259 PyMac_PRECHECK(CFHash);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
260 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
261 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
262 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
263 _rv = CFHash(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
264 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
265 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
266 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
267 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
268
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
269 static PyObject *CFTypeRefObj_CFCopyDescription(CFTypeRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
270 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
271 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
272 CFStringRef _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
273 #ifndef CFCopyDescription
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
274 PyMac_PRECHECK(CFCopyDescription);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
275 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
276 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
277 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
278 _rv = CFCopyDescription(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
279 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
280 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
281 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
282 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
283
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
284 static PyObject *CFTypeRefObj_CFPropertyListCreateXMLData(CFTypeRefObject *_self, PyObject *_args)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
285 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
286 PyObject *_res = NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
287 CFDataRef _rv;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
288 if (!PyArg_ParseTuple(_args, ""))
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
289 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
290 _rv = CFPropertyListCreateXMLData((CFAllocatorRef)NULL,
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
291 _self->ob_itself);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
292 _res = Py_BuildValue("O&",
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
293 CFDataRefObj_New, _rv);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
294 return _res;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
295 }
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
296
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
297 static PyObject *CFTypeRefObj_CFPropertyListCreateDeepCopy(CFTypeRefObject *_self, PyObject *_args)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
298 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
299 PyObject *_res = NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
300 CFTypeRef _rv;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
301 CFOptionFlags mutabilityOption;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
302 if (!PyArg_ParseTuple(_args, "l",
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
303 &mutabilityOption))
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
304 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
305 _rv = CFPropertyListCreateDeepCopy((CFAllocatorRef)NULL,
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
306 _self->ob_itself,
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
307 mutabilityOption);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
308 _res = Py_BuildValue("O&",
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
309 CFTypeRefObj_New, _rv);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
310 return _res;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
311 }
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
312
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
313 static PyObject *CFTypeRefObj_CFShow(CFTypeRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
314 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
315 PyObject *_res = NULL;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
316 #ifndef CFShow
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
317 PyMac_PRECHECK(CFShow);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
318 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
319 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
320 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
321 CFShow(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
322 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
323 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
324 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
325 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
326
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
327 static PyObject *CFTypeRefObj_CFPropertyListCreateFromXMLData(CFTypeRefObject *_self, PyObject *_args)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
328 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
329 PyObject *_res = NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
330
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
331 CFTypeRef _rv;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
332 CFOptionFlags mutabilityOption;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
333 CFStringRef errorString;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
334 if (!PyArg_ParseTuple(_args, "l",
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
335 &mutabilityOption))
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
336 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
337 _rv = CFPropertyListCreateFromXMLData((CFAllocatorRef)NULL,
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
338 _self->ob_itself,
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
339 mutabilityOption,
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
340 &errorString);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
341 if (errorString)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
342 CFRelease(errorString);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
343 if (_rv == NULL) {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
344 PyErr_SetString(PyExc_RuntimeError, "Parse error in XML data");
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
345 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
346 }
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
347 _res = Py_BuildValue("O&",
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
348 CFTypeRefObj_New, _rv);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
349 return _res;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
350
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
351 }
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
352
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
353 static PyObject *CFTypeRefObj_toPython(CFTypeRefObject *_self, PyObject *_args)
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
354 {
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
355 PyObject *_res = NULL;
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
356
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
357 _res = PyCF_CF2Python(_self->ob_itself);
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
358 return _res;
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
359
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
360 }
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
361
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
362 static PyMethodDef CFTypeRefObj_methods[] = {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
363 {"CFGetTypeID", (PyCFunction)CFTypeRefObj_CFGetTypeID, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
364 PyDoc_STR("() -> (CFTypeID _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
365 {"CFRetain", (PyCFunction)CFTypeRefObj_CFRetain, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
366 PyDoc_STR("() -> (CFTypeRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
367 {"CFRelease", (PyCFunction)CFTypeRefObj_CFRelease, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
368 PyDoc_STR("() -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
369 {"CFGetRetainCount", (PyCFunction)CFTypeRefObj_CFGetRetainCount, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
370 PyDoc_STR("() -> (CFIndex _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
371 {"CFEqual", (PyCFunction)CFTypeRefObj_CFEqual, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
372 PyDoc_STR("(CFTypeRef cf2) -> (Boolean _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
373 {"CFHash", (PyCFunction)CFTypeRefObj_CFHash, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
374 PyDoc_STR("() -> (CFHashCode _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
375 {"CFCopyDescription", (PyCFunction)CFTypeRefObj_CFCopyDescription, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
376 PyDoc_STR("() -> (CFStringRef _rv)")},
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
377 {"CFPropertyListCreateXMLData", (PyCFunction)CFTypeRefObj_CFPropertyListCreateXMLData, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
378 PyDoc_STR("() -> (CFDataRef _rv)")},
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
379 {"CFPropertyListCreateDeepCopy", (PyCFunction)CFTypeRefObj_CFPropertyListCreateDeepCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
380 PyDoc_STR("(CFOptionFlags mutabilityOption) -> (CFTypeRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
381 {"CFShow", (PyCFunction)CFTypeRefObj_CFShow, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
382 PyDoc_STR("() -> None")},
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
383 {"CFPropertyListCreateFromXMLData", (PyCFunction)CFTypeRefObj_CFPropertyListCreateFromXMLData, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
384 PyDoc_STR("(CFOptionFlags mutabilityOption) -> (CFTypeRefObj)")},
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
385 {"toPython", (PyCFunction)CFTypeRefObj_toPython, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
386 PyDoc_STR("() -> (python_object)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
387 {NULL, NULL, 0}
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
388 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
389
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
390 PyMethodChain CFTypeRefObj_chain = { CFTypeRefObj_methods, NULL };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
391
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
392 static PyObject *CFTypeRefObj_getattr(CFTypeRefObject *self, char *name)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
393 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
394 return Py_FindMethodInChain(&CFTypeRefObj_chain, (PyObject *)self, name);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
395 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
396
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
397 #define CFTypeRefObj_setattr NULL
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
398
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
399 static int CFTypeRefObj_compare(CFTypeRefObject *self, CFTypeRefObject *other)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
400 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
401 /* XXXX Or should we use CFEqual?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
402 if ( self->ob_itself > other->ob_itself ) return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
403 if ( self->ob_itself < other->ob_itself ) return -1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
404 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
405 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
406
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
407 static PyObject * CFTypeRefObj_repr(CFTypeRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
408 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
409 char buf[100];
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
410 sprintf(buf, "<CFTypeRef type-%d object at 0x%8.8x for 0x%8.8x>", (int)CFGetTypeID(self->ob_itself), (unsigned)self, (unsigned)self->ob_itself);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
411 return PyString_FromString(buf);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
412 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
413
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
414 static int CFTypeRefObj_hash(CFTypeRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
415 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
416 /* XXXX Or should we use CFHash?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
417 return (int)self->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
418 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
419
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
420 PyTypeObject CFTypeRef_Type = {
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
421 PyObject_HEAD_INIT(NULL)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
422 0, /*ob_size*/
21313
91dd223829c6 Patch supplied by Burton Radons for his own SF bug #487390: Modifying
Guido van Rossum <guido@python.org>
parents: 21113
diff changeset
423 "_CF.CFTypeRef", /*tp_name*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
424 sizeof(CFTypeRefObject), /*tp_basicsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
425 0, /*tp_itemsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
426 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
427 (destructor) CFTypeRefObj_dealloc, /*tp_dealloc*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
428 0, /*tp_print*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
429 (getattrfunc) CFTypeRefObj_getattr, /*tp_getattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
430 (setattrfunc) CFTypeRefObj_setattr, /*tp_setattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
431 (cmpfunc) CFTypeRefObj_compare, /*tp_compare*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
432 (reprfunc) CFTypeRefObj_repr, /*tp_repr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
433 (PyNumberMethods *)0, /* tp_as_number */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
434 (PySequenceMethods *)0, /* tp_as_sequence */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
435 (PyMappingMethods *)0, /* tp_as_mapping */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
436 (hashfunc) CFTypeRefObj_hash, /*tp_hash*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
437 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
438
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
439 /* ------------------- End object type CFTypeRef -------------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
440
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
441
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
442 /* --------------------- Object type CFArrayRef --------------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
444 PyTypeObject CFArrayRef_Type;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
445
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
446 #define CFArrayRefObj_Check(x) ((x)->ob_type == &CFArrayRef_Type || PyObject_TypeCheck((x), &CFArrayRef_Type))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
447
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
448 typedef struct CFArrayRefObject {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
449 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
450 CFArrayRef ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
451 void (*ob_freeit)(CFTypeRef ptr);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
452 } CFArrayRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
453
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
454 PyObject *CFArrayRefObj_New(CFArrayRef itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
455 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
456 CFArrayRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
457 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
458 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
459 PyErr_SetString(PyExc_RuntimeError, "cannot wrap NULL");
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
460 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
461 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
462 it = PyObject_NEW(CFArrayRefObject, &CFArrayRef_Type);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
463 if (it == NULL) return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
464 it->ob_itself = itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
465 it->ob_freeit = CFRelease;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
466 return (PyObject *)it;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
467 }
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
468 int CFArrayRefObj_Convert(PyObject *v, CFArrayRef *p_itself)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
469 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
470
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
471 if (v == Py_None) { *p_itself = NULL; return 1; }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
472 /* Check for other CF objects here */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
473
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
474 if (!CFArrayRefObj_Check(v))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
475 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
476 PyErr_SetString(PyExc_TypeError, "CFArrayRef required");
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
477 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
478 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
479 *p_itself = ((CFArrayRefObject *)v)->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
480 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
481 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
482
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
483 static void CFArrayRefObj_dealloc(CFArrayRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
484 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
485 if (self->ob_freeit && self->ob_itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
486 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
487 self->ob_freeit((CFTypeRef)self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
488 }
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
489 PyObject_Free((PyObject *)self);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
490 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
491
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
492 static PyObject *CFArrayRefObj_CFArrayCreateCopy(CFArrayRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
493 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
494 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
495 CFArrayRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
496 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
497 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
498 _rv = CFArrayCreateCopy((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
499 _self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
500 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
501 CFArrayRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
502 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
503 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
504
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
505 static PyObject *CFArrayRefObj_CFArrayGetCount(CFArrayRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
506 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
507 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
508 CFIndex _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
509 #ifndef CFArrayGetCount
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
510 PyMac_PRECHECK(CFArrayGetCount);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
511 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
512 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
513 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
514 _rv = CFArrayGetCount(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
515 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
516 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
517 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
518 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
519
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
520 static PyObject *CFArrayRefObj_CFStringCreateByCombiningStrings(CFArrayRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
521 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
522 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
523 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
524 CFStringRef separatorString;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
525 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
526 CFStringRefObj_Convert, &separatorString))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
527 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
528 _rv = CFStringCreateByCombiningStrings((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
529 _self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
530 separatorString);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
531 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
532 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
533 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
534 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
535
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
536 static PyMethodDef CFArrayRefObj_methods[] = {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
537 {"CFArrayCreateCopy", (PyCFunction)CFArrayRefObj_CFArrayCreateCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
538 PyDoc_STR("() -> (CFArrayRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
539 {"CFArrayGetCount", (PyCFunction)CFArrayRefObj_CFArrayGetCount, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
540 PyDoc_STR("() -> (CFIndex _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
541 {"CFStringCreateByCombiningStrings", (PyCFunction)CFArrayRefObj_CFStringCreateByCombiningStrings, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
542 PyDoc_STR("(CFStringRef separatorString) -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
543 {NULL, NULL, 0}
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
544 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
545
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
546 PyMethodChain CFArrayRefObj_chain = { CFArrayRefObj_methods, &CFTypeRefObj_chain };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
547
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
548 static PyObject *CFArrayRefObj_getattr(CFArrayRefObject *self, char *name)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
549 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
550 return Py_FindMethodInChain(&CFArrayRefObj_chain, (PyObject *)self, name);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
551 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
552
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
553 #define CFArrayRefObj_setattr NULL
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
554
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
555 static int CFArrayRefObj_compare(CFArrayRefObject *self, CFArrayRefObject *other)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
556 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
557 /* XXXX Or should we use CFEqual?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
558 if ( self->ob_itself > other->ob_itself ) return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
559 if ( self->ob_itself < other->ob_itself ) return -1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
560 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
561 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
562
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
563 static PyObject * CFArrayRefObj_repr(CFArrayRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
564 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
565 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
566 sprintf(buf, "<CFArrayRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
567 return PyString_FromString(buf);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
568 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
569
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
570 static int CFArrayRefObj_hash(CFArrayRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
571 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
572 /* XXXX Or should we use CFHash?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
573 return (int)self->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
574 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
575
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
576 PyTypeObject CFArrayRef_Type = {
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
577 PyObject_HEAD_INIT(NULL)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
578 0, /*ob_size*/
21313
91dd223829c6 Patch supplied by Burton Radons for his own SF bug #487390: Modifying
Guido van Rossum <guido@python.org>
parents: 21113
diff changeset
579 "_CF.CFArrayRef", /*tp_name*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
580 sizeof(CFArrayRefObject), /*tp_basicsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
581 0, /*tp_itemsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
582 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
583 (destructor) CFArrayRefObj_dealloc, /*tp_dealloc*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
584 0, /*tp_print*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
585 (getattrfunc) CFArrayRefObj_getattr, /*tp_getattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
586 (setattrfunc) CFArrayRefObj_setattr, /*tp_setattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
587 (cmpfunc) CFArrayRefObj_compare, /*tp_compare*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
588 (reprfunc) CFArrayRefObj_repr, /*tp_repr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
589 (PyNumberMethods *)0, /* tp_as_number */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
590 (PySequenceMethods *)0, /* tp_as_sequence */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
591 (PyMappingMethods *)0, /* tp_as_mapping */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
592 (hashfunc) CFArrayRefObj_hash, /*tp_hash*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
593 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
594
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
595 /* ------------------- End object type CFArrayRef ------------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
596
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
597
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
598 /* ----------------- Object type CFMutableArrayRef ------------------ */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
599
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
600 PyTypeObject CFMutableArrayRef_Type;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
601
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
602 #define CFMutableArrayRefObj_Check(x) ((x)->ob_type == &CFMutableArrayRef_Type || PyObject_TypeCheck((x), &CFMutableArrayRef_Type))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
603
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
604 typedef struct CFMutableArrayRefObject {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
605 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
606 CFMutableArrayRef ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
607 void (*ob_freeit)(CFTypeRef ptr);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
608 } CFMutableArrayRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
609
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
610 PyObject *CFMutableArrayRefObj_New(CFMutableArrayRef itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
611 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
612 CFMutableArrayRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
613 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
614 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
615 PyErr_SetString(PyExc_RuntimeError, "cannot wrap NULL");
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
616 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
617 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
618 it = PyObject_NEW(CFMutableArrayRefObject, &CFMutableArrayRef_Type);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
619 if (it == NULL) return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
620 it->ob_itself = itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
621 it->ob_freeit = CFRelease;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
622 return (PyObject *)it;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
623 }
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
624 int CFMutableArrayRefObj_Convert(PyObject *v, CFMutableArrayRef *p_itself)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
625 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
626
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
627 if (v == Py_None) { *p_itself = NULL; return 1; }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
628 /* Check for other CF objects here */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
629
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
630 if (!CFMutableArrayRefObj_Check(v))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
631 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
632 PyErr_SetString(PyExc_TypeError, "CFMutableArrayRef required");
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
633 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
634 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
635 *p_itself = ((CFMutableArrayRefObject *)v)->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
636 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
637 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
638
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
639 static void CFMutableArrayRefObj_dealloc(CFMutableArrayRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
640 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
641 if (self->ob_freeit && self->ob_itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
642 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
643 self->ob_freeit((CFTypeRef)self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
644 }
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
645 PyObject_Free((PyObject *)self);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
646 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
647
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
648 static PyObject *CFMutableArrayRefObj_CFArrayRemoveValueAtIndex(CFMutableArrayRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
649 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
650 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
651 CFIndex idx;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
652 #ifndef CFArrayRemoveValueAtIndex
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
653 PyMac_PRECHECK(CFArrayRemoveValueAtIndex);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
654 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
655 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
656 &idx))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
657 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
658 CFArrayRemoveValueAtIndex(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
659 idx);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
660 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
661 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
662 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
663 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
664
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
665 static PyObject *CFMutableArrayRefObj_CFArrayRemoveAllValues(CFMutableArrayRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
666 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
667 PyObject *_res = NULL;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
668 #ifndef CFArrayRemoveAllValues
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
669 PyMac_PRECHECK(CFArrayRemoveAllValues);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
670 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
671 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
672 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
673 CFArrayRemoveAllValues(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
674 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
675 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
676 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
677 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
678
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
679 static PyObject *CFMutableArrayRefObj_CFArrayExchangeValuesAtIndices(CFMutableArrayRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
680 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
681 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
682 CFIndex idx1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
683 CFIndex idx2;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
684 #ifndef CFArrayExchangeValuesAtIndices
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
685 PyMac_PRECHECK(CFArrayExchangeValuesAtIndices);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
686 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
687 if (!PyArg_ParseTuple(_args, "ll",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
688 &idx1,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
689 &idx2))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
690 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
691 CFArrayExchangeValuesAtIndices(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
692 idx1,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
693 idx2);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
694 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
695 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
696 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
697 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
698
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
699 static PyObject *CFMutableArrayRefObj_CFArrayAppendArray(CFMutableArrayRefObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
700 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
701 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
702 CFArrayRef otherArray;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
703 CFRange otherRange;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
704 #ifndef CFArrayAppendArray
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
705 PyMac_PRECHECK(CFArrayAppendArray);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
706 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
707 if (!PyArg_ParseTuple(_args, "O&O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
708 CFArrayRefObj_Convert, &otherArray,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
709 CFRange_Convert, &otherRange))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
710 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
711 CFArrayAppendArray(_self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
712 otherArray,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
713 otherRange);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
714 Py_INCREF(Py_None);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
715 _res = Py_None;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
716 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
717 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
718
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
719 static PyMethodDef CFMutableArrayRefObj_methods[] = {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
720 {"CFArrayRemoveValueAtIndex", (PyCFunction)CFMutableArrayRefObj_CFArrayRemoveValueAtIndex, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
721 PyDoc_STR("(CFIndex idx) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
722 {"CFArrayRemoveAllValues", (PyCFunction)CFMutableArrayRefObj_CFArrayRemoveAllValues, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
723 PyDoc_STR("() -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
724 {"CFArrayExchangeValuesAtIndices", (PyCFunction)CFMutableArrayRefObj_CFArrayExchangeValuesAtIndices, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
725 PyDoc_STR("(CFIndex idx1, CFIndex idx2) -> None")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
726 {"CFArrayAppendArray", (PyCFunction)CFMutableArrayRefObj_CFArrayAppendArray, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
727 PyDoc_STR("(CFArrayRef otherArray, CFRange otherRange) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
728 {NULL, NULL, 0}
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
729 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
730
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
731 PyMethodChain CFMutableArrayRefObj_chain = { CFMutableArrayRefObj_methods, &CFArrayRefObj_chain };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
732
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
733 static PyObject *CFMutableArrayRefObj_getattr(CFMutableArrayRefObject *self, char *name)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
734 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
735 return Py_FindMethodInChain(&CFMutableArrayRefObj_chain, (PyObject *)self, name);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
736 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
737
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
738 #define CFMutableArrayRefObj_setattr NULL
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
739
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
740 static int CFMutableArrayRefObj_compare(CFMutableArrayRefObject *self, CFMutableArrayRefObject *other)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
741 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
742 /* XXXX Or should we use CFEqual?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
743 if ( self->ob_itself > other->ob_itself ) return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
744 if ( self->ob_itself < other->ob_itself ) return -1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
745 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
746 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
747
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
748 static PyObject * CFMutableArrayRefObj_repr(CFMutableArrayRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
749 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
750 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
751 sprintf(buf, "<CFMutableArrayRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
752 return PyString_FromString(buf);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
753 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
754
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
755 static int CFMutableArrayRefObj_hash(CFMutableArrayRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
756 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
757 /* XXXX Or should we use CFHash?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
758 return (int)self->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
759 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
760
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
761 PyTypeObject CFMutableArrayRef_Type = {
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
762 PyObject_HEAD_INIT(NULL)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
763 0, /*ob_size*/
21313
91dd223829c6 Patch supplied by Burton Radons for his own SF bug #487390: Modifying
Guido van Rossum <guido@python.org>
parents: 21113
diff changeset
764 "_CF.CFMutableArrayRef", /*tp_name*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
765 sizeof(CFMutableArrayRefObject), /*tp_basicsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
766 0, /*tp_itemsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
767 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
768 (destructor) CFMutableArrayRefObj_dealloc, /*tp_dealloc*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
769 0, /*tp_print*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
770 (getattrfunc) CFMutableArrayRefObj_getattr, /*tp_getattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
771 (setattrfunc) CFMutableArrayRefObj_setattr, /*tp_setattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
772 (cmpfunc) CFMutableArrayRefObj_compare, /*tp_compare*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
773 (reprfunc) CFMutableArrayRefObj_repr, /*tp_repr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
774 (PyNumberMethods *)0, /* tp_as_number */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
775 (PySequenceMethods *)0, /* tp_as_sequence */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
776 (PyMappingMethods *)0, /* tp_as_mapping */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
777 (hashfunc) CFMutableArrayRefObj_hash, /*tp_hash*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
778 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
779
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
780 /* --------------- End object type CFMutableArrayRef ---------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
781
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
782
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
783 /* ------------------ Object type CFDictionaryRef ------------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
784
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
785 PyTypeObject CFDictionaryRef_Type;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
786
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
787 #define CFDictionaryRefObj_Check(x) ((x)->ob_type == &CFDictionaryRef_Type || PyObject_TypeCheck((x), &CFDictionaryRef_Type))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
788
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
789 typedef struct CFDictionaryRefObject {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
790 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
791 CFDictionaryRef ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
792 void (*ob_freeit)(CFTypeRef ptr);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
793 } CFDictionaryRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
794
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
795 PyObject *CFDictionaryRefObj_New(CFDictionaryRef itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
796 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
797 CFDictionaryRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
798 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
799 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
800 PyErr_SetString(PyExc_RuntimeError, "cannot wrap NULL");
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
801 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
802 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
803 it = PyObject_NEW(CFDictionaryRefObject, &CFDictionaryRef_Type);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
804 if (it == NULL) return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
805 it->ob_itself = itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
806 it->ob_freeit = CFRelease;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
807 return (PyObject *)it;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
808 }
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
809 int CFDictionaryRefObj_Convert(PyObject *v, CFDictionaryRef *p_itself)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
810 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
811
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
812 if (v == Py_None) { *p_itself = NULL; return 1; }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
813 /* Check for other CF objects here */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
814
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
815 if (!CFDictionaryRefObj_Check(v))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
816 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
817 PyErr_SetString(PyExc_TypeError, "CFDictionaryRef required");
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
818 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
819 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
820 *p_itself = ((CFDictionaryRefObject *)v)->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
821 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
822 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
823
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
824 static void CFDictionaryRefObj_dealloc(CFDictionaryRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
825 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
826 if (self->ob_freeit && self->ob_itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
827 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
828 self->ob_freeit((CFTypeRef)self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
829 }
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
830 PyObject_Free((PyObject *)self);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
831 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
832
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
833 static PyObject *CFDictionaryRefObj_CFDictionaryCreateCopy(CFDictionaryRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
834 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
835 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
836 CFDictionaryRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
837 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
838 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
839 _rv = CFDictionaryCreateCopy((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
840 _self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
841 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
842 CFDictionaryRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
843 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
844 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
845
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
846 static PyObject *CFDictionaryRefObj_CFDictionaryGetCount(CFDictionaryRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
847 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
848 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
849 CFIndex _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
850 #ifndef CFDictionaryGetCount
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
851 PyMac_PRECHECK(CFDictionaryGetCount);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
852 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
853 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
854 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
855 _rv = CFDictionaryGetCount(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
856 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
857 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
858 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
859 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
860
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
861 static PyMethodDef CFDictionaryRefObj_methods[] = {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
862 {"CFDictionaryCreateCopy", (PyCFunction)CFDictionaryRefObj_CFDictionaryCreateCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
863 PyDoc_STR("() -> (CFDictionaryRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
864 {"CFDictionaryGetCount", (PyCFunction)CFDictionaryRefObj_CFDictionaryGetCount, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
865 PyDoc_STR("() -> (CFIndex _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
866 {NULL, NULL, 0}
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
867 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
868
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
869 PyMethodChain CFDictionaryRefObj_chain = { CFDictionaryRefObj_methods, &CFTypeRefObj_chain };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
870
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
871 static PyObject *CFDictionaryRefObj_getattr(CFDictionaryRefObject *self, char *name)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
872 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
873 return Py_FindMethodInChain(&CFDictionaryRefObj_chain, (PyObject *)self, name);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
874 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
875
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
876 #define CFDictionaryRefObj_setattr NULL
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
877
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
878 static int CFDictionaryRefObj_compare(CFDictionaryRefObject *self, CFDictionaryRefObject *other)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
879 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
880 /* XXXX Or should we use CFEqual?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
881 if ( self->ob_itself > other->ob_itself ) return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
882 if ( self->ob_itself < other->ob_itself ) return -1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
883 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
884 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
885
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
886 static PyObject * CFDictionaryRefObj_repr(CFDictionaryRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
887 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
888 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
889 sprintf(buf, "<CFDictionaryRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
890 return PyString_FromString(buf);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
891 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
892
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
893 static int CFDictionaryRefObj_hash(CFDictionaryRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
894 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
895 /* XXXX Or should we use CFHash?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
896 return (int)self->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
897 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
898
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
899 PyTypeObject CFDictionaryRef_Type = {
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
900 PyObject_HEAD_INIT(NULL)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
901 0, /*ob_size*/
21313
91dd223829c6 Patch supplied by Burton Radons for his own SF bug #487390: Modifying
Guido van Rossum <guido@python.org>
parents: 21113
diff changeset
902 "_CF.CFDictionaryRef", /*tp_name*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
903 sizeof(CFDictionaryRefObject), /*tp_basicsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
904 0, /*tp_itemsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
905 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
906 (destructor) CFDictionaryRefObj_dealloc, /*tp_dealloc*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
907 0, /*tp_print*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
908 (getattrfunc) CFDictionaryRefObj_getattr, /*tp_getattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
909 (setattrfunc) CFDictionaryRefObj_setattr, /*tp_setattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
910 (cmpfunc) CFDictionaryRefObj_compare, /*tp_compare*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
911 (reprfunc) CFDictionaryRefObj_repr, /*tp_repr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
912 (PyNumberMethods *)0, /* tp_as_number */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
913 (PySequenceMethods *)0, /* tp_as_sequence */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
914 (PyMappingMethods *)0, /* tp_as_mapping */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
915 (hashfunc) CFDictionaryRefObj_hash, /*tp_hash*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
916 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
917
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
918 /* ---------------- End object type CFDictionaryRef ----------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
919
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
920
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
921 /* --------------- Object type CFMutableDictionaryRef --------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
922
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
923 PyTypeObject CFMutableDictionaryRef_Type;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
924
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
925 #define CFMutableDictionaryRefObj_Check(x) ((x)->ob_type == &CFMutableDictionaryRef_Type || PyObject_TypeCheck((x), &CFMutableDictionaryRef_Type))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
926
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
927 typedef struct CFMutableDictionaryRefObject {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
928 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
929 CFMutableDictionaryRef ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
930 void (*ob_freeit)(CFTypeRef ptr);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
931 } CFMutableDictionaryRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
932
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
933 PyObject *CFMutableDictionaryRefObj_New(CFMutableDictionaryRef itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
934 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
935 CFMutableDictionaryRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
936 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
937 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
938 PyErr_SetString(PyExc_RuntimeError, "cannot wrap NULL");
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
939 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
940 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
941 it = PyObject_NEW(CFMutableDictionaryRefObject, &CFMutableDictionaryRef_Type);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
942 if (it == NULL) return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
943 it->ob_itself = itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
944 it->ob_freeit = CFRelease;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
945 return (PyObject *)it;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
946 }
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
947 int CFMutableDictionaryRefObj_Convert(PyObject *v, CFMutableDictionaryRef *p_itself)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
948 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
949
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
950 if (v == Py_None) { *p_itself = NULL; return 1; }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
951 /* Check for other CF objects here */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
952
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
953 if (!CFMutableDictionaryRefObj_Check(v))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
954 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
955 PyErr_SetString(PyExc_TypeError, "CFMutableDictionaryRef required");
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
956 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
957 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
958 *p_itself = ((CFMutableDictionaryRefObject *)v)->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
959 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
960 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
961
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
962 static void CFMutableDictionaryRefObj_dealloc(CFMutableDictionaryRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
963 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
964 if (self->ob_freeit && self->ob_itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
965 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
966 self->ob_freeit((CFTypeRef)self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
967 }
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
968 PyObject_Free((PyObject *)self);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
969 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
970
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
971 static PyObject *CFMutableDictionaryRefObj_CFDictionaryRemoveAllValues(CFMutableDictionaryRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
972 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
973 PyObject *_res = NULL;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
974 #ifndef CFDictionaryRemoveAllValues
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
975 PyMac_PRECHECK(CFDictionaryRemoveAllValues);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
976 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
977 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
978 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
979 CFDictionaryRemoveAllValues(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
980 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
981 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
982 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
983 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
984
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
985 static PyMethodDef CFMutableDictionaryRefObj_methods[] = {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
986 {"CFDictionaryRemoveAllValues", (PyCFunction)CFMutableDictionaryRefObj_CFDictionaryRemoveAllValues, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
987 PyDoc_STR("() -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
988 {NULL, NULL, 0}
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
989 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
990
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
991 PyMethodChain CFMutableDictionaryRefObj_chain = { CFMutableDictionaryRefObj_methods, &CFDictionaryRefObj_chain };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
992
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
993 static PyObject *CFMutableDictionaryRefObj_getattr(CFMutableDictionaryRefObject *self, char *name)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
994 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
995 return Py_FindMethodInChain(&CFMutableDictionaryRefObj_chain, (PyObject *)self, name);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
996 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
997
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
998 #define CFMutableDictionaryRefObj_setattr NULL
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
999
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1000 static int CFMutableDictionaryRefObj_compare(CFMutableDictionaryRefObject *self, CFMutableDictionaryRefObject *other)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1001 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1002 /* XXXX Or should we use CFEqual?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1003 if ( self->ob_itself > other->ob_itself ) return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1004 if ( self->ob_itself < other->ob_itself ) return -1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1005 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1006 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1007
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1008 static PyObject * CFMutableDictionaryRefObj_repr(CFMutableDictionaryRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1009 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1010 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
1011 sprintf(buf, "<CFMutableDictionaryRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1012 return PyString_FromString(buf);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1013 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1014
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1015 static int CFMutableDictionaryRefObj_hash(CFMutableDictionaryRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1016 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1017 /* XXXX Or should we use CFHash?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1018 return (int)self->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1019 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1020
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1021 PyTypeObject CFMutableDictionaryRef_Type = {
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1022 PyObject_HEAD_INIT(NULL)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1023 0, /*ob_size*/
21313
91dd223829c6 Patch supplied by Burton Radons for his own SF bug #487390: Modifying
Guido van Rossum <guido@python.org>
parents: 21113
diff changeset
1024 "_CF.CFMutableDictionaryRef", /*tp_name*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1025 sizeof(CFMutableDictionaryRefObject), /*tp_basicsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1026 0, /*tp_itemsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1027 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1028 (destructor) CFMutableDictionaryRefObj_dealloc, /*tp_dealloc*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1029 0, /*tp_print*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1030 (getattrfunc) CFMutableDictionaryRefObj_getattr, /*tp_getattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1031 (setattrfunc) CFMutableDictionaryRefObj_setattr, /*tp_setattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1032 (cmpfunc) CFMutableDictionaryRefObj_compare, /*tp_compare*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1033 (reprfunc) CFMutableDictionaryRefObj_repr, /*tp_repr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1034 (PyNumberMethods *)0, /* tp_as_number */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1035 (PySequenceMethods *)0, /* tp_as_sequence */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1036 (PyMappingMethods *)0, /* tp_as_mapping */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1037 (hashfunc) CFMutableDictionaryRefObj_hash, /*tp_hash*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1038 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1039
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1040 /* ------------- End object type CFMutableDictionaryRef ------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1041
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1042
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1043 /* --------------------- Object type CFDataRef ---------------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1044
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1045 PyTypeObject CFDataRef_Type;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1046
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
1047 #define CFDataRefObj_Check(x) ((x)->ob_type == &CFDataRef_Type || PyObject_TypeCheck((x), &CFDataRef_Type))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1048
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1049 typedef struct CFDataRefObject {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1050 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1051 CFDataRef ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1052 void (*ob_freeit)(CFTypeRef ptr);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1053 } CFDataRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1054
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1055 PyObject *CFDataRefObj_New(CFDataRef itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1056 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1057 CFDataRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1058 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1059 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1060 PyErr_SetString(PyExc_RuntimeError, "cannot wrap NULL");
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1061 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1062 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1063 it = PyObject_NEW(CFDataRefObject, &CFDataRef_Type);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1064 if (it == NULL) return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1065 it->ob_itself = itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1066 it->ob_freeit = CFRelease;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1067 return (PyObject *)it;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1068 }
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
1069 int CFDataRefObj_Convert(PyObject *v, CFDataRef *p_itself)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1070 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1071
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1072 if (v == Py_None) { *p_itself = NULL; return 1; }
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1073 if (PyString_Check(v)) {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1074 char *cStr;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1075 int cLen;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1076 if( PyString_AsStringAndSize(v, &cStr, &cLen) < 0 ) return 0;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1077 *p_itself = CFDataCreate((CFAllocatorRef)NULL, (unsigned char *)cStr, cLen);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1078 return 1;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1079 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1080
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1081 if (!CFDataRefObj_Check(v))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1082 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1083 PyErr_SetString(PyExc_TypeError, "CFDataRef required");
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1084 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1085 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1086 *p_itself = ((CFDataRefObject *)v)->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1087 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1088 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1089
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1090 static void CFDataRefObj_dealloc(CFDataRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1091 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1092 if (self->ob_freeit && self->ob_itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1093 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1094 self->ob_freeit((CFTypeRef)self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1095 }
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
1096 PyObject_Free((PyObject *)self);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1097 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1098
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1099 static PyObject *CFDataRefObj_CFDataCreateCopy(CFDataRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1100 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1101 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1102 CFDataRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1103 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1104 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1105 _rv = CFDataCreateCopy((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1106 _self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1107 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1108 CFDataRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1109 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1110 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1111
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1112 static PyObject *CFDataRefObj_CFDataGetLength(CFDataRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1113 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1114 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1115 CFIndex _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1116 #ifndef CFDataGetLength
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1117 PyMac_PRECHECK(CFDataGetLength);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1118 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1119 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1120 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1121 _rv = CFDataGetLength(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1122 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1123 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1124 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1125 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1126
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1127 static PyObject *CFDataRefObj_CFStringCreateFromExternalRepresentation(CFDataRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1128 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1129 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1130 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1131 CFStringEncoding encoding;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1132 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1133 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1134 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1135 _rv = CFStringCreateFromExternalRepresentation((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1136 _self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1137 encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1138 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1139 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1140 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1141 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1142
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1143 static PyObject *CFDataRefObj_CFDataGetData(CFDataRefObject *_self, PyObject *_args)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1144 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1145 PyObject *_res = NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1146
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1147 int size = CFDataGetLength(_self->ob_itself);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1148 char *data = (char *)CFDataGetBytePtr(_self->ob_itself);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1149
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1150 _res = (PyObject *)PyString_FromStringAndSize(data, size);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1151 return _res;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1152
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1153 }
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1154
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1155 static PyMethodDef CFDataRefObj_methods[] = {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1156 {"CFDataCreateCopy", (PyCFunction)CFDataRefObj_CFDataCreateCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1157 PyDoc_STR("() -> (CFDataRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1158 {"CFDataGetLength", (PyCFunction)CFDataRefObj_CFDataGetLength, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1159 PyDoc_STR("() -> (CFIndex _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1160 {"CFStringCreateFromExternalRepresentation", (PyCFunction)CFDataRefObj_CFStringCreateFromExternalRepresentation, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1161 PyDoc_STR("(CFStringEncoding encoding) -> (CFStringRef _rv)")},
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1162 {"CFDataGetData", (PyCFunction)CFDataRefObj_CFDataGetData, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1163 PyDoc_STR("() -> (string _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1164 {NULL, NULL, 0}
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1165 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1166
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1167 PyMethodChain CFDataRefObj_chain = { CFDataRefObj_methods, &CFTypeRefObj_chain };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1168
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1169 static PyObject *CFDataRefObj_getattr(CFDataRefObject *self, char *name)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1170 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1171 return Py_FindMethodInChain(&CFDataRefObj_chain, (PyObject *)self, name);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1172 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1173
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1174 #define CFDataRefObj_setattr NULL
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1175
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1176 static int CFDataRefObj_compare(CFDataRefObject *self, CFDataRefObject *other)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1177 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1178 /* XXXX Or should we use CFEqual?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1179 if ( self->ob_itself > other->ob_itself ) return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1180 if ( self->ob_itself < other->ob_itself ) return -1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1181 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1182 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1183
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1184 static PyObject * CFDataRefObj_repr(CFDataRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1185 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1186 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
1187 sprintf(buf, "<CFDataRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1188 return PyString_FromString(buf);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1189 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1190
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1191 static int CFDataRefObj_hash(CFDataRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1192 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1193 /* XXXX Or should we use CFHash?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1194 return (int)self->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1195 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1196
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1197 PyTypeObject CFDataRef_Type = {
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1198 PyObject_HEAD_INIT(NULL)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1199 0, /*ob_size*/
21313
91dd223829c6 Patch supplied by Burton Radons for his own SF bug #487390: Modifying
Guido van Rossum <guido@python.org>
parents: 21113
diff changeset
1200 "_CF.CFDataRef", /*tp_name*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1201 sizeof(CFDataRefObject), /*tp_basicsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1202 0, /*tp_itemsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1203 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1204 (destructor) CFDataRefObj_dealloc, /*tp_dealloc*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1205 0, /*tp_print*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1206 (getattrfunc) CFDataRefObj_getattr, /*tp_getattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1207 (setattrfunc) CFDataRefObj_setattr, /*tp_setattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1208 (cmpfunc) CFDataRefObj_compare, /*tp_compare*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1209 (reprfunc) CFDataRefObj_repr, /*tp_repr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1210 (PyNumberMethods *)0, /* tp_as_number */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1211 (PySequenceMethods *)0, /* tp_as_sequence */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1212 (PyMappingMethods *)0, /* tp_as_mapping */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1213 (hashfunc) CFDataRefObj_hash, /*tp_hash*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1214 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1215
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1216 /* ------------------- End object type CFDataRef -------------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1217
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1218
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1219 /* ------------------ Object type CFMutableDataRef ------------------ */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1220
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1221 PyTypeObject CFMutableDataRef_Type;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1222
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
1223 #define CFMutableDataRefObj_Check(x) ((x)->ob_type == &CFMutableDataRef_Type || PyObject_TypeCheck((x), &CFMutableDataRef_Type))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1224
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1225 typedef struct CFMutableDataRefObject {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1226 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1227 CFMutableDataRef ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1228 void (*ob_freeit)(CFTypeRef ptr);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1229 } CFMutableDataRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1230
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1231 PyObject *CFMutableDataRefObj_New(CFMutableDataRef itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1232 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1233 CFMutableDataRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1234 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1235 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1236 PyErr_SetString(PyExc_RuntimeError, "cannot wrap NULL");
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1237 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1238 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1239 it = PyObject_NEW(CFMutableDataRefObject, &CFMutableDataRef_Type);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1240 if (it == NULL) return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1241 it->ob_itself = itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1242 it->ob_freeit = CFRelease;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1243 return (PyObject *)it;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1244 }
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
1245 int CFMutableDataRefObj_Convert(PyObject *v, CFMutableDataRef *p_itself)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1246 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1247
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1248 if (v == Py_None) { *p_itself = NULL; return 1; }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1249 /* Check for other CF objects here */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1250
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1251 if (!CFMutableDataRefObj_Check(v))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1252 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1253 PyErr_SetString(PyExc_TypeError, "CFMutableDataRef required");
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1254 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1255 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1256 *p_itself = ((CFMutableDataRefObject *)v)->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1257 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1258 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1259
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1260 static void CFMutableDataRefObj_dealloc(CFMutableDataRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1261 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1262 if (self->ob_freeit && self->ob_itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1263 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1264 self->ob_freeit((CFTypeRef)self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1265 }
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
1266 PyObject_Free((PyObject *)self);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1267 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1268
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1269 static PyObject *CFMutableDataRefObj_CFDataSetLength(CFMutableDataRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1270 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1271 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1272 CFIndex length;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1273 #ifndef CFDataSetLength
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1274 PyMac_PRECHECK(CFDataSetLength);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1275 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1276 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1277 &length))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1278 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1279 CFDataSetLength(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1280 length);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1281 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1282 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1283 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1284 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1285
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1286 static PyObject *CFMutableDataRefObj_CFDataIncreaseLength(CFMutableDataRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1287 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1288 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1289 CFIndex extraLength;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1290 #ifndef CFDataIncreaseLength
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1291 PyMac_PRECHECK(CFDataIncreaseLength);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1292 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1293 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1294 &extraLength))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1295 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1296 CFDataIncreaseLength(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1297 extraLength);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1298 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1299 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1300 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1301 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1302
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1303 static PyObject *CFMutableDataRefObj_CFDataAppendBytes(CFMutableDataRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1304 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1305 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1306 unsigned char *bytes__in__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1307 long bytes__len__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1308 int bytes__in_len__;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1309 #ifndef CFDataAppendBytes
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1310 PyMac_PRECHECK(CFDataAppendBytes);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1311 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1312 if (!PyArg_ParseTuple(_args, "s#",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1313 &bytes__in__, &bytes__in_len__))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1314 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1315 bytes__len__ = bytes__in_len__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1316 CFDataAppendBytes(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1317 bytes__in__, bytes__len__);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1318 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1319 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1320 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1321 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1322
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1323 static PyObject *CFMutableDataRefObj_CFDataReplaceBytes(CFMutableDataRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1324 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1325 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1326 CFRange range;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1327 unsigned char *newBytes__in__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1328 long newBytes__len__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1329 int newBytes__in_len__;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1330 #ifndef CFDataReplaceBytes
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1331 PyMac_PRECHECK(CFDataReplaceBytes);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1332 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1333 if (!PyArg_ParseTuple(_args, "O&s#",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1334 CFRange_Convert, &range,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1335 &newBytes__in__, &newBytes__in_len__))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1336 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1337 newBytes__len__ = newBytes__in_len__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1338 CFDataReplaceBytes(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1339 range,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1340 newBytes__in__, newBytes__len__);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1341 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1342 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1343 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1344 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1345
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1346 static PyObject *CFMutableDataRefObj_CFDataDeleteBytes(CFMutableDataRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1347 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1348 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1349 CFRange range;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1350 #ifndef CFDataDeleteBytes
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1351 PyMac_PRECHECK(CFDataDeleteBytes);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1352 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1353 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1354 CFRange_Convert, &range))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1355 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1356 CFDataDeleteBytes(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1357 range);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1358 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1359 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1360 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1361 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1362
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1363 static PyMethodDef CFMutableDataRefObj_methods[] = {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1364 {"CFDataSetLength", (PyCFunction)CFMutableDataRefObj_CFDataSetLength, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1365 PyDoc_STR("(CFIndex length) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1366 {"CFDataIncreaseLength", (PyCFunction)CFMutableDataRefObj_CFDataIncreaseLength, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1367 PyDoc_STR("(CFIndex extraLength) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1368 {"CFDataAppendBytes", (PyCFunction)CFMutableDataRefObj_CFDataAppendBytes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1369 PyDoc_STR("(Buffer bytes) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1370 {"CFDataReplaceBytes", (PyCFunction)CFMutableDataRefObj_CFDataReplaceBytes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1371 PyDoc_STR("(CFRange range, Buffer newBytes) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1372 {"CFDataDeleteBytes", (PyCFunction)CFMutableDataRefObj_CFDataDeleteBytes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1373 PyDoc_STR("(CFRange range) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1374 {NULL, NULL, 0}
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1375 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1376
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1377 PyMethodChain CFMutableDataRefObj_chain = { CFMutableDataRefObj_methods, &CFDataRefObj_chain };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1378
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1379 static PyObject *CFMutableDataRefObj_getattr(CFMutableDataRefObject *self, char *name)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1380 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1381 return Py_FindMethodInChain(&CFMutableDataRefObj_chain, (PyObject *)self, name);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1382 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1383
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1384 #define CFMutableDataRefObj_setattr NULL
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1385
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1386 static int CFMutableDataRefObj_compare(CFMutableDataRefObject *self, CFMutableDataRefObject *other)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1387 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1388 /* XXXX Or should we use CFEqual?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1389 if ( self->ob_itself > other->ob_itself ) return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1390 if ( self->ob_itself < other->ob_itself ) return -1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1391 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1392 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1393
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1394 static PyObject * CFMutableDataRefObj_repr(CFMutableDataRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1395 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1396 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
1397 sprintf(buf, "<CFMutableDataRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1398 return PyString_FromString(buf);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1399 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1400
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1401 static int CFMutableDataRefObj_hash(CFMutableDataRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1402 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1403 /* XXXX Or should we use CFHash?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1404 return (int)self->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1405 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1406
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1407 PyTypeObject CFMutableDataRef_Type = {
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1408 PyObject_HEAD_INIT(NULL)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1409 0, /*ob_size*/
21313
91dd223829c6 Patch supplied by Burton Radons for his own SF bug #487390: Modifying
Guido van Rossum <guido@python.org>
parents: 21113
diff changeset
1410 "_CF.CFMutableDataRef", /*tp_name*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1411 sizeof(CFMutableDataRefObject), /*tp_basicsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1412 0, /*tp_itemsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1413 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1414 (destructor) CFMutableDataRefObj_dealloc, /*tp_dealloc*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1415 0, /*tp_print*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1416 (getattrfunc) CFMutableDataRefObj_getattr, /*tp_getattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1417 (setattrfunc) CFMutableDataRefObj_setattr, /*tp_setattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1418 (cmpfunc) CFMutableDataRefObj_compare, /*tp_compare*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1419 (reprfunc) CFMutableDataRefObj_repr, /*tp_repr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1420 (PyNumberMethods *)0, /* tp_as_number */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1421 (PySequenceMethods *)0, /* tp_as_sequence */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1422 (PyMappingMethods *)0, /* tp_as_mapping */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1423 (hashfunc) CFMutableDataRefObj_hash, /*tp_hash*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1424 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1425
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1426 /* ---------------- End object type CFMutableDataRef ---------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1427
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1428
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1429 /* -------------------- Object type CFStringRef --------------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1430
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1431 PyTypeObject CFStringRef_Type;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1432
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
1433 #define CFStringRefObj_Check(x) ((x)->ob_type == &CFStringRef_Type || PyObject_TypeCheck((x), &CFStringRef_Type))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1434
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1435 typedef struct CFStringRefObject {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1436 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1437 CFStringRef ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1438 void (*ob_freeit)(CFTypeRef ptr);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1439 } CFStringRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1440
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1441 PyObject *CFStringRefObj_New(CFStringRef itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1442 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1443 CFStringRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1444 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1445 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1446 PyErr_SetString(PyExc_RuntimeError, "cannot wrap NULL");
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1447 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1448 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1449 it = PyObject_NEW(CFStringRefObject, &CFStringRef_Type);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1450 if (it == NULL) return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1451 it->ob_itself = itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1452 it->ob_freeit = CFRelease;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1453 return (PyObject *)it;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1454 }
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
1455 int CFStringRefObj_Convert(PyObject *v, CFStringRef *p_itself)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1456 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1457
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1458 if (v == Py_None) { *p_itself = NULL; return 1; }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1459 if (PyString_Check(v)) {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1460 char *cStr = PyString_AsString(v);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1461 *p_itself = CFStringCreateWithCString((CFAllocatorRef)NULL, cStr, 0);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1462 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1463 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1464 if (PyUnicode_Check(v)) {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1465 /* We use the CF types here, if Python was configured differently that will give an error */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1466 CFIndex size = PyUnicode_GetSize(v);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1467 UniChar *unichars = PyUnicode_AsUnicode(v);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1468 if (!unichars) return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1469 *p_itself = CFStringCreateWithCharacters((CFAllocatorRef)NULL, unichars, size);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1470 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1471 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1472
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1473
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1474 if (!CFStringRefObj_Check(v))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1475 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1476 PyErr_SetString(PyExc_TypeError, "CFStringRef required");
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1477 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1478 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1479 *p_itself = ((CFStringRefObject *)v)->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1480 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1481 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1482
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1483 static void CFStringRefObj_dealloc(CFStringRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1484 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1485 if (self->ob_freeit && self->ob_itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1486 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1487 self->ob_freeit((CFTypeRef)self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1488 }
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
1489 PyObject_Free((PyObject *)self);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1490 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1491
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1492 static PyObject *CFStringRefObj_CFStringCreateWithSubstring(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1493 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1494 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1495 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1496 CFRange range;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1497 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1498 CFRange_Convert, &range))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1499 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1500 _rv = CFStringCreateWithSubstring((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1501 _self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1502 range);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1503 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1504 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1505 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1506 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1507
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1508 static PyObject *CFStringRefObj_CFStringCreateCopy(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1509 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1510 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1511 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1512 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1513 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1514 _rv = CFStringCreateCopy((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1515 _self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1516 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1517 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1518 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1519 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1520
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1521 static PyObject *CFStringRefObj_CFStringGetLength(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1522 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1523 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1524 CFIndex _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1525 #ifndef CFStringGetLength
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1526 PyMac_PRECHECK(CFStringGetLength);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1527 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1528 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1529 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1530 _rv = CFStringGetLength(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1531 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1532 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1533 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1534 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1535
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1536 static PyObject *CFStringRefObj_CFStringGetBytes(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1537 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1538 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1539 CFIndex _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1540 CFRange range;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1541 CFStringEncoding encoding;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1542 UInt8 lossByte;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1543 Boolean isExternalRepresentation;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1544 UInt8 buffer;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1545 CFIndex maxBufLen;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1546 CFIndex usedBufLen;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1547 #ifndef CFStringGetBytes
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1548 PyMac_PRECHECK(CFStringGetBytes);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1549 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1550 if (!PyArg_ParseTuple(_args, "O&lbll",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1551 CFRange_Convert, &range,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1552 &encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1553 &lossByte,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1554 &isExternalRepresentation,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1555 &maxBufLen))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1556 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1557 _rv = CFStringGetBytes(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1558 range,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1559 encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1560 lossByte,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1561 isExternalRepresentation,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1562 &buffer,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1563 maxBufLen,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1564 &usedBufLen);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1565 _res = Py_BuildValue("lbl",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1566 _rv,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1567 buffer,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1568 usedBufLen);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1569 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1570 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1571
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1572 static PyObject *CFStringRefObj_CFStringCreateExternalRepresentation(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1573 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1574 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1575 CFDataRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1576 CFStringEncoding encoding;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1577 UInt8 lossByte;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1578 if (!PyArg_ParseTuple(_args, "lb",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1579 &encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1580 &lossByte))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1581 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1582 _rv = CFStringCreateExternalRepresentation((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1583 _self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1584 encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1585 lossByte);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1586 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1587 CFDataRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1588 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1589 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1590
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1591 static PyObject *CFStringRefObj_CFStringGetSmallestEncoding(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1592 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1593 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1594 CFStringEncoding _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1595 #ifndef CFStringGetSmallestEncoding
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1596 PyMac_PRECHECK(CFStringGetSmallestEncoding);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1597 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1598 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1599 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1600 _rv = CFStringGetSmallestEncoding(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1601 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1602 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1603 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1604 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1605
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1606 static PyObject *CFStringRefObj_CFStringGetFastestEncoding(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1607 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1608 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1609 CFStringEncoding _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1610 #ifndef CFStringGetFastestEncoding
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1611 PyMac_PRECHECK(CFStringGetFastestEncoding);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1612 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1613 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1614 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1615 _rv = CFStringGetFastestEncoding(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1616 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1617 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1618 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1619 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1620
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1621 static PyObject *CFStringRefObj_CFStringCompareWithOptions(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1622 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1623 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1624 CFComparisonResult _rv;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1625 CFStringRef theString2;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1626 CFRange rangeToCompare;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1627 CFOptionFlags compareOptions;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1628 #ifndef CFStringCompareWithOptions
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1629 PyMac_PRECHECK(CFStringCompareWithOptions);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1630 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1631 if (!PyArg_ParseTuple(_args, "O&O&l",
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1632 CFStringRefObj_Convert, &theString2,
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1633 CFRange_Convert, &rangeToCompare,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1634 &compareOptions))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1635 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1636 _rv = CFStringCompareWithOptions(_self->ob_itself,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1637 theString2,
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1638 rangeToCompare,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1639 compareOptions);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1640 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1641 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1642 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1643 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1644
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1645 static PyObject *CFStringRefObj_CFStringCompare(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1646 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1647 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1648 CFComparisonResult _rv;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1649 CFStringRef theString2;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1650 CFOptionFlags compareOptions;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1651 #ifndef CFStringCompare
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1652 PyMac_PRECHECK(CFStringCompare);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1653 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1654 if (!PyArg_ParseTuple(_args, "O&l",
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1655 CFStringRefObj_Convert, &theString2,
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1656 &compareOptions))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1657 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1658 _rv = CFStringCompare(_self->ob_itself,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1659 theString2,
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1660 compareOptions);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1661 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1662 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1663 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1664 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1665
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1666 static PyObject *CFStringRefObj_CFStringFindWithOptions(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1667 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1668 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1669 Boolean _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1670 CFStringRef stringToFind;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1671 CFRange rangeToSearch;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1672 CFOptionFlags searchOptions;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1673 CFRange result;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1674 #ifndef CFStringFindWithOptions
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1675 PyMac_PRECHECK(CFStringFindWithOptions);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1676 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1677 if (!PyArg_ParseTuple(_args, "O&O&l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1678 CFStringRefObj_Convert, &stringToFind,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1679 CFRange_Convert, &rangeToSearch,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1680 &searchOptions))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1681 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1682 _rv = CFStringFindWithOptions(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1683 stringToFind,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1684 rangeToSearch,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1685 searchOptions,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1686 &result);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1687 _res = Py_BuildValue("lO&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1688 _rv,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1689 CFRange_New, result);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1690 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1691 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1692
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1693 static PyObject *CFStringRefObj_CFStringCreateArrayWithFindResults(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1694 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1695 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1696 CFArrayRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1697 CFStringRef stringToFind;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1698 CFRange rangeToSearch;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1699 CFOptionFlags compareOptions;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1700 if (!PyArg_ParseTuple(_args, "O&O&l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1701 CFStringRefObj_Convert, &stringToFind,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1702 CFRange_Convert, &rangeToSearch,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1703 &compareOptions))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1704 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1705 _rv = CFStringCreateArrayWithFindResults((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1706 _self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1707 stringToFind,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1708 rangeToSearch,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1709 compareOptions);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1710 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1711 CFArrayRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1712 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1713 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1714
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1715 static PyObject *CFStringRefObj_CFStringFind(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1716 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1717 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1718 CFRange _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1719 CFStringRef stringToFind;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1720 CFOptionFlags compareOptions;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1721 #ifndef CFStringFind
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1722 PyMac_PRECHECK(CFStringFind);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1723 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1724 if (!PyArg_ParseTuple(_args, "O&l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1725 CFStringRefObj_Convert, &stringToFind,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1726 &compareOptions))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1727 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1728 _rv = CFStringFind(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1729 stringToFind,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1730 compareOptions);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1731 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1732 CFRange_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1733 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1734 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1735
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1736 static PyObject *CFStringRefObj_CFStringHasPrefix(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1737 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1738 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1739 Boolean _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1740 CFStringRef prefix;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1741 #ifndef CFStringHasPrefix
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1742 PyMac_PRECHECK(CFStringHasPrefix);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1743 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1744 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1745 CFStringRefObj_Convert, &prefix))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1746 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1747 _rv = CFStringHasPrefix(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1748 prefix);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1749 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1750 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1751 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1752 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1753
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1754 static PyObject *CFStringRefObj_CFStringHasSuffix(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1755 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1756 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1757 Boolean _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1758 CFStringRef suffix;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1759 #ifndef CFStringHasSuffix
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1760 PyMac_PRECHECK(CFStringHasSuffix);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1761 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1762 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1763 CFStringRefObj_Convert, &suffix))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1764 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1765 _rv = CFStringHasSuffix(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1766 suffix);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1767 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1768 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1769 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1770 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1771
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1772 static PyObject *CFStringRefObj_CFStringGetLineBounds(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1773 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1774 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1775 CFRange range;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1776 CFIndex lineBeginIndex;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1777 CFIndex lineEndIndex;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1778 CFIndex contentsEndIndex;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1779 #ifndef CFStringGetLineBounds
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1780 PyMac_PRECHECK(CFStringGetLineBounds);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1781 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1782 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1783 CFRange_Convert, &range))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1784 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1785 CFStringGetLineBounds(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1786 range,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1787 &lineBeginIndex,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1788 &lineEndIndex,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1789 &contentsEndIndex);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1790 _res = Py_BuildValue("lll",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1791 lineBeginIndex,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1792 lineEndIndex,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1793 contentsEndIndex);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1794 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1795 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1796
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1797 static PyObject *CFStringRefObj_CFStringCreateArrayBySeparatingStrings(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1798 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1799 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1800 CFArrayRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1801 CFStringRef separatorString;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1802 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1803 CFStringRefObj_Convert, &separatorString))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1804 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1805 _rv = CFStringCreateArrayBySeparatingStrings((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1806 _self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1807 separatorString);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1808 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1809 CFArrayRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1810 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1811 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1812
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1813 static PyObject *CFStringRefObj_CFStringGetIntValue(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1814 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1815 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1816 SInt32 _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1817 #ifndef CFStringGetIntValue
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1818 PyMac_PRECHECK(CFStringGetIntValue);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1819 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1820 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1821 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1822 _rv = CFStringGetIntValue(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1823 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1824 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1825 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1826 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1827
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1828 static PyObject *CFStringRefObj_CFStringGetDoubleValue(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1829 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1830 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1831 double _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1832 #ifndef CFStringGetDoubleValue
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1833 PyMac_PRECHECK(CFStringGetDoubleValue);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1834 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1835 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1836 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1837 _rv = CFStringGetDoubleValue(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1838 _res = Py_BuildValue("d",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1839 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1840 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1841 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1842
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1843 static PyObject *CFStringRefObj_CFStringConvertIANACharSetNameToEncoding(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1844 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1845 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1846 CFStringEncoding _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1847 #ifndef CFStringConvertIANACharSetNameToEncoding
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1848 PyMac_PRECHECK(CFStringConvertIANACharSetNameToEncoding);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1849 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1850 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1851 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1852 _rv = CFStringConvertIANACharSetNameToEncoding(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1853 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1854 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1855 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1856 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1857
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1858 static PyObject *CFStringRefObj_CFShowStr(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1859 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1860 PyObject *_res = NULL;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1861 #ifndef CFShowStr
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1862 PyMac_PRECHECK(CFShowStr);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
1863 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1864 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1865 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1866 CFShowStr(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1867 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1868 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1869 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1870 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1871
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1872 static PyObject *CFStringRefObj_CFURLCreateWithString(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1873 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1874 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1875 CFURLRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1876 CFURLRef baseURL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1877 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1878 OptionalCFURLRefObj_Convert, &baseURL))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1879 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1880 _rv = CFURLCreateWithString((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1881 _self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1882 baseURL);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1883 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1884 CFURLRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1885 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1886 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1887
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1888 static PyObject *CFStringRefObj_CFURLCreateWithFileSystemPath(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1889 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1890 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1891 CFURLRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1892 CFURLPathStyle pathStyle;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1893 Boolean isDirectory;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1894 if (!PyArg_ParseTuple(_args, "ll",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1895 &pathStyle,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1896 &isDirectory))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1897 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1898 _rv = CFURLCreateWithFileSystemPath((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1899 _self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1900 pathStyle,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1901 isDirectory);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1902 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1903 CFURLRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1904 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1905 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1906
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1907 static PyObject *CFStringRefObj_CFURLCreateWithFileSystemPathRelativeToBase(CFStringRefObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1908 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1909 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1910 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1911 CFURLPathStyle pathStyle;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1912 Boolean isDirectory;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1913 CFURLRef baseURL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1914 if (!PyArg_ParseTuple(_args, "llO&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1915 &pathStyle,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1916 &isDirectory,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1917 OptionalCFURLRefObj_Convert, &baseURL))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1918 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1919 _rv = CFURLCreateWithFileSystemPathRelativeToBase((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1920 _self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1921 pathStyle,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1922 isDirectory,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1923 baseURL);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1924 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1925 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1926 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1927 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1928
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1929 static PyObject *CFStringRefObj_CFURLCreateStringByReplacingPercentEscapes(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1930 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1931 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1932 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1933 CFStringRef charactersToLeaveEscaped;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1934 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1935 CFStringRefObj_Convert, &charactersToLeaveEscaped))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1936 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1937 _rv = CFURLCreateStringByReplacingPercentEscapes((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1938 _self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1939 charactersToLeaveEscaped);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1940 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1941 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1942 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1943 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1944
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1945 static PyObject *CFStringRefObj_CFURLCreateStringByAddingPercentEscapes(CFStringRefObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1946 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1947 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1948 CFStringRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1949 CFStringRef charactersToLeaveUnescaped;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1950 CFStringRef legalURLCharactersToBeEscaped;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1951 CFStringEncoding encoding;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1952 if (!PyArg_ParseTuple(_args, "O&O&l",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1953 CFStringRefObj_Convert, &charactersToLeaveUnescaped,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1954 CFStringRefObj_Convert, &legalURLCharactersToBeEscaped,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1955 &encoding))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1956 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1957 _rv = CFURLCreateStringByAddingPercentEscapes((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1958 _self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1959 charactersToLeaveUnescaped,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1960 legalURLCharactersToBeEscaped,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1961 encoding);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1962 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1963 CFStringRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1964 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1965 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1966
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1967 static PyObject *CFStringRefObj_CFStringGetString(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1968 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1969 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1970
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1971 int size = CFStringGetLength(_self->ob_itself)+1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1972 char *data = malloc(size);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1973
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1974 if( data == NULL ) return PyErr_NoMemory();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1975 if ( CFStringGetCString(_self->ob_itself, data, size, 0) ) {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1976 _res = (PyObject *)PyString_FromString(data);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1977 } else {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1978 PyErr_SetString(PyExc_RuntimeError, "CFStringGetCString could not fit the string");
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1979 _res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1980 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1981 free(data);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1982 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1983
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1984 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1985
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1986 static PyObject *CFStringRefObj_CFStringGetUnicode(CFStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1987 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1988 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1989
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1990 int size = CFStringGetLength(_self->ob_itself)+1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1991 Py_UNICODE *data = malloc(size*sizeof(Py_UNICODE));
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1992 CFRange range;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1993
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1994 range.location = 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1995 range.length = size;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1996 if( data == NULL ) return PyErr_NoMemory();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1997 CFStringGetCharacters(_self->ob_itself, range, data);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1998 _res = (PyObject *)PyUnicode_FromUnicode(data, size);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1999 free(data);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2000 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2001
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2002 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2003
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2004 static PyMethodDef CFStringRefObj_methods[] = {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2005 {"CFStringCreateWithSubstring", (PyCFunction)CFStringRefObj_CFStringCreateWithSubstring, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2006 PyDoc_STR("(CFRange range) -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2007 {"CFStringCreateCopy", (PyCFunction)CFStringRefObj_CFStringCreateCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2008 PyDoc_STR("() -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2009 {"CFStringGetLength", (PyCFunction)CFStringRefObj_CFStringGetLength, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2010 PyDoc_STR("() -> (CFIndex _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2011 {"CFStringGetBytes", (PyCFunction)CFStringRefObj_CFStringGetBytes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2012 PyDoc_STR("(CFRange range, CFStringEncoding encoding, UInt8 lossByte, Boolean isExternalRepresentation, CFIndex maxBufLen) -> (CFIndex _rv, UInt8 buffer, CFIndex usedBufLen)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2013 {"CFStringCreateExternalRepresentation", (PyCFunction)CFStringRefObj_CFStringCreateExternalRepresentation, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2014 PyDoc_STR("(CFStringEncoding encoding, UInt8 lossByte) -> (CFDataRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2015 {"CFStringGetSmallestEncoding", (PyCFunction)CFStringRefObj_CFStringGetSmallestEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2016 PyDoc_STR("() -> (CFStringEncoding _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2017 {"CFStringGetFastestEncoding", (PyCFunction)CFStringRefObj_CFStringGetFastestEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2018 PyDoc_STR("() -> (CFStringEncoding _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2019 {"CFStringCompareWithOptions", (PyCFunction)CFStringRefObj_CFStringCompareWithOptions, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2020 PyDoc_STR("(CFStringRef theString2, CFRange rangeToCompare, CFOptionFlags compareOptions) -> (CFComparisonResult _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2021 {"CFStringCompare", (PyCFunction)CFStringRefObj_CFStringCompare, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2022 PyDoc_STR("(CFStringRef theString2, CFOptionFlags compareOptions) -> (CFComparisonResult _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2023 {"CFStringFindWithOptions", (PyCFunction)CFStringRefObj_CFStringFindWithOptions, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2024 PyDoc_STR("(CFStringRef stringToFind, CFRange rangeToSearch, CFOptionFlags searchOptions) -> (Boolean _rv, CFRange result)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2025 {"CFStringCreateArrayWithFindResults", (PyCFunction)CFStringRefObj_CFStringCreateArrayWithFindResults, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2026 PyDoc_STR("(CFStringRef stringToFind, CFRange rangeToSearch, CFOptionFlags compareOptions) -> (CFArrayRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2027 {"CFStringFind", (PyCFunction)CFStringRefObj_CFStringFind, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2028 PyDoc_STR("(CFStringRef stringToFind, CFOptionFlags compareOptions) -> (CFRange _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2029 {"CFStringHasPrefix", (PyCFunction)CFStringRefObj_CFStringHasPrefix, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2030 PyDoc_STR("(CFStringRef prefix) -> (Boolean _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2031 {"CFStringHasSuffix", (PyCFunction)CFStringRefObj_CFStringHasSuffix, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2032 PyDoc_STR("(CFStringRef suffix) -> (Boolean _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2033 {"CFStringGetLineBounds", (PyCFunction)CFStringRefObj_CFStringGetLineBounds, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2034 PyDoc_STR("(CFRange range) -> (CFIndex lineBeginIndex, CFIndex lineEndIndex, CFIndex contentsEndIndex)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2035 {"CFStringCreateArrayBySeparatingStrings", (PyCFunction)CFStringRefObj_CFStringCreateArrayBySeparatingStrings, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2036 PyDoc_STR("(CFStringRef separatorString) -> (CFArrayRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2037 {"CFStringGetIntValue", (PyCFunction)CFStringRefObj_CFStringGetIntValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2038 PyDoc_STR("() -> (SInt32 _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2039 {"CFStringGetDoubleValue", (PyCFunction)CFStringRefObj_CFStringGetDoubleValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2040 PyDoc_STR("() -> (double _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2041 {"CFStringConvertIANACharSetNameToEncoding", (PyCFunction)CFStringRefObj_CFStringConvertIANACharSetNameToEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2042 PyDoc_STR("() -> (CFStringEncoding _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2043 {"CFShowStr", (PyCFunction)CFStringRefObj_CFShowStr, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2044 PyDoc_STR("() -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2045 {"CFURLCreateWithString", (PyCFunction)CFStringRefObj_CFURLCreateWithString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2046 PyDoc_STR("(CFURLRef baseURL) -> (CFURLRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2047 {"CFURLCreateWithFileSystemPath", (PyCFunction)CFStringRefObj_CFURLCreateWithFileSystemPath, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2048 PyDoc_STR("(CFURLPathStyle pathStyle, Boolean isDirectory) -> (CFURLRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2049 {"CFURLCreateWithFileSystemPathRelativeToBase", (PyCFunction)CFStringRefObj_CFURLCreateWithFileSystemPathRelativeToBase, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2050 PyDoc_STR("(CFURLPathStyle pathStyle, Boolean isDirectory, CFURLRef baseURL) -> (CFURLRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2051 {"CFURLCreateStringByReplacingPercentEscapes", (PyCFunction)CFStringRefObj_CFURLCreateStringByReplacingPercentEscapes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2052 PyDoc_STR("(CFStringRef charactersToLeaveEscaped) -> (CFStringRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2053 {"CFURLCreateStringByAddingPercentEscapes", (PyCFunction)CFStringRefObj_CFURLCreateStringByAddingPercentEscapes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2054 PyDoc_STR("(CFStringRef charactersToLeaveUnescaped, CFStringRef legalURLCharactersToBeEscaped, CFStringEncoding encoding) -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2055 {"CFStringGetString", (PyCFunction)CFStringRefObj_CFStringGetString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2056 PyDoc_STR("() -> (string _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2057 {"CFStringGetUnicode", (PyCFunction)CFStringRefObj_CFStringGetUnicode, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2058 PyDoc_STR("() -> (unicode _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2059 {NULL, NULL, 0}
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2060 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2061
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2062 PyMethodChain CFStringRefObj_chain = { CFStringRefObj_methods, &CFTypeRefObj_chain };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2063
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2064 static PyObject *CFStringRefObj_getattr(CFStringRefObject *self, char *name)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2065 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2066 return Py_FindMethodInChain(&CFStringRefObj_chain, (PyObject *)self, name);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2067 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2068
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2069 #define CFStringRefObj_setattr NULL
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2070
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2071 static int CFStringRefObj_compare(CFStringRefObject *self, CFStringRefObject *other)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2072 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2073 /* XXXX Or should we use CFEqual?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2074 if ( self->ob_itself > other->ob_itself ) return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2075 if ( self->ob_itself < other->ob_itself ) return -1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2076 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2077 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2078
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2079 static PyObject * CFStringRefObj_repr(CFStringRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2080 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2081 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
2082 sprintf(buf, "<CFStringRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2083 return PyString_FromString(buf);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2084 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2085
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2086 static int CFStringRefObj_hash(CFStringRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2087 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2088 /* XXXX Or should we use CFHash?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2089 return (int)self->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2090 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2091
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2092 PyTypeObject CFStringRef_Type = {
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2093 PyObject_HEAD_INIT(NULL)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2094 0, /*ob_size*/
21313
91dd223829c6 Patch supplied by Burton Radons for his own SF bug #487390: Modifying
Guido van Rossum <guido@python.org>
parents: 21113
diff changeset
2095 "_CF.CFStringRef", /*tp_name*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2096 sizeof(CFStringRefObject), /*tp_basicsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2097 0, /*tp_itemsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2098 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2099 (destructor) CFStringRefObj_dealloc, /*tp_dealloc*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2100 0, /*tp_print*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2101 (getattrfunc) CFStringRefObj_getattr, /*tp_getattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2102 (setattrfunc) CFStringRefObj_setattr, /*tp_setattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2103 (cmpfunc) CFStringRefObj_compare, /*tp_compare*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2104 (reprfunc) CFStringRefObj_repr, /*tp_repr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2105 (PyNumberMethods *)0, /* tp_as_number */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2106 (PySequenceMethods *)0, /* tp_as_sequence */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2107 (PyMappingMethods *)0, /* tp_as_mapping */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2108 (hashfunc) CFStringRefObj_hash, /*tp_hash*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2109 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2110
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2111 /* ------------------ End object type CFStringRef ------------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2112
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2113
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2114 /* ----------------- Object type CFMutableStringRef ----------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2115
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2116 PyTypeObject CFMutableStringRef_Type;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2117
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
2118 #define CFMutableStringRefObj_Check(x) ((x)->ob_type == &CFMutableStringRef_Type || PyObject_TypeCheck((x), &CFMutableStringRef_Type))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2119
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2120 typedef struct CFMutableStringRefObject {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2121 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2122 CFMutableStringRef ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2123 void (*ob_freeit)(CFTypeRef ptr);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2124 } CFMutableStringRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2125
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2126 PyObject *CFMutableStringRefObj_New(CFMutableStringRef itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2127 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2128 CFMutableStringRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2129 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2130 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2131 PyErr_SetString(PyExc_RuntimeError, "cannot wrap NULL");
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2132 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2133 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2134 it = PyObject_NEW(CFMutableStringRefObject, &CFMutableStringRef_Type);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2135 if (it == NULL) return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2136 it->ob_itself = itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2137 it->ob_freeit = CFRelease;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2138 return (PyObject *)it;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2139 }
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
2140 int CFMutableStringRefObj_Convert(PyObject *v, CFMutableStringRef *p_itself)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2141 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2142
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2143 if (v == Py_None) { *p_itself = NULL; return 1; }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2144 /* Check for other CF objects here */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2145
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2146 if (!CFMutableStringRefObj_Check(v))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2147 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2148 PyErr_SetString(PyExc_TypeError, "CFMutableStringRef required");
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2149 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2150 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2151 *p_itself = ((CFMutableStringRefObject *)v)->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2152 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2153 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2154
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2155 static void CFMutableStringRefObj_dealloc(CFMutableStringRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2156 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2157 if (self->ob_freeit && self->ob_itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2158 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2159 self->ob_freeit((CFTypeRef)self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2160 }
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
2161 PyObject_Free((PyObject *)self);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2162 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2163
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2164 static PyObject *CFMutableStringRefObj_CFStringAppend(CFMutableStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2165 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2166 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2167 CFStringRef appendedString;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2168 #ifndef CFStringAppend
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2169 PyMac_PRECHECK(CFStringAppend);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2170 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2171 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2172 CFStringRefObj_Convert, &appendedString))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2173 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2174 CFStringAppend(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2175 appendedString);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2176 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2177 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2178 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2179 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2180
21614
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2181 static PyObject *CFMutableStringRefObj_CFStringAppendCharacters(CFMutableStringRefObject *_self, PyObject *_args)
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2182 {
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2183 PyObject *_res = NULL;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2184 UniChar *chars__in__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2185 UniCharCount chars__len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2186 int chars__in_len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2187 #ifndef CFStringAppendCharacters
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2188 PyMac_PRECHECK(CFStringAppendCharacters);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2189 #endif
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2190 if (!PyArg_ParseTuple(_args, "u#",
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2191 &chars__in__, &chars__in_len__))
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2192 return NULL;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2193 chars__len__ = chars__in_len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2194 CFStringAppendCharacters(_self->ob_itself,
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2195 chars__in__, chars__len__);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2196 Py_INCREF(Py_None);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2197 _res = Py_None;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2198 return _res;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2199 }
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2200
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2201 static PyObject *CFMutableStringRefObj_CFStringAppendPascalString(CFMutableStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2202 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2203 PyObject *_res = NULL;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2204 Str255 pStr;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2205 CFStringEncoding encoding;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2206 #ifndef CFStringAppendPascalString
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2207 PyMac_PRECHECK(CFStringAppendPascalString);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2208 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2209 if (!PyArg_ParseTuple(_args, "O&l",
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2210 PyMac_GetStr255, pStr,
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2211 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2212 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2213 CFStringAppendPascalString(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2214 pStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2215 encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2216 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2217 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2218 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2219 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2220
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2221 static PyObject *CFMutableStringRefObj_CFStringAppendCString(CFMutableStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2222 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2223 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2224 char* cStr;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2225 CFStringEncoding encoding;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2226 #ifndef CFStringAppendCString
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2227 PyMac_PRECHECK(CFStringAppendCString);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2228 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2229 if (!PyArg_ParseTuple(_args, "sl",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2230 &cStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2231 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2232 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2233 CFStringAppendCString(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2234 cStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2235 encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2236 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2237 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2238 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2239 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2240
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2241 static PyObject *CFMutableStringRefObj_CFStringInsert(CFMutableStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2242 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2243 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2244 CFIndex idx;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2245 CFStringRef insertedStr;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2246 #ifndef CFStringInsert
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2247 PyMac_PRECHECK(CFStringInsert);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2248 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2249 if (!PyArg_ParseTuple(_args, "lO&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2250 &idx,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2251 CFStringRefObj_Convert, &insertedStr))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2252 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2253 CFStringInsert(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2254 idx,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2255 insertedStr);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2256 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2257 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2258 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2259 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2260
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2261 static PyObject *CFMutableStringRefObj_CFStringDelete(CFMutableStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2262 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2263 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2264 CFRange range;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2265 #ifndef CFStringDelete
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2266 PyMac_PRECHECK(CFStringDelete);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2267 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2268 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2269 CFRange_Convert, &range))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2270 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2271 CFStringDelete(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2272 range);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2273 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2274 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2275 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2276 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2277
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2278 static PyObject *CFMutableStringRefObj_CFStringReplace(CFMutableStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2279 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2280 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2281 CFRange range;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2282 CFStringRef replacement;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2283 #ifndef CFStringReplace
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2284 PyMac_PRECHECK(CFStringReplace);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2285 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2286 if (!PyArg_ParseTuple(_args, "O&O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2287 CFRange_Convert, &range,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2288 CFStringRefObj_Convert, &replacement))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2289 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2290 CFStringReplace(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2291 range,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2292 replacement);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2293 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2294 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2295 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2296 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2297
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2298 static PyObject *CFMutableStringRefObj_CFStringReplaceAll(CFMutableStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2299 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2300 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2301 CFStringRef replacement;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2302 #ifndef CFStringReplaceAll
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2303 PyMac_PRECHECK(CFStringReplaceAll);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2304 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2305 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2306 CFStringRefObj_Convert, &replacement))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2307 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2308 CFStringReplaceAll(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2309 replacement);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2310 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2311 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2312 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2313 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2314
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2315 static PyObject *CFMutableStringRefObj_CFStringPad(CFMutableStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2316 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2317 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2318 CFStringRef padString;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2319 CFIndex length;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2320 CFIndex indexIntoPad;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2321 #ifndef CFStringPad
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2322 PyMac_PRECHECK(CFStringPad);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2323 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2324 if (!PyArg_ParseTuple(_args, "O&ll",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2325 CFStringRefObj_Convert, &padString,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2326 &length,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2327 &indexIntoPad))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2328 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2329 CFStringPad(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2330 padString,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2331 length,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2332 indexIntoPad);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2333 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2334 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2335 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2336 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2337
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2338 static PyObject *CFMutableStringRefObj_CFStringTrim(CFMutableStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2339 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2340 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2341 CFStringRef trimString;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2342 #ifndef CFStringTrim
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2343 PyMac_PRECHECK(CFStringTrim);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2344 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2345 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2346 CFStringRefObj_Convert, &trimString))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2347 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2348 CFStringTrim(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2349 trimString);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2350 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2351 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2352 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2353 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2354
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2355 static PyObject *CFMutableStringRefObj_CFStringTrimWhitespace(CFMutableStringRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2356 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2357 PyObject *_res = NULL;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2358 #ifndef CFStringTrimWhitespace
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2359 PyMac_PRECHECK(CFStringTrimWhitespace);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2360 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2361 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2362 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2363 CFStringTrimWhitespace(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2364 Py_INCREF(Py_None);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2365 _res = Py_None;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2366 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2367 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2368
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2369 static PyMethodDef CFMutableStringRefObj_methods[] = {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2370 {"CFStringAppend", (PyCFunction)CFMutableStringRefObj_CFStringAppend, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2371 PyDoc_STR("(CFStringRef appendedString) -> None")},
21614
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2372 {"CFStringAppendCharacters", (PyCFunction)CFMutableStringRefObj_CFStringAppendCharacters, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2373 PyDoc_STR("(Buffer chars) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2374 {"CFStringAppendPascalString", (PyCFunction)CFMutableStringRefObj_CFStringAppendPascalString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2375 PyDoc_STR("(Str255 pStr, CFStringEncoding encoding) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2376 {"CFStringAppendCString", (PyCFunction)CFMutableStringRefObj_CFStringAppendCString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2377 PyDoc_STR("(char* cStr, CFStringEncoding encoding) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2378 {"CFStringInsert", (PyCFunction)CFMutableStringRefObj_CFStringInsert, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2379 PyDoc_STR("(CFIndex idx, CFStringRef insertedStr) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2380 {"CFStringDelete", (PyCFunction)CFMutableStringRefObj_CFStringDelete, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2381 PyDoc_STR("(CFRange range) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2382 {"CFStringReplace", (PyCFunction)CFMutableStringRefObj_CFStringReplace, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2383 PyDoc_STR("(CFRange range, CFStringRef replacement) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2384 {"CFStringReplaceAll", (PyCFunction)CFMutableStringRefObj_CFStringReplaceAll, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2385 PyDoc_STR("(CFStringRef replacement) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2386 {"CFStringPad", (PyCFunction)CFMutableStringRefObj_CFStringPad, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2387 PyDoc_STR("(CFStringRef padString, CFIndex length, CFIndex indexIntoPad) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2388 {"CFStringTrim", (PyCFunction)CFMutableStringRefObj_CFStringTrim, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2389 PyDoc_STR("(CFStringRef trimString) -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2390 {"CFStringTrimWhitespace", (PyCFunction)CFMutableStringRefObj_CFStringTrimWhitespace, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2391 PyDoc_STR("() -> None")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2392 {NULL, NULL, 0}
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2393 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2394
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2395 PyMethodChain CFMutableStringRefObj_chain = { CFMutableStringRefObj_methods, &CFStringRefObj_chain };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2396
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2397 static PyObject *CFMutableStringRefObj_getattr(CFMutableStringRefObject *self, char *name)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2398 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2399 return Py_FindMethodInChain(&CFMutableStringRefObj_chain, (PyObject *)self, name);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2400 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2401
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2402 #define CFMutableStringRefObj_setattr NULL
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2403
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2404 static int CFMutableStringRefObj_compare(CFMutableStringRefObject *self, CFMutableStringRefObject *other)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2405 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2406 /* XXXX Or should we use CFEqual?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2407 if ( self->ob_itself > other->ob_itself ) return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2408 if ( self->ob_itself < other->ob_itself ) return -1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2409 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2410 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2411
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2412 static PyObject * CFMutableStringRefObj_repr(CFMutableStringRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2413 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2414 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
2415 sprintf(buf, "<CFMutableStringRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2416 return PyString_FromString(buf);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2417 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2418
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2419 static int CFMutableStringRefObj_hash(CFMutableStringRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2420 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2421 /* XXXX Or should we use CFHash?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2422 return (int)self->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2423 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2424
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2425 PyTypeObject CFMutableStringRef_Type = {
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2426 PyObject_HEAD_INIT(NULL)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2427 0, /*ob_size*/
21313
91dd223829c6 Patch supplied by Burton Radons for his own SF bug #487390: Modifying
Guido van Rossum <guido@python.org>
parents: 21113
diff changeset
2428 "_CF.CFMutableStringRef", /*tp_name*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2429 sizeof(CFMutableStringRefObject), /*tp_basicsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2430 0, /*tp_itemsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2431 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2432 (destructor) CFMutableStringRefObj_dealloc, /*tp_dealloc*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2433 0, /*tp_print*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2434 (getattrfunc) CFMutableStringRefObj_getattr, /*tp_getattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2435 (setattrfunc) CFMutableStringRefObj_setattr, /*tp_setattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2436 (cmpfunc) CFMutableStringRefObj_compare, /*tp_compare*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2437 (reprfunc) CFMutableStringRefObj_repr, /*tp_repr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2438 (PyNumberMethods *)0, /* tp_as_number */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2439 (PySequenceMethods *)0, /* tp_as_sequence */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2440 (PyMappingMethods *)0, /* tp_as_mapping */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2441 (hashfunc) CFMutableStringRefObj_hash, /*tp_hash*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2442 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2444 /* --------------- End object type CFMutableStringRef --------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2445
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2446
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2447 /* ---------------------- Object type CFURLRef ---------------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2448
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2449 PyTypeObject CFURLRef_Type;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2450
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
2451 #define CFURLRefObj_Check(x) ((x)->ob_type == &CFURLRef_Type || PyObject_TypeCheck((x), &CFURLRef_Type))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2452
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2453 typedef struct CFURLRefObject {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2454 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2455 CFURLRef ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2456 void (*ob_freeit)(CFTypeRef ptr);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2457 } CFURLRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2458
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2459 PyObject *CFURLRefObj_New(CFURLRef itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2460 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2461 CFURLRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2462 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2463 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2464 PyErr_SetString(PyExc_RuntimeError, "cannot wrap NULL");
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2465 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2466 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2467 it = PyObject_NEW(CFURLRefObject, &CFURLRef_Type);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2468 if (it == NULL) return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2469 it->ob_itself = itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2470 it->ob_freeit = CFRelease;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2471 return (PyObject *)it;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2472 }
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
2473 int CFURLRefObj_Convert(PyObject *v, CFURLRef *p_itself)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2474 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2475
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2476 if (v == Py_None) { *p_itself = NULL; return 1; }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2477 /* Check for other CF objects here */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2478
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2479 if (!CFURLRefObj_Check(v))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2480 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2481 PyErr_SetString(PyExc_TypeError, "CFURLRef required");
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2482 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2483 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2484 *p_itself = ((CFURLRefObject *)v)->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2485 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2486 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2487
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2488 static void CFURLRefObj_dealloc(CFURLRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2489 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2490 if (self->ob_freeit && self->ob_itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2491 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2492 self->ob_freeit((CFTypeRef)self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2493 }
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
2494 PyObject_Free((PyObject *)self);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2495 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2496
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2497 static PyObject *CFURLRefObj_CFURLCreateData(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2498 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2499 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2500 CFDataRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2501 CFStringEncoding encoding;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2502 Boolean escapeWhitespace;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2503 if (!PyArg_ParseTuple(_args, "ll",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2504 &encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2505 &escapeWhitespace))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2506 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2507 _rv = CFURLCreateData((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2508 _self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2509 encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2510 escapeWhitespace);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2511 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2512 CFDataRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2513 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2514 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2515
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2516 static PyObject *CFURLRefObj_CFURLGetFileSystemRepresentation(CFURLRefObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2517 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2518 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2519 Boolean _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2520 Boolean resolveAgainstBase;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2521 UInt8 buffer;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2522 CFIndex maxBufLen;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2523 #ifndef CFURLGetFileSystemRepresentation
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2524 PyMac_PRECHECK(CFURLGetFileSystemRepresentation);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2525 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2526 if (!PyArg_ParseTuple(_args, "ll",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2527 &resolveAgainstBase,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2528 &maxBufLen))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2529 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2530 _rv = CFURLGetFileSystemRepresentation(_self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2531 resolveAgainstBase,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2532 &buffer,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2533 maxBufLen);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2534 _res = Py_BuildValue("lb",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2535 _rv,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2536 buffer);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2537 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2538 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2539
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2540 static PyObject *CFURLRefObj_CFURLCopyAbsoluteURL(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2541 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2542 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2543 CFURLRef _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2544 #ifndef CFURLCopyAbsoluteURL
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2545 PyMac_PRECHECK(CFURLCopyAbsoluteURL);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2546 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2547 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2548 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2549 _rv = CFURLCopyAbsoluteURL(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2550 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2551 CFURLRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2552 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2553 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2554
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2555 static PyObject *CFURLRefObj_CFURLGetString(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2556 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2557 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2558 CFStringRef _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2559 #ifndef CFURLGetString
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2560 PyMac_PRECHECK(CFURLGetString);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2561 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2562 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2563 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2564 _rv = CFURLGetString(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2565 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2566 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2567 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2568 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2569
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2570 static PyObject *CFURLRefObj_CFURLGetBaseURL(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2571 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2572 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2573 CFURLRef _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2574 #ifndef CFURLGetBaseURL
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2575 PyMac_PRECHECK(CFURLGetBaseURL);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2576 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2577 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2578 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2579 _rv = CFURLGetBaseURL(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2580 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2581 CFURLRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2582 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2583 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2584
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2585 static PyObject *CFURLRefObj_CFURLCanBeDecomposed(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2586 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2587 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2588 Boolean _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2589 #ifndef CFURLCanBeDecomposed
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2590 PyMac_PRECHECK(CFURLCanBeDecomposed);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2591 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2592 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2593 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2594 _rv = CFURLCanBeDecomposed(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2595 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2596 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2597 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2598 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2599
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2600 static PyObject *CFURLRefObj_CFURLCopyScheme(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2601 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2602 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2603 CFStringRef _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2604 #ifndef CFURLCopyScheme
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2605 PyMac_PRECHECK(CFURLCopyScheme);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2606 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2607 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2608 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2609 _rv = CFURLCopyScheme(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2610 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2611 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2612 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2613 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2614
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2615 static PyObject *CFURLRefObj_CFURLCopyNetLocation(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2616 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2617 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2618 CFStringRef _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2619 #ifndef CFURLCopyNetLocation
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2620 PyMac_PRECHECK(CFURLCopyNetLocation);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2621 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2622 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2623 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2624 _rv = CFURLCopyNetLocation(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2625 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2626 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2627 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2628 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2629
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2630 static PyObject *CFURLRefObj_CFURLCopyPath(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2631 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2632 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2633 CFStringRef _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2634 #ifndef CFURLCopyPath
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2635 PyMac_PRECHECK(CFURLCopyPath);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2636 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2637 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2638 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2639 _rv = CFURLCopyPath(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2640 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2641 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2642 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2643 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2644
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2645 static PyObject *CFURLRefObj_CFURLCopyStrictPath(CFURLRefObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2646 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2647 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2648 CFStringRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2649 Boolean isAbsolute;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2650 #ifndef CFURLCopyStrictPath
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2651 PyMac_PRECHECK(CFURLCopyStrictPath);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2652 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2653 if (!PyArg_ParseTuple(_args, ""))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2654 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2655 _rv = CFURLCopyStrictPath(_self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2656 &isAbsolute);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2657 _res = Py_BuildValue("O&l",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2658 CFStringRefObj_New, _rv,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2659 isAbsolute);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2660 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2661 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2662
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2663 static PyObject *CFURLRefObj_CFURLCopyFileSystemPath(CFURLRefObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2664 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2665 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2666 CFStringRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2667 CFURLPathStyle pathStyle;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2668 #ifndef CFURLCopyFileSystemPath
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2669 PyMac_PRECHECK(CFURLCopyFileSystemPath);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2670 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2671 if (!PyArg_ParseTuple(_args, "l",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2672 &pathStyle))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2673 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2674 _rv = CFURLCopyFileSystemPath(_self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2675 pathStyle);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2676 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2677 CFStringRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2678 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2679 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2680
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2681 static PyObject *CFURLRefObj_CFURLHasDirectoryPath(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2682 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2683 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2684 Boolean _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2685 #ifndef CFURLHasDirectoryPath
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2686 PyMac_PRECHECK(CFURLHasDirectoryPath);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2687 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2688 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2689 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2690 _rv = CFURLHasDirectoryPath(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2691 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2692 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2693 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2694 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2695
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2696 static PyObject *CFURLRefObj_CFURLCopyResourceSpecifier(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2697 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2698 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2699 CFStringRef _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2700 #ifndef CFURLCopyResourceSpecifier
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2701 PyMac_PRECHECK(CFURLCopyResourceSpecifier);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2702 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2703 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2704 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2705 _rv = CFURLCopyResourceSpecifier(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2706 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2707 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2708 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2709 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2710
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2711 static PyObject *CFURLRefObj_CFURLCopyHostName(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2712 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2713 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2714 CFStringRef _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2715 #ifndef CFURLCopyHostName
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2716 PyMac_PRECHECK(CFURLCopyHostName);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2717 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2718 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2719 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2720 _rv = CFURLCopyHostName(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2721 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2722 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2723 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2724 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2725
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2726 static PyObject *CFURLRefObj_CFURLGetPortNumber(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2727 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2728 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2729 SInt32 _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2730 #ifndef CFURLGetPortNumber
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2731 PyMac_PRECHECK(CFURLGetPortNumber);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2732 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2733 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2734 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2735 _rv = CFURLGetPortNumber(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2736 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2737 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2738 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2739 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2740
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2741 static PyObject *CFURLRefObj_CFURLCopyUserName(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2742 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2743 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2744 CFStringRef _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2745 #ifndef CFURLCopyUserName
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2746 PyMac_PRECHECK(CFURLCopyUserName);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2747 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2748 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2749 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2750 _rv = CFURLCopyUserName(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2751 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2752 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2753 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2754 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2755
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2756 static PyObject *CFURLRefObj_CFURLCopyPassword(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2757 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2758 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2759 CFStringRef _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2760 #ifndef CFURLCopyPassword
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2761 PyMac_PRECHECK(CFURLCopyPassword);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2762 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2763 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2764 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2765 _rv = CFURLCopyPassword(_self->ob_itself);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2766 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2767 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2768 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2769 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2770
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2771 static PyObject *CFURLRefObj_CFURLCopyParameterString(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2772 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2773 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2774 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2775 CFStringRef charactersToLeaveEscaped;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2776 #ifndef CFURLCopyParameterString
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2777 PyMac_PRECHECK(CFURLCopyParameterString);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2778 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2779 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2780 CFStringRefObj_Convert, &charactersToLeaveEscaped))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2781 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2782 _rv = CFURLCopyParameterString(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2783 charactersToLeaveEscaped);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2784 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2785 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2786 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2787 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2788
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2789 static PyObject *CFURLRefObj_CFURLCopyQueryString(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2790 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2791 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2792 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2793 CFStringRef charactersToLeaveEscaped;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2794 #ifndef CFURLCopyQueryString
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2795 PyMac_PRECHECK(CFURLCopyQueryString);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2796 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2797 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2798 CFStringRefObj_Convert, &charactersToLeaveEscaped))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2799 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2800 _rv = CFURLCopyQueryString(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2801 charactersToLeaveEscaped);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2802 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2803 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2804 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2805 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2806
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2807 static PyObject *CFURLRefObj_CFURLCopyFragment(CFURLRefObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2808 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2809 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2810 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2811 CFStringRef charactersToLeaveEscaped;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2812 #ifndef CFURLCopyFragment
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2813 PyMac_PRECHECK(CFURLCopyFragment);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
2814 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2815 if (!PyArg_ParseTuple(_args, "O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2816 CFStringRefObj_Convert, &charactersToLeaveEscaped))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2817 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2818 _rv = CFURLCopyFragment(_self->ob_itself,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2819 charactersToLeaveEscaped);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2820 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2821 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2822 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2823 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2824
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2825 static PyObject *CFURLRefObj_CFURLCopyLastPathComponent(CFURLRefObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2826 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2827 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2828 CFStringRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2829 #ifndef CFURLCopyLastPathComponent
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2830 PyMac_PRECHECK(CFURLCopyLastPathComponent);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2831 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2832 if (!PyArg_ParseTuple(_args, ""))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2833 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2834 _rv = CFURLCopyLastPathComponent(_self->ob_itself);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2835 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2836 CFStringRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2837 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2838 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2839
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2840 static PyObject *CFURLRefObj_CFURLCopyPathExtension(CFURLRefObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2841 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2842 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2843 CFStringRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2844 #ifndef CFURLCopyPathExtension
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2845 PyMac_PRECHECK(CFURLCopyPathExtension);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2846 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2847 if (!PyArg_ParseTuple(_args, ""))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2848 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2849 _rv = CFURLCopyPathExtension(_self->ob_itself);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2850 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2851 CFStringRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2852 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2853 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2854
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2855 static PyObject *CFURLRefObj_CFURLCreateCopyAppendingPathComponent(CFURLRefObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2856 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2857 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2858 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2859 CFStringRef pathComponent;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2860 Boolean isDirectory;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2861 if (!PyArg_ParseTuple(_args, "O&l",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2862 CFStringRefObj_Convert, &pathComponent,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2863 &isDirectory))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2864 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2865 _rv = CFURLCreateCopyAppendingPathComponent((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2866 _self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2867 pathComponent,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2868 isDirectory);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2869 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2870 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2871 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2872 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2873
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2874 static PyObject *CFURLRefObj_CFURLCreateCopyDeletingLastPathComponent(CFURLRefObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2875 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2876 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2877 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2878 if (!PyArg_ParseTuple(_args, ""))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2879 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2880 _rv = CFURLCreateCopyDeletingLastPathComponent((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2881 _self->ob_itself);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2882 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2883 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2884 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2885 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2886
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2887 static PyObject *CFURLRefObj_CFURLCreateCopyAppendingPathExtension(CFURLRefObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2888 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2889 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2890 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2891 CFStringRef extension;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2892 if (!PyArg_ParseTuple(_args, "O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2893 CFStringRefObj_Convert, &extension))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2894 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2895 _rv = CFURLCreateCopyAppendingPathExtension((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2896 _self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2897 extension);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2898 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2899 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2900 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2901 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2902
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2903 static PyObject *CFURLRefObj_CFURLCreateCopyDeletingPathExtension(CFURLRefObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2904 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2905 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2906 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2907 if (!PyArg_ParseTuple(_args, ""))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2908 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2909 _rv = CFURLCreateCopyDeletingPathExtension((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2910 _self->ob_itself);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2911 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2912 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2913 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2914 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2915
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2916 static PyObject *CFURLRefObj_CFURLGetFSRef(CFURLRefObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2917 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2918 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2919 Boolean _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2920 FSRef fsRef;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2921 #ifndef CFURLGetFSRef
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2922 PyMac_PRECHECK(CFURLGetFSRef);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2923 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2924 if (!PyArg_ParseTuple(_args, ""))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2925 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2926 _rv = CFURLGetFSRef(_self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2927 &fsRef);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2928 _res = Py_BuildValue("lO&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2929 _rv,
22387
b59e8a8df57e Backport of _CFmodule.c 1.11 and _Winmodule 1.8:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21614
diff changeset
2930 PyMac_BuildFSRef, &fsRef);
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2931 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2932 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2933
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2934 static PyMethodDef CFURLRefObj_methods[] = {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2935 {"CFURLCreateData", (PyCFunction)CFURLRefObj_CFURLCreateData, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2936 PyDoc_STR("(CFStringEncoding encoding, Boolean escapeWhitespace) -> (CFDataRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2937 {"CFURLGetFileSystemRepresentation", (PyCFunction)CFURLRefObj_CFURLGetFileSystemRepresentation, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2938 PyDoc_STR("(Boolean resolveAgainstBase, CFIndex maxBufLen) -> (Boolean _rv, UInt8 buffer)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2939 {"CFURLCopyAbsoluteURL", (PyCFunction)CFURLRefObj_CFURLCopyAbsoluteURL, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2940 PyDoc_STR("() -> (CFURLRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2941 {"CFURLGetString", (PyCFunction)CFURLRefObj_CFURLGetString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2942 PyDoc_STR("() -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2943 {"CFURLGetBaseURL", (PyCFunction)CFURLRefObj_CFURLGetBaseURL, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2944 PyDoc_STR("() -> (CFURLRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2945 {"CFURLCanBeDecomposed", (PyCFunction)CFURLRefObj_CFURLCanBeDecomposed, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2946 PyDoc_STR("() -> (Boolean _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2947 {"CFURLCopyScheme", (PyCFunction)CFURLRefObj_CFURLCopyScheme, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2948 PyDoc_STR("() -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2949 {"CFURLCopyNetLocation", (PyCFunction)CFURLRefObj_CFURLCopyNetLocation, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2950 PyDoc_STR("() -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2951 {"CFURLCopyPath", (PyCFunction)CFURLRefObj_CFURLCopyPath, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2952 PyDoc_STR("() -> (CFStringRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2953 {"CFURLCopyStrictPath", (PyCFunction)CFURLRefObj_CFURLCopyStrictPath, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2954 PyDoc_STR("() -> (CFStringRef _rv, Boolean isAbsolute)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2955 {"CFURLCopyFileSystemPath", (PyCFunction)CFURLRefObj_CFURLCopyFileSystemPath, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2956 PyDoc_STR("(CFURLPathStyle pathStyle) -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2957 {"CFURLHasDirectoryPath", (PyCFunction)CFURLRefObj_CFURLHasDirectoryPath, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2958 PyDoc_STR("() -> (Boolean _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2959 {"CFURLCopyResourceSpecifier", (PyCFunction)CFURLRefObj_CFURLCopyResourceSpecifier, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2960 PyDoc_STR("() -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2961 {"CFURLCopyHostName", (PyCFunction)CFURLRefObj_CFURLCopyHostName, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2962 PyDoc_STR("() -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2963 {"CFURLGetPortNumber", (PyCFunction)CFURLRefObj_CFURLGetPortNumber, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2964 PyDoc_STR("() -> (SInt32 _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2965 {"CFURLCopyUserName", (PyCFunction)CFURLRefObj_CFURLCopyUserName, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2966 PyDoc_STR("() -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2967 {"CFURLCopyPassword", (PyCFunction)CFURLRefObj_CFURLCopyPassword, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2968 PyDoc_STR("() -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2969 {"CFURLCopyParameterString", (PyCFunction)CFURLRefObj_CFURLCopyParameterString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2970 PyDoc_STR("(CFStringRef charactersToLeaveEscaped) -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2971 {"CFURLCopyQueryString", (PyCFunction)CFURLRefObj_CFURLCopyQueryString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2972 PyDoc_STR("(CFStringRef charactersToLeaveEscaped) -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2973 {"CFURLCopyFragment", (PyCFunction)CFURLRefObj_CFURLCopyFragment, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2974 PyDoc_STR("(CFStringRef charactersToLeaveEscaped) -> (CFStringRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2975 {"CFURLCopyLastPathComponent", (PyCFunction)CFURLRefObj_CFURLCopyLastPathComponent, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2976 PyDoc_STR("() -> (CFStringRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2977 {"CFURLCopyPathExtension", (PyCFunction)CFURLRefObj_CFURLCopyPathExtension, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2978 PyDoc_STR("() -> (CFStringRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2979 {"CFURLCreateCopyAppendingPathComponent", (PyCFunction)CFURLRefObj_CFURLCreateCopyAppendingPathComponent, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2980 PyDoc_STR("(CFStringRef pathComponent, Boolean isDirectory) -> (CFURLRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2981 {"CFURLCreateCopyDeletingLastPathComponent", (PyCFunction)CFURLRefObj_CFURLCreateCopyDeletingLastPathComponent, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2982 PyDoc_STR("() -> (CFURLRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2983 {"CFURLCreateCopyAppendingPathExtension", (PyCFunction)CFURLRefObj_CFURLCreateCopyAppendingPathExtension, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2984 PyDoc_STR("(CFStringRef extension) -> (CFURLRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2985 {"CFURLCreateCopyDeletingPathExtension", (PyCFunction)CFURLRefObj_CFURLCreateCopyDeletingPathExtension, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2986 PyDoc_STR("() -> (CFURLRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2987 {"CFURLGetFSRef", (PyCFunction)CFURLRefObj_CFURLGetFSRef, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2988 PyDoc_STR("() -> (Boolean _rv, FSRef fsRef)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2989 {NULL, NULL, 0}
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2990 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2991
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2992 PyMethodChain CFURLRefObj_chain = { CFURLRefObj_methods, &CFTypeRefObj_chain };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2993
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2994 static PyObject *CFURLRefObj_getattr(CFURLRefObject *self, char *name)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2995 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2996 return Py_FindMethodInChain(&CFURLRefObj_chain, (PyObject *)self, name);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2997 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2998
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2999 #define CFURLRefObj_setattr NULL
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3000
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3001 static int CFURLRefObj_compare(CFURLRefObject *self, CFURLRefObject *other)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3002 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3003 /* XXXX Or should we use CFEqual?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3004 if ( self->ob_itself > other->ob_itself ) return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3005 if ( self->ob_itself < other->ob_itself ) return -1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3006 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3007 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3008
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3009 static PyObject * CFURLRefObj_repr(CFURLRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3010 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3011 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
3012 sprintf(buf, "<CFURL object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3013 return PyString_FromString(buf);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3014 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3015
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3016 static int CFURLRefObj_hash(CFURLRefObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3017 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3018 /* XXXX Or should we use CFHash?? */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3019 return (int)self->ob_itself;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3020 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3021
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3022 PyTypeObject CFURLRef_Type = {
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3023 PyObject_HEAD_INIT(NULL)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3024 0, /*ob_size*/
21313
91dd223829c6 Patch supplied by Burton Radons for his own SF bug #487390: Modifying
Guido van Rossum <guido@python.org>
parents: 21113
diff changeset
3025 "_CF.CFURLRef", /*tp_name*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3026 sizeof(CFURLRefObject), /*tp_basicsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3027 0, /*tp_itemsize*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3028 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3029 (destructor) CFURLRefObj_dealloc, /*tp_dealloc*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3030 0, /*tp_print*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3031 (getattrfunc) CFURLRefObj_getattr, /*tp_getattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3032 (setattrfunc) CFURLRefObj_setattr, /*tp_setattr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3033 (cmpfunc) CFURLRefObj_compare, /*tp_compare*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3034 (reprfunc) CFURLRefObj_repr, /*tp_repr*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3035 (PyNumberMethods *)0, /* tp_as_number */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3036 (PySequenceMethods *)0, /* tp_as_sequence */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3037 (PyMappingMethods *)0, /* tp_as_mapping */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3038 (hashfunc) CFURLRefObj_hash, /*tp_hash*/
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3039 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3040
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3041 /* -------------------- End object type CFURLRef -------------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3042
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3043
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3044 static PyObject *CF___CFRangeMake(PyObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3045 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3046 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3047 CFRange _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3048 CFIndex loc;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3049 CFIndex len;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3050 #ifndef __CFRangeMake
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3051 PyMac_PRECHECK(__CFRangeMake);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3052 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3053 if (!PyArg_ParseTuple(_args, "ll",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3054 &loc,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3055 &len))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3056 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3057 _rv = __CFRangeMake(loc,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3058 len);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3059 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3060 CFRange_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3061 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3062 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3063
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3064 static PyObject *CF_CFAllocatorGetTypeID(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3065 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3066 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3067 CFTypeID _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3068 #ifndef CFAllocatorGetTypeID
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3069 PyMac_PRECHECK(CFAllocatorGetTypeID);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3070 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3071 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3072 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3073 _rv = CFAllocatorGetTypeID();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3074 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3075 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3076 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3077 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3078
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3079 static PyObject *CF_CFAllocatorGetPreferredSizeForSize(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3080 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3081 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3082 CFIndex _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3083 CFIndex size;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3084 CFOptionFlags hint;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3085 #ifndef CFAllocatorGetPreferredSizeForSize
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3086 PyMac_PRECHECK(CFAllocatorGetPreferredSizeForSize);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3087 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3088 if (!PyArg_ParseTuple(_args, "ll",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3089 &size,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3090 &hint))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3091 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3092 _rv = CFAllocatorGetPreferredSizeForSize((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3093 size,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3094 hint);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3095 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3096 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3097 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3098 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3099
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3100 static PyObject *CF_CFCopyTypeIDDescription(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3101 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3102 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3103 CFStringRef _rv;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3104 CFTypeID type_id;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3105 #ifndef CFCopyTypeIDDescription
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3106 PyMac_PRECHECK(CFCopyTypeIDDescription);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3107 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3108 if (!PyArg_ParseTuple(_args, "l",
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3109 &type_id))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3110 return NULL;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3111 _rv = CFCopyTypeIDDescription(type_id);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3112 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3113 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3114 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3115 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3116
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3117 static PyObject *CF_CFArrayGetTypeID(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3118 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3119 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3120 CFTypeID _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3121 #ifndef CFArrayGetTypeID
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3122 PyMac_PRECHECK(CFArrayGetTypeID);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3123 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3124 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3125 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3126 _rv = CFArrayGetTypeID();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3127 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3128 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3129 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3130 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3131
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3132 static PyObject *CF_CFArrayCreateMutable(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3133 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3134 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3135 CFMutableArrayRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3136 CFIndex capacity;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3137 #ifndef CFArrayCreateMutable
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3138 PyMac_PRECHECK(CFArrayCreateMutable);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3139 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3140 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3141 &capacity))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3142 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3143 _rv = CFArrayCreateMutable((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3144 capacity,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3145 &kCFTypeArrayCallBacks);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3146 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3147 CFMutableArrayRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3148 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3149 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3150
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3151 static PyObject *CF_CFArrayCreateMutableCopy(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3152 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3153 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3154 CFMutableArrayRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3155 CFIndex capacity;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3156 CFArrayRef theArray;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3157 #ifndef CFArrayCreateMutableCopy
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3158 PyMac_PRECHECK(CFArrayCreateMutableCopy);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3159 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3160 if (!PyArg_ParseTuple(_args, "lO&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3161 &capacity,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3162 CFArrayRefObj_Convert, &theArray))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3163 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3164 _rv = CFArrayCreateMutableCopy((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3165 capacity,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3166 theArray);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3167 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3168 CFMutableArrayRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3169 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3170 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3171
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3172 static PyObject *CF_CFDataGetTypeID(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3173 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3174 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3175 CFTypeID _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3176 #ifndef CFDataGetTypeID
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3177 PyMac_PRECHECK(CFDataGetTypeID);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3178 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3179 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3180 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3181 _rv = CFDataGetTypeID();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3182 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3183 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3184 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3185 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3186
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3187 static PyObject *CF_CFDataCreate(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3188 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3189 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3190 CFDataRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3191 unsigned char *bytes__in__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3192 long bytes__len__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3193 int bytes__in_len__;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3194 #ifndef CFDataCreate
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3195 PyMac_PRECHECK(CFDataCreate);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3196 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3197 if (!PyArg_ParseTuple(_args, "s#",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3198 &bytes__in__, &bytes__in_len__))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3199 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3200 bytes__len__ = bytes__in_len__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3201 _rv = CFDataCreate((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3202 bytes__in__, bytes__len__);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3203 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3204 CFDataRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3205 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3206 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3207
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3208 static PyObject *CF_CFDataCreateWithBytesNoCopy(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3209 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3210 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3211 CFDataRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3212 unsigned char *bytes__in__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3213 long bytes__len__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3214 int bytes__in_len__;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3215 #ifndef CFDataCreateWithBytesNoCopy
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3216 PyMac_PRECHECK(CFDataCreateWithBytesNoCopy);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3217 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3218 if (!PyArg_ParseTuple(_args, "s#",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3219 &bytes__in__, &bytes__in_len__))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3220 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3221 bytes__len__ = bytes__in_len__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3222 _rv = CFDataCreateWithBytesNoCopy((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3223 bytes__in__, bytes__len__,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3224 (CFAllocatorRef)NULL);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3225 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3226 CFDataRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3227 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3228 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3229
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3230 static PyObject *CF_CFDataCreateMutable(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3231 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3232 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3233 CFMutableDataRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3234 CFIndex capacity;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3235 #ifndef CFDataCreateMutable
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3236 PyMac_PRECHECK(CFDataCreateMutable);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3237 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3238 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3239 &capacity))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3240 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3241 _rv = CFDataCreateMutable((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3242 capacity);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3243 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3244 CFMutableDataRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3245 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3246 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3247
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3248 static PyObject *CF_CFDataCreateMutableCopy(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3249 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3250 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3251 CFMutableDataRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3252 CFIndex capacity;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3253 CFDataRef theData;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3254 #ifndef CFDataCreateMutableCopy
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3255 PyMac_PRECHECK(CFDataCreateMutableCopy);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3256 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3257 if (!PyArg_ParseTuple(_args, "lO&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3258 &capacity,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3259 CFDataRefObj_Convert, &theData))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3260 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3261 _rv = CFDataCreateMutableCopy((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3262 capacity,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3263 theData);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3264 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3265 CFMutableDataRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3266 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3267 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3268
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3269 static PyObject *CF_CFDictionaryGetTypeID(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3270 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3271 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3272 CFTypeID _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3273 #ifndef CFDictionaryGetTypeID
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3274 PyMac_PRECHECK(CFDictionaryGetTypeID);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3275 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3276 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3277 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3278 _rv = CFDictionaryGetTypeID();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3279 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3280 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3281 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3282 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3283
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3284 static PyObject *CF_CFDictionaryCreateMutable(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3285 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3286 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3287 CFMutableDictionaryRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3288 CFIndex capacity;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3289 #ifndef CFDictionaryCreateMutable
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3290 PyMac_PRECHECK(CFDictionaryCreateMutable);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3291 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3292 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3293 &capacity))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3294 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3295 _rv = CFDictionaryCreateMutable((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3296 capacity,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3297 &kCFTypeDictionaryKeyCallBacks,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3298 &kCFTypeDictionaryValueCallBacks);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3299 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3300 CFMutableDictionaryRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3301 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3302 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3303
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3304 static PyObject *CF_CFDictionaryCreateMutableCopy(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3305 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3306 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3307 CFMutableDictionaryRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3308 CFIndex capacity;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3309 CFDictionaryRef theDict;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3310 #ifndef CFDictionaryCreateMutableCopy
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3311 PyMac_PRECHECK(CFDictionaryCreateMutableCopy);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3312 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3313 if (!PyArg_ParseTuple(_args, "lO&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3314 &capacity,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3315 CFDictionaryRefObj_Convert, &theDict))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3316 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3317 _rv = CFDictionaryCreateMutableCopy((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3318 capacity,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3319 theDict);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3320 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3321 CFMutableDictionaryRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3322 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3323 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3324
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3325 static PyObject *CF_CFPreferencesCopyAppValue(PyObject *_self, PyObject *_args)
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3326 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3327 PyObject *_res = NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3328 CFTypeRef _rv;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3329 CFStringRef key;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3330 CFStringRef applicationID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3331 #ifndef CFPreferencesCopyAppValue
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3332 PyMac_PRECHECK(CFPreferencesCopyAppValue);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3333 #endif
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3334 if (!PyArg_ParseTuple(_args, "O&O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3335 CFStringRefObj_Convert, &key,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3336 CFStringRefObj_Convert, &applicationID))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3337 return NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3338 _rv = CFPreferencesCopyAppValue(key,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3339 applicationID);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3340 _res = Py_BuildValue("O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3341 CFTypeRefObj_New, _rv);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3342 return _res;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3343 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3344
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3345 static PyObject *CF_CFPreferencesGetAppBooleanValue(PyObject *_self, PyObject *_args)
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3346 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3347 PyObject *_res = NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3348 Boolean _rv;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3349 CFStringRef key;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3350 CFStringRef applicationID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3351 Boolean keyExistsAndHasValidFormat;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3352 #ifndef CFPreferencesGetAppBooleanValue
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3353 PyMac_PRECHECK(CFPreferencesGetAppBooleanValue);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3354 #endif
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3355 if (!PyArg_ParseTuple(_args, "O&O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3356 CFStringRefObj_Convert, &key,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3357 CFStringRefObj_Convert, &applicationID))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3358 return NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3359 _rv = CFPreferencesGetAppBooleanValue(key,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3360 applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3361 &keyExistsAndHasValidFormat);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3362 _res = Py_BuildValue("ll",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3363 _rv,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3364 keyExistsAndHasValidFormat);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3365 return _res;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3366 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3367
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3368 static PyObject *CF_CFPreferencesGetAppIntegerValue(PyObject *_self, PyObject *_args)
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3369 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3370 PyObject *_res = NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3371 CFIndex _rv;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3372 CFStringRef key;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3373 CFStringRef applicationID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3374 Boolean keyExistsAndHasValidFormat;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3375 #ifndef CFPreferencesGetAppIntegerValue
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3376 PyMac_PRECHECK(CFPreferencesGetAppIntegerValue);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3377 #endif
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3378 if (!PyArg_ParseTuple(_args, "O&O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3379 CFStringRefObj_Convert, &key,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3380 CFStringRefObj_Convert, &applicationID))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3381 return NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3382 _rv = CFPreferencesGetAppIntegerValue(key,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3383 applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3384 &keyExistsAndHasValidFormat);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3385 _res = Py_BuildValue("ll",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3386 _rv,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3387 keyExistsAndHasValidFormat);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3388 return _res;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3389 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3390
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3391 static PyObject *CF_CFPreferencesSetAppValue(PyObject *_self, PyObject *_args)
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3392 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3393 PyObject *_res = NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3394 CFStringRef key;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3395 CFTypeRef value;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3396 CFStringRef applicationID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3397 #ifndef CFPreferencesSetAppValue
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3398 PyMac_PRECHECK(CFPreferencesSetAppValue);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3399 #endif
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3400 if (!PyArg_ParseTuple(_args, "O&O&O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3401 CFStringRefObj_Convert, &key,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3402 CFTypeRefObj_Convert, &value,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3403 CFStringRefObj_Convert, &applicationID))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3404 return NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3405 CFPreferencesSetAppValue(key,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3406 value,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3407 applicationID);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3408 Py_INCREF(Py_None);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3409 _res = Py_None;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3410 return _res;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3411 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3412
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3413 static PyObject *CF_CFPreferencesAddSuitePreferencesToApp(PyObject *_self, PyObject *_args)
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3414 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3415 PyObject *_res = NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3416 CFStringRef applicationID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3417 CFStringRef suiteID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3418 #ifndef CFPreferencesAddSuitePreferencesToApp
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3419 PyMac_PRECHECK(CFPreferencesAddSuitePreferencesToApp);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3420 #endif
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3421 if (!PyArg_ParseTuple(_args, "O&O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3422 CFStringRefObj_Convert, &applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3423 CFStringRefObj_Convert, &suiteID))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3424 return NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3425 CFPreferencesAddSuitePreferencesToApp(applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3426 suiteID);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3427 Py_INCREF(Py_None);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3428 _res = Py_None;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3429 return _res;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3430 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3431
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3432 static PyObject *CF_CFPreferencesRemoveSuitePreferencesFromApp(PyObject *_self, PyObject *_args)
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3433 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3434 PyObject *_res = NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3435 CFStringRef applicationID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3436 CFStringRef suiteID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3437 #ifndef CFPreferencesRemoveSuitePreferencesFromApp
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3438 PyMac_PRECHECK(CFPreferencesRemoveSuitePreferencesFromApp);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3439 #endif
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3440 if (!PyArg_ParseTuple(_args, "O&O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3441 CFStringRefObj_Convert, &applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3442 CFStringRefObj_Convert, &suiteID))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3443 return NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3444 CFPreferencesRemoveSuitePreferencesFromApp(applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3445 suiteID);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3446 Py_INCREF(Py_None);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3447 _res = Py_None;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3448 return _res;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3449 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3450
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3451 static PyObject *CF_CFPreferencesAppSynchronize(PyObject *_self, PyObject *_args)
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3452 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3453 PyObject *_res = NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3454 Boolean _rv;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3455 CFStringRef applicationID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3456 #ifndef CFPreferencesAppSynchronize
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3457 PyMac_PRECHECK(CFPreferencesAppSynchronize);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3458 #endif
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3459 if (!PyArg_ParseTuple(_args, "O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3460 CFStringRefObj_Convert, &applicationID))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3461 return NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3462 _rv = CFPreferencesAppSynchronize(applicationID);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3463 _res = Py_BuildValue("l",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3464 _rv);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3465 return _res;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3466 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3467
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3468 static PyObject *CF_CFPreferencesCopyValue(PyObject *_self, PyObject *_args)
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3469 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3470 PyObject *_res = NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3471 CFTypeRef _rv;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3472 CFStringRef key;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3473 CFStringRef applicationID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3474 CFStringRef userName;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3475 CFStringRef hostName;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3476 #ifndef CFPreferencesCopyValue
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3477 PyMac_PRECHECK(CFPreferencesCopyValue);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3478 #endif
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3479 if (!PyArg_ParseTuple(_args, "O&O&O&O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3480 CFStringRefObj_Convert, &key,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3481 CFStringRefObj_Convert, &applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3482 CFStringRefObj_Convert, &userName,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3483 CFStringRefObj_Convert, &hostName))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3484 return NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3485 _rv = CFPreferencesCopyValue(key,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3486 applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3487 userName,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3488 hostName);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3489 _res = Py_BuildValue("O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3490 CFTypeRefObj_New, _rv);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3491 return _res;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3492 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3493
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3494 static PyObject *CF_CFPreferencesCopyMultiple(PyObject *_self, PyObject *_args)
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3495 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3496 PyObject *_res = NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3497 CFDictionaryRef _rv;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3498 CFArrayRef keysToFetch;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3499 CFStringRef applicationID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3500 CFStringRef userName;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3501 CFStringRef hostName;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3502 #ifndef CFPreferencesCopyMultiple
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3503 PyMac_PRECHECK(CFPreferencesCopyMultiple);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3504 #endif
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3505 if (!PyArg_ParseTuple(_args, "O&O&O&O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3506 CFArrayRefObj_Convert, &keysToFetch,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3507 CFStringRefObj_Convert, &applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3508 CFStringRefObj_Convert, &userName,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3509 CFStringRefObj_Convert, &hostName))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3510 return NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3511 _rv = CFPreferencesCopyMultiple(keysToFetch,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3512 applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3513 userName,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3514 hostName);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3515 _res = Py_BuildValue("O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3516 CFDictionaryRefObj_New, _rv);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3517 return _res;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3518 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3519
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3520 static PyObject *CF_CFPreferencesSetValue(PyObject *_self, PyObject *_args)
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3521 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3522 PyObject *_res = NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3523 CFStringRef key;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3524 CFTypeRef value;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3525 CFStringRef applicationID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3526 CFStringRef userName;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3527 CFStringRef hostName;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3528 #ifndef CFPreferencesSetValue
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3529 PyMac_PRECHECK(CFPreferencesSetValue);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3530 #endif
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3531 if (!PyArg_ParseTuple(_args, "O&O&O&O&O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3532 CFStringRefObj_Convert, &key,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3533 CFTypeRefObj_Convert, &value,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3534 CFStringRefObj_Convert, &applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3535 CFStringRefObj_Convert, &userName,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3536 CFStringRefObj_Convert, &hostName))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3537 return NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3538 CFPreferencesSetValue(key,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3539 value,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3540 applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3541 userName,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3542 hostName);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3543 Py_INCREF(Py_None);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3544 _res = Py_None;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3545 return _res;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3546 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3547
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3548 static PyObject *CF_CFPreferencesSetMultiple(PyObject *_self, PyObject *_args)
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3549 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3550 PyObject *_res = NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3551 CFDictionaryRef keysToSet;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3552 CFArrayRef keysToRemove;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3553 CFStringRef applicationID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3554 CFStringRef userName;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3555 CFStringRef hostName;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3556 #ifndef CFPreferencesSetMultiple
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3557 PyMac_PRECHECK(CFPreferencesSetMultiple);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3558 #endif
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3559 if (!PyArg_ParseTuple(_args, "O&O&O&O&O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3560 CFDictionaryRefObj_Convert, &keysToSet,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3561 CFArrayRefObj_Convert, &keysToRemove,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3562 CFStringRefObj_Convert, &applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3563 CFStringRefObj_Convert, &userName,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3564 CFStringRefObj_Convert, &hostName))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3565 return NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3566 CFPreferencesSetMultiple(keysToSet,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3567 keysToRemove,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3568 applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3569 userName,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3570 hostName);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3571 Py_INCREF(Py_None);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3572 _res = Py_None;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3573 return _res;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3574 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3575
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3576 static PyObject *CF_CFPreferencesSynchronize(PyObject *_self, PyObject *_args)
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3577 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3578 PyObject *_res = NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3579 Boolean _rv;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3580 CFStringRef applicationID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3581 CFStringRef userName;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3582 CFStringRef hostName;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3583 #ifndef CFPreferencesSynchronize
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3584 PyMac_PRECHECK(CFPreferencesSynchronize);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3585 #endif
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3586 if (!PyArg_ParseTuple(_args, "O&O&O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3587 CFStringRefObj_Convert, &applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3588 CFStringRefObj_Convert, &userName,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3589 CFStringRefObj_Convert, &hostName))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3590 return NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3591 _rv = CFPreferencesSynchronize(applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3592 userName,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3593 hostName);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3594 _res = Py_BuildValue("l",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3595 _rv);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3596 return _res;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3597 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3598
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3599 static PyObject *CF_CFPreferencesCopyApplicationList(PyObject *_self, PyObject *_args)
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3600 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3601 PyObject *_res = NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3602 CFArrayRef _rv;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3603 CFStringRef userName;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3604 CFStringRef hostName;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3605 #ifndef CFPreferencesCopyApplicationList
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3606 PyMac_PRECHECK(CFPreferencesCopyApplicationList);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3607 #endif
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3608 if (!PyArg_ParseTuple(_args, "O&O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3609 CFStringRefObj_Convert, &userName,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3610 CFStringRefObj_Convert, &hostName))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3611 return NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3612 _rv = CFPreferencesCopyApplicationList(userName,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3613 hostName);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3614 _res = Py_BuildValue("O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3615 CFArrayRefObj_New, _rv);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3616 return _res;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3617 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3618
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3619 static PyObject *CF_CFPreferencesCopyKeyList(PyObject *_self, PyObject *_args)
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3620 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3621 PyObject *_res = NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3622 CFArrayRef _rv;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3623 CFStringRef applicationID;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3624 CFStringRef userName;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3625 CFStringRef hostName;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3626 #ifndef CFPreferencesCopyKeyList
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3627 PyMac_PRECHECK(CFPreferencesCopyKeyList);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3628 #endif
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3629 if (!PyArg_ParseTuple(_args, "O&O&O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3630 CFStringRefObj_Convert, &applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3631 CFStringRefObj_Convert, &userName,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3632 CFStringRefObj_Convert, &hostName))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3633 return NULL;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3634 _rv = CFPreferencesCopyKeyList(applicationID,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3635 userName,
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3636 hostName);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3637 _res = Py_BuildValue("O&",
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3638 CFArrayRefObj_New, _rv);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3639 return _res;
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3640 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3641
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3642 static PyObject *CF_CFStringGetTypeID(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3643 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3644 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3645 CFTypeID _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3646 #ifndef CFStringGetTypeID
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3647 PyMac_PRECHECK(CFStringGetTypeID);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3648 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3649 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3650 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3651 _rv = CFStringGetTypeID();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3652 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3653 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3654 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3655 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3656
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3657 static PyObject *CF_CFStringCreateWithPascalString(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3658 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3659 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3660 CFStringRef _rv;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3661 Str255 pStr;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3662 CFStringEncoding encoding;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3663 #ifndef CFStringCreateWithPascalString
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3664 PyMac_PRECHECK(CFStringCreateWithPascalString);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3665 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3666 if (!PyArg_ParseTuple(_args, "O&l",
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3667 PyMac_GetStr255, pStr,
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3668 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3669 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3670 _rv = CFStringCreateWithPascalString((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3671 pStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3672 encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3673 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3674 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3675 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3676 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3677
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3678 static PyObject *CF_CFStringCreateWithCString(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3679 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3680 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3681 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3682 char* cStr;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3683 CFStringEncoding encoding;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3684 #ifndef CFStringCreateWithCString
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3685 PyMac_PRECHECK(CFStringCreateWithCString);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3686 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3687 if (!PyArg_ParseTuple(_args, "sl",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3688 &cStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3689 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3690 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3691 _rv = CFStringCreateWithCString((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3692 cStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3693 encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3694 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3695 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3696 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3697 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3698
21614
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3699 static PyObject *CF_CFStringCreateWithCharacters(PyObject *_self, PyObject *_args)
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3700 {
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3701 PyObject *_res = NULL;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3702 CFStringRef _rv;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3703 UniChar *chars__in__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3704 UniCharCount chars__len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3705 int chars__in_len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3706 #ifndef CFStringCreateWithCharacters
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3707 PyMac_PRECHECK(CFStringCreateWithCharacters);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3708 #endif
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3709 if (!PyArg_ParseTuple(_args, "u#",
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3710 &chars__in__, &chars__in_len__))
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3711 return NULL;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3712 chars__len__ = chars__in_len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3713 _rv = CFStringCreateWithCharacters((CFAllocatorRef)NULL,
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3714 chars__in__, chars__len__);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3715 _res = Py_BuildValue("O&",
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3716 CFStringRefObj_New, _rv);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3717 return _res;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3718 }
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3719
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3720 static PyObject *CF_CFStringCreateWithPascalStringNoCopy(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3721 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3722 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3723 CFStringRef _rv;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3724 Str255 pStr;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3725 CFStringEncoding encoding;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3726 #ifndef CFStringCreateWithPascalStringNoCopy
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3727 PyMac_PRECHECK(CFStringCreateWithPascalStringNoCopy);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3728 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3729 if (!PyArg_ParseTuple(_args, "O&l",
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3730 PyMac_GetStr255, pStr,
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3731 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3732 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3733 _rv = CFStringCreateWithPascalStringNoCopy((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3734 pStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3735 encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3736 (CFAllocatorRef)NULL);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3737 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3738 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3739 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3740 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3741
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3742 static PyObject *CF_CFStringCreateWithCStringNoCopy(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3743 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3744 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3745 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3746 char* cStr;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3747 CFStringEncoding encoding;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3748 #ifndef CFStringCreateWithCStringNoCopy
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3749 PyMac_PRECHECK(CFStringCreateWithCStringNoCopy);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3750 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3751 if (!PyArg_ParseTuple(_args, "sl",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3752 &cStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3753 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3754 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3755 _rv = CFStringCreateWithCStringNoCopy((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3756 cStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3757 encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3758 (CFAllocatorRef)NULL);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3759 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3760 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3761 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3762 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3763
21614
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3764 static PyObject *CF_CFStringCreateWithCharactersNoCopy(PyObject *_self, PyObject *_args)
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3765 {
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3766 PyObject *_res = NULL;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3767 CFStringRef _rv;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3768 UniChar *chars__in__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3769 UniCharCount chars__len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3770 int chars__in_len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3771 #ifndef CFStringCreateWithCharactersNoCopy
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3772 PyMac_PRECHECK(CFStringCreateWithCharactersNoCopy);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3773 #endif
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3774 if (!PyArg_ParseTuple(_args, "u#",
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3775 &chars__in__, &chars__in_len__))
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3776 return NULL;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3777 chars__len__ = chars__in_len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3778 _rv = CFStringCreateWithCharactersNoCopy((CFAllocatorRef)NULL,
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3779 chars__in__, chars__len__,
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3780 (CFAllocatorRef)NULL);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3781 _res = Py_BuildValue("O&",
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3782 CFStringRefObj_New, _rv);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3783 return _res;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3784 }
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
3785
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3786 static PyObject *CF_CFStringCreateMutable(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3787 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3788 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3789 CFMutableStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3790 CFIndex maxLength;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3791 #ifndef CFStringCreateMutable
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3792 PyMac_PRECHECK(CFStringCreateMutable);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3793 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3794 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3795 &maxLength))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3796 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3797 _rv = CFStringCreateMutable((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3798 maxLength);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3799 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3800 CFMutableStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3801 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3802 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3803
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3804 static PyObject *CF_CFStringCreateMutableCopy(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3805 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3806 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3807 CFMutableStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3808 CFIndex maxLength;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3809 CFStringRef theString;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3810 #ifndef CFStringCreateMutableCopy
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3811 PyMac_PRECHECK(CFStringCreateMutableCopy);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3812 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3813 if (!PyArg_ParseTuple(_args, "lO&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3814 &maxLength,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3815 CFStringRefObj_Convert, &theString))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3816 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3817 _rv = CFStringCreateMutableCopy((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3818 maxLength,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3819 theString);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3820 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3821 CFMutableStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3822 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3823 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3824
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3825 static PyObject *CF_CFStringCreateWithBytes(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3826 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3827 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3828 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3829 unsigned char *bytes__in__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3830 long bytes__len__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3831 int bytes__in_len__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3832 CFStringEncoding encoding;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3833 Boolean isExternalRepresentation;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3834 #ifndef CFStringCreateWithBytes
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3835 PyMac_PRECHECK(CFStringCreateWithBytes);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3836 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3837 if (!PyArg_ParseTuple(_args, "s#ll",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3838 &bytes__in__, &bytes__in_len__,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3839 &encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3840 &isExternalRepresentation))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3841 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3842 bytes__len__ = bytes__in_len__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3843 _rv = CFStringCreateWithBytes((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3844 bytes__in__, bytes__len__,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3845 encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3846 isExternalRepresentation);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3847 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3848 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3849 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3850 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3851
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3852 static PyObject *CF_CFStringGetSystemEncoding(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3853 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3854 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3855 CFStringEncoding _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3856 #ifndef CFStringGetSystemEncoding
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3857 PyMac_PRECHECK(CFStringGetSystemEncoding);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3858 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3859 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3860 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3861 _rv = CFStringGetSystemEncoding();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3862 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3863 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3864 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3865 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3866
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3867 static PyObject *CF_CFStringGetMaximumSizeForEncoding(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3868 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3869 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3870 CFIndex _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3871 CFIndex length;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3872 CFStringEncoding encoding;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3873 #ifndef CFStringGetMaximumSizeForEncoding
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3874 PyMac_PRECHECK(CFStringGetMaximumSizeForEncoding);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3875 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3876 if (!PyArg_ParseTuple(_args, "ll",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3877 &length,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3878 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3879 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3880 _rv = CFStringGetMaximumSizeForEncoding(length,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3881 encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3882 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3883 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3884 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3885 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3886
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3887 static PyObject *CF_CFStringIsEncodingAvailable(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3888 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3889 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3890 Boolean _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3891 CFStringEncoding encoding;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3892 #ifndef CFStringIsEncodingAvailable
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3893 PyMac_PRECHECK(CFStringIsEncodingAvailable);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3894 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3895 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3896 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3897 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3898 _rv = CFStringIsEncodingAvailable(encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3899 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3900 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3901 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3902 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3903
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3904 static PyObject *CF_CFStringGetNameOfEncoding(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3905 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3906 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3907 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3908 CFStringEncoding encoding;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3909 #ifndef CFStringGetNameOfEncoding
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3910 PyMac_PRECHECK(CFStringGetNameOfEncoding);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3911 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3912 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3913 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3914 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3915 _rv = CFStringGetNameOfEncoding(encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3916 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3917 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3918 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3919 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3920
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3921 static PyObject *CF_CFStringConvertEncodingToNSStringEncoding(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3922 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3923 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3924 UInt32 _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3925 CFStringEncoding encoding;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3926 #ifndef CFStringConvertEncodingToNSStringEncoding
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3927 PyMac_PRECHECK(CFStringConvertEncodingToNSStringEncoding);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3928 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3929 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3930 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3931 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3932 _rv = CFStringConvertEncodingToNSStringEncoding(encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3933 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3934 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3935 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3936 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3937
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3938 static PyObject *CF_CFStringConvertNSStringEncodingToEncoding(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3939 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3940 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3941 CFStringEncoding _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3942 UInt32 encoding;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3943 #ifndef CFStringConvertNSStringEncodingToEncoding
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3944 PyMac_PRECHECK(CFStringConvertNSStringEncodingToEncoding);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3945 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3946 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3947 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3948 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3949 _rv = CFStringConvertNSStringEncodingToEncoding(encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3950 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3951 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3952 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3953 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3954
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3955 static PyObject *CF_CFStringConvertEncodingToWindowsCodepage(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3956 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3957 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3958 UInt32 _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3959 CFStringEncoding encoding;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3960 #ifndef CFStringConvertEncodingToWindowsCodepage
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3961 PyMac_PRECHECK(CFStringConvertEncodingToWindowsCodepage);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3962 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3963 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3964 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3965 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3966 _rv = CFStringConvertEncodingToWindowsCodepage(encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3967 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3968 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3969 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3970 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3971
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3972 static PyObject *CF_CFStringConvertWindowsCodepageToEncoding(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3973 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3974 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3975 CFStringEncoding _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3976 UInt32 codepage;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3977 #ifndef CFStringConvertWindowsCodepageToEncoding
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3978 PyMac_PRECHECK(CFStringConvertWindowsCodepageToEncoding);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3979 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3980 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3981 &codepage))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3982 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3983 _rv = CFStringConvertWindowsCodepageToEncoding(codepage);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3984 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3985 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3986 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3987 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3988
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3989 static PyObject *CF_CFStringConvertEncodingToIANACharSetName(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3990 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3991 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3992 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3993 CFStringEncoding encoding;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3994 #ifndef CFStringConvertEncodingToIANACharSetName
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3995 PyMac_PRECHECK(CFStringConvertEncodingToIANACharSetName);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
3996 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3997 if (!PyArg_ParseTuple(_args, "l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3998 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3999 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4000 _rv = CFStringConvertEncodingToIANACharSetName(encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4001 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4002 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4003 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4004 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4005
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4006 static PyObject *CF_CFStringGetMostCompatibleMacStringEncoding(PyObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4007 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4008 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4009 CFStringEncoding _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4010 CFStringEncoding encoding;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4011 #ifndef CFStringGetMostCompatibleMacStringEncoding
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4012 PyMac_PRECHECK(CFStringGetMostCompatibleMacStringEncoding);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4013 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4014 if (!PyArg_ParseTuple(_args, "l",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4015 &encoding))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4016 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4017 _rv = CFStringGetMostCompatibleMacStringEncoding(encoding);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4018 _res = Py_BuildValue("l",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4019 _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4020 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4021 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4022
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4023 static PyObject *CF___CFStringMakeConstantString(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4024 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4025 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4026 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4027 char* cStr;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
4028 #ifndef __CFStringMakeConstantString
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4029 PyMac_PRECHECK(__CFStringMakeConstantString);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
4030 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4031 if (!PyArg_ParseTuple(_args, "s",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4032 &cStr))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4033 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4034 _rv = __CFStringMakeConstantString(cStr);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4035 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4036 CFStringRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4037 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4038 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4039
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4040 static PyObject *CF_CFURLGetTypeID(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4041 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4042 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4043 CFTypeID _rv;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
4044 #ifndef CFURLGetTypeID
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4045 PyMac_PRECHECK(CFURLGetTypeID);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
4046 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4047 if (!PyArg_ParseTuple(_args, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4048 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4049 _rv = CFURLGetTypeID();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4050 _res = Py_BuildValue("l",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4051 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4052 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4053 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4054
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4055 static PyObject *CF_CFURLCreateWithBytes(PyObject *_self, PyObject *_args)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4056 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4057 PyObject *_res = NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4058 CFURLRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4059 unsigned char *URLBytes__in__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4060 long URLBytes__len__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4061 int URLBytes__in_len__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4062 CFStringEncoding encoding;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4063 CFURLRef baseURL;
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
4064 #ifndef CFURLCreateWithBytes
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4065 PyMac_PRECHECK(CFURLCreateWithBytes);
21113
ed3dce17fc79 Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
Jack Jansen <jack.jansen@cwi.nl>
parents: 20877
diff changeset
4066 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4067 if (!PyArg_ParseTuple(_args, "s#lO&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4068 &URLBytes__in__, &URLBytes__in_len__,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4069 &encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4070 OptionalCFURLRefObj_Convert, &baseURL))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4071 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4072 URLBytes__len__ = URLBytes__in_len__;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4073 _rv = CFURLCreateWithBytes((CFAllocatorRef)NULL,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4074 URLBytes__in__, URLBytes__len__,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4075 encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4076 baseURL);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4077 _res = Py_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4078 CFURLRefObj_New, _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4079 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4080 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4081
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4082 static PyObject *CF_CFURLCreateFromFileSystemRepresentation(PyObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4083 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4084 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4085 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4086 unsigned char *buffer__in__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4087 long buffer__len__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4088 int buffer__in_len__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4089 Boolean isDirectory;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4090 #ifndef CFURLCreateFromFileSystemRepresentation
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4091 PyMac_PRECHECK(CFURLCreateFromFileSystemRepresentation);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4092 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4093 if (!PyArg_ParseTuple(_args, "s#l",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4094 &buffer__in__, &buffer__in_len__,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4095 &isDirectory))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4096 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4097 buffer__len__ = buffer__in_len__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4098 _rv = CFURLCreateFromFileSystemRepresentation((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4099 buffer__in__, buffer__len__,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4100 isDirectory);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4101 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4102 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4103 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4104 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4105
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4106 static PyObject *CF_CFURLCreateFromFileSystemRepresentationRelativeToBase(PyObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4107 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4108 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4109 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4110 unsigned char *buffer__in__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4111 long buffer__len__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4112 int buffer__in_len__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4113 Boolean isDirectory;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4114 CFURLRef baseURL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4115 #ifndef CFURLCreateFromFileSystemRepresentationRelativeToBase
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4116 PyMac_PRECHECK(CFURLCreateFromFileSystemRepresentationRelativeToBase);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4117 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4118 if (!PyArg_ParseTuple(_args, "s#lO&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4119 &buffer__in__, &buffer__in_len__,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4120 &isDirectory,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4121 OptionalCFURLRefObj_Convert, &baseURL))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4122 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4123 buffer__len__ = buffer__in_len__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4124 _rv = CFURLCreateFromFileSystemRepresentationRelativeToBase((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4125 buffer__in__, buffer__len__,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4126 isDirectory,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4127 baseURL);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4128 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4129 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4130 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4131 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4132
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4133 static PyObject *CF_CFURLCreateFromFSRef(PyObject *_self, PyObject *_args)
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4134 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4135 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4136 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4137 FSRef fsRef;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4138 #ifndef CFURLCreateFromFSRef
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4139 PyMac_PRECHECK(CFURLCreateFromFSRef);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4140 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4141 if (!PyArg_ParseTuple(_args, "O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4142 PyMac_GetFSRef, &fsRef))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4143 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4144 _rv = CFURLCreateFromFSRef((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4145 &fsRef);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4146 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4147 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4148 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4149 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4150
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4151 static PyObject *CF_toCF(PyObject *_self, PyObject *_args)
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4152 {
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4153 PyObject *_res = NULL;
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4154
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4155 CFTypeRef rv;
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4156 CFTypeID typeid;
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4157
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4158 if (!PyArg_ParseTuple(_args, "O&", PyCF_Python2CF, &rv))
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4159 return NULL;
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4160 typeid = CFGetTypeID(rv);
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4161
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4162 if (typeid == CFStringGetTypeID())
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4163 return Py_BuildValue("O&", CFStringRefObj_New, rv);
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4164 if (typeid == CFArrayGetTypeID())
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4165 return Py_BuildValue("O&", CFArrayRefObj_New, rv);
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4166 if (typeid == CFDictionaryGetTypeID())
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4167 return Py_BuildValue("O&", CFDictionaryRefObj_New, rv);
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4168 if (typeid == CFURLGetTypeID())
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4169 return Py_BuildValue("O&", CFURLRefObj_New, rv);
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4170
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4171 _res = Py_BuildValue("O&", CFTypeRefObj_New, rv);
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4172 return _res;
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4173
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4174 }
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4175
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4176 static PyMethodDef CF_methods[] = {
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4177 {"__CFRangeMake", (PyCFunction)CF___CFRangeMake, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4178 PyDoc_STR("(CFIndex loc, CFIndex len) -> (CFRange _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4179 {"CFAllocatorGetTypeID", (PyCFunction)CF_CFAllocatorGetTypeID, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4180 PyDoc_STR("() -> (CFTypeID _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4181 {"CFAllocatorGetPreferredSizeForSize", (PyCFunction)CF_CFAllocatorGetPreferredSizeForSize, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4182 PyDoc_STR("(CFIndex size, CFOptionFlags hint) -> (CFIndex _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4183 {"CFCopyTypeIDDescription", (PyCFunction)CF_CFCopyTypeIDDescription, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4184 PyDoc_STR("(CFTypeID type_id) -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4185 {"CFArrayGetTypeID", (PyCFunction)CF_CFArrayGetTypeID, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4186 PyDoc_STR("() -> (CFTypeID _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4187 {"CFArrayCreateMutable", (PyCFunction)CF_CFArrayCreateMutable, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4188 PyDoc_STR("(CFIndex capacity) -> (CFMutableArrayRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4189 {"CFArrayCreateMutableCopy", (PyCFunction)CF_CFArrayCreateMutableCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4190 PyDoc_STR("(CFIndex capacity, CFArrayRef theArray) -> (CFMutableArrayRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4191 {"CFDataGetTypeID", (PyCFunction)CF_CFDataGetTypeID, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4192 PyDoc_STR("() -> (CFTypeID _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4193 {"CFDataCreate", (PyCFunction)CF_CFDataCreate, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4194 PyDoc_STR("(Buffer bytes) -> (CFDataRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4195 {"CFDataCreateWithBytesNoCopy", (PyCFunction)CF_CFDataCreateWithBytesNoCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4196 PyDoc_STR("(Buffer bytes) -> (CFDataRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4197 {"CFDataCreateMutable", (PyCFunction)CF_CFDataCreateMutable, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4198 PyDoc_STR("(CFIndex capacity) -> (CFMutableDataRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4199 {"CFDataCreateMutableCopy", (PyCFunction)CF_CFDataCreateMutableCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4200 PyDoc_STR("(CFIndex capacity, CFDataRef theData) -> (CFMutableDataRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4201 {"CFDictionaryGetTypeID", (PyCFunction)CF_CFDictionaryGetTypeID, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4202 PyDoc_STR("() -> (CFTypeID _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4203 {"CFDictionaryCreateMutable", (PyCFunction)CF_CFDictionaryCreateMutable, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4204 PyDoc_STR("(CFIndex capacity) -> (CFMutableDictionaryRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4205 {"CFDictionaryCreateMutableCopy", (PyCFunction)CF_CFDictionaryCreateMutableCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4206 PyDoc_STR("(CFIndex capacity, CFDictionaryRef theDict) -> (CFMutableDictionaryRef _rv)")},
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4207 {"CFPreferencesCopyAppValue", (PyCFunction)CF_CFPreferencesCopyAppValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4208 PyDoc_STR("(CFStringRef key, CFStringRef applicationID) -> (CFTypeRef _rv)")},
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4209 {"CFPreferencesGetAppBooleanValue", (PyCFunction)CF_CFPreferencesGetAppBooleanValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4210 PyDoc_STR("(CFStringRef key, CFStringRef applicationID) -> (Boolean _rv, Boolean keyExistsAndHasValidFormat)")},
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4211 {"CFPreferencesGetAppIntegerValue", (PyCFunction)CF_CFPreferencesGetAppIntegerValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4212 PyDoc_STR("(CFStringRef key, CFStringRef applicationID) -> (CFIndex _rv, Boolean keyExistsAndHasValidFormat)")},
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4213 {"CFPreferencesSetAppValue", (PyCFunction)CF_CFPreferencesSetAppValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4214 PyDoc_STR("(CFStringRef key, CFTypeRef value, CFStringRef applicationID) -> None")},
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4215 {"CFPreferencesAddSuitePreferencesToApp", (PyCFunction)CF_CFPreferencesAddSuitePreferencesToApp, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4216 PyDoc_STR("(CFStringRef applicationID, CFStringRef suiteID) -> None")},
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4217 {"CFPreferencesRemoveSuitePreferencesFromApp", (PyCFunction)CF_CFPreferencesRemoveSuitePreferencesFromApp, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4218 PyDoc_STR("(CFStringRef applicationID, CFStringRef suiteID) -> None")},
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4219 {"CFPreferencesAppSynchronize", (PyCFunction)CF_CFPreferencesAppSynchronize, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4220 PyDoc_STR("(CFStringRef applicationID) -> (Boolean _rv)")},
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4221 {"CFPreferencesCopyValue", (PyCFunction)CF_CFPreferencesCopyValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4222 PyDoc_STR("(CFStringRef key, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName) -> (CFTypeRef _rv)")},
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4223 {"CFPreferencesCopyMultiple", (PyCFunction)CF_CFPreferencesCopyMultiple, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4224 PyDoc_STR("(CFArrayRef keysToFetch, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName) -> (CFDictionaryRef _rv)")},
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4225 {"CFPreferencesSetValue", (PyCFunction)CF_CFPreferencesSetValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4226 PyDoc_STR("(CFStringRef key, CFTypeRef value, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName) -> None")},
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4227 {"CFPreferencesSetMultiple", (PyCFunction)CF_CFPreferencesSetMultiple, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4228 PyDoc_STR("(CFDictionaryRef keysToSet, CFArrayRef keysToRemove, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName) -> None")},
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4229 {"CFPreferencesSynchronize", (PyCFunction)CF_CFPreferencesSynchronize, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4230 PyDoc_STR("(CFStringRef applicationID, CFStringRef userName, CFStringRef hostName) -> (Boolean _rv)")},
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4231 {"CFPreferencesCopyApplicationList", (PyCFunction)CF_CFPreferencesCopyApplicationList, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4232 PyDoc_STR("(CFStringRef userName, CFStringRef hostName) -> (CFArrayRef _rv)")},
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4233 {"CFPreferencesCopyKeyList", (PyCFunction)CF_CFPreferencesCopyKeyList, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4234 PyDoc_STR("(CFStringRef applicationID, CFStringRef userName, CFStringRef hostName) -> (CFArrayRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4235 {"CFStringGetTypeID", (PyCFunction)CF_CFStringGetTypeID, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4236 PyDoc_STR("() -> (CFTypeID _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4237 {"CFStringCreateWithPascalString", (PyCFunction)CF_CFStringCreateWithPascalString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4238 PyDoc_STR("(Str255 pStr, CFStringEncoding encoding) -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4239 {"CFStringCreateWithCString", (PyCFunction)CF_CFStringCreateWithCString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4240 PyDoc_STR("(char* cStr, CFStringEncoding encoding) -> (CFStringRef _rv)")},
21614
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4241 {"CFStringCreateWithCharacters", (PyCFunction)CF_CFStringCreateWithCharacters, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4242 PyDoc_STR("(Buffer chars) -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4243 {"CFStringCreateWithPascalStringNoCopy", (PyCFunction)CF_CFStringCreateWithPascalStringNoCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4244 PyDoc_STR("(Str255 pStr, CFStringEncoding encoding) -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4245 {"CFStringCreateWithCStringNoCopy", (PyCFunction)CF_CFStringCreateWithCStringNoCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4246 PyDoc_STR("(char* cStr, CFStringEncoding encoding) -> (CFStringRef _rv)")},
21614
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4247 {"CFStringCreateWithCharactersNoCopy", (PyCFunction)CF_CFStringCreateWithCharactersNoCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4248 PyDoc_STR("(Buffer chars) -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4249 {"CFStringCreateMutable", (PyCFunction)CF_CFStringCreateMutable, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4250 PyDoc_STR("(CFIndex maxLength) -> (CFMutableStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4251 {"CFStringCreateMutableCopy", (PyCFunction)CF_CFStringCreateMutableCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4252 PyDoc_STR("(CFIndex maxLength, CFStringRef theString) -> (CFMutableStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4253 {"CFStringCreateWithBytes", (PyCFunction)CF_CFStringCreateWithBytes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4254 PyDoc_STR("(Buffer bytes, CFStringEncoding encoding, Boolean isExternalRepresentation) -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4255 {"CFStringGetSystemEncoding", (PyCFunction)CF_CFStringGetSystemEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4256 PyDoc_STR("() -> (CFStringEncoding _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4257 {"CFStringGetMaximumSizeForEncoding", (PyCFunction)CF_CFStringGetMaximumSizeForEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4258 PyDoc_STR("(CFIndex length, CFStringEncoding encoding) -> (CFIndex _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4259 {"CFStringIsEncodingAvailable", (PyCFunction)CF_CFStringIsEncodingAvailable, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4260 PyDoc_STR("(CFStringEncoding encoding) -> (Boolean _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4261 {"CFStringGetNameOfEncoding", (PyCFunction)CF_CFStringGetNameOfEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4262 PyDoc_STR("(CFStringEncoding encoding) -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4263 {"CFStringConvertEncodingToNSStringEncoding", (PyCFunction)CF_CFStringConvertEncodingToNSStringEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4264 PyDoc_STR("(CFStringEncoding encoding) -> (UInt32 _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4265 {"CFStringConvertNSStringEncodingToEncoding", (PyCFunction)CF_CFStringConvertNSStringEncodingToEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4266 PyDoc_STR("(UInt32 encoding) -> (CFStringEncoding _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4267 {"CFStringConvertEncodingToWindowsCodepage", (PyCFunction)CF_CFStringConvertEncodingToWindowsCodepage, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4268 PyDoc_STR("(CFStringEncoding encoding) -> (UInt32 _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4269 {"CFStringConvertWindowsCodepageToEncoding", (PyCFunction)CF_CFStringConvertWindowsCodepageToEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4270 PyDoc_STR("(UInt32 codepage) -> (CFStringEncoding _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4271 {"CFStringConvertEncodingToIANACharSetName", (PyCFunction)CF_CFStringConvertEncodingToIANACharSetName, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4272 PyDoc_STR("(CFStringEncoding encoding) -> (CFStringRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4273 {"CFStringGetMostCompatibleMacStringEncoding", (PyCFunction)CF_CFStringGetMostCompatibleMacStringEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4274 PyDoc_STR("(CFStringEncoding encoding) -> (CFStringEncoding _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4275 {"__CFStringMakeConstantString", (PyCFunction)CF___CFStringMakeConstantString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4276 PyDoc_STR("(char* cStr) -> (CFStringRef _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4277 {"CFURLGetTypeID", (PyCFunction)CF_CFURLGetTypeID, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4278 PyDoc_STR("() -> (CFTypeID _rv)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4279 {"CFURLCreateWithBytes", (PyCFunction)CF_CFURLCreateWithBytes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4280 PyDoc_STR("(Buffer URLBytes, CFStringEncoding encoding, CFURLRef baseURL) -> (CFURLRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4281 {"CFURLCreateFromFileSystemRepresentation", (PyCFunction)CF_CFURLCreateFromFileSystemRepresentation, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4282 PyDoc_STR("(Buffer buffer, Boolean isDirectory) -> (CFURLRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4283 {"CFURLCreateFromFileSystemRepresentationRelativeToBase", (PyCFunction)CF_CFURLCreateFromFileSystemRepresentationRelativeToBase, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4284 PyDoc_STR("(Buffer buffer, Boolean isDirectory, CFURLRef baseURL) -> (CFURLRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4285 {"CFURLCreateFromFSRef", (PyCFunction)CF_CFURLCreateFromFSRef, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4286 PyDoc_STR("(FSRef fsRef) -> (CFURLRef _rv)")},
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4287 {"toCF", (PyCFunction)CF_toCF, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4288 PyDoc_STR("(python_object) -> (CF_object)")},
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4289 {NULL, NULL, 0}
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4290 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4291
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4292
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4293
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4294
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4295 void init_CF(void)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4296 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4297 PyObject *m;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4298 PyObject *d;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4299
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4300
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4301
20877
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4302 PyMac_INIT_TOOLBOX_OBJECT_NEW(CFTypeRef, CFTypeRefObj_New);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4303 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFTypeRef, CFTypeRefObj_Convert);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4304 PyMac_INIT_TOOLBOX_OBJECT_NEW(CFStringRef, CFStringRefObj_New);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4305 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFStringRef, CFStringRefObj_Convert);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4306 PyMac_INIT_TOOLBOX_OBJECT_NEW(CFMutableStringRef, CFMutableStringRefObj_New);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4307 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFMutableStringRef, CFMutableStringRefObj_Convert);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4308
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4309 PyMac_INIT_TOOLBOX_OBJECT_NEW(CFArrayRef, CFArrayRefObj_New);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4310 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFArrayRef, CFArrayRefObj_Convert);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4311 PyMac_INIT_TOOLBOX_OBJECT_NEW(CFMutableArrayRef, CFMutableArrayRefObj_New);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4312 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFMutableArrayRef, CFMutableArrayRefObj_Convert);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4313 PyMac_INIT_TOOLBOX_OBJECT_NEW(CFDictionaryRef, CFDictionaryRefObj_New);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4314 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFDictionaryRef, CFDictionaryRefObj_Convert);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4315 PyMac_INIT_TOOLBOX_OBJECT_NEW(CFMutableDictionaryRef, CFMutableDictionaryRefObj_New);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4316 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFMutableDictionaryRef, CFMutableDictionaryRefObj_Convert);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4317 PyMac_INIT_TOOLBOX_OBJECT_NEW(CFURLRef, CFURLRefObj_New);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4318 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFURLRef, CFURLRefObj_Convert);
d54e294484b2 Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19723
diff changeset
4319 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFURLRef, CFURLRefObj_Convert);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4320
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4321
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4322 m = Py_InitModule("_CF", CF_methods);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4323 d = PyModule_GetDict(m);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4324 CF_Error = PyMac_GetOSErrException();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4325 if (CF_Error == NULL ||
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4326 PyDict_SetItemString(d, "Error", CF_Error) != 0)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4327 return;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4328 CFTypeRef_Type.ob_type = &PyType_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4329 if (PyType_Ready(&CFTypeRef_Type) < 0) return;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4330 Py_INCREF(&CFTypeRef_Type);
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4331 PyModule_AddObject(m, "CFTypeRef", (PyObject *)&CFTypeRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4332 /* Backward-compatible name */
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4333 Py_INCREF(&CFTypeRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4334 PyModule_AddObject(m, "CFTypeRefType", (PyObject *)&CFTypeRef_Type);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4335 CFArrayRef_Type.ob_type = &PyType_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4336 if (PyType_Ready(&CFArrayRef_Type) < 0) return;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4337 Py_INCREF(&CFArrayRef_Type);
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4338 PyModule_AddObject(m, "CFArrayRef", (PyObject *)&CFArrayRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4339 /* Backward-compatible name */
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4340 Py_INCREF(&CFArrayRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4341 PyModule_AddObject(m, "CFArrayRefType", (PyObject *)&CFArrayRef_Type);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4342 CFMutableArrayRef_Type.ob_type = &PyType_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4343 if (PyType_Ready(&CFMutableArrayRef_Type) < 0) return;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4344 Py_INCREF(&CFMutableArrayRef_Type);
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4345 PyModule_AddObject(m, "CFMutableArrayRef", (PyObject *)&CFMutableArrayRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4346 /* Backward-compatible name */
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4347 Py_INCREF(&CFMutableArrayRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4348 PyModule_AddObject(m, "CFMutableArrayRefType", (PyObject *)&CFMutableArrayRef_Type);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4349 CFDictionaryRef_Type.ob_type = &PyType_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4350 if (PyType_Ready(&CFDictionaryRef_Type) < 0) return;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4351 Py_INCREF(&CFDictionaryRef_Type);
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4352 PyModule_AddObject(m, "CFDictionaryRef", (PyObject *)&CFDictionaryRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4353 /* Backward-compatible name */
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4354 Py_INCREF(&CFDictionaryRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4355 PyModule_AddObject(m, "CFDictionaryRefType", (PyObject *)&CFDictionaryRef_Type);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4356 CFMutableDictionaryRef_Type.ob_type = &PyType_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4357 if (PyType_Ready(&CFMutableDictionaryRef_Type) < 0) return;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4358 Py_INCREF(&CFMutableDictionaryRef_Type);
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4359 PyModule_AddObject(m, "CFMutableDictionaryRef", (PyObject *)&CFMutableDictionaryRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4360 /* Backward-compatible name */
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4361 Py_INCREF(&CFMutableDictionaryRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4362 PyModule_AddObject(m, "CFMutableDictionaryRefType", (PyObject *)&CFMutableDictionaryRef_Type);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4363 CFDataRef_Type.ob_type = &PyType_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4364 if (PyType_Ready(&CFDataRef_Type) < 0) return;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4365 Py_INCREF(&CFDataRef_Type);
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4366 PyModule_AddObject(m, "CFDataRef", (PyObject *)&CFDataRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4367 /* Backward-compatible name */
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4368 Py_INCREF(&CFDataRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4369 PyModule_AddObject(m, "CFDataRefType", (PyObject *)&CFDataRef_Type);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4370 CFMutableDataRef_Type.ob_type = &PyType_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4371 if (PyType_Ready(&CFMutableDataRef_Type) < 0) return;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4372 Py_INCREF(&CFMutableDataRef_Type);
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4373 PyModule_AddObject(m, "CFMutableDataRef", (PyObject *)&CFMutableDataRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4374 /* Backward-compatible name */
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4375 Py_INCREF(&CFMutableDataRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4376 PyModule_AddObject(m, "CFMutableDataRefType", (PyObject *)&CFMutableDataRef_Type);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4377 CFStringRef_Type.ob_type = &PyType_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4378 if (PyType_Ready(&CFStringRef_Type) < 0) return;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4379 Py_INCREF(&CFStringRef_Type);
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4380 PyModule_AddObject(m, "CFStringRef", (PyObject *)&CFStringRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4381 /* Backward-compatible name */
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4382 Py_INCREF(&CFStringRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4383 PyModule_AddObject(m, "CFStringRefType", (PyObject *)&CFStringRef_Type);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4384 CFMutableStringRef_Type.ob_type = &PyType_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4385 if (PyType_Ready(&CFMutableStringRef_Type) < 0) return;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4386 Py_INCREF(&CFMutableStringRef_Type);
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4387 PyModule_AddObject(m, "CFMutableStringRef", (PyObject *)&CFMutableStringRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4388 /* Backward-compatible name */
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4389 Py_INCREF(&CFMutableStringRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4390 PyModule_AddObject(m, "CFMutableStringRefType", (PyObject *)&CFMutableStringRef_Type);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4391 CFURLRef_Type.ob_type = &PyType_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4392 if (PyType_Ready(&CFURLRef_Type) < 0) return;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4393 Py_INCREF(&CFURLRef_Type);
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4394 PyModule_AddObject(m, "CFURLRef", (PyObject *)&CFURLRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4395 /* Backward-compatible name */
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4396 Py_INCREF(&CFURLRef_Type);
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
4397 PyModule_AddObject(m, "CFURLRefType", (PyObject *)&CFURLRef_Type);
23438
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4398
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4399 #define _STRINGCONST(name) PyModule_AddObject(m, #name, CFStringRefObj_New(name))
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4400 _STRINGCONST(kCFPreferencesAnyApplication);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4401 _STRINGCONST(kCFPreferencesCurrentApplication);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4402 _STRINGCONST(kCFPreferencesAnyHost);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4403 _STRINGCONST(kCFPreferencesCurrentHost);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4404 _STRINGCONST(kCFPreferencesAnyUser);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4405 _STRINGCONST(kCFPreferencesCurrentUser);
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4406
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4407
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4408
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4409 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4410
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4411 /* ========================= End module _CF ========================= */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4412