annotate Mac/Modules/cf/_CFmodule.c @ 58765:2ba7677bfa95 legacy-trunk

testCopysign was defined twice in test_math; combine the definitions
author Mark Dickinson <dickinsm@gmail.com>
date Sat, 06 Feb 2010 23:11:25 +0000
parents 52294af4b663
children fd25030223b0
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
8 #include "pymactoolbox.h"
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
9
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
10 /* 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
11 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
28146
f9b702c52dae Accept only the system default encoding when converting Python
Jack Jansen <jack.jansen@cwi.nl>
parents: 26767
diff changeset
12 PyErr_SetString(PyExc_NotImplementedError, \
f9b702c52dae Accept only the system default encoding when converting Python
Jack Jansen <jack.jansen@cwi.nl>
parents: 26767
diff changeset
13 "Not available in this shared library/OS version"); \
f9b702c52dae Accept only the system default encoding when converting Python
Jack Jansen <jack.jansen@cwi.nl>
parents: 26767
diff changeset
14 return NULL; \
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
15 }} while(0)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
16
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
17
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
18 #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
19
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
20 #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
21
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
22 #ifdef USE_TOOLBOX_OBJECT_GLUE
29279
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
23 extern PyObject *_CFObj_New(CFTypeRef);
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
24 extern int _CFObj_Convert(PyObject *, CFTypeRef *);
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
25 #define CFObj_New _CFObj_New
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
26 #define CFObj_Convert _CFObj_Convert
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
27
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
28 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
29 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
30 #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
31 #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
32
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
33 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
34 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
35 #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
36 #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
37
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 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
39 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
40 #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
41 #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
42
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 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
44 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
45 #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
46 #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
47
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 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
49 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
50 #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
51 #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
52
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 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
54 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
55 #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
56 #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
57
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 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
59 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
60 #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
61 #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
62
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 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
64 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
65 #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
66 #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
67
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 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
69 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
70 #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
71 #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
72
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 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
74 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
75 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
76 #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
77 #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
78 #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
79 #endif
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
80
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
81 /*
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
82 ** 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
83 */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
84 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
85 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
86
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
87 return Py_BuildValue("ll", (long)itself->location, (long)itself->length);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
88 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
89
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
90 int
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
91 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
92 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
93 long location, length;
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
94
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
95 if( !PyArg_ParseTuple(v, "ll", &location, &length) )
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
96 return 0;
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
97 p_itself->location = (CFIndex)location;
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
98 p_itself->length = (CFIndex)length;
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
99 return 1;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
100 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
101
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
102 /* 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
103 int
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
104 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
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 ( v == Py_None ) {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
107 p_itself = NULL;
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
108 return 1;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
109 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
110 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
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 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
114
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
115 /* --------------------- 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
116
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
117 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
118
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
119 #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
120
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
121 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
122 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
123 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
124 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
125 } CFTypeRefObject;
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 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
128 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
129 CFTypeRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
130 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
131 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
132 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
133 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
134 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
135 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
136 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
137 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
138 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
139 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
140 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
141
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
142 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
143 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
144
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
145 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
146 /* 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
147
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
148 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
149 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
150 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
151 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
152 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
153 *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
154 return 1;
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
157 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
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 (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
160 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
161 self->ob_freeit((CFTypeRef)self->ob_itself);
32693
780a33787458 The CF inheritance could cause double frees of the underlying objects.
Jack Jansen <jack.jansen@cwi.nl>
parents: 32691
diff changeset
162 self->ob_itself = NULL;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
163 }
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
164 self->ob_type->tp_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
165 }
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 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
168 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
169 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
170 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
171 #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
172 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
173 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
174 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
175 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
176 _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
177 _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
178 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
179 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
180 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
181
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
182 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
183 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
184 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
185 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
186 #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
187 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
188 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
189 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
190 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
191 _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
192 _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
193 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
194 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
195 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
196
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
197 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
198 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
199 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
200 #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
201 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
202 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
203 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
204 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
205 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
206 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
207 _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
208 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
209 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
210
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
211 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
212 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
213 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
214 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
215 #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
216 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
217 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
218 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
219 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
220 _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
221 _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
222 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
223 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
224 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
225
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
226 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
227 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
228 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
229 Boolean _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
230 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
231 #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
232 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
233 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
234 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
235 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
236 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
237 _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
238 cf2);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
239 _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
240 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
241 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
242 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
243
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
244 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
245 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
246 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
247 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
248 #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
249 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
250 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
251 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
252 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
253 _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
254 _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
255 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
256 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
257 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
258
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
259 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
260 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
261 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
262 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
263 #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
264 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
265 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
266 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
267 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
268 _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
269 _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
270 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
271 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
272 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
273
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
274 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
275 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
276 PyObject *_res = NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
277 CFDataRef _rv;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
278 if (!PyArg_ParseTuple(_args, ""))
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
279 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
280 _rv = CFPropertyListCreateXMLData((CFAllocatorRef)NULL,
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
281 _self->ob_itself);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
282 _res = Py_BuildValue("O&",
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
283 CFDataRefObj_New, _rv);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
284 return _res;
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
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
287 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
288 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
289 PyObject *_res = NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
290 CFTypeRef _rv;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
291 CFOptionFlags mutabilityOption;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
292 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
293 &mutabilityOption))
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
294 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
295 _rv = CFPropertyListCreateDeepCopy((CFAllocatorRef)NULL,
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
296 _self->ob_itself,
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
297 mutabilityOption);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
298 _res = Py_BuildValue("O&",
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
299 CFTypeRefObj_New, _rv);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
300 return _res;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
301 }
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
302
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
303 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
304 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
305 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
306 #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
307 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
308 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
309 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
310 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
311 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
312 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
313 _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
314 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
315 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
316
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
317 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
318 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
319 PyObject *_res = NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
320
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
321 CFTypeRef _rv;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
322 CFOptionFlags mutabilityOption;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
323 CFStringRef errorString;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
324 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
325 &mutabilityOption))
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
326 return NULL;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
327 _rv = CFPropertyListCreateFromXMLData((CFAllocatorRef)NULL,
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
328 _self->ob_itself,
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
329 mutabilityOption,
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
330 &errorString);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
331 if (errorString)
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
332 CFRelease(errorString);
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
333 if (_rv == NULL) {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
334 PyErr_SetString(PyExc_RuntimeError, "Parse error in XML data");
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
335 return NULL;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
336 }
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
337 _res = Py_BuildValue("O&",
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
338 CFTypeRefObj_New, _rv);
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
339 return _res;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
340
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
341 }
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
342
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
343 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
344 {
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
345 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
346
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
347 _res = PyCF_CF2Python(_self->ob_itself);
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
348 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
349
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
350 }
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
351
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
352 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
353 {"CFGetTypeID", (PyCFunction)CFTypeRefObj_CFGetTypeID, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
354 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
355 {"CFRetain", (PyCFunction)CFTypeRefObj_CFRetain, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
356 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
357 {"CFRelease", (PyCFunction)CFTypeRefObj_CFRelease, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
358 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
359 {"CFGetRetainCount", (PyCFunction)CFTypeRefObj_CFGetRetainCount, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
360 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
361 {"CFEqual", (PyCFunction)CFTypeRefObj_CFEqual, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
362 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
363 {"CFHash", (PyCFunction)CFTypeRefObj_CFHash, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
364 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
365 {"CFCopyDescription", (PyCFunction)CFTypeRefObj_CFCopyDescription, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
366 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
367 {"CFPropertyListCreateXMLData", (PyCFunction)CFTypeRefObj_CFPropertyListCreateXMLData, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
368 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
369 {"CFPropertyListCreateDeepCopy", (PyCFunction)CFTypeRefObj_CFPropertyListCreateDeepCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
370 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
371 {"CFShow", (PyCFunction)CFTypeRefObj_CFShow, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
372 PyDoc_STR("() -> None")},
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
373 {"CFPropertyListCreateFromXMLData", (PyCFunction)CFTypeRefObj_CFPropertyListCreateFromXMLData, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
374 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
375 {"toPython", (PyCFunction)CFTypeRefObj_toPython, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
376 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
377 {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
378 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
379
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
380 #define CFTypeRefObj_getsetlist NULL
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
381
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
382
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
383 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
384 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
385 /* 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
386 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
387 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
388 return 0;
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
391 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
392 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
393 char buf[100];
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
394 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);
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
395 return PyString_FromString(buf);
19443
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
398 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
399 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
400 /* 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
401 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
402 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
403 static int CFTypeRefObj_tp_init(PyObject *_self, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
404 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
405 CFTypeRef itself;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
406 char *kw[] = {"itself", 0};
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
407
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
408 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFTypeRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
409 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
410 ((CFTypeRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
411 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
412 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
413 return -1;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
414 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
415
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
416 #define CFTypeRefObj_tp_alloc PyType_GenericAlloc
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
417
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
418 static PyObject *CFTypeRefObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
419 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
420 PyObject *self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
421 if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
422 ((CFTypeRefObject *)self)->ob_itself = NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
423 ((CFTypeRefObject *)self)->ob_freeit = CFRelease;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
424 return self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
425 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
426
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
427 #define CFTypeRefObj_tp_free PyObject_Del
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
428
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
429
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
430 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
431 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
432 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
433 "_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
434 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
435 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
436 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
437 (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
438 0, /*tp_print*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
439 (getattrfunc)0, /*tp_getattr*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
440 (setattrfunc)0, /*tp_setattr*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
441 (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
442 (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
443 (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
444 (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
445 (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
446 (hashfunc) CFTypeRefObj_hash, /*tp_hash*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
447 0, /*tp_call*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
448 0, /*tp_str*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
449 PyObject_GenericGetAttr, /*tp_getattro*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
450 PyObject_GenericSetAttr, /*tp_setattro */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
451 0, /*tp_as_buffer*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
452 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
453 0, /*tp_doc*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
454 0, /*tp_traverse*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
455 0, /*tp_clear*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
456 0, /*tp_richcompare*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
457 0, /*tp_weaklistoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
458 0, /*tp_iter*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
459 0, /*tp_iternext*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
460 CFTypeRefObj_methods, /* tp_methods */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
461 0, /*tp_members*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
462 CFTypeRefObj_getsetlist, /*tp_getset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
463 0, /*tp_base*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
464 0, /*tp_dict*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
465 0, /*tp_descr_get*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
466 0, /*tp_descr_set*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
467 0, /*tp_dictoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
468 CFTypeRefObj_tp_init, /* tp_init */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
469 CFTypeRefObj_tp_alloc, /* tp_alloc */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
470 CFTypeRefObj_tp_new, /* tp_new */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
471 CFTypeRefObj_tp_free, /* tp_free */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
472 };
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 /* ------------------- 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
475
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
476
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
477 /* --------------------- 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
478
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
479 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
480
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
481 #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
482
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
483 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
484 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
485 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
486 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
487 } CFArrayRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
488
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
489 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
490 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
491 CFArrayRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
492 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
493 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
494 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
495 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
496 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
497 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
498 if (it == NULL) return NULL;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
499 /* XXXX Should we tp_init or tp_new our basetype? */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
500 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
501 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
502 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
503 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
504
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
505 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
506 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
507
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
508 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
509 /* 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
510
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
511 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
512 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
513 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
514 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
515 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
516 *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
517 return 1;
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 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
521 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
522 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
523 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
524 self->ob_freeit((CFTypeRef)self->ob_itself);
32693
780a33787458 The CF inheritance could cause double frees of the underlying objects.
Jack Jansen <jack.jansen@cwi.nl>
parents: 32691
diff changeset
525 self->ob_itself = NULL;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
526 }
38223
accdf1124ba2 Fix bug #1000914 (again).
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 37089
diff changeset
527 CFTypeRef_Type.tp_dealloc((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
528 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
529
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
530 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
531 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
532 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
533 CFArrayRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
534 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
535 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
536 _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
537 _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
538 _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
539 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
540 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
541 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
542
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
543 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
544 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
545 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
546 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
547 #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
548 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
549 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
550 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
551 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
552 _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
553 _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
554 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
555 return _res;
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
558 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
559 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
560 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
561 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
562 CFStringRef separatorString;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
563 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
564 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
565 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
566 _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
567 _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
568 separatorString);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
569 _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
570 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
571 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
572 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
573
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
574 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
575 {"CFArrayCreateCopy", (PyCFunction)CFArrayRefObj_CFArrayCreateCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
576 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
577 {"CFArrayGetCount", (PyCFunction)CFArrayRefObj_CFArrayGetCount, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
578 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
579 {"CFStringCreateByCombiningStrings", (PyCFunction)CFArrayRefObj_CFStringCreateByCombiningStrings, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
580 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
581 {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
582 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
583
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
584 #define CFArrayRefObj_getsetlist NULL
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
585
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
586
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
587 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
588 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
589 /* 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
590 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
591 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
592 return 0;
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 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
596 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
597 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
598 sprintf(buf, "<CFArrayRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
599 return PyString_FromString(buf);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
600 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
601
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
602 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
603 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
604 /* 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
605 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
606 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
607 static int CFArrayRefObj_tp_init(PyObject *_self, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
608 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
609 CFArrayRef itself;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
610 char *kw[] = {"itself", 0};
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
611
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
612 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFArrayRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
613 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
614 ((CFArrayRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
615 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
616 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
617
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
618 /* Any CFTypeRef descendent is allowed as initializer too */
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
619 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFTypeRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
620 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
621 ((CFArrayRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
622 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
623 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
624 return -1;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
625 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
626
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
627 #define CFArrayRefObj_tp_alloc PyType_GenericAlloc
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
628
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
629 static PyObject *CFArrayRefObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
630 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
631 PyObject *self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
632 if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
633 ((CFArrayRefObject *)self)->ob_itself = NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
634 ((CFArrayRefObject *)self)->ob_freeit = CFRelease;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
635 return self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
636 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
637
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
638 #define CFArrayRefObj_tp_free PyObject_Del
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
639
19443
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 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
642 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
643 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
644 "_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
645 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
646 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
647 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
648 (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
649 0, /*tp_print*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
650 (getattrfunc)0, /*tp_getattr*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
651 (setattrfunc)0, /*tp_setattr*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
652 (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
653 (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
654 (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
655 (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
656 (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
657 (hashfunc) CFArrayRefObj_hash, /*tp_hash*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
658 0, /*tp_call*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
659 0, /*tp_str*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
660 PyObject_GenericGetAttr, /*tp_getattro*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
661 PyObject_GenericSetAttr, /*tp_setattro */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
662 0, /*tp_as_buffer*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
663 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
664 0, /*tp_doc*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
665 0, /*tp_traverse*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
666 0, /*tp_clear*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
667 0, /*tp_richcompare*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
668 0, /*tp_weaklistoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
669 0, /*tp_iter*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
670 0, /*tp_iternext*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
671 CFArrayRefObj_methods, /* tp_methods */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
672 0, /*tp_members*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
673 CFArrayRefObj_getsetlist, /*tp_getset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
674 0, /*tp_base*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
675 0, /*tp_dict*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
676 0, /*tp_descr_get*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
677 0, /*tp_descr_set*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
678 0, /*tp_dictoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
679 CFArrayRefObj_tp_init, /* tp_init */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
680 CFArrayRefObj_tp_alloc, /* tp_alloc */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
681 CFArrayRefObj_tp_new, /* tp_new */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
682 CFArrayRefObj_tp_free, /* tp_free */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
683 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
684
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
685 /* ------------------- 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
686
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
687
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
688 /* ----------------- 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
689
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
690 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
691
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
692 #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
693
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
694 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
695 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
696 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
697 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
698 } CFMutableArrayRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
699
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
700 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
701 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
702 CFMutableArrayRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
703 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
704 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
705 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
706 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
707 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
708 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
709 if (it == NULL) return NULL;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
710 /* XXXX Should we tp_init or tp_new our basetype? */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
711 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
712 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
713 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
714 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
715
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
716 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
717 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
718
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
719 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
720 /* 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
721
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
722 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
723 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
724 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
725 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
726 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
727 *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
728 return 1;
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 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
732 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
733 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
734 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
735 self->ob_freeit((CFTypeRef)self->ob_itself);
32693
780a33787458 The CF inheritance could cause double frees of the underlying objects.
Jack Jansen <jack.jansen@cwi.nl>
parents: 32691
diff changeset
736 self->ob_itself = NULL;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
737 }
38223
accdf1124ba2 Fix bug #1000914 (again).
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 37089
diff changeset
738 CFArrayRef_Type.tp_dealloc((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
739 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
740
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
741 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
742 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
743 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
744 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
745 #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
746 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
747 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
748 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
749 &idx))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
750 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
751 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
752 idx);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
753 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
754 _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
755 return _res;
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
758 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
759 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
760 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
761 #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
762 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
763 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
764 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
765 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
766 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
767 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
768 _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
769 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
770 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
771
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
772 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
773 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
774 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
775 CFIndex idx1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
776 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
777 #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
778 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
779 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
780 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
781 &idx1,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
782 &idx2))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
783 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
784 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
785 idx1,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
786 idx2);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
787 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
788 _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
789 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
790 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
791
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
792 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
793 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
794 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
795 CFArrayRef otherArray;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
796 CFRange otherRange;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
797 #ifndef CFArrayAppendArray
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
798 PyMac_PRECHECK(CFArrayAppendArray);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
799 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
800 if (!PyArg_ParseTuple(_args, "O&O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
801 CFArrayRefObj_Convert, &otherArray,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
802 CFRange_Convert, &otherRange))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
803 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
804 CFArrayAppendArray(_self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
805 otherArray,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
806 otherRange);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
807 Py_INCREF(Py_None);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
808 _res = Py_None;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
809 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
810 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
811
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
812 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
813 {"CFArrayRemoveValueAtIndex", (PyCFunction)CFMutableArrayRefObj_CFArrayRemoveValueAtIndex, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
814 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
815 {"CFArrayRemoveAllValues", (PyCFunction)CFMutableArrayRefObj_CFArrayRemoveAllValues, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
816 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
817 {"CFArrayExchangeValuesAtIndices", (PyCFunction)CFMutableArrayRefObj_CFArrayExchangeValuesAtIndices, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
818 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
819 {"CFArrayAppendArray", (PyCFunction)CFMutableArrayRefObj_CFArrayAppendArray, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
820 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
821 {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
822 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
823
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
824 #define CFMutableArrayRefObj_getsetlist NULL
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
825
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
826
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
827 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
828 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
829 /* 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
830 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
831 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
832 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
833 }
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 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
836 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
837 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
838 sprintf(buf, "<CFMutableArrayRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
839 return PyString_FromString(buf);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
840 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
841
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
842 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
843 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
844 /* 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
845 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
846 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
847 static int CFMutableArrayRefObj_tp_init(PyObject *_self, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
848 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
849 CFMutableArrayRef itself;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
850 char *kw[] = {"itself", 0};
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
851
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
852 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFMutableArrayRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
853 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
854 ((CFMutableArrayRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
855 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
856 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
857
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
858 /* Any CFTypeRef descendent is allowed as initializer too */
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
859 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFTypeRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
860 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
861 ((CFMutableArrayRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
862 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
863 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
864 return -1;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
865 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
866
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
867 #define CFMutableArrayRefObj_tp_alloc PyType_GenericAlloc
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
868
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
869 static PyObject *CFMutableArrayRefObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
870 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
871 PyObject *self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
872 if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
873 ((CFMutableArrayRefObject *)self)->ob_itself = NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
874 ((CFMutableArrayRefObject *)self)->ob_freeit = CFRelease;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
875 return self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
876 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
877
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
878 #define CFMutableArrayRefObj_tp_free PyObject_Del
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
879
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
880
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
881 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
882 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
883 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
884 "_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
885 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
886 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
887 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
888 (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
889 0, /*tp_print*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
890 (getattrfunc)0, /*tp_getattr*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
891 (setattrfunc)0, /*tp_setattr*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
892 (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
893 (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
894 (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
895 (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
896 (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
897 (hashfunc) CFMutableArrayRefObj_hash, /*tp_hash*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
898 0, /*tp_call*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
899 0, /*tp_str*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
900 PyObject_GenericGetAttr, /*tp_getattro*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
901 PyObject_GenericSetAttr, /*tp_setattro */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
902 0, /*tp_as_buffer*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
903 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
904 0, /*tp_doc*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
905 0, /*tp_traverse*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
906 0, /*tp_clear*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
907 0, /*tp_richcompare*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
908 0, /*tp_weaklistoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
909 0, /*tp_iter*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
910 0, /*tp_iternext*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
911 CFMutableArrayRefObj_methods, /* tp_methods */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
912 0, /*tp_members*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
913 CFMutableArrayRefObj_getsetlist, /*tp_getset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
914 0, /*tp_base*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
915 0, /*tp_dict*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
916 0, /*tp_descr_get*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
917 0, /*tp_descr_set*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
918 0, /*tp_dictoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
919 CFMutableArrayRefObj_tp_init, /* tp_init */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
920 CFMutableArrayRefObj_tp_alloc, /* tp_alloc */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
921 CFMutableArrayRefObj_tp_new, /* tp_new */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
922 CFMutableArrayRefObj_tp_free, /* tp_free */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
923 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
924
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
925 /* --------------- 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
926
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
927
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
928 /* ------------------ 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
929
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
930 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
931
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
932 #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
933
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
934 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
935 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
936 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
937 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
938 } CFDictionaryRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
939
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
940 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
941 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
942 CFDictionaryRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
943 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
944 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
945 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
946 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
947 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
948 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
949 if (it == NULL) return NULL;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
950 /* XXXX Should we tp_init or tp_new our basetype? */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
951 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
952 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
953 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
954 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
955
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
956 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
957 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
958
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
959 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
960 /* 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
961
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
962 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
963 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
964 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
965 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
966 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
967 *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
968 return 1;
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 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
972 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
973 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
974 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
975 self->ob_freeit((CFTypeRef)self->ob_itself);
32693
780a33787458 The CF inheritance could cause double frees of the underlying objects.
Jack Jansen <jack.jansen@cwi.nl>
parents: 32691
diff changeset
976 self->ob_itself = NULL;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
977 }
38223
accdf1124ba2 Fix bug #1000914 (again).
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 37089
diff changeset
978 CFTypeRef_Type.tp_dealloc((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
979 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
980
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
981 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
982 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
983 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
984 CFDictionaryRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
985 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
986 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
987 _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
988 _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
989 _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
990 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
991 return _res;
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
994 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
995 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
996 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
997 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
998 #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
999 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
1000 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1001 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
1002 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1003 _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
1004 _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
1005 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1006 return _res;
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1009 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
1010 {"CFDictionaryCreateCopy", (PyCFunction)CFDictionaryRefObj_CFDictionaryCreateCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1011 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
1012 {"CFDictionaryGetCount", (PyCFunction)CFDictionaryRefObj_CFDictionaryGetCount, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1013 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
1014 {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
1015 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1016
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1017 #define CFDictionaryRefObj_getsetlist NULL
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1018
19443
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 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
1021 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1022 /* 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
1023 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
1024 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
1025 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1026 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1027
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1028 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
1029 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1030 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
1031 sprintf(buf, "<CFDictionaryRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
1032 return PyString_FromString(buf);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1033 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1034
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1035 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
1036 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1037 /* 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
1038 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
1039 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1040 static int CFDictionaryRefObj_tp_init(PyObject *_self, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1041 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1042 CFDictionaryRef itself;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1043 char *kw[] = {"itself", 0};
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1044
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1045 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFDictionaryRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1046 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1047 ((CFDictionaryRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1048 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1049 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1050
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1051 /* Any CFTypeRef descendent is allowed as initializer too */
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1052 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFTypeRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1053 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1054 ((CFDictionaryRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1055 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1056 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1057 return -1;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1058 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1059
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1060 #define CFDictionaryRefObj_tp_alloc PyType_GenericAlloc
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1061
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1062 static PyObject *CFDictionaryRefObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1063 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1064 PyObject *self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1065 if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1066 ((CFDictionaryRefObject *)self)->ob_itself = NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1067 ((CFDictionaryRefObject *)self)->ob_freeit = CFRelease;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1068 return self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1069 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1070
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1071 #define CFDictionaryRefObj_tp_free PyObject_Del
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1072
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1073
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1074 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
1075 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
1076 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
1077 "_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
1078 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
1079 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
1080 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1081 (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
1082 0, /*tp_print*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1083 (getattrfunc)0, /*tp_getattr*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1084 (setattrfunc)0, /*tp_setattr*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1085 (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
1086 (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
1087 (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
1088 (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
1089 (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
1090 (hashfunc) CFDictionaryRefObj_hash, /*tp_hash*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1091 0, /*tp_call*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1092 0, /*tp_str*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1093 PyObject_GenericGetAttr, /*tp_getattro*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1094 PyObject_GenericSetAttr, /*tp_setattro */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1095 0, /*tp_as_buffer*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1096 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1097 0, /*tp_doc*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1098 0, /*tp_traverse*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1099 0, /*tp_clear*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1100 0, /*tp_richcompare*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1101 0, /*tp_weaklistoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1102 0, /*tp_iter*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1103 0, /*tp_iternext*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1104 CFDictionaryRefObj_methods, /* tp_methods */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1105 0, /*tp_members*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1106 CFDictionaryRefObj_getsetlist, /*tp_getset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1107 0, /*tp_base*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1108 0, /*tp_dict*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1109 0, /*tp_descr_get*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1110 0, /*tp_descr_set*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1111 0, /*tp_dictoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1112 CFDictionaryRefObj_tp_init, /* tp_init */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1113 CFDictionaryRefObj_tp_alloc, /* tp_alloc */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1114 CFDictionaryRefObj_tp_new, /* tp_new */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1115 CFDictionaryRefObj_tp_free, /* tp_free */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1116 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1117
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1118 /* ---------------- 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
1119
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1120
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1121 /* --------------- 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
1122
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1123 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
1124
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
1125 #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
1126
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1127 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
1128 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1129 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
1130 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
1131 } CFMutableDictionaryRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1132
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1133 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
1134 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1135 CFMutableDictionaryRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1136 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1137 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1138 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
1139 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1140 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1141 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
1142 if (it == NULL) return NULL;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1143 /* XXXX Should we tp_init or tp_new our basetype? */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1144 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
1145 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
1146 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
1147 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1148
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
1149 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
1150 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1151
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1152 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
1153 /* 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
1154
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1155 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
1156 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1157 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
1158 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1159 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1160 *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
1161 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1162 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1163
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1164 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
1165 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1166 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
1167 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1168 self->ob_freeit((CFTypeRef)self->ob_itself);
32693
780a33787458 The CF inheritance could cause double frees of the underlying objects.
Jack Jansen <jack.jansen@cwi.nl>
parents: 32691
diff changeset
1169 self->ob_itself = NULL;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1170 }
38223
accdf1124ba2 Fix bug #1000914 (again).
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 37089
diff changeset
1171 CFDictionaryRef_Type.tp_dealloc((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
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 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
1175 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1176 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
1177 #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
1178 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
1179 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1180 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
1181 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1182 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
1183 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
1184 _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
1185 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1186 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1187
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1188 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
1189 {"CFDictionaryRemoveAllValues", (PyCFunction)CFMutableDictionaryRefObj_CFDictionaryRemoveAllValues, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1190 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
1191 {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
1192 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1193
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1194 #define CFMutableDictionaryRefObj_getsetlist NULL
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1195
19443
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 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
1198 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1199 /* 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
1200 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
1201 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
1202 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1203 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1204
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1205 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
1206 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1207 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
1208 sprintf(buf, "<CFMutableDictionaryRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
1209 return PyString_FromString(buf);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1210 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1211
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1212 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
1213 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1214 /* 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
1215 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
1216 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1217 static int CFMutableDictionaryRefObj_tp_init(PyObject *_self, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1218 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1219 CFMutableDictionaryRef itself;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1220 char *kw[] = {"itself", 0};
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1221
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1222 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFMutableDictionaryRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1223 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1224 ((CFMutableDictionaryRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1225 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1226 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1227
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1228 /* Any CFTypeRef descendent is allowed as initializer too */
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1229 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFTypeRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1230 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1231 ((CFMutableDictionaryRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1232 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1233 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1234 return -1;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1235 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1236
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1237 #define CFMutableDictionaryRefObj_tp_alloc PyType_GenericAlloc
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1238
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1239 static PyObject *CFMutableDictionaryRefObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1240 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1241 PyObject *self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1242 if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1243 ((CFMutableDictionaryRefObject *)self)->ob_itself = NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1244 ((CFMutableDictionaryRefObject *)self)->ob_freeit = CFRelease;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1245 return self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1246 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1247
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1248 #define CFMutableDictionaryRefObj_tp_free PyObject_Del
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1249
19443
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 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
1252 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
1253 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
1254 "_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
1255 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
1256 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
1257 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1258 (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
1259 0, /*tp_print*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1260 (getattrfunc)0, /*tp_getattr*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1261 (setattrfunc)0, /*tp_setattr*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1262 (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
1263 (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
1264 (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
1265 (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
1266 (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
1267 (hashfunc) CFMutableDictionaryRefObj_hash, /*tp_hash*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1268 0, /*tp_call*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1269 0, /*tp_str*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1270 PyObject_GenericGetAttr, /*tp_getattro*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1271 PyObject_GenericSetAttr, /*tp_setattro */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1272 0, /*tp_as_buffer*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1273 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1274 0, /*tp_doc*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1275 0, /*tp_traverse*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1276 0, /*tp_clear*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1277 0, /*tp_richcompare*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1278 0, /*tp_weaklistoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1279 0, /*tp_iter*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1280 0, /*tp_iternext*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1281 CFMutableDictionaryRefObj_methods, /* tp_methods */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1282 0, /*tp_members*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1283 CFMutableDictionaryRefObj_getsetlist, /*tp_getset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1284 0, /*tp_base*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1285 0, /*tp_dict*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1286 0, /*tp_descr_get*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1287 0, /*tp_descr_set*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1288 0, /*tp_dictoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1289 CFMutableDictionaryRefObj_tp_init, /* tp_init */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1290 CFMutableDictionaryRefObj_tp_alloc, /* tp_alloc */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1291 CFMutableDictionaryRefObj_tp_new, /* tp_new */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1292 CFMutableDictionaryRefObj_tp_free, /* tp_free */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1293 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1294
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1295 /* ------------- 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
1296
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1297
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1298 /* --------------------- 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
1299
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1300 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
1301
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
1302 #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
1303
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1304 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
1305 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1306 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
1307 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
1308 } CFDataRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1309
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1310 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
1311 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1312 CFDataRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1313 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1314 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1315 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
1316 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1317 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1318 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
1319 if (it == NULL) return NULL;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1320 /* XXXX Should we tp_init or tp_new our basetype? */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1321 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
1322 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
1323 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
1324 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1325
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
1326 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
1327 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1328
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1329 if (v == Py_None) { *p_itself = NULL; return 1; }
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
1330 if (PyString_Check(v)) {
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1331 char *cStr;
37089
23357b88c03e Get rid of some warnings.
Neal Norwitz <nnorwitz@gmail.com>
parents: 35200
diff changeset
1332 Py_ssize_t cLen;
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
1333 if( PyString_AsStringAndSize(v, &cStr, &cLen) < 0 ) return 0;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1334 *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
1335 return 1;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1336 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1337
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1338 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
1339 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1340 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
1341 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1342 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1343 *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
1344 return 1;
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1347 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
1348 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1349 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
1350 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1351 self->ob_freeit((CFTypeRef)self->ob_itself);
32693
780a33787458 The CF inheritance could cause double frees of the underlying objects.
Jack Jansen <jack.jansen@cwi.nl>
parents: 32691
diff changeset
1352 self->ob_itself = NULL;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1353 }
38223
accdf1124ba2 Fix bug #1000914 (again).
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 37089
diff changeset
1354 CFTypeRef_Type.tp_dealloc((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
1355 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1356
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1357 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
1358 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1359 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
1360 CFDataRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1361 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
1362 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1363 _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
1364 _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
1365 _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
1366 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
1367 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1368 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1369
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1370 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
1371 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1372 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
1373 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
1374 #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
1375 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
1376 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1377 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
1378 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1379 _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
1380 _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
1381 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1382 return _res;
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1385 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
1386 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1387 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
1388 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1389 CFStringEncoding encoding;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1390 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
1391 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1392 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1393 _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
1394 _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
1395 encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1396 _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
1397 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
1398 return _res;
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
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1401 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
1402 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1403 PyObject *_res = NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1404
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1405 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
1406 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
1407
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
1408 _res = (PyObject *)PyString_FromStringAndSize(data, size);
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1409 return _res;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1410
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1411 }
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1412
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1413 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
1414 {"CFDataCreateCopy", (PyCFunction)CFDataRefObj_CFDataCreateCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1415 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
1416 {"CFDataGetLength", (PyCFunction)CFDataRefObj_CFDataGetLength, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1417 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
1418 {"CFStringCreateFromExternalRepresentation", (PyCFunction)CFDataRefObj_CFStringCreateFromExternalRepresentation, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1419 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
1420 {"CFDataGetData", (PyCFunction)CFDataRefObj_CFDataGetData, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1421 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
1422 {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
1423 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1424
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1425 #define CFDataRefObj_getsetlist NULL
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1426
19443
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 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
1429 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1430 /* 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
1431 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
1432 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
1433 return 0;
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1436 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
1437 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1438 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
1439 sprintf(buf, "<CFDataRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
1440 return PyString_FromString(buf);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1441 }
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 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
1444 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1445 /* 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
1446 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
1447 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1448 static int CFDataRefObj_tp_init(PyObject *_self, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1449 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1450 CFDataRef itself;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1451 char *kw[] = {"itself", 0};
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1452
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1453 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFDataRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1454 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1455 ((CFDataRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1456 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1457 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1458
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1459 /* Any CFTypeRef descendent is allowed as initializer too */
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1460 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFTypeRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1461 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1462 ((CFDataRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1463 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1464 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1465 return -1;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1466 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1467
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1468 #define CFDataRefObj_tp_alloc PyType_GenericAlloc
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1469
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1470 static PyObject *CFDataRefObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1471 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1472 PyObject *self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1473 if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1474 ((CFDataRefObject *)self)->ob_itself = NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1475 ((CFDataRefObject *)self)->ob_freeit = CFRelease;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1476 return self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1477 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1478
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1479 #define CFDataRefObj_tp_free PyObject_Del
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1480
19443
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 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
1483 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
1484 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
1485 "_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
1486 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
1487 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
1488 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1489 (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
1490 0, /*tp_print*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1491 (getattrfunc)0, /*tp_getattr*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1492 (setattrfunc)0, /*tp_setattr*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1493 (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
1494 (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
1495 (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
1496 (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
1497 (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
1498 (hashfunc) CFDataRefObj_hash, /*tp_hash*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1499 0, /*tp_call*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1500 0, /*tp_str*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1501 PyObject_GenericGetAttr, /*tp_getattro*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1502 PyObject_GenericSetAttr, /*tp_setattro */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1503 0, /*tp_as_buffer*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1504 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1505 0, /*tp_doc*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1506 0, /*tp_traverse*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1507 0, /*tp_clear*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1508 0, /*tp_richcompare*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1509 0, /*tp_weaklistoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1510 0, /*tp_iter*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1511 0, /*tp_iternext*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1512 CFDataRefObj_methods, /* tp_methods */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1513 0, /*tp_members*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1514 CFDataRefObj_getsetlist, /*tp_getset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1515 0, /*tp_base*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1516 0, /*tp_dict*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1517 0, /*tp_descr_get*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1518 0, /*tp_descr_set*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1519 0, /*tp_dictoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1520 CFDataRefObj_tp_init, /* tp_init */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1521 CFDataRefObj_tp_alloc, /* tp_alloc */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1522 CFDataRefObj_tp_new, /* tp_new */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1523 CFDataRefObj_tp_free, /* tp_free */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1524 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1525
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1526 /* ------------------- 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
1527
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1528
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1529 /* ------------------ 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
1530
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1531 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
1532
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
1533 #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
1534
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1535 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
1536 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1537 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
1538 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
1539 } CFMutableDataRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1540
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1541 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
1542 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1543 CFMutableDataRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1544 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1545 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1546 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
1547 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1548 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1549 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
1550 if (it == NULL) return NULL;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1551 /* XXXX Should we tp_init or tp_new our basetype? */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1552 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
1553 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
1554 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
1555 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1556
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
1557 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
1558 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1559
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1560 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
1561 /* 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
1562
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1563 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
1564 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1565 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
1566 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1567 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1568 *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
1569 return 1;
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 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
1573 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1574 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
1575 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1576 self->ob_freeit((CFTypeRef)self->ob_itself);
32693
780a33787458 The CF inheritance could cause double frees of the underlying objects.
Jack Jansen <jack.jansen@cwi.nl>
parents: 32691
diff changeset
1577 self->ob_itself = NULL;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1578 }
38223
accdf1124ba2 Fix bug #1000914 (again).
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 37089
diff changeset
1579 CFDataRef_Type.tp_dealloc((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
1580 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1581
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1582 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
1583 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1584 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
1585 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
1586 #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
1587 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
1588 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1589 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
1590 &length))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1591 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1592 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
1593 length);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1594 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
1595 _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
1596 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1597 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1598
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1599 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
1600 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1601 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
1602 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
1603 #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
1604 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
1605 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1606 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
1607 &extraLength))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1608 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1609 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
1610 extraLength);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1611 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
1612 _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
1613 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1614 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1615
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1616 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
1617 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1618 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
1619 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
1620 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
1621 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
1622 #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
1623 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
1624 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1625 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
1626 &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
1627 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1628 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
1629 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
1630 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
1631 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
1632 _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
1633 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1634 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1635
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1636 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
1637 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1638 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
1639 CFRange range;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1640 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
1641 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
1642 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
1643 #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
1644 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
1645 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1646 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
1647 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
1648 &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
1649 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1650 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
1651 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
1652 range,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1653 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
1654 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
1655 _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
1656 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1657 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1658
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1659 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
1660 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1661 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
1662 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
1663 #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
1664 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
1665 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1666 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
1667 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
1668 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1669 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
1670 range);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1671 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
1672 _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
1673 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1674 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1675
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1676 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
1677 {"CFDataSetLength", (PyCFunction)CFMutableDataRefObj_CFDataSetLength, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1678 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
1679 {"CFDataIncreaseLength", (PyCFunction)CFMutableDataRefObj_CFDataIncreaseLength, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1680 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
1681 {"CFDataAppendBytes", (PyCFunction)CFMutableDataRefObj_CFDataAppendBytes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1682 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
1683 {"CFDataReplaceBytes", (PyCFunction)CFMutableDataRefObj_CFDataReplaceBytes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1684 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
1685 {"CFDataDeleteBytes", (PyCFunction)CFMutableDataRefObj_CFDataDeleteBytes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
1686 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
1687 {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
1688 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1689
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1690 #define CFMutableDataRefObj_getsetlist NULL
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1691
19443
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 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
1694 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1695 /* 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
1696 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
1697 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
1698 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1699 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1700
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1701 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
1702 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1703 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
1704 sprintf(buf, "<CFMutableDataRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
1705 return PyString_FromString(buf);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1706 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1707
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1708 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
1709 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1710 /* 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
1711 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
1712 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1713 static int CFMutableDataRefObj_tp_init(PyObject *_self, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1714 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1715 CFMutableDataRef itself;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1716 char *kw[] = {"itself", 0};
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1717
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1718 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFMutableDataRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1719 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1720 ((CFMutableDataRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1721 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1722 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1723
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1724 /* Any CFTypeRef descendent is allowed as initializer too */
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1725 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFTypeRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1726 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1727 ((CFMutableDataRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1728 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1729 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1730 return -1;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1731 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1732
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1733 #define CFMutableDataRefObj_tp_alloc PyType_GenericAlloc
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1734
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1735 static PyObject *CFMutableDataRefObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1736 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1737 PyObject *self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1738 if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1739 ((CFMutableDataRefObject *)self)->ob_itself = NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1740 ((CFMutableDataRefObject *)self)->ob_freeit = CFRelease;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1741 return self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1742 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1743
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1744 #define CFMutableDataRefObj_tp_free PyObject_Del
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1745
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1746
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1747 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
1748 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
1749 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
1750 "_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
1751 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
1752 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
1753 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1754 (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
1755 0, /*tp_print*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1756 (getattrfunc)0, /*tp_getattr*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1757 (setattrfunc)0, /*tp_setattr*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1758 (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
1759 (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
1760 (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
1761 (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
1762 (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
1763 (hashfunc) CFMutableDataRefObj_hash, /*tp_hash*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1764 0, /*tp_call*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1765 0, /*tp_str*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1766 PyObject_GenericGetAttr, /*tp_getattro*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1767 PyObject_GenericSetAttr, /*tp_setattro */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1768 0, /*tp_as_buffer*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1769 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1770 0, /*tp_doc*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1771 0, /*tp_traverse*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1772 0, /*tp_clear*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1773 0, /*tp_richcompare*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1774 0, /*tp_weaklistoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1775 0, /*tp_iter*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1776 0, /*tp_iternext*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1777 CFMutableDataRefObj_methods, /* tp_methods */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1778 0, /*tp_members*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1779 CFMutableDataRefObj_getsetlist, /*tp_getset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1780 0, /*tp_base*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1781 0, /*tp_dict*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1782 0, /*tp_descr_get*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1783 0, /*tp_descr_set*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1784 0, /*tp_dictoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1785 CFMutableDataRefObj_tp_init, /* tp_init */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1786 CFMutableDataRefObj_tp_alloc, /* tp_alloc */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1787 CFMutableDataRefObj_tp_new, /* tp_new */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1788 CFMutableDataRefObj_tp_free, /* tp_free */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1789 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1790
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1791 /* ---------------- 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
1792
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1793
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1794 /* -------------------- 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
1795
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1796 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
1797
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
1798 #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
1799
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1800 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
1801 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1802 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
1803 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
1804 } CFStringRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1805
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1806 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
1807 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1808 CFStringRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1809 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1810 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1811 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
1812 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
1813 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1814 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
1815 if (it == NULL) return NULL;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1816 /* XXXX Should we tp_init or tp_new our basetype? */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1817 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
1818 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
1819 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
1820 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1821
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
1822 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
1823 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1824
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1825 if (v == Py_None) { *p_itself = NULL; return 1; }
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
1826 if (PyString_Check(v)) {
29279
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
1827 char *cStr;
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
1828 if (!PyArg_Parse(v, "es", "ascii", &cStr))
37089
23357b88c03e Get rid of some warnings.
Neal Norwitz <nnorwitz@gmail.com>
parents: 35200
diff changeset
1829 return 0;
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1830 *p_itself = CFStringCreateWithCString((CFAllocatorRef)NULL, cStr, kCFStringEncodingASCII);
43344
840ff58d1e9e bug #1154: release memory allocated by "es" PyArg_ParseTuple format specifier.
Georg Brandl <georg@python.org>
parents: 38223
diff changeset
1831 PyMem_Free(cStr);
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1832 return 1;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1833 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1834 if (PyUnicode_Check(v)) {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1835 /* We use the CF types here, if Python was configured differently that will give an error */
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1836 CFIndex size = PyUnicode_GetSize(v);
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1837 UniChar *unichars = PyUnicode_AsUnicode(v);
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1838 if (!unichars) return 0;
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1839 *p_itself = CFStringCreateWithCharacters((CFAllocatorRef)NULL, unichars, size);
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1840 return 1;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1841 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
1842
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1843
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1844 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
1845 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1846 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
1847 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1848 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1849 *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
1850 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1851 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1852
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1853 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
1854 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1855 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
1856 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1857 self->ob_freeit((CFTypeRef)self->ob_itself);
32693
780a33787458 The CF inheritance could cause double frees of the underlying objects.
Jack Jansen <jack.jansen@cwi.nl>
parents: 32691
diff changeset
1858 self->ob_itself = NULL;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1859 }
38223
accdf1124ba2 Fix bug #1000914 (again).
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 37089
diff changeset
1860 CFTypeRef_Type.tp_dealloc((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
1861 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1862
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1863 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
1864 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1865 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
1866 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1867 CFRange range;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1868 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
1869 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
1870 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1871 _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
1872 _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
1873 range);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1874 _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
1875 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
1876 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1877 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1878
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1879 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
1880 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1881 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
1882 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1883 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
1884 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1885 _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
1886 _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
1887 _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
1888 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
1889 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1890 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1891
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1892 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
1893 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1894 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
1895 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
1896 #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
1897 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
1898 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1899 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
1900 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1901 _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
1902 _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
1903 _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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1907 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
1908 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1909 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
1910 CFIndex _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1911 CFRange range;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1912 CFStringEncoding encoding;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1913 UInt8 lossByte;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1914 Boolean isExternalRepresentation;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1915 UInt8 buffer;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1916 CFIndex maxBufLen;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1917 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
1918 #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
1919 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
1920 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1921 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
1922 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
1923 &encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1924 &lossByte,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1925 &isExternalRepresentation,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1926 &maxBufLen))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1927 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1928 _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
1929 range,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1930 encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1931 lossByte,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1932 isExternalRepresentation,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1933 &buffer,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1934 maxBufLen,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1935 &usedBufLen);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1936 _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
1937 _rv,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1938 buffer,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1939 usedBufLen);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1940 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1941 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1942
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1943 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
1944 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1945 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
1946 CFDataRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1947 CFStringEncoding encoding;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1948 UInt8 lossByte;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1949 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
1950 &encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1951 &lossByte))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1952 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1953 _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
1954 _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
1955 encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1956 lossByte);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1957 _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
1958 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
1959 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1960 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1961
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1962 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
1963 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1964 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
1965 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
1966 #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
1967 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
1968 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1969 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
1970 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1971 _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
1972 _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
1973 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1974 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1975 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1976
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1977 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
1978 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1979 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
1980 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
1981 #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
1982 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
1983 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1984 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
1985 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1986 _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
1987 _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
1988 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1989 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1990 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1991
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1992 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
1993 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1994 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
1995 CFComparisonResult _rv;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
1996 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
1997 CFRange rangeToCompare;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1998 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
1999 #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
2000 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
2001 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2002 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
2003 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
2004 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
2005 &compareOptions))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2006 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2007 _rv = CFStringCompareWithOptions(_self->ob_itself,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2008 theString2,
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2009 rangeToCompare,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2010 compareOptions);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2011 _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
2012 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2013 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2014 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2015
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2016 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
2017 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2018 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
2019 CFComparisonResult _rv;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2020 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
2021 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
2022 #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
2023 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
2024 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2025 if (!PyArg_ParseTuple(_args, "O&l",
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2026 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
2027 &compareOptions))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2028 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2029 _rv = CFStringCompare(_self->ob_itself,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2030 theString2,
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2031 compareOptions);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2032 _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
2033 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2034 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2035 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2036
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2037 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
2038 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2039 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
2040 Boolean _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2041 CFStringRef stringToFind;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2042 CFRange rangeToSearch;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2043 CFOptionFlags searchOptions;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2044 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
2045 #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
2046 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
2047 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2048 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
2049 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
2050 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
2051 &searchOptions))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2052 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2053 _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
2054 stringToFind,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2055 rangeToSearch,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2056 searchOptions,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2057 &result);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2058 _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
2059 _rv,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2060 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
2061 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2062 }
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_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
2065 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2066 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
2067 CFArrayRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2068 CFStringRef stringToFind;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2069 CFRange rangeToSearch;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2070 CFOptionFlags compareOptions;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2071 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
2072 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
2073 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
2074 &compareOptions))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2075 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2076 _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
2077 _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
2078 stringToFind,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2079 rangeToSearch,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2080 compareOptions);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2081 _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
2082 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
2083 return _res;
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 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
2087 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2088 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
2089 CFRange _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2090 CFStringRef stringToFind;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2091 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
2092 #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
2093 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
2094 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2095 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
2096 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
2097 &compareOptions))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2098 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2099 _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
2100 stringToFind,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2101 compareOptions);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2102 _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
2103 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
2104 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2105 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2106
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2107 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
2108 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2109 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
2110 Boolean _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2111 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
2112 #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
2113 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
2114 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2115 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
2116 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
2117 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2118 _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
2119 prefix);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2120 _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
2121 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2122 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2123 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2124
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2125 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
2126 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2127 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
2128 Boolean _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2129 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
2130 #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
2131 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
2132 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2133 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
2134 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
2135 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 _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
2137 suffix);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2138 _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
2139 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2140 return _res;
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 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
2144 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2145 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
2146 CFRange range;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2147 CFIndex lineBeginIndex;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2148 CFIndex lineEndIndex;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2149 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
2150 #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
2151 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
2152 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2153 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
2154 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
2155 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2156 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
2157 range,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2158 &lineBeginIndex,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2159 &lineEndIndex,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2160 &contentsEndIndex);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2161 _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
2162 lineBeginIndex,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2163 lineEndIndex,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2164 contentsEndIndex);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2165 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2166 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2167
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2168 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
2169 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2170 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
2171 CFArrayRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2172 CFStringRef separatorString;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2173 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
2174 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
2175 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2176 _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
2177 _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
2178 separatorString);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2179 _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
2180 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
2181 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2182 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2183
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2184 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
2185 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2186 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
2187 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
2188 #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
2189 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
2190 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2191 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
2192 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2193 _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
2194 _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
2195 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2196 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2197 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2198
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2199 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
2200 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2201 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
2202 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
2203 #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
2204 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
2205 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2206 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
2207 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2208 _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
2209 _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
2210 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2211 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2212 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2213
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2214 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
2215 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2216 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
2217 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
2218 #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
2219 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
2220 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2221 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
2222 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2223 _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
2224 _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
2225 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2226 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2227 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2228
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2229 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
2230 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2231 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
2232 #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
2233 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
2234 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2235 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
2236 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2237 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
2238 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
2239 _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
2240 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2241 }
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 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
2244 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2245 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
2246 CFURLRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2247 CFURLRef baseURL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2248 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
2249 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
2250 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2251 _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
2252 _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
2253 baseURL);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2254 _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
2255 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
2256 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2257 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2258
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2259 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
2260 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2261 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
2262 CFURLRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2263 CFURLPathStyle pathStyle;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2264 Boolean isDirectory;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2265 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
2266 &pathStyle,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2267 &isDirectory))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2268 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2269 _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
2270 _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
2271 pathStyle,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2272 isDirectory);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2273 _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
2274 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
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
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2278 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
2279 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2280 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2281 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2282 CFURLPathStyle pathStyle;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2283 Boolean isDirectory;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2284 CFURLRef baseURL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2285 if (!PyArg_ParseTuple(_args, "llO&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2286 &pathStyle,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2287 &isDirectory,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2288 OptionalCFURLRefObj_Convert, &baseURL))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2289 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2290 _rv = CFURLCreateWithFileSystemPathRelativeToBase((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2291 _self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2292 pathStyle,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2293 isDirectory,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2294 baseURL);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2295 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2296 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2297 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2298 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2299
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2300 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
2301 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2302 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
2303 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2304 CFStringRef charactersToLeaveEscaped;
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, &charactersToLeaveEscaped))
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 _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
2309 _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
2310 charactersToLeaveEscaped);
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_BuildValue("O&",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2312 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
2313 return _res;
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
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2316 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
2317 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2318 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2319 CFStringRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2320 CFStringRef charactersToLeaveUnescaped;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2321 CFStringRef legalURLCharactersToBeEscaped;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2322 CFStringEncoding encoding;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2323 if (!PyArg_ParseTuple(_args, "O&O&l",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2324 CFStringRefObj_Convert, &charactersToLeaveUnescaped,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2325 CFStringRefObj_Convert, &legalURLCharactersToBeEscaped,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2326 &encoding))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2327 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2328 _rv = CFURLCreateStringByAddingPercentEscapes((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2329 _self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2330 charactersToLeaveUnescaped,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2331 legalURLCharactersToBeEscaped,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2332 encoding);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2333 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2334 CFStringRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2335 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2336 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2337
19443
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 *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
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2342 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
2343 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
2344
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2345 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
2346 if ( CFStringGetCString(_self->ob_itself, data, size, 0) ) {
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
2347 _res = (PyObject *)PyString_FromString(data);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2348 } else {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2349 PyErr_SetString(PyExc_RuntimeError, "CFStringGetCString could not fit the string");
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2350 _res = NULL;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2351 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2352 free(data);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2353 return _res;
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 }
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 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
2358 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2359 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
2360
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2361 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
2362 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
2363 CFRange range;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2364
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2365 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
2366 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
2367 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
2368 CFStringGetCharacters(_self->ob_itself, range, data);
32691
5fb78a2d94f0 CFStringGetUnicode() returned an extra null character at the end of the string.
Jack Jansen <jack.jansen@cwi.nl>
parents: 32690
diff changeset
2369 _res = (PyObject *)PyUnicode_FromUnicode(data, size-1);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2370 free(data);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2371 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2372
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2373 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2374
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2375 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
2376 {"CFStringCreateWithSubstring", (PyCFunction)CFStringRefObj_CFStringCreateWithSubstring, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2377 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
2378 {"CFStringCreateCopy", (PyCFunction)CFStringRefObj_CFStringCreateCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2379 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
2380 {"CFStringGetLength", (PyCFunction)CFStringRefObj_CFStringGetLength, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2381 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
2382 {"CFStringGetBytes", (PyCFunction)CFStringRefObj_CFStringGetBytes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2383 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
2384 {"CFStringCreateExternalRepresentation", (PyCFunction)CFStringRefObj_CFStringCreateExternalRepresentation, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2385 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
2386 {"CFStringGetSmallestEncoding", (PyCFunction)CFStringRefObj_CFStringGetSmallestEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2387 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
2388 {"CFStringGetFastestEncoding", (PyCFunction)CFStringRefObj_CFStringGetFastestEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2389 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
2390 {"CFStringCompareWithOptions", (PyCFunction)CFStringRefObj_CFStringCompareWithOptions, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2391 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
2392 {"CFStringCompare", (PyCFunction)CFStringRefObj_CFStringCompare, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2393 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
2394 {"CFStringFindWithOptions", (PyCFunction)CFStringRefObj_CFStringFindWithOptions, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2395 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
2396 {"CFStringCreateArrayWithFindResults", (PyCFunction)CFStringRefObj_CFStringCreateArrayWithFindResults, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2397 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
2398 {"CFStringFind", (PyCFunction)CFStringRefObj_CFStringFind, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2399 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
2400 {"CFStringHasPrefix", (PyCFunction)CFStringRefObj_CFStringHasPrefix, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2401 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
2402 {"CFStringHasSuffix", (PyCFunction)CFStringRefObj_CFStringHasSuffix, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2403 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
2404 {"CFStringGetLineBounds", (PyCFunction)CFStringRefObj_CFStringGetLineBounds, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2405 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
2406 {"CFStringCreateArrayBySeparatingStrings", (PyCFunction)CFStringRefObj_CFStringCreateArrayBySeparatingStrings, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2407 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
2408 {"CFStringGetIntValue", (PyCFunction)CFStringRefObj_CFStringGetIntValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2409 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
2410 {"CFStringGetDoubleValue", (PyCFunction)CFStringRefObj_CFStringGetDoubleValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2411 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
2412 {"CFStringConvertIANACharSetNameToEncoding", (PyCFunction)CFStringRefObj_CFStringConvertIANACharSetNameToEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2413 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
2414 {"CFShowStr", (PyCFunction)CFStringRefObj_CFShowStr, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2415 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
2416 {"CFURLCreateWithString", (PyCFunction)CFStringRefObj_CFURLCreateWithString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2417 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
2418 {"CFURLCreateWithFileSystemPath", (PyCFunction)CFStringRefObj_CFURLCreateWithFileSystemPath, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2419 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
2420 {"CFURLCreateWithFileSystemPathRelativeToBase", (PyCFunction)CFStringRefObj_CFURLCreateWithFileSystemPathRelativeToBase, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2421 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
2422 {"CFURLCreateStringByReplacingPercentEscapes", (PyCFunction)CFStringRefObj_CFURLCreateStringByReplacingPercentEscapes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2423 PyDoc_STR("(CFStringRef charactersToLeaveEscaped) -> (CFStringRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2424 {"CFURLCreateStringByAddingPercentEscapes", (PyCFunction)CFStringRefObj_CFURLCreateStringByAddingPercentEscapes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2425 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
2426 {"CFStringGetString", (PyCFunction)CFStringRefObj_CFStringGetString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2427 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
2428 {"CFStringGetUnicode", (PyCFunction)CFStringRefObj_CFStringGetUnicode, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2429 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
2430 {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
2431 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2432
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2433 #define CFStringRefObj_getsetlist NULL
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2434
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2435
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2436 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
2437 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2438 /* 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
2439 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
2440 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
2441 return 0;
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 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
2445 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2446 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
2447 sprintf(buf, "<CFStringRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
2448 return PyString_FromString(buf);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2449 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2450
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2451 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
2452 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2453 /* 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
2454 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
2455 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2456 static int CFStringRefObj_tp_init(PyObject *_self, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2457 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2458 CFStringRef itself;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2459 char *kw[] = {"itself", 0};
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2460
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2461 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFStringRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2462 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2463 ((CFStringRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2464 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2465 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2466
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2467 /* Any CFTypeRef descendent is allowed as initializer too */
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2468 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFTypeRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2469 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2470 ((CFStringRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2471 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2472 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2473 return -1;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2474 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2475
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2476 #define CFStringRefObj_tp_alloc PyType_GenericAlloc
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2477
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2478 static PyObject *CFStringRefObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2479 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2480 PyObject *self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2481 if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2482 ((CFStringRefObject *)self)->ob_itself = NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2483 ((CFStringRefObject *)self)->ob_freeit = CFRelease;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2484 return self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2485 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2486
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2487 #define CFStringRefObj_tp_free PyObject_Del
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2488
19443
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 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
2491 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
2492 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
2493 "_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
2494 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
2495 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
2496 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2497 (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
2498 0, /*tp_print*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2499 (getattrfunc)0, /*tp_getattr*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2500 (setattrfunc)0, /*tp_setattr*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2501 (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
2502 (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
2503 (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
2504 (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
2505 (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
2506 (hashfunc) CFStringRefObj_hash, /*tp_hash*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2507 0, /*tp_call*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2508 0, /*tp_str*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2509 PyObject_GenericGetAttr, /*tp_getattro*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2510 PyObject_GenericSetAttr, /*tp_setattro */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2511 0, /*tp_as_buffer*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2512 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2513 0, /*tp_doc*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2514 0, /*tp_traverse*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2515 0, /*tp_clear*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2516 0, /*tp_richcompare*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2517 0, /*tp_weaklistoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2518 0, /*tp_iter*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2519 0, /*tp_iternext*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2520 CFStringRefObj_methods, /* tp_methods */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2521 0, /*tp_members*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2522 CFStringRefObj_getsetlist, /*tp_getset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2523 0, /*tp_base*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2524 0, /*tp_dict*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2525 0, /*tp_descr_get*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2526 0, /*tp_descr_set*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2527 0, /*tp_dictoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2528 CFStringRefObj_tp_init, /* tp_init */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2529 CFStringRefObj_tp_alloc, /* tp_alloc */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2530 CFStringRefObj_tp_new, /* tp_new */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2531 CFStringRefObj_tp_free, /* tp_free */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2532 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2533
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2534 /* ------------------ 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
2535
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2536
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2537 /* ----------------- 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
2538
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2539 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
2540
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
2541 #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
2542
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2543 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
2544 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2545 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
2546 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
2547 } CFMutableStringRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2548
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2549 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
2550 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2551 CFMutableStringRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2552 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2553 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2554 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
2555 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2556 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2557 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
2558 if (it == NULL) return NULL;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2559 /* XXXX Should we tp_init or tp_new our basetype? */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2560 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
2561 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
2562 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
2563 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2564
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
2565 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
2566 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2567
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2568 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
2569 /* 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
2570
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2571 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
2572 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2573 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
2574 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2575 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2576 *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
2577 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2578 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2579
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2580 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
2581 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2582 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
2583 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2584 self->ob_freeit((CFTypeRef)self->ob_itself);
32693
780a33787458 The CF inheritance could cause double frees of the underlying objects.
Jack Jansen <jack.jansen@cwi.nl>
parents: 32691
diff changeset
2585 self->ob_itself = NULL;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2586 }
38223
accdf1124ba2 Fix bug #1000914 (again).
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 37089
diff changeset
2587 CFStringRef_Type.tp_dealloc((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
2588 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2589
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2590 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
2591 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2592 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
2593 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
2594 #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
2595 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
2596 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2597 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
2598 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
2599 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2600 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
2601 appendedString);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2602 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
2603 _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
2604 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2605 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2606
21614
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2607 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
2608 {
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2609 PyObject *_res = NULL;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2610 UniChar *chars__in__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2611 UniCharCount chars__len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2612 int chars__in_len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2613 #ifndef CFStringAppendCharacters
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2614 PyMac_PRECHECK(CFStringAppendCharacters);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2615 #endif
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2616 if (!PyArg_ParseTuple(_args, "u#",
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2617 &chars__in__, &chars__in_len__))
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2618 return NULL;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2619 chars__len__ = chars__in_len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2620 CFStringAppendCharacters(_self->ob_itself,
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2621 chars__in__, chars__len__);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2622 Py_INCREF(Py_None);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2623 _res = Py_None;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2624 return _res;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2625 }
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2626
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2627 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
2628 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2629 PyObject *_res = NULL;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2630 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
2631 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
2632 #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
2633 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
2634 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2635 if (!PyArg_ParseTuple(_args, "O&l",
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2636 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
2637 &encoding))
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 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
2640 pStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2641 encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2642 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
2643 _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
2644 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2645 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2646
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2647 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
2648 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2649 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
2650 char* cStr;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2651 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
2652 #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
2653 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
2654 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2655 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
2656 &cStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2657 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2658 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2659 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
2660 cStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2661 encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2662 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
2663 _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
2664 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2665 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2666
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2667 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
2668 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2669 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
2670 CFIndex idx;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2671 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
2672 #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
2673 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
2674 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2675 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
2676 &idx,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2677 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
2678 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2679 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
2680 idx,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2681 insertedStr);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2682 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
2683 _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
2684 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2685 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2686
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2687 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
2688 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2689 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
2690 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
2691 #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
2692 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
2693 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2694 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
2695 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
2696 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2697 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
2698 range);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2699 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
2700 _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
2701 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2702 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2703
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2704 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
2705 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2706 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
2707 CFRange range;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2708 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
2709 #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
2710 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
2711 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2712 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
2713 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
2714 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
2715 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2716 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
2717 range,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2718 replacement);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2719 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
2720 _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
2721 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2722 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2723
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2724 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
2725 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2726 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
2727 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
2728 #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
2729 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
2730 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2731 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
2732 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
2733 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2734 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
2735 replacement);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2736 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
2737 _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
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 *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
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 padString;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2745 CFIndex length;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2746 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
2747 #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
2748 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
2749 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2750 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
2751 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
2752 &length,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2753 &indexIntoPad))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2754 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2755 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
2756 padString,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2757 length,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2758 indexIntoPad);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2759 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
2760 _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
2761 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2762 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2763
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2764 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
2765 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2766 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
2767 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
2768 #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
2769 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
2770 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2771 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
2772 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
2773 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2774 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
2775 trimString);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2776 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
2777 _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
2778 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2779 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2780
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2781 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
2782 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2783 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
2784 #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
2785 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
2786 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2787 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
2788 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2789 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
2790 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
2791 _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
2792 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2793 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2794
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2795 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
2796 {"CFStringAppend", (PyCFunction)CFMutableStringRefObj_CFStringAppend, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2797 PyDoc_STR("(CFStringRef appendedString) -> None")},
21614
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
2798 {"CFStringAppendCharacters", (PyCFunction)CFMutableStringRefObj_CFStringAppendCharacters, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2799 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
2800 {"CFStringAppendPascalString", (PyCFunction)CFMutableStringRefObj_CFStringAppendPascalString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2801 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
2802 {"CFStringAppendCString", (PyCFunction)CFMutableStringRefObj_CFStringAppendCString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2803 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
2804 {"CFStringInsert", (PyCFunction)CFMutableStringRefObj_CFStringInsert, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2805 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
2806 {"CFStringDelete", (PyCFunction)CFMutableStringRefObj_CFStringDelete, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2807 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
2808 {"CFStringReplace", (PyCFunction)CFMutableStringRefObj_CFStringReplace, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2809 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
2810 {"CFStringReplaceAll", (PyCFunction)CFMutableStringRefObj_CFStringReplaceAll, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2811 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
2812 {"CFStringPad", (PyCFunction)CFMutableStringRefObj_CFStringPad, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2813 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
2814 {"CFStringTrim", (PyCFunction)CFMutableStringRefObj_CFStringTrim, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2815 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
2816 {"CFStringTrimWhitespace", (PyCFunction)CFMutableStringRefObj_CFStringTrimWhitespace, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
2817 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
2818 {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
2819 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2820
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2821 #define CFMutableStringRefObj_getsetlist NULL
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2822
19443
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 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
2825 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2826 /* 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
2827 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
2828 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
2829 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2830 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2831
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2832 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
2833 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2834 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
2835 sprintf(buf, "<CFMutableStringRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
2836 return PyString_FromString(buf);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2837 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2838
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2839 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
2840 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2841 /* 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
2842 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
2843 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2844 static int CFMutableStringRefObj_tp_init(PyObject *_self, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2845 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2846 CFMutableStringRef itself;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2847 char *kw[] = {"itself", 0};
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2848
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2849 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFMutableStringRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2850 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2851 ((CFMutableStringRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2852 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2853 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2854
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2855 /* Any CFTypeRef descendent is allowed as initializer too */
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2856 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFTypeRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2857 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2858 ((CFMutableStringRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2859 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2860 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2861 return -1;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2862 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2863
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2864 #define CFMutableStringRefObj_tp_alloc PyType_GenericAlloc
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2865
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2866 static PyObject *CFMutableStringRefObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2867 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2868 PyObject *self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2869 if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2870 ((CFMutableStringRefObject *)self)->ob_itself = NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2871 ((CFMutableStringRefObject *)self)->ob_freeit = CFRelease;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2872 return self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2873 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2874
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2875 #define CFMutableStringRefObj_tp_free PyObject_Del
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2876
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2877
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2878 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
2879 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
2880 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
2881 "_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
2882 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
2883 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
2884 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2885 (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
2886 0, /*tp_print*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2887 (getattrfunc)0, /*tp_getattr*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2888 (setattrfunc)0, /*tp_setattr*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2889 (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
2890 (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
2891 (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
2892 (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
2893 (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
2894 (hashfunc) CFMutableStringRefObj_hash, /*tp_hash*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2895 0, /*tp_call*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2896 0, /*tp_str*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2897 PyObject_GenericGetAttr, /*tp_getattro*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2898 PyObject_GenericSetAttr, /*tp_setattro */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2899 0, /*tp_as_buffer*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2900 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2901 0, /*tp_doc*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2902 0, /*tp_traverse*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2903 0, /*tp_clear*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2904 0, /*tp_richcompare*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2905 0, /*tp_weaklistoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2906 0, /*tp_iter*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2907 0, /*tp_iternext*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2908 CFMutableStringRefObj_methods, /* tp_methods */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2909 0, /*tp_members*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2910 CFMutableStringRefObj_getsetlist, /*tp_getset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2911 0, /*tp_base*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2912 0, /*tp_dict*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2913 0, /*tp_descr_get*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2914 0, /*tp_descr_set*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2915 0, /*tp_dictoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2916 CFMutableStringRefObj_tp_init, /* tp_init */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2917 CFMutableStringRefObj_tp_alloc, /* tp_alloc */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2918 CFMutableStringRefObj_tp_new, /* tp_new */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2919 CFMutableStringRefObj_tp_free, /* tp_free */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2920 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2921
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2922 /* --------------- 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
2923
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2924
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2925 /* ---------------------- 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
2926
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2927 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
2928
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26524
diff changeset
2929 #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
2930
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2931 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
2932 PyObject_HEAD
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2933 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
2934 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
2935 } CFURLRefObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2936
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2937 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
2938 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2939 CFURLRefObject *it;
23424
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2940 if (itself == NULL)
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2941 {
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2942 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
2943 return NULL;
63890bc29a7c - Better exception when a NULL CF object is encountered.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23395
diff changeset
2944 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2945 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
2946 if (it == NULL) return NULL;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
2947 /* XXXX Should we tp_init or tp_new our basetype? */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2948 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
2949 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
2950 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
2951 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
2952
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19443
diff changeset
2953 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
2954 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2955
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2956 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
2957 /* 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
2958
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2959 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
2960 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2961 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
2962 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2963 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2964 *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
2965 return 1;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2966 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2967
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2968 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
2969 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2970 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
2971 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2972 self->ob_freeit((CFTypeRef)self->ob_itself);
32693
780a33787458 The CF inheritance could cause double frees of the underlying objects.
Jack Jansen <jack.jansen@cwi.nl>
parents: 32691
diff changeset
2973 self->ob_itself = NULL;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2974 }
38223
accdf1124ba2 Fix bug #1000914 (again).
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 37089
diff changeset
2975 CFTypeRef_Type.tp_dealloc((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
2976 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2977
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2978 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
2979 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2980 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
2981 CFDataRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2982 CFStringEncoding encoding;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2983 Boolean escapeWhitespace;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2984 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
2985 &encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2986 &escapeWhitespace))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2987 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2988 _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
2989 _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
2990 encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2991 escapeWhitespace);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2992 _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
2993 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
2994 return _res;
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
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2997 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
2998 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
2999 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3000 Boolean _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3001 Boolean resolveAgainstBase;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3002 UInt8 buffer;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3003 CFIndex maxBufLen;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3004 #ifndef CFURLGetFileSystemRepresentation
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3005 PyMac_PRECHECK(CFURLGetFileSystemRepresentation);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3006 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3007 if (!PyArg_ParseTuple(_args, "ll",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3008 &resolveAgainstBase,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3009 &maxBufLen))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3010 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3011 _rv = CFURLGetFileSystemRepresentation(_self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3012 resolveAgainstBase,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3013 &buffer,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3014 maxBufLen);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3015 _res = Py_BuildValue("lb",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3016 _rv,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3017 buffer);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3018 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3019 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3020
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3021 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
3022 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3023 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
3024 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
3025 #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
3026 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
3027 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3028 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
3029 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3030 _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
3031 _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
3032 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
3033 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3034 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3035
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3036 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
3037 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3038 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
3039 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
3040 #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
3041 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
3042 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3043 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
3044 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3045 _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
3046 _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
3047 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
3048 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3049 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3050
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3051 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
3052 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3053 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
3054 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
3055 #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
3056 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
3057 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3058 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
3059 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3060 _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
3061 _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
3062 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
3063 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3064 }
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 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
3067 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3068 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
3069 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
3070 #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
3071 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
3072 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3073 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
3074 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3075 _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
3076 _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
3077 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3078 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3079 }
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 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
3082 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3083 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
3084 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
3085 #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
3086 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
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, ""))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3089 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3090 _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
3091 _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
3092 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
3093 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3094 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3095
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3096 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
3097 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3098 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
3099 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
3100 #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
3101 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
3102 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3103 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
3104 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3105 _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
3106 _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
3107 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
3108 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3109 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3110
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3111 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
3112 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3113 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
3114 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
3115 #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
3116 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
3117 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3118 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
3119 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3120 _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
3121 _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
3122 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
3123 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3124 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3125
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3126 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
3127 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3128 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3129 CFStringRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3130 Boolean isAbsolute;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3131 #ifndef CFURLCopyStrictPath
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3132 PyMac_PRECHECK(CFURLCopyStrictPath);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3133 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3134 if (!PyArg_ParseTuple(_args, ""))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3135 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3136 _rv = CFURLCopyStrictPath(_self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3137 &isAbsolute);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3138 _res = Py_BuildValue("O&l",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3139 CFStringRefObj_New, _rv,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3140 isAbsolute);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3141 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3142 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3143
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3144 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
3145 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3146 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3147 CFStringRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3148 CFURLPathStyle pathStyle;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3149 #ifndef CFURLCopyFileSystemPath
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3150 PyMac_PRECHECK(CFURLCopyFileSystemPath);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3151 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3152 if (!PyArg_ParseTuple(_args, "l",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3153 &pathStyle))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3154 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3155 _rv = CFURLCopyFileSystemPath(_self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3156 pathStyle);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3157 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3158 CFStringRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3159 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3160 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3161
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3162 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
3163 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3164 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
3165 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
3166 #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
3167 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
3168 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3169 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
3170 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3171 _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
3172 _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
3173 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3174 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3175 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3176
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3177 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
3178 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3179 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
3180 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
3181 #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
3182 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
3183 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3184 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
3185 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3186 _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
3187 _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
3188 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
3189 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3190 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3191
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3192 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
3193 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3194 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
3195 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
3196 #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
3197 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
3198 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3199 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
3200 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3201 _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
3202 _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
3203 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
3204 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3205 }
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 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
3208 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3209 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
3210 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
3211 #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
3212 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
3213 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3214 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
3215 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3216 _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
3217 _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
3218 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3219 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3220 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3221
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3222 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
3223 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3224 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
3225 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
3226 #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
3227 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
3228 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3229 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
3230 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3231 _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
3232 _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
3233 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
3234 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3235 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3236
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3237 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
3238 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3239 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
3240 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
3241 #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
3242 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
3243 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3244 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
3245 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3246 _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
3247 _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
3248 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
3249 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3250 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3251
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3252 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
3253 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3254 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
3255 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3256 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
3257 #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
3258 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
3259 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3260 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
3261 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
3262 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3263 _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
3264 charactersToLeaveEscaped);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3265 _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
3266 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
3267 return _res;
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3270 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
3271 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3272 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
3273 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3274 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
3275 #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
3276 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
3277 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3278 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
3279 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
3280 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3281 _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
3282 charactersToLeaveEscaped);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3283 _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
3284 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
3285 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3286 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3287
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3288 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
3289 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3290 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
3291 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3292 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
3293 #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
3294 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
3295 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3296 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
3297 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
3298 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3299 _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
3300 charactersToLeaveEscaped);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3301 _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
3302 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
3303 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3304 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3305
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3306 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
3307 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3308 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3309 CFStringRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3310 #ifndef CFURLCopyLastPathComponent
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3311 PyMac_PRECHECK(CFURLCopyLastPathComponent);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3312 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3313 if (!PyArg_ParseTuple(_args, ""))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3314 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3315 _rv = CFURLCopyLastPathComponent(_self->ob_itself);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3316 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3317 CFStringRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3318 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3319 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3320
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3321 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
3322 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3323 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3324 CFStringRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3325 #ifndef CFURLCopyPathExtension
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3326 PyMac_PRECHECK(CFURLCopyPathExtension);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3327 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3328 if (!PyArg_ParseTuple(_args, ""))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3329 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3330 _rv = CFURLCopyPathExtension(_self->ob_itself);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3331 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3332 CFStringRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3333 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3334 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3335
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3336 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
3337 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3338 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3339 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3340 CFStringRef pathComponent;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3341 Boolean isDirectory;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3342 if (!PyArg_ParseTuple(_args, "O&l",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3343 CFStringRefObj_Convert, &pathComponent,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3344 &isDirectory))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3345 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3346 _rv = CFURLCreateCopyAppendingPathComponent((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3347 _self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3348 pathComponent,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3349 isDirectory);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3350 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3351 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3352 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3353 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3354
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3355 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
3356 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3357 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3358 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3359 if (!PyArg_ParseTuple(_args, ""))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3360 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3361 _rv = CFURLCreateCopyDeletingLastPathComponent((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3362 _self->ob_itself);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3363 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3364 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3365 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3366 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3367
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3368 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
3369 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3370 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3371 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3372 CFStringRef extension;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3373 if (!PyArg_ParseTuple(_args, "O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3374 CFStringRefObj_Convert, &extension))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3375 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3376 _rv = CFURLCreateCopyAppendingPathExtension((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3377 _self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3378 extension);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3379 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3380 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3381 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3382 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3383
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3384 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
3385 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3386 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3387 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3388 if (!PyArg_ParseTuple(_args, ""))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3389 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3390 _rv = CFURLCreateCopyDeletingPathExtension((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3391 _self->ob_itself);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3392 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3393 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3394 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3395 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3396
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3397 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
3398 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3399 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3400 Boolean _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3401 FSRef fsRef;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3402 #ifndef CFURLGetFSRef
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3403 PyMac_PRECHECK(CFURLGetFSRef);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3404 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3405 if (!PyArg_ParseTuple(_args, ""))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3406 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3407 _rv = CFURLGetFSRef(_self->ob_itself,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3408 &fsRef);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3409 _res = Py_BuildValue("lO&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3410 _rv,
22387
b59e8a8df57e Backport of _CFmodule.c 1.11 and _Winmodule 1.8:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21614
diff changeset
3411 PyMac_BuildFSRef, &fsRef);
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3412 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3413 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3414
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3415 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
3416 {"CFURLCreateData", (PyCFunction)CFURLRefObj_CFURLCreateData, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3417 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
3418 {"CFURLGetFileSystemRepresentation", (PyCFunction)CFURLRefObj_CFURLGetFileSystemRepresentation, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3419 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
3420 {"CFURLCopyAbsoluteURL", (PyCFunction)CFURLRefObj_CFURLCopyAbsoluteURL, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3421 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
3422 {"CFURLGetString", (PyCFunction)CFURLRefObj_CFURLGetString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3423 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
3424 {"CFURLGetBaseURL", (PyCFunction)CFURLRefObj_CFURLGetBaseURL, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3425 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
3426 {"CFURLCanBeDecomposed", (PyCFunction)CFURLRefObj_CFURLCanBeDecomposed, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3427 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
3428 {"CFURLCopyScheme", (PyCFunction)CFURLRefObj_CFURLCopyScheme, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3429 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
3430 {"CFURLCopyNetLocation", (PyCFunction)CFURLRefObj_CFURLCopyNetLocation, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3431 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
3432 {"CFURLCopyPath", (PyCFunction)CFURLRefObj_CFURLCopyPath, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3433 PyDoc_STR("() -> (CFStringRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3434 {"CFURLCopyStrictPath", (PyCFunction)CFURLRefObj_CFURLCopyStrictPath, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3435 PyDoc_STR("() -> (CFStringRef _rv, Boolean isAbsolute)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3436 {"CFURLCopyFileSystemPath", (PyCFunction)CFURLRefObj_CFURLCopyFileSystemPath, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3437 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
3438 {"CFURLHasDirectoryPath", (PyCFunction)CFURLRefObj_CFURLHasDirectoryPath, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3439 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
3440 {"CFURLCopyResourceSpecifier", (PyCFunction)CFURLRefObj_CFURLCopyResourceSpecifier, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3441 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
3442 {"CFURLCopyHostName", (PyCFunction)CFURLRefObj_CFURLCopyHostName, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3443 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
3444 {"CFURLGetPortNumber", (PyCFunction)CFURLRefObj_CFURLGetPortNumber, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3445 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
3446 {"CFURLCopyUserName", (PyCFunction)CFURLRefObj_CFURLCopyUserName, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3447 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
3448 {"CFURLCopyPassword", (PyCFunction)CFURLRefObj_CFURLCopyPassword, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3449 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
3450 {"CFURLCopyParameterString", (PyCFunction)CFURLRefObj_CFURLCopyParameterString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3451 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
3452 {"CFURLCopyQueryString", (PyCFunction)CFURLRefObj_CFURLCopyQueryString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3453 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
3454 {"CFURLCopyFragment", (PyCFunction)CFURLRefObj_CFURLCopyFragment, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3455 PyDoc_STR("(CFStringRef charactersToLeaveEscaped) -> (CFStringRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3456 {"CFURLCopyLastPathComponent", (PyCFunction)CFURLRefObj_CFURLCopyLastPathComponent, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3457 PyDoc_STR("() -> (CFStringRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3458 {"CFURLCopyPathExtension", (PyCFunction)CFURLRefObj_CFURLCopyPathExtension, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3459 PyDoc_STR("() -> (CFStringRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3460 {"CFURLCreateCopyAppendingPathComponent", (PyCFunction)CFURLRefObj_CFURLCreateCopyAppendingPathComponent, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3461 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
3462 {"CFURLCreateCopyDeletingLastPathComponent", (PyCFunction)CFURLRefObj_CFURLCreateCopyDeletingLastPathComponent, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3463 PyDoc_STR("() -> (CFURLRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3464 {"CFURLCreateCopyAppendingPathExtension", (PyCFunction)CFURLRefObj_CFURLCreateCopyAppendingPathExtension, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3465 PyDoc_STR("(CFStringRef extension) -> (CFURLRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3466 {"CFURLCreateCopyDeletingPathExtension", (PyCFunction)CFURLRefObj_CFURLCreateCopyDeletingPathExtension, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3467 PyDoc_STR("() -> (CFURLRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3468 {"CFURLGetFSRef", (PyCFunction)CFURLRefObj_CFURLGetFSRef, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
3469 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
3470 {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
3471 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3472
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3473 #define CFURLRefObj_getsetlist NULL
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3474
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3475
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3476 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
3477 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3478 /* 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
3479 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
3480 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
3481 return 0;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3482 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3483
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3484 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
3485 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3486 char buf[100];
19723
2a9bbdbefbb1 Shut up many more gcc warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19710
diff changeset
3487 sprintf(buf, "<CFURL object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
47527
52294af4b663 This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents: 47294
diff changeset
3488 return PyString_FromString(buf);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3489 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3490
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3491 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
3492 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3493 /* 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
3494 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
3495 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
3496 static int CFURLRefObj_tp_init(PyObject *_self, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3497 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3498 CFURLRef itself;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3499 char *kw[] = {"itself", 0};
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3500
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
3501 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFURLRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3502 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
3503 ((CFURLRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3504 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3505 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3506
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3507 /* Any CFTypeRef descendent is allowed as initializer too */
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
3508 if (PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CFTypeRefObj_Convert, &itself))
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3509 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
3510 ((CFURLRefObject *)_self)->ob_itself = itself;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3511 return 0;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3512 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3513 return -1;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3514 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3515
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3516 #define CFURLRefObj_tp_alloc PyType_GenericAlloc
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3517
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
3518 static PyObject *CFURLRefObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3519 {
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3520 PyObject *self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3521 if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3522 ((CFURLRefObject *)self)->ob_itself = NULL;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3523 ((CFURLRefObject *)self)->ob_freeit = CFRelease;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3524 return self;
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3525 }
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3526
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3527 #define CFURLRefObj_tp_free PyObject_Del
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3528
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3529
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3530 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
3531 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
3532 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
3533 "_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
3534 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
3535 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
3536 /* methods */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3537 (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
3538 0, /*tp_print*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3539 (getattrfunc)0, /*tp_getattr*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3540 (setattrfunc)0, /*tp_setattr*/
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3541 (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
3542 (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
3543 (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
3544 (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
3545 (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
3546 (hashfunc) CFURLRefObj_hash, /*tp_hash*/
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3547 0, /*tp_call*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3548 0, /*tp_str*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3549 PyObject_GenericGetAttr, /*tp_getattro*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3550 PyObject_GenericSetAttr, /*tp_setattro */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3551 0, /*tp_as_buffer*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3552 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3553 0, /*tp_doc*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3554 0, /*tp_traverse*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3555 0, /*tp_clear*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3556 0, /*tp_richcompare*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3557 0, /*tp_weaklistoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3558 0, /*tp_iter*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3559 0, /*tp_iternext*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3560 CFURLRefObj_methods, /* tp_methods */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3561 0, /*tp_members*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3562 CFURLRefObj_getsetlist, /*tp_getset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3563 0, /*tp_base*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3564 0, /*tp_dict*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3565 0, /*tp_descr_get*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3566 0, /*tp_descr_set*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3567 0, /*tp_dictoffset*/
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3568 CFURLRefObj_tp_init, /* tp_init */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3569 CFURLRefObj_tp_alloc, /* tp_alloc */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3570 CFURLRefObj_tp_new, /* tp_new */
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
3571 CFURLRefObj_tp_free, /* tp_free */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3572 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3573
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3574 /* -------------------- 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
3575
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3576
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3577 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
3578 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3579 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3580 CFRange _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3581 CFIndex loc;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3582 CFIndex len;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3583 #ifndef __CFRangeMake
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3584 PyMac_PRECHECK(__CFRangeMake);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3585 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3586 if (!PyArg_ParseTuple(_args, "ll",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3587 &loc,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3588 &len))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3589 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3590 _rv = __CFRangeMake(loc,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3591 len);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3592 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3593 CFRange_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3594 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3595 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3596
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3597 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
3598 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3599 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
3600 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
3601 #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
3602 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
3603 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3604 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
3605 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3606 _rv = CFAllocatorGetTypeID();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3607 _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
3608 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3609 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3610 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3611
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3612 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
3613 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3614 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
3615 CFIndex _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3616 CFIndex size;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3617 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
3618 #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
3619 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
3620 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3621 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
3622 &size,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3623 &hint))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3624 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3625 _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
3626 size,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3627 hint);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3628 _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
3629 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3630 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3631 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3632
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3633 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
3634 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3635 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
3636 CFStringRef _rv;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3637 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
3638 #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
3639 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
3640 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3641 if (!PyArg_ParseTuple(_args, "l",
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3642 &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
3643 return NULL;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3644 _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
3645 _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
3646 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
3647 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3648 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3649
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3650 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
3651 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3652 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
3653 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
3654 #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
3655 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
3656 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3657 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
3658 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3659 _rv = CFArrayGetTypeID();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3660 _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
3661 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3662 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3663 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3664
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3665 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
3666 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3667 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
3668 CFMutableArrayRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3669 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
3670 #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
3671 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
3672 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3673 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
3674 &capacity))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3675 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3676 _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
3677 capacity,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3678 &kCFTypeArrayCallBacks);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3679 _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
3680 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
3681 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3682 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3683
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3684 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
3685 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3686 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
3687 CFMutableArrayRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3688 CFIndex capacity;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3689 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
3690 #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
3691 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
3692 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3693 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
3694 &capacity,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3695 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
3696 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3697 _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
3698 capacity,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3699 theArray);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3700 _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
3701 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
3702 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3703 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3704
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3705 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
3706 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3707 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
3708 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
3709 #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
3710 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
3711 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3712 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
3713 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3714 _rv = CFDataGetTypeID();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3715 _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
3716 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3717 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3718 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3719
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_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
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 CFDataRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3724 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
3725 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
3726 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
3727 #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
3728 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
3729 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3730 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
3731 &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
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 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
3734 _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
3735 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
3736 _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
3737 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
3738 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3739 }
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 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
3742 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3743 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
3744 CFDataRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3745 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
3746 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
3747 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
3748 #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
3749 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
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, "s#",
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3752 &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
3753 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3754 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
3755 _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
3756 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
3757 (CFAllocatorRef)NULL);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3758 _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
3759 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
3760 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3761 }
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 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
3764 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3765 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
3766 CFMutableDataRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3767 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
3768 #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
3769 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
3770 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3771 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
3772 &capacity))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3773 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3774 _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
3775 capacity);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3776 _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
3777 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
3778 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3779 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3780
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3781 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
3782 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3783 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
3784 CFMutableDataRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3785 CFIndex capacity;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3786 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
3787 #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
3788 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
3789 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3790 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
3791 &capacity,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3792 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
3793 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3794 _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
3795 capacity,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3796 theData);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3797 _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
3798 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
3799 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3800 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3801
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3802 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
3803 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3804 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
3805 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
3806 #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
3807 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
3808 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3809 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
3810 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3811 _rv = CFDictionaryGetTypeID();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3812 _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
3813 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3814 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3815 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3816
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3817 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
3818 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3819 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
3820 CFMutableDictionaryRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3821 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
3822 #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
3823 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
3824 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3825 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
3826 &capacity))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3827 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3828 _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
3829 capacity,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3830 &kCFTypeDictionaryKeyCallBacks,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3831 &kCFTypeDictionaryValueCallBacks);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3832 _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
3833 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
3834 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3835 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3836
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3837 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
3838 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3839 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
3840 CFMutableDictionaryRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3841 CFIndex capacity;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3842 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
3843 #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
3844 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
3845 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3846 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
3847 &capacity,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3848 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
3849 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3850 _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
3851 capacity,
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
3852 theDict);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3853 _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
3854 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
3855 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3856 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3857
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
3858 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
3859 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3860 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
3861 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
3862 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
3863 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
3864 #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
3865 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
3866 #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
3867 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
3868 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
3869 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
3870 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
3871 _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
3872 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
3873 _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
3874 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
3875 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
3876 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3877
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3878 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
3879 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3880 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
3881 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
3882 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
3883 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
3884 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
3885 #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
3886 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
3887 #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
3888 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
3889 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
3890 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
3891 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
3892 _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
3893 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
3894 &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
3895 _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
3896 _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
3897 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
3898 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
3899 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3900
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3901 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
3902 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3903 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
3904 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
3905 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
3906 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
3907 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
3908 #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
3909 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
3910 #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
3911 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
3912 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
3913 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
3914 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
3915 _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
3916 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
3917 &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
3918 _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
3919 _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
3920 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
3921 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
3922 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3923
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3924 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
3925 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3926 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
3927 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
3928 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
3929 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
3930 #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
3931 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
3932 #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
3933 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
3934 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
3935 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
3936 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
3937 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
3938 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
3939 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
3940 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
3941 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
3942 _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
3943 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
3944 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3945
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3946 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
3947 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3948 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
3949 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
3950 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
3951 #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
3952 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
3953 #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
3954 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
3955 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
3956 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
3957 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
3958 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
3959 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
3960 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
3961 _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
3962 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
3963 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3964
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3965 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
3966 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3967 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
3968 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
3969 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
3970 #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
3971 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
3972 #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
3973 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
3974 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
3975 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
3976 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
3977 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
3978 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
3979 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
3980 _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
3981 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
3982 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3983
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3984 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
3985 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
3986 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
3987 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
3988 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
3989 #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
3990 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
3991 #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
3992 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
3993 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
3994 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
3995 _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
3996 _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
3997 _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
3998 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
3999 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4000
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4001 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
4002 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4003 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
4004 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
4005 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
4006 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
4007 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
4008 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
4009 #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
4010 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
4011 #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
4012 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
4013 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
4014 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
4015 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
4016 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
4017 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
4018 _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
4019 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
4020 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
4021 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
4022 _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
4023 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
4024 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
4025 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4026
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4027 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
4028 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4029 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
4030 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
4031 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
4032 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
4033 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
4034 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
4035 #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
4036 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
4037 #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
4038 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
4039 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
4040 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
4041 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
4042 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
4043 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
4044 _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
4045 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
4046 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
4047 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
4048 _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
4049 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
4050 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
4051 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4052
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4053 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
4054 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4055 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
4056 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
4057 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
4058 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
4059 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
4060 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
4061 #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
4062 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
4063 #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
4064 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
4065 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
4066 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
4067 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
4068 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
4069 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
4070 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
4071 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
4072 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
4073 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
4074 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
4075 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
4076 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
4077 _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
4078 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
4079 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4080
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4081 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
4082 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4083 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
4084 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
4085 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
4086 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
4087 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
4088 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
4089 #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
4090 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
4091 #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
4092 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
4093 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
4094 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
4095 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
4096 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
4097 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
4098 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
4099 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
4100 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
4101 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
4102 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
4103 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
4104 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
4105 _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
4106 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
4107 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4108
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4109 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
4110 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4111 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
4112 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
4113 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
4114 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
4115 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
4116 #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
4117 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
4118 #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
4119 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
4120 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
4121 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
4122 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
4123 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
4124 _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
4125 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
4126 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
4127 _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
4128 _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
4129 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
4130 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4131
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4132 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
4133 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4134 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
4135 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
4136 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
4137 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
4138 #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
4139 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
4140 #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
4141 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
4142 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
4143 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
4144 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
4145 _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
4146 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
4147 _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
4148 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
4149 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
4150 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4151
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4152 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
4153 {
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4154 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
4155 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
4156 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
4157 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
4158 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
4159 #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
4160 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
4161 #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
4162 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
4163 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
4164 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
4165 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
4166 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
4167 _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
4168 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
4169 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
4170 _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
4171 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
4172 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
4173 }
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4174
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4175 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
4176 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4177 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
4178 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
4179 #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
4180 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
4181 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4182 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
4183 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4184 _rv = CFStringGetTypeID();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4185 _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
4186 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4187 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4188 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4189
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4190 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
4191 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4192 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
4193 CFStringRef _rv;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4194 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
4195 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
4196 #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
4197 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
4198 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4199 if (!PyArg_ParseTuple(_args, "O&l",
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4200 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
4201 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4202 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4203 _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
4204 pStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4205 encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4206 _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
4207 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
4208 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4209 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4210
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4211 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
4212 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4213 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
4214 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4215 char* cStr;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4216 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
4217 #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
4218 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
4219 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4220 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
4221 &cStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4222 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4223 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4224 _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
4225 cStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4226 encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4227 _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
4228 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
4229 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4230 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4231
21614
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4232 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
4233 {
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4234 PyObject *_res = NULL;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4235 CFStringRef _rv;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4236 UniChar *chars__in__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4237 UniCharCount chars__len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4238 int chars__in_len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4239 #ifndef CFStringCreateWithCharacters
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4240 PyMac_PRECHECK(CFStringCreateWithCharacters);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4241 #endif
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4242 if (!PyArg_ParseTuple(_args, "u#",
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4243 &chars__in__, &chars__in_len__))
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4244 return NULL;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4245 chars__len__ = chars__in_len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4246 _rv = CFStringCreateWithCharacters((CFAllocatorRef)NULL,
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4247 chars__in__, chars__len__);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4248 _res = Py_BuildValue("O&",
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4249 CFStringRefObj_New, _rv);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4250 return _res;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4251 }
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4252
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4253 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
4254 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4255 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
4256 CFStringRef _rv;
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4257 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
4258 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
4259 #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
4260 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
4261 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4262 if (!PyArg_ParseTuple(_args, "O&l",
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4263 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
4264 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4265 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4266 _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
4267 pStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4268 encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4269 (CFAllocatorRef)NULL);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4270 _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
4271 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
4272 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4273 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4274
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4275 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
4276 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4277 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
4278 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4279 char* cStr;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4280 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
4281 #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
4282 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
4283 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4284 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
4285 &cStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4286 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4287 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4288 _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
4289 cStr,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4290 encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4291 (CFAllocatorRef)NULL);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4292 _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
4293 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
4294 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4295 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4296
21614
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4297 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
4298 {
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4299 PyObject *_res = NULL;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4300 CFStringRef _rv;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4301 UniChar *chars__in__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4302 UniCharCount chars__len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4303 int chars__in_len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4304 #ifndef CFStringCreateWithCharactersNoCopy
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4305 PyMac_PRECHECK(CFStringCreateWithCharactersNoCopy);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4306 #endif
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4307 if (!PyArg_ParseTuple(_args, "u#",
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4308 &chars__in__, &chars__in_len__))
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4309 return NULL;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4310 chars__len__ = chars__in_len__;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4311 _rv = CFStringCreateWithCharactersNoCopy((CFAllocatorRef)NULL,
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4312 chars__in__, chars__len__,
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4313 (CFAllocatorRef)NULL);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4314 _res = Py_BuildValue("O&",
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4315 CFStringRefObj_New, _rv);
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4316 return _res;
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4317 }
095cff21956c Added some support for unicode arguments.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21464
diff changeset
4318
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4319 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
4320 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4321 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
4322 CFMutableStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4323 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
4324 #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
4325 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
4326 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4327 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
4328 &maxLength))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4329 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4330 _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
4331 maxLength);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4332 _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
4333 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
4334 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4335 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4336
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4337 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
4338 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4339 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
4340 CFMutableStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4341 CFIndex maxLength;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4342 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
4343 #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
4344 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
4345 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4346 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
4347 &maxLength,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4348 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
4349 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4350 _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
4351 maxLength,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4352 theString);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4353 _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
4354 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
4355 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4356 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4357
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4358 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
4359 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4360 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
4361 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4362 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
4363 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
4364 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
4365 CFStringEncoding encoding;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4366 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
4367 #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
4368 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
4369 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4370 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
4371 &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
4372 &encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4373 &isExternalRepresentation))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4374 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4375 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
4376 _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
4377 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
4378 encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4379 isExternalRepresentation);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4380 _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
4381 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
4382 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4383 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4384
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4385 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
4386 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4387 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
4388 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
4389 #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
4390 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
4391 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4392 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
4393 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4394 _rv = CFStringGetSystemEncoding();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4395 _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
4396 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4397 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4398 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4399
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4400 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
4401 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4402 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
4403 CFIndex _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4404 CFIndex length;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4405 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
4406 #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
4407 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
4408 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4409 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
4410 &length,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4411 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4412 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4413 _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
4414 encoding);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4415 _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
4416 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4417 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4418 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4419
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4420 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
4421 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4422 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
4423 Boolean _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4424 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
4425 #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
4426 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
4427 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4428 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
4429 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4430 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4431 _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
4432 _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
4433 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4434 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4435 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4436
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4437 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
4438 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4439 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
4440 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4441 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
4442 #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
4443 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
4444 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4445 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
4446 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4447 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4448 _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
4449 _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
4450 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
4451 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4452 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4453
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4454 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
4455 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4456 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
4457 UInt32 _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4458 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
4459 #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
4460 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
4461 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4462 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
4463 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4464 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4465 _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
4466 _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
4467 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4468 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4469 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4470
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4471 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
4472 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4473 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
4474 CFStringEncoding _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4475 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
4476 #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
4477 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
4478 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4479 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
4480 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4481 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4482 _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
4483 _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
4484 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4485 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4486 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4487
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4488 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
4489 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4490 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
4491 UInt32 _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4492 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
4493 #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
4494 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
4495 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4496 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
4497 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4498 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4499 _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
4500 _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
4501 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4502 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4503 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4504
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4505 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
4506 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4507 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
4508 CFStringEncoding _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4509 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
4510 #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
4511 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
4512 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4513 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
4514 &codepage))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4515 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4516 _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
4517 _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
4518 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4519 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4520 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4521
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4522 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
4523 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4524 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
4525 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4526 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
4527 #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
4528 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
4529 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4530 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
4531 &encoding))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4532 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4533 _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
4534 _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
4535 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
4536 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4537 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4538
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4539 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
4540 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4541 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4542 CFStringEncoding _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4543 CFStringEncoding encoding;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4544 #ifndef CFStringGetMostCompatibleMacStringEncoding
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4545 PyMac_PRECHECK(CFStringGetMostCompatibleMacStringEncoding);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4546 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4547 if (!PyArg_ParseTuple(_args, "l",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4548 &encoding))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4549 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4550 _rv = CFStringGetMostCompatibleMacStringEncoding(encoding);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4551 _res = Py_BuildValue("l",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4552 _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4553 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4554 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4555
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4556 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
4557 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4558 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
4559 CFStringRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4560 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
4561 #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
4562 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
4563 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4564 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
4565 &cStr))
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4566 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4567 _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
4568 _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
4569 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
4570 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4571 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4572
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4573 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
4574 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4575 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
4576 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
4577 #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
4578 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
4579 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4580 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
4581 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4582 _rv = CFURLGetTypeID();
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4583 _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
4584 _rv);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4585 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4586 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4587
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4588 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
4589 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4590 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
4591 CFURLRef _rv;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4592 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
4593 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
4594 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
4595 CFStringEncoding encoding;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4596 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
4597 #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
4598 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
4599 #endif
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4600 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
4601 &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
4602 &encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4603 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
4604 return NULL;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4605 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
4606 _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
4607 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
4608 encoding,
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4609 baseURL);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4610 _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
4611 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
4612 return _res;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4613 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4614
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4615 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
4616 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4617 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4618 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4619 unsigned char *buffer__in__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4620 long buffer__len__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4621 int buffer__in_len__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4622 Boolean isDirectory;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4623 #ifndef CFURLCreateFromFileSystemRepresentation
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4624 PyMac_PRECHECK(CFURLCreateFromFileSystemRepresentation);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4625 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4626 if (!PyArg_ParseTuple(_args, "s#l",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4627 &buffer__in__, &buffer__in_len__,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4628 &isDirectory))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4629 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4630 buffer__len__ = buffer__in_len__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4631 _rv = CFURLCreateFromFileSystemRepresentation((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4632 buffer__in__, buffer__len__,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4633 isDirectory);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4634 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4635 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4636 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4637 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4638
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4639 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
4640 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4641 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4642 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4643 unsigned char *buffer__in__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4644 long buffer__len__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4645 int buffer__in_len__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4646 Boolean isDirectory;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4647 CFURLRef baseURL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4648 #ifndef CFURLCreateFromFileSystemRepresentationRelativeToBase
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4649 PyMac_PRECHECK(CFURLCreateFromFileSystemRepresentationRelativeToBase);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4650 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4651 if (!PyArg_ParseTuple(_args, "s#lO&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4652 &buffer__in__, &buffer__in_len__,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4653 &isDirectory,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4654 OptionalCFURLRefObj_Convert, &baseURL))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4655 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4656 buffer__len__ = buffer__in_len__;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4657 _rv = CFURLCreateFromFileSystemRepresentationRelativeToBase((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4658 buffer__in__, buffer__len__,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4659 isDirectory,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4660 baseURL);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4661 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4662 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4663 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4664 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4665
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4666 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
4667 {
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4668 PyObject *_res = NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4669 CFURLRef _rv;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4670 FSRef fsRef;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4671 #ifndef CFURLCreateFromFSRef
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4672 PyMac_PRECHECK(CFURLCreateFromFSRef);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4673 #endif
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4674 if (!PyArg_ParseTuple(_args, "O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4675 PyMac_GetFSRef, &fsRef))
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4676 return NULL;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4677 _rv = CFURLCreateFromFSRef((CFAllocatorRef)NULL,
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4678 &fsRef);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4679 _res = Py_BuildValue("O&",
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4680 CFURLRefObj_New, _rv);
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4681 return _res;
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4682 }
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4683
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4684 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
4685 {
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4686 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
4687
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4688 CFTypeRef rv;
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4689 CFTypeID typeid;
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4690
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4691 if (!PyArg_ParseTuple(_args, "O&", PyCF_Python2CF, &rv))
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4692 return NULL;
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4693 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
4694
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4695 if (typeid == CFStringGetTypeID())
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4696 return Py_BuildValue("O&", CFStringRefObj_New, rv);
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4697 if (typeid == CFArrayGetTypeID())
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4698 return Py_BuildValue("O&", CFArrayRefObj_New, rv);
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4699 if (typeid == CFDictionaryGetTypeID())
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4700 return Py_BuildValue("O&", CFDictionaryRefObj_New, rv);
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4701 if (typeid == CFURLGetTypeID())
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4702 return Py_BuildValue("O&", CFURLRefObj_New, rv);
23395
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4703
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4704 _res = Py_BuildValue("O&", CFTypeRefObj_New, rv);
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4705 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
4706
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4707 }
bfe91e1e31b2 More support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23261
diff changeset
4708
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4709 static PyMethodDef CF_methods[] = {
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4710 {"__CFRangeMake", (PyCFunction)CF___CFRangeMake, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4711 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
4712 {"CFAllocatorGetTypeID", (PyCFunction)CF_CFAllocatorGetTypeID, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4713 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
4714 {"CFAllocatorGetPreferredSizeForSize", (PyCFunction)CF_CFAllocatorGetPreferredSizeForSize, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4715 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
4716 {"CFCopyTypeIDDescription", (PyCFunction)CF_CFCopyTypeIDDescription, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4717 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
4718 {"CFArrayGetTypeID", (PyCFunction)CF_CFArrayGetTypeID, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4719 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
4720 {"CFArrayCreateMutable", (PyCFunction)CF_CFArrayCreateMutable, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4721 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
4722 {"CFArrayCreateMutableCopy", (PyCFunction)CF_CFArrayCreateMutableCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4723 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
4724 {"CFDataGetTypeID", (PyCFunction)CF_CFDataGetTypeID, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4725 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
4726 {"CFDataCreate", (PyCFunction)CF_CFDataCreate, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4727 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
4728 {"CFDataCreateWithBytesNoCopy", (PyCFunction)CF_CFDataCreateWithBytesNoCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4729 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
4730 {"CFDataCreateMutable", (PyCFunction)CF_CFDataCreateMutable, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4731 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
4732 {"CFDataCreateMutableCopy", (PyCFunction)CF_CFDataCreateMutableCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4733 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
4734 {"CFDictionaryGetTypeID", (PyCFunction)CF_CFDictionaryGetTypeID, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4735 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
4736 {"CFDictionaryCreateMutable", (PyCFunction)CF_CFDictionaryCreateMutable, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4737 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
4738 {"CFDictionaryCreateMutableCopy", (PyCFunction)CF_CFDictionaryCreateMutableCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4739 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
4740 {"CFPreferencesCopyAppValue", (PyCFunction)CF_CFPreferencesCopyAppValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4741 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
4742 {"CFPreferencesGetAppBooleanValue", (PyCFunction)CF_CFPreferencesGetAppBooleanValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4743 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
4744 {"CFPreferencesGetAppIntegerValue", (PyCFunction)CF_CFPreferencesGetAppIntegerValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4745 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
4746 {"CFPreferencesSetAppValue", (PyCFunction)CF_CFPreferencesSetAppValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4747 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
4748 {"CFPreferencesAddSuitePreferencesToApp", (PyCFunction)CF_CFPreferencesAddSuitePreferencesToApp, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4749 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
4750 {"CFPreferencesRemoveSuitePreferencesFromApp", (PyCFunction)CF_CFPreferencesRemoveSuitePreferencesFromApp, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4751 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
4752 {"CFPreferencesAppSynchronize", (PyCFunction)CF_CFPreferencesAppSynchronize, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4753 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
4754 {"CFPreferencesCopyValue", (PyCFunction)CF_CFPreferencesCopyValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4755 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
4756 {"CFPreferencesCopyMultiple", (PyCFunction)CF_CFPreferencesCopyMultiple, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4757 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
4758 {"CFPreferencesSetValue", (PyCFunction)CF_CFPreferencesSetValue, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4759 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
4760 {"CFPreferencesSetMultiple", (PyCFunction)CF_CFPreferencesSetMultiple, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4761 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
4762 {"CFPreferencesSynchronize", (PyCFunction)CF_CFPreferencesSynchronize, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4763 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
4764 {"CFPreferencesCopyApplicationList", (PyCFunction)CF_CFPreferencesCopyApplicationList, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4765 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
4766 {"CFPreferencesCopyKeyList", (PyCFunction)CF_CFPreferencesCopyKeyList, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4767 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
4768 {"CFStringGetTypeID", (PyCFunction)CF_CFStringGetTypeID, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4769 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
4770 {"CFStringCreateWithPascalString", (PyCFunction)CF_CFStringCreateWithPascalString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4771 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
4772 {"CFStringCreateWithCString", (PyCFunction)CF_CFStringCreateWithCString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4773 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
4774 {"CFStringCreateWithCharacters", (PyCFunction)CF_CFStringCreateWithCharacters, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4775 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
4776 {"CFStringCreateWithPascalStringNoCopy", (PyCFunction)CF_CFStringCreateWithPascalStringNoCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4777 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
4778 {"CFStringCreateWithCStringNoCopy", (PyCFunction)CF_CFStringCreateWithCStringNoCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4779 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
4780 {"CFStringCreateWithCharactersNoCopy", (PyCFunction)CF_CFStringCreateWithCharactersNoCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4781 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
4782 {"CFStringCreateMutable", (PyCFunction)CF_CFStringCreateMutable, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4783 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
4784 {"CFStringCreateMutableCopy", (PyCFunction)CF_CFStringCreateMutableCopy, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4785 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
4786 {"CFStringCreateWithBytes", (PyCFunction)CF_CFStringCreateWithBytes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4787 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
4788 {"CFStringGetSystemEncoding", (PyCFunction)CF_CFStringGetSystemEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4789 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
4790 {"CFStringGetMaximumSizeForEncoding", (PyCFunction)CF_CFStringGetMaximumSizeForEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4791 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
4792 {"CFStringIsEncodingAvailable", (PyCFunction)CF_CFStringIsEncodingAvailable, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4793 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
4794 {"CFStringGetNameOfEncoding", (PyCFunction)CF_CFStringGetNameOfEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4795 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
4796 {"CFStringConvertEncodingToNSStringEncoding", (PyCFunction)CF_CFStringConvertEncodingToNSStringEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4797 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
4798 {"CFStringConvertNSStringEncodingToEncoding", (PyCFunction)CF_CFStringConvertNSStringEncodingToEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4799 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
4800 {"CFStringConvertEncodingToWindowsCodepage", (PyCFunction)CF_CFStringConvertEncodingToWindowsCodepage, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4801 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
4802 {"CFStringConvertWindowsCodepageToEncoding", (PyCFunction)CF_CFStringConvertWindowsCodepageToEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4803 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
4804 {"CFStringConvertEncodingToIANACharSetName", (PyCFunction)CF_CFStringConvertEncodingToIANACharSetName, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4805 PyDoc_STR("(CFStringEncoding encoding) -> (CFStringRef _rv)")},
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 21313
diff changeset
4806 {"CFStringGetMostCompatibleMacStringEncoding", (PyCFunction)CF_CFStringGetMostCompatibleMacStringEncoding, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4807 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
4808 {"__CFStringMakeConstantString", (PyCFunction)CF___CFStringMakeConstantString, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4809 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
4810 {"CFURLGetTypeID", (PyCFunction)CF_CFURLGetTypeID, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4811 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
4812 {"CFURLCreateWithBytes", (PyCFunction)CF_CFURLCreateWithBytes, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4813 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
4814 {"CFURLCreateFromFileSystemRepresentation", (PyCFunction)CF_CFURLCreateFromFileSystemRepresentation, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4815 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
4816 {"CFURLCreateFromFileSystemRepresentationRelativeToBase", (PyCFunction)CF_CFURLCreateFromFileSystemRepresentationRelativeToBase, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4817 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
4818 {"CFURLCreateFromFSRef", (PyCFunction)CF_CFURLCreateFromFSRef, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4819 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
4820 {"toCF", (PyCFunction)CF_toCF, 1,
24865
b54cfa98b66b Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23438
diff changeset
4821 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
4822 {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
4823 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4824
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4825
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4826
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4827
29279
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
4828 /* Routines to convert any CF type to/from the corresponding CFxxxObj */
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
4829 PyObject *CFObj_New(CFTypeRef itself)
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
4830 {
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4831 if (itself == NULL)
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4832 {
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4833 PyErr_SetString(PyExc_RuntimeError, "cannot wrap NULL");
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4834 return NULL;
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4835 }
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4836 if (CFGetTypeID(itself) == CFArrayGetTypeID()) return CFArrayRefObj_New((CFArrayRef)itself);
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4837 if (CFGetTypeID(itself) == CFDictionaryGetTypeID()) return CFDictionaryRefObj_New((CFDictionaryRef)itself);
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4838 if (CFGetTypeID(itself) == CFDataGetTypeID()) return CFDataRefObj_New((CFDataRef)itself);
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4839 if (CFGetTypeID(itself) == CFStringGetTypeID()) return CFStringRefObj_New((CFStringRef)itself);
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4840 if (CFGetTypeID(itself) == CFURLGetTypeID()) return CFURLRefObj_New((CFURLRef)itself);
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4841 /* XXXX Or should we use PyCF_CF2Python here?? */
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4842 return CFTypeRefObj_New(itself);
29279
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
4843 }
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
4844 int CFObj_Convert(PyObject *v, CFTypeRef *p_itself)
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
4845 {
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
4846
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4847 if (v == Py_None) { *p_itself = NULL; return 1; }
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4848 /* Check for other CF objects here */
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4849
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4850 if (!CFTypeRefObj_Check(v) &&
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4851 !CFArrayRefObj_Check(v) &&
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4852 !CFMutableArrayRefObj_Check(v) &&
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4853 !CFDictionaryRefObj_Check(v) &&
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4854 !CFMutableDictionaryRefObj_Check(v) &&
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4855 !CFDataRefObj_Check(v) &&
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4856 !CFMutableDataRefObj_Check(v) &&
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4857 !CFStringRefObj_Check(v) &&
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4858 !CFMutableStringRefObj_Check(v) &&
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4859 !CFURLRefObj_Check(v) )
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4860 {
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4861 /* XXXX Or should we use PyCF_Python2CF here?? */
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4862 PyErr_SetString(PyExc_TypeError, "CF object required");
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4863 return 0;
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4864 }
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4865 *p_itself = ((CFTypeRefObject *)v)->ob_itself;
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 32693
diff changeset
4866 return 1;
29279
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
4867 }
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
4868
b372b903d10e Added functions CFObj_New and CFObj_Convert, general functions to convert
Jack Jansen <jack.jansen@cwi.nl>
parents: 28146
diff changeset
4869
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4870 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
4871 {
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4872 PyObject *m;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4873 PyObject *d;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4874
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4875
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4876
29345
b3455c4c1798 Forgot the code to initialize the glue for the new CFObj_ routines.
Jack Jansen <jack.jansen@cwi.nl>
parents: 29279
diff changeset
4877 PyMac_INIT_TOOLBOX_OBJECT_NEW(CFTypeRef, CFObj_New);
b3455c4c1798 Forgot the code to initialize the glue for the new CFObj_ routines.
Jack Jansen <jack.jansen@cwi.nl>
parents: 29279
diff changeset
4878 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFTypeRef, CFObj_Convert);
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
4879 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
4880 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
4881 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
4882 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
4883 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
4884 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
4885 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
4886 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
4887 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
4888 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
4889 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
4890 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
4891 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
4892 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
4893 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
4894 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
4895
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4896
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4897 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
4898 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
4899 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
4900 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
4901 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
4902 return;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4903 CFTypeRef_Type.ob_type = &PyType_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4904 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
4905 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
4906 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
4907 /* 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
4908 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
4909 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
4910 CFArrayRef_Type.ob_type = &PyType_Type;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
4911 CFArrayRef_Type.tp_base = &CFTypeRef_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4912 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
4913 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
4914 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
4915 /* 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
4916 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
4917 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
4918 CFMutableArrayRef_Type.ob_type = &PyType_Type;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
4919 CFMutableArrayRef_Type.tp_base = &CFArrayRef_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4920 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
4921 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
4922 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
4923 /* 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
4924 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
4925 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
4926 CFDictionaryRef_Type.ob_type = &PyType_Type;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
4927 CFDictionaryRef_Type.tp_base = &CFTypeRef_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4928 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
4929 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
4930 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
4931 /* 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
4932 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
4933 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
4934 CFMutableDictionaryRef_Type.ob_type = &PyType_Type;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
4935 CFMutableDictionaryRef_Type.tp_base = &CFDictionaryRef_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4936 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
4937 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
4938 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
4939 /* 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
4940 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
4941 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
4942 CFDataRef_Type.ob_type = &PyType_Type;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
4943 CFDataRef_Type.tp_base = &CFTypeRef_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4944 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
4945 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
4946 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
4947 /* 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
4948 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
4949 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
4950 CFMutableDataRef_Type.ob_type = &PyType_Type;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
4951 CFMutableDataRef_Type.tp_base = &CFDataRef_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4952 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
4953 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
4954 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
4955 /* 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
4956 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
4957 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
4958 CFStringRef_Type.ob_type = &PyType_Type;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
4959 CFStringRef_Type.tp_base = &CFTypeRef_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4960 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
4961 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
4962 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
4963 /* 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
4964 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
4965 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
4966 CFMutableStringRef_Type.ob_type = &PyType_Type;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
4967 CFMutableStringRef_Type.tp_base = &CFStringRef_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4968 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
4969 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
4970 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
4971 /* 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
4972 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
4973 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
4974 CFURLRef_Type.ob_type = &PyType_Type;
32690
2bf869d31f0c Make CF module PEP253 based (finally).
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
4975 CFURLRef_Type.tp_base = &CFTypeRef_Type;
26767
ad263d268255 - Various tweaks to forestall compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26720
diff changeset
4976 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
4977 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
4978 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
4979 /* 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
4980 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
4981 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
4982
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4983 #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
4984 _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
4985 _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
4986 _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
4987 _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
4988 _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
4989 _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
4990
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4991
08d6c8b780d9 Added CFPreferences support. Added these as functions, not methods, which seemed counter-intuitive.
Jack Jansen <jack.jansen@cwi.nl>
parents: 23424
diff changeset
4992
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4993 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4994
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4995 /* ========================= 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
4996