annotate Mac/Modules/ae/_AEmodule.c @ 79675:c0a2294de787 2.7

Issue #16199: Backport 2to3 typo fix from 3.2.
author Chris Jerdonek <chris.jerdonek@gmail.com>
date Thu, 11 Oct 2012 16:15:46 -0700
parents fd25030223b0
children
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 _AE =========================== */
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
47501
c9a5f2eb720c Fix build issue on OSX 10.4
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47473
diff changeset
10 #ifndef HAVE_OSX105_SDK
c9a5f2eb720c Fix build issue on OSX 10.4
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47473
diff changeset
11 typedef SInt32 SRefCon;
c9a5f2eb720c Fix build issue on OSX 10.4
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47473
diff changeset
12 #endif
c9a5f2eb720c Fix build issue on OSX 10.4
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47473
diff changeset
13
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
14 /* 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
15 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
16 PyErr_SetString(PyExc_NotImplementedError, \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
17 "Not available in this shared library/OS version"); \
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
18 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
19 }} while(0)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
20
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
21
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
22 #include <Carbon/Carbon.h>
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
23
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
24 #ifdef USE_TOOLBOX_OBJECT_GLUE
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
25 extern PyObject *_AEDesc_New(AEDesc *);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
26 extern int _AEDesc_Convert(PyObject *, AEDesc *);
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
27
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
28 #define AEDesc_New _AEDesc_New
27286
04e5610c5efe It turns out that some calls return AEDesc records that are "borrowed",
Jack Jansen <jack.jansen@cwi.nl>
parents: 26769
diff changeset
29 #define AEDesc_NewBorrowed _AEDesc_NewBorrowed
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
30 #define AEDesc_Convert _AEDesc_Convert
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
31 #endif
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
32
26464
14fc187334c5 Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
33 typedef long refcontype;
14fc187334c5 Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
34
14fc187334c5 Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
35 static pascal OSErr GenericEventHandler(const AppleEvent *request, AppleEvent *reply, refcontype refcon); /* Forward */
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
36
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
37 AEEventHandlerUPP upp_GenericEventHandler;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
38
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
39 static pascal Boolean AEIdleProc(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
40 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
41 if ( PyOS_InterruptOccurred() )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
42 return 1;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
43 return 0;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
44 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
45
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
46 AEIdleUPP upp_AEIdleProc;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
47
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
48 static PyObject *AE_Error;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
49
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
50 /* ----------------------- Object type AEDesc ----------------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
51
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
52 PyTypeObject AEDesc_Type;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
53
26720
a12e1727850a Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents: 26636
diff changeset
54 #define AEDesc_Check(x) ((x)->ob_type == &AEDesc_Type || PyObject_TypeCheck((x), &AEDesc_Type))
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
55
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
56 typedef struct AEDescObject {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
57 PyObject_HEAD
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
58 AEDesc ob_itself;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
59 int ob_owned;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
60 } AEDescObject;
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
61
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
62 PyObject *AEDesc_New(AEDesc *itself)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
63 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
64 AEDescObject *it;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
65 it = PyObject_NEW(AEDescObject, &AEDesc_Type);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
66 if (it == NULL) return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
67 it->ob_itself = *itself;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
68 it->ob_owned = 1;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
69 return (PyObject *)it;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
70 }
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
71
19708
6eafc4a6359a Regenerated without default int return types.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19644
diff changeset
72 int AEDesc_Convert(PyObject *v, AEDesc *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
73 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
74 if (!AEDesc_Check(v))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
75 {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
76 PyErr_SetString(PyExc_TypeError, "AEDesc required");
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
77 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
78 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
79 *p_itself = ((AEDescObject *)v)->ob_itself;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
80 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
81 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
82
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
83 static void AEDesc_dealloc(AEDescObject *self)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
84 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
85 if (self->ob_owned) AEDisposeDesc(&self->ob_itself);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
86 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
87 }
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 static PyObject *AEDesc_AECoerceDesc(AEDescObject *_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
90 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
91 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
92 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
93 DescType toType;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
94 AEDesc result;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
95 #ifndef AECoerceDesc
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
96 PyMac_PRECHECK(AECoerceDesc);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
97 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
98 if (!PyArg_ParseTuple(_args, "O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
99 PyMac_GetOSType, &toType))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
100 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
101 _err = AECoerceDesc(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
102 toType,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
103 &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
104 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
105 _res = Py_BuildValue("O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
106 AEDesc_New, &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
107 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
108 }
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 static PyObject *AEDesc_AEDuplicateDesc(AEDescObject *_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
111 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
112 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
113 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
114 AEDesc result;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
115 #ifndef AEDuplicateDesc
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
116 PyMac_PRECHECK(AEDuplicateDesc);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
117 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
118 if (!PyArg_ParseTuple(_args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
119 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
120 _err = AEDuplicateDesc(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
121 &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
122 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
123 _res = Py_BuildValue("O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
124 AEDesc_New, &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
125 return _res;
19443
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
128 static PyObject *AEDesc_AECountItems(AEDescObject *_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
129 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
130 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
131 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
132 long theCount;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
133 #ifndef AECountItems
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
134 PyMac_PRECHECK(AECountItems);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
135 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
136 if (!PyArg_ParseTuple(_args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
137 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
138 _err = AECountItems(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
139 &theCount);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
140 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
141 _res = Py_BuildValue("l",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
142 theCount);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
143 return _res;
19443
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
146 static PyObject *AEDesc_AEPutPtr(AEDescObject *_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
147 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
148 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
149 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
150 long index;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
151 DescType typeCode;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
152 char *dataPtr__in__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
153 long dataPtr__len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
154 int dataPtr__in_len__;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
155 #ifndef AEPutPtr
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
156 PyMac_PRECHECK(AEPutPtr);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
157 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
158 if (!PyArg_ParseTuple(_args, "lO&s#",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
159 &index,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
160 PyMac_GetOSType, &typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
161 &dataPtr__in__, &dataPtr__in_len__))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
162 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
163 dataPtr__len__ = dataPtr__in_len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
164 _err = AEPutPtr(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
165 index,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
166 typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
167 dataPtr__in__, dataPtr__len__);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
168 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
169 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
170 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
171 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
172 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
173
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
174 static PyObject *AEDesc_AEPutDesc(AEDescObject *_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
175 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
176 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
177 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
178 long index;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
179 AEDesc theAEDesc;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
180 #ifndef AEPutDesc
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
181 PyMac_PRECHECK(AEPutDesc);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
182 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
183 if (!PyArg_ParseTuple(_args, "lO&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
184 &index,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
185 AEDesc_Convert, &theAEDesc))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
186 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
187 _err = AEPutDesc(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
188 index,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
189 &theAEDesc);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
190 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
191 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
192 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
193 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
194 }
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 static PyObject *AEDesc_AEGetNthPtr(AEDescObject *_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
197 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
198 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
199 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
200 long index;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
201 DescType desiredType;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
202 AEKeyword theAEKeyword;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
203 DescType typeCode;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
204 char *dataPtr__out__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
205 long dataPtr__len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
206 int dataPtr__in_len__;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
207 #ifndef AEGetNthPtr
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
208 PyMac_PRECHECK(AEGetNthPtr);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
209 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
210 if (!PyArg_ParseTuple(_args, "lO&i",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
211 &index,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
212 PyMac_GetOSType, &desiredType,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
213 &dataPtr__in_len__))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
214 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
215 if ((dataPtr__out__ = malloc(dataPtr__in_len__)) == NULL)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
216 {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
217 PyErr_NoMemory();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
218 goto dataPtr__error__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
219 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
220 dataPtr__len__ = dataPtr__in_len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
221 _err = AEGetNthPtr(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
222 index,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
223 desiredType,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
224 &theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
225 &typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
226 dataPtr__out__, dataPtr__len__, &dataPtr__len__);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
227 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
228 _res = Py_BuildValue("O&O&s#",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
229 PyMac_BuildOSType, theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
230 PyMac_BuildOSType, typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
231 dataPtr__out__, (int)dataPtr__len__);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
232 free(dataPtr__out__);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
233 dataPtr__error__: ;
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
234 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
235 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
236
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
237 static PyObject *AEDesc_AEGetNthDesc(AEDescObject *_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
238 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
239 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
240 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
241 long index;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
242 DescType desiredType;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
243 AEKeyword theAEKeyword;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
244 AEDesc result;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
245 #ifndef AEGetNthDesc
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
246 PyMac_PRECHECK(AEGetNthDesc);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
247 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
248 if (!PyArg_ParseTuple(_args, "lO&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
249 &index,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
250 PyMac_GetOSType, &desiredType))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
251 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
252 _err = AEGetNthDesc(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
253 index,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
254 desiredType,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
255 &theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
256 &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
257 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
258 _res = Py_BuildValue("O&O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
259 PyMac_BuildOSType, theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
260 AEDesc_New, &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
261 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
262 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
263
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
264 static PyObject *AEDesc_AESizeOfNthItem(AEDescObject *_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
265 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
266 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
267 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
268 long index;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
269 DescType typeCode;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
270 Size dataSize;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
271 #ifndef AESizeOfNthItem
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
272 PyMac_PRECHECK(AESizeOfNthItem);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
273 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
274 if (!PyArg_ParseTuple(_args, "l",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
275 &index))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
276 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
277 _err = AESizeOfNthItem(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
278 index,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
279 &typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
280 &dataSize);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
281 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
282 _res = Py_BuildValue("O&l",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
283 PyMac_BuildOSType, typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
284 dataSize);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
285 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
286 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
287
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
288 static PyObject *AEDesc_AEDeleteItem(AEDescObject *_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
289 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
290 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
291 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
292 long index;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
293 #ifndef AEDeleteItem
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
294 PyMac_PRECHECK(AEDeleteItem);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
295 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
296 if (!PyArg_ParseTuple(_args, "l",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
297 &index))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
298 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
299 _err = AEDeleteItem(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
300 index);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
301 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
302 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
303 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
304 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
305 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
306
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
307 static PyObject *AEDesc_AEPutParamPtr(AEDescObject *_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
308 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
309 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
310 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
311 AEKeyword theAEKeyword;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
312 DescType typeCode;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
313 char *dataPtr__in__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
314 long dataPtr__len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
315 int dataPtr__in_len__;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
316 #ifndef AEPutParamPtr
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
317 PyMac_PRECHECK(AEPutParamPtr);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
318 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
319 if (!PyArg_ParseTuple(_args, "O&O&s#",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
320 PyMac_GetOSType, &theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
321 PyMac_GetOSType, &typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
322 &dataPtr__in__, &dataPtr__in_len__))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
323 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
324 dataPtr__len__ = dataPtr__in_len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
325 _err = AEPutParamPtr(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
326 theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
327 typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
328 dataPtr__in__, dataPtr__len__);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
329 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
330 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
331 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
332 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
333 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
334
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
335 static PyObject *AEDesc_AEPutParamDesc(AEDescObject *_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
336 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
337 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
338 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
339 AEKeyword theAEKeyword;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
340 AEDesc theAEDesc;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
341 #ifndef AEPutParamDesc
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
342 PyMac_PRECHECK(AEPutParamDesc);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
343 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
344 if (!PyArg_ParseTuple(_args, "O&O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
345 PyMac_GetOSType, &theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
346 AEDesc_Convert, &theAEDesc))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
347 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
348 _err = AEPutParamDesc(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
349 theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
350 &theAEDesc);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
351 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
352 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
353 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
354 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
355 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
356
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
357 static PyObject *AEDesc_AEGetParamPtr(AEDescObject *_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
358 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
359 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
360 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
361 AEKeyword theAEKeyword;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
362 DescType desiredType;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
363 DescType typeCode;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
364 char *dataPtr__out__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
365 long dataPtr__len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
366 int dataPtr__in_len__;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
367 #ifndef AEGetParamPtr
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
368 PyMac_PRECHECK(AEGetParamPtr);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
369 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
370 if (!PyArg_ParseTuple(_args, "O&O&i",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
371 PyMac_GetOSType, &theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
372 PyMac_GetOSType, &desiredType,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
373 &dataPtr__in_len__))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
374 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
375 if ((dataPtr__out__ = malloc(dataPtr__in_len__)) == NULL)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
376 {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
377 PyErr_NoMemory();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
378 goto dataPtr__error__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
379 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
380 dataPtr__len__ = dataPtr__in_len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
381 _err = AEGetParamPtr(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
382 theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
383 desiredType,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
384 &typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
385 dataPtr__out__, dataPtr__len__, &dataPtr__len__);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
386 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
387 _res = Py_BuildValue("O&s#",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
388 PyMac_BuildOSType, typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
389 dataPtr__out__, (int)dataPtr__len__);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
390 free(dataPtr__out__);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
391 dataPtr__error__: ;
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
392 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
393 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
394
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
395 static PyObject *AEDesc_AEGetParamDesc(AEDescObject *_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
396 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
397 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
398 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
399 AEKeyword theAEKeyword;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
400 DescType desiredType;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
401 AEDesc result;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
402 #ifndef AEGetParamDesc
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
403 PyMac_PRECHECK(AEGetParamDesc);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
404 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
405 if (!PyArg_ParseTuple(_args, "O&O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
406 PyMac_GetOSType, &theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
407 PyMac_GetOSType, &desiredType))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
408 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
409 _err = AEGetParamDesc(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
410 theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
411 desiredType,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
412 &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
413 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
414 _res = Py_BuildValue("O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
415 AEDesc_New, &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
416 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
417 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
418
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
419 static PyObject *AEDesc_AESizeOfParam(AEDescObject *_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
420 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
421 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
422 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
423 AEKeyword theAEKeyword;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
424 DescType typeCode;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
425 Size dataSize;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
426 #ifndef AESizeOfParam
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
427 PyMac_PRECHECK(AESizeOfParam);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
428 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
429 if (!PyArg_ParseTuple(_args, "O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
430 PyMac_GetOSType, &theAEKeyword))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
431 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
432 _err = AESizeOfParam(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
433 theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
434 &typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
435 &dataSize);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
436 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
437 _res = Py_BuildValue("O&l",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
438 PyMac_BuildOSType, typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
439 dataSize);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
440 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
441 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
442
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
443 static PyObject *AEDesc_AEDeleteParam(AEDescObject *_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
444 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
445 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
446 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
447 AEKeyword theAEKeyword;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
448 #ifndef AEDeleteParam
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
449 PyMac_PRECHECK(AEDeleteParam);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
450 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
451 if (!PyArg_ParseTuple(_args, "O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
452 PyMac_GetOSType, &theAEKeyword))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
453 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
454 _err = AEDeleteParam(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
455 theAEKeyword);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
456 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
457 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
458 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
459 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
460 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
461
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
462 static PyObject *AEDesc_AEGetAttributePtr(AEDescObject *_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
463 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
464 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
465 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
466 AEKeyword theAEKeyword;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
467 DescType desiredType;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
468 DescType typeCode;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
469 char *dataPtr__out__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
470 long dataPtr__len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
471 int dataPtr__in_len__;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
472 #ifndef AEGetAttributePtr
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
473 PyMac_PRECHECK(AEGetAttributePtr);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
474 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
475 if (!PyArg_ParseTuple(_args, "O&O&i",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
476 PyMac_GetOSType, &theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
477 PyMac_GetOSType, &desiredType,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
478 &dataPtr__in_len__))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
479 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
480 if ((dataPtr__out__ = malloc(dataPtr__in_len__)) == NULL)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
481 {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
482 PyErr_NoMemory();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
483 goto dataPtr__error__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
484 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
485 dataPtr__len__ = dataPtr__in_len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
486 _err = AEGetAttributePtr(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
487 theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
488 desiredType,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
489 &typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
490 dataPtr__out__, dataPtr__len__, &dataPtr__len__);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
491 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
492 _res = Py_BuildValue("O&s#",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
493 PyMac_BuildOSType, typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
494 dataPtr__out__, (int)dataPtr__len__);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
495 free(dataPtr__out__);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
496 dataPtr__error__: ;
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
497 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
498 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
499
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
500 static PyObject *AEDesc_AEGetAttributeDesc(AEDescObject *_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
501 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
502 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
503 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
504 AEKeyword theAEKeyword;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
505 DescType desiredType;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
506 AEDesc result;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
507 #ifndef AEGetAttributeDesc
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
508 PyMac_PRECHECK(AEGetAttributeDesc);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
509 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
510 if (!PyArg_ParseTuple(_args, "O&O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
511 PyMac_GetOSType, &theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
512 PyMac_GetOSType, &desiredType))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
513 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
514 _err = AEGetAttributeDesc(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
515 theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
516 desiredType,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
517 &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
518 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
519 _res = Py_BuildValue("O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
520 AEDesc_New, &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
521 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
522 }
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 static PyObject *AEDesc_AESizeOfAttribute(AEDescObject *_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
525 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
526 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
527 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
528 AEKeyword theAEKeyword;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
529 DescType typeCode;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
530 Size dataSize;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
531 #ifndef AESizeOfAttribute
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
532 PyMac_PRECHECK(AESizeOfAttribute);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
533 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
534 if (!PyArg_ParseTuple(_args, "O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
535 PyMac_GetOSType, &theAEKeyword))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
536 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
537 _err = AESizeOfAttribute(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
538 theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
539 &typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
540 &dataSize);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
541 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
542 _res = Py_BuildValue("O&l",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
543 PyMac_BuildOSType, typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
544 dataSize);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
545 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
546 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
547
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
548 static PyObject *AEDesc_AEPutAttributePtr(AEDescObject *_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
549 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
550 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
551 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
552 AEKeyword theAEKeyword;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
553 DescType typeCode;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
554 char *dataPtr__in__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
555 long dataPtr__len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
556 int dataPtr__in_len__;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
557 #ifndef AEPutAttributePtr
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
558 PyMac_PRECHECK(AEPutAttributePtr);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
559 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
560 if (!PyArg_ParseTuple(_args, "O&O&s#",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
561 PyMac_GetOSType, &theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
562 PyMac_GetOSType, &typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
563 &dataPtr__in__, &dataPtr__in_len__))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
564 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
565 dataPtr__len__ = dataPtr__in_len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
566 _err = AEPutAttributePtr(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
567 theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
568 typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
569 dataPtr__in__, dataPtr__len__);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
570 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
571 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
572 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
573 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
574 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
575
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
576 static PyObject *AEDesc_AEPutAttributeDesc(AEDescObject *_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
577 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
578 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
579 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
580 AEKeyword theAEKeyword;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
581 AEDesc theAEDesc;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
582 #ifndef AEPutAttributeDesc
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
583 PyMac_PRECHECK(AEPutAttributeDesc);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
584 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
585 if (!PyArg_ParseTuple(_args, "O&O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
586 PyMac_GetOSType, &theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
587 AEDesc_Convert, &theAEDesc))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
588 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
589 _err = AEPutAttributeDesc(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
590 theAEKeyword,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
591 &theAEDesc);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
592 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
593 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
594 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
595 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
596 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
597
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
598 static PyObject *AEDesc_AEGetDescDataSize(AEDescObject *_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
599 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
600 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
601 Size _rv;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
602 #ifndef AEGetDescDataSize
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
603 PyMac_PRECHECK(AEGetDescDataSize);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
604 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
605 if (!PyArg_ParseTuple(_args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
606 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
607 _rv = AEGetDescDataSize(&_self->ob_itself);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
608 _res = Py_BuildValue("l",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
609 _rv);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
610 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
611 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
612
21448
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
613 static PyObject *AEDesc_AESend(AEDescObject *_self, PyObject *_args)
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
614 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
615 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
616 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
617 AppleEvent reply;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
618 AESendMode sendMode;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
619 AESendPriority sendPriority;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
620 long timeOutInTicks;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
621 #ifndef AESend
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
622 PyMac_PRECHECK(AESend);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
623 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
624 if (!PyArg_ParseTuple(_args, "lhl",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
625 &sendMode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
626 &sendPriority,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
627 &timeOutInTicks))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
628 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
629 _err = AESend(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
630 &reply,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
631 sendMode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
632 sendPriority,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
633 timeOutInTicks,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
634 upp_AEIdleProc,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
635 (AEFilterUPP)0);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
636 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
637 _res = Py_BuildValue("O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
638 AEDesc_New, &reply);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
639 return _res;
21448
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
640 }
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
641
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
642 static PyObject *AEDesc_AEResetTimer(AEDescObject *_self, PyObject *_args)
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
643 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
644 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
645 OSErr _err;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
646 #ifndef AEResetTimer
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
647 PyMac_PRECHECK(AEResetTimer);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
648 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
649 if (!PyArg_ParseTuple(_args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
650 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
651 _err = AEResetTimer(&_self->ob_itself);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
652 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
653 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
654 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
655 return _res;
21448
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
656 }
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
657
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
658 static PyObject *AEDesc_AESuspendTheCurrentEvent(AEDescObject *_self, PyObject *_args)
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
659 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
660 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
661 OSErr _err;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
662 #ifndef AESuspendTheCurrentEvent
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
663 PyMac_PRECHECK(AESuspendTheCurrentEvent);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
664 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
665 if (!PyArg_ParseTuple(_args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
666 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
667 _err = AESuspendTheCurrentEvent(&_self->ob_itself);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
668 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
669 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
670 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
671 return _res;
21448
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
672 }
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
673
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
674 static PyObject *AEDesc_AEResumeTheCurrentEvent(AEDescObject *_self, PyObject *_args)
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
675 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
676 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
677 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
678 AppleEvent reply;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
679 AEEventHandlerUPP dispatcher__proc__ = upp_GenericEventHandler;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
680 PyObject *dispatcher;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
681 #ifndef AEResumeTheCurrentEvent
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
682 PyMac_PRECHECK(AEResumeTheCurrentEvent);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
683 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
684 if (!PyArg_ParseTuple(_args, "O&O",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
685 AEDesc_Convert, &reply,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
686 &dispatcher))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
687 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
688 _err = AEResumeTheCurrentEvent(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
689 &reply,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
690 dispatcher__proc__,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
691 (SRefCon)dispatcher);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
692 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
693 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
694 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
695 Py_INCREF(dispatcher); /* XXX leak, but needed */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
696 return _res;
21448
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
697 }
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
698
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
699 static PyObject *AEDesc_AEGetTheCurrentEvent(AEDescObject *_self, PyObject *_args)
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
700 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
701 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
702 OSErr _err;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
703 #ifndef AEGetTheCurrentEvent
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
704 PyMac_PRECHECK(AEGetTheCurrentEvent);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
705 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
706 if (!PyArg_ParseTuple(_args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
707 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
708 _err = AEGetTheCurrentEvent(&_self->ob_itself);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
709 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
710 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
711 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
712 return _res;
21448
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
713 }
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
714
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
715 static PyObject *AEDesc_AESetTheCurrentEvent(AEDescObject *_self, PyObject *_args)
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
716 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
717 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
718 OSErr _err;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
719 #ifndef AESetTheCurrentEvent
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
720 PyMac_PRECHECK(AESetTheCurrentEvent);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
721 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
722 if (!PyArg_ParseTuple(_args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
723 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
724 _err = AESetTheCurrentEvent(&_self->ob_itself);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
725 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
726 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
727 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
728 return _res;
21448
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
729 }
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
730
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
731 static PyObject *AEDesc_AEResolve(AEDescObject *_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
732 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
733 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
734 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
735 short callbackFlags;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
736 AEDesc theToken;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
737 #ifndef AEResolve
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
738 PyMac_PRECHECK(AEResolve);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
739 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
740 if (!PyArg_ParseTuple(_args, "h",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
741 &callbackFlags))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
742 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
743 _err = AEResolve(&_self->ob_itself,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
744 callbackFlags,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
745 &theToken);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
746 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
747 _res = Py_BuildValue("O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
748 AEDesc_New, &theToken);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
749 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
750 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
751
27286
04e5610c5efe It turns out that some calls return AEDesc records that are "borrowed",
Jack Jansen <jack.jansen@cwi.nl>
parents: 26769
diff changeset
752 static PyObject *AEDesc_AutoDispose(AEDescObject *_self, PyObject *_args)
04e5610c5efe It turns out that some calls return AEDesc records that are "borrowed",
Jack Jansen <jack.jansen@cwi.nl>
parents: 26769
diff changeset
753 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
754 PyObject *_res = NULL;
27286
04e5610c5efe It turns out that some calls return AEDesc records that are "borrowed",
Jack Jansen <jack.jansen@cwi.nl>
parents: 26769
diff changeset
755
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
756 int onoff, old;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
757 if (!PyArg_ParseTuple(_args, "i", &onoff))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
758 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
759 old = _self->ob_owned;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
760 _self->ob_owned = onoff;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
761 _res = Py_BuildValue("i", old);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
762 return _res;
27286
04e5610c5efe It turns out that some calls return AEDesc records that are "borrowed",
Jack Jansen <jack.jansen@cwi.nl>
parents: 26769
diff changeset
763
04e5610c5efe It turns out that some calls return AEDesc records that are "borrowed",
Jack Jansen <jack.jansen@cwi.nl>
parents: 26769
diff changeset
764 }
04e5610c5efe It turns out that some calls return AEDesc records that are "borrowed",
Jack Jansen <jack.jansen@cwi.nl>
parents: 26769
diff changeset
765
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
766 static PyMethodDef AEDesc_methods[] = {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
767 {"AECoerceDesc", (PyCFunction)AEDesc_AECoerceDesc, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
768 PyDoc_STR("(DescType toType) -> (AEDesc result)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
769 {"AEDuplicateDesc", (PyCFunction)AEDesc_AEDuplicateDesc, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
770 PyDoc_STR("() -> (AEDesc result)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
771 {"AECountItems", (PyCFunction)AEDesc_AECountItems, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
772 PyDoc_STR("() -> (long theCount)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
773 {"AEPutPtr", (PyCFunction)AEDesc_AEPutPtr, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
774 PyDoc_STR("(long index, DescType typeCode, Buffer dataPtr) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
775 {"AEPutDesc", (PyCFunction)AEDesc_AEPutDesc, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
776 PyDoc_STR("(long index, AEDesc theAEDesc) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
777 {"AEGetNthPtr", (PyCFunction)AEDesc_AEGetNthPtr, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
778 PyDoc_STR("(long index, DescType desiredType, Buffer dataPtr) -> (AEKeyword theAEKeyword, DescType typeCode, Buffer dataPtr)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
779 {"AEGetNthDesc", (PyCFunction)AEDesc_AEGetNthDesc, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
780 PyDoc_STR("(long index, DescType desiredType) -> (AEKeyword theAEKeyword, AEDesc result)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
781 {"AESizeOfNthItem", (PyCFunction)AEDesc_AESizeOfNthItem, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
782 PyDoc_STR("(long index) -> (DescType typeCode, Size dataSize)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
783 {"AEDeleteItem", (PyCFunction)AEDesc_AEDeleteItem, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
784 PyDoc_STR("(long index) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
785 {"AEPutParamPtr", (PyCFunction)AEDesc_AEPutParamPtr, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
786 PyDoc_STR("(AEKeyword theAEKeyword, DescType typeCode, Buffer dataPtr) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
787 {"AEPutParamDesc", (PyCFunction)AEDesc_AEPutParamDesc, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
788 PyDoc_STR("(AEKeyword theAEKeyword, AEDesc theAEDesc) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
789 {"AEGetParamPtr", (PyCFunction)AEDesc_AEGetParamPtr, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
790 PyDoc_STR("(AEKeyword theAEKeyword, DescType desiredType, Buffer dataPtr) -> (DescType typeCode, Buffer dataPtr)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
791 {"AEGetParamDesc", (PyCFunction)AEDesc_AEGetParamDesc, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
792 PyDoc_STR("(AEKeyword theAEKeyword, DescType desiredType) -> (AEDesc result)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
793 {"AESizeOfParam", (PyCFunction)AEDesc_AESizeOfParam, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
794 PyDoc_STR("(AEKeyword theAEKeyword) -> (DescType typeCode, Size dataSize)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
795 {"AEDeleteParam", (PyCFunction)AEDesc_AEDeleteParam, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
796 PyDoc_STR("(AEKeyword theAEKeyword) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
797 {"AEGetAttributePtr", (PyCFunction)AEDesc_AEGetAttributePtr, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
798 PyDoc_STR("(AEKeyword theAEKeyword, DescType desiredType, Buffer dataPtr) -> (DescType typeCode, Buffer dataPtr)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
799 {"AEGetAttributeDesc", (PyCFunction)AEDesc_AEGetAttributeDesc, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
800 PyDoc_STR("(AEKeyword theAEKeyword, DescType desiredType) -> (AEDesc result)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
801 {"AESizeOfAttribute", (PyCFunction)AEDesc_AESizeOfAttribute, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
802 PyDoc_STR("(AEKeyword theAEKeyword) -> (DescType typeCode, Size dataSize)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
803 {"AEPutAttributePtr", (PyCFunction)AEDesc_AEPutAttributePtr, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
804 PyDoc_STR("(AEKeyword theAEKeyword, DescType typeCode, Buffer dataPtr) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
805 {"AEPutAttributeDesc", (PyCFunction)AEDesc_AEPutAttributeDesc, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
806 PyDoc_STR("(AEKeyword theAEKeyword, AEDesc theAEDesc) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
807 {"AEGetDescDataSize", (PyCFunction)AEDesc_AEGetDescDataSize, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
808 PyDoc_STR("() -> (Size _rv)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
809 {"AESend", (PyCFunction)AEDesc_AESend, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
810 PyDoc_STR("(AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks) -> (AppleEvent reply)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
811 {"AEResetTimer", (PyCFunction)AEDesc_AEResetTimer, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
812 PyDoc_STR("() -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
813 {"AESuspendTheCurrentEvent", (PyCFunction)AEDesc_AESuspendTheCurrentEvent, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
814 PyDoc_STR("() -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
815 {"AEResumeTheCurrentEvent", (PyCFunction)AEDesc_AEResumeTheCurrentEvent, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
816 PyDoc_STR("(AppleEvent reply, EventHandler dispatcher) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
817 {"AEGetTheCurrentEvent", (PyCFunction)AEDesc_AEGetTheCurrentEvent, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
818 PyDoc_STR("() -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
819 {"AESetTheCurrentEvent", (PyCFunction)AEDesc_AESetTheCurrentEvent, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
820 PyDoc_STR("() -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
821 {"AEResolve", (PyCFunction)AEDesc_AEResolve, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
822 PyDoc_STR("(short callbackFlags) -> (AEDesc theToken)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
823 {"AutoDispose", (PyCFunction)AEDesc_AutoDispose, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
824 PyDoc_STR("(int)->int. Automatically AEDisposeDesc the object on Python object cleanup")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
825 {NULL, NULL, 0}
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
26464
14fc187334c5 Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
828 static PyObject *AEDesc_get_type(AEDescObject *self, void *closure)
14fc187334c5 Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
829 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
830 return PyMac_BuildOSType(self->ob_itself.descriptorType);
26464
14fc187334c5 Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
831 }
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
832
26464
14fc187334c5 Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
833 #define AEDesc_set_type NULL
14fc187334c5 Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
834
14fc187334c5 Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
835 static PyObject *AEDesc_get_data(AEDescObject *self, void *closure)
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
836 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
837 PyObject *res;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
838 Size size;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
839 char *ptr;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
840 OSErr err;
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
841
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
842 size = AEGetDescDataSize(&self->ob_itself);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
843 if ( (res = PyString_FromStringAndSize(NULL, size)) == NULL )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
844 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
845 if ( (ptr = PyString_AsString(res)) == NULL )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
846 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
847 if ( (err=AEGetDescData(&self->ob_itself, ptr, size)) < 0 )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
848 return PyMac_Error(err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
849 return res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
850 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
851
26464
14fc187334c5 Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
852 #define AEDesc_set_data NULL
14fc187334c5 Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
853
14fc187334c5 Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
854 static PyGetSetDef AEDesc_getsetlist[] = {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
855 {"type", (getter)AEDesc_get_type, (setter)AEDesc_set_type, "Type of this AEDesc"},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
856 {"data", (getter)AEDesc_get_data, (setter)AEDesc_set_data, "The raw data in this AEDesc"},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
857 {NULL, NULL, NULL, NULL},
26464
14fc187334c5 Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
858 };
14fc187334c5 Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents: 24865
diff changeset
859
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
860
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
861 #define AEDesc_compare NULL
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
862
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
863 #define AEDesc_repr NULL
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
864
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
865 #define AEDesc_hash NULL
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 26464
diff changeset
866 #define AEDesc_tp_init 0
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 26464
diff changeset
867
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 26464
diff changeset
868 #define AEDesc_tp_alloc PyType_GenericAlloc
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 26464
diff changeset
869
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
870 static PyObject *AEDesc_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 26464
diff changeset
871 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
872 PyObject *_self;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
873 AEDesc itself;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
874 char *kw[] = {"itself", 0};
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 26464
diff changeset
875
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
876 if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, AEDesc_Convert, &itself)) return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
877 if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
878 ((AEDescObject *)_self)->ob_itself = itself;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
879 return _self;
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 26464
diff changeset
880 }
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 26464
diff changeset
881
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 26464
diff changeset
882 #define AEDesc_tp_free PyObject_Del
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 26464
diff changeset
883
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
884
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
885 PyTypeObject AEDesc_Type = {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
886 PyObject_HEAD_INIT(NULL)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
887 0, /*ob_size*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
888 "_AE.AEDesc", /*tp_name*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
889 sizeof(AEDescObject), /*tp_basicsize*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
890 0, /*tp_itemsize*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
891 /* methods */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
892 (destructor) AEDesc_dealloc, /*tp_dealloc*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
893 0, /*tp_print*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
894 (getattrfunc)0, /*tp_getattr*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
895 (setattrfunc)0, /*tp_setattr*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
896 (cmpfunc) AEDesc_compare, /*tp_compare*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
897 (reprfunc) AEDesc_repr, /*tp_repr*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
898 (PyNumberMethods *)0, /* tp_as_number */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
899 (PySequenceMethods *)0, /* tp_as_sequence */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
900 (PyMappingMethods *)0, /* tp_as_mapping */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
901 (hashfunc) AEDesc_hash, /*tp_hash*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
902 0, /*tp_call*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
903 0, /*tp_str*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
904 PyObject_GenericGetAttr, /*tp_getattro*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
905 PyObject_GenericSetAttr, /*tp_setattro */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
906 0, /*tp_as_buffer*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
907 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
908 0, /*tp_doc*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
909 0, /*tp_traverse*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
910 0, /*tp_clear*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
911 0, /*tp_richcompare*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
912 0, /*tp_weaklistoffset*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
913 0, /*tp_iter*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
914 0, /*tp_iternext*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
915 AEDesc_methods, /* tp_methods */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
916 0, /*tp_members*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
917 AEDesc_getsetlist, /*tp_getset*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
918 0, /*tp_base*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
919 0, /*tp_dict*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
920 0, /*tp_descr_get*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
921 0, /*tp_descr_set*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
922 0, /*tp_dictoffset*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
923 AEDesc_tp_init, /* tp_init */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
924 AEDesc_tp_alloc, /* tp_alloc */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
925 AEDesc_tp_new, /* tp_new */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
926 AEDesc_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
927 };
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
928
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
929 /* --------------------- End object type AEDesc --------------------- */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
930
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
931
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
932 static PyObject *AE_AECoercePtr(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
933 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
934 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
935 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
936 DescType typeCode;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
937 char *dataPtr__in__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
938 long dataPtr__len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
939 int dataPtr__in_len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
940 DescType toType;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
941 AEDesc result;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
942 #ifndef AECoercePtr
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
943 PyMac_PRECHECK(AECoercePtr);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
944 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
945 if (!PyArg_ParseTuple(_args, "O&s#O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
946 PyMac_GetOSType, &typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
947 &dataPtr__in__, &dataPtr__in_len__,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
948 PyMac_GetOSType, &toType))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
949 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
950 dataPtr__len__ = dataPtr__in_len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
951 _err = AECoercePtr(typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
952 dataPtr__in__, dataPtr__len__,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
953 toType,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
954 &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
955 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
956 _res = Py_BuildValue("O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
957 AEDesc_New, &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
958 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
959 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
960
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
961 static PyObject *AE_AECreateDesc(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
962 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
963 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
964 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
965 DescType typeCode;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
966 char *dataPtr__in__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
967 long dataPtr__len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
968 int dataPtr__in_len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
969 AEDesc result;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
970 #ifndef AECreateDesc
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
971 PyMac_PRECHECK(AECreateDesc);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
972 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
973 if (!PyArg_ParseTuple(_args, "O&s#",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
974 PyMac_GetOSType, &typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
975 &dataPtr__in__, &dataPtr__in_len__))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
976 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
977 dataPtr__len__ = dataPtr__in_len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
978 _err = AECreateDesc(typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
979 dataPtr__in__, dataPtr__len__,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
980 &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
981 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
982 _res = Py_BuildValue("O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
983 AEDesc_New, &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
984 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
985 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
986
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
987 static PyObject *AE_AECreateList(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
988 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
989 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
990 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
991 char *factoringPtr__in__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
992 long factoringPtr__len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
993 int factoringPtr__in_len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
994 Boolean isRecord;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
995 AEDescList resultList;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
996 #ifndef AECreateList
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
997 PyMac_PRECHECK(AECreateList);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
998 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
999 if (!PyArg_ParseTuple(_args, "s#b",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1000 &factoringPtr__in__, &factoringPtr__in_len__,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1001 &isRecord))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1002 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1003 factoringPtr__len__ = factoringPtr__in_len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1004 _err = AECreateList(factoringPtr__in__, factoringPtr__len__,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1005 isRecord,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1006 &resultList);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1007 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1008 _res = Py_BuildValue("O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1009 AEDesc_New, &resultList);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1010 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1011 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1012
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1013 static PyObject *AE_AECreateAppleEvent(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
1014 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1015 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1016 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1017 AEEventClass theAEEventClass;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1018 AEEventID theAEEventID;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1019 AEAddressDesc target;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1020 AEReturnID returnID;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1021 AETransactionID transactionID;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1022 AppleEvent result;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1023 #ifndef AECreateAppleEvent
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1024 PyMac_PRECHECK(AECreateAppleEvent);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1025 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1026 if (!PyArg_ParseTuple(_args, "O&O&O&hl",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1027 PyMac_GetOSType, &theAEEventClass,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1028 PyMac_GetOSType, &theAEEventID,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1029 AEDesc_Convert, &target,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1030 &returnID,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1031 &transactionID))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1032 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1033 _err = AECreateAppleEvent(theAEEventClass,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1034 theAEEventID,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1035 &target,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1036 returnID,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1037 transactionID,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1038 &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1039 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1040 _res = Py_BuildValue("O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1041 AEDesc_New, &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1042 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1043 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1044
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1045 static PyObject *AE_AEReplaceDescData(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
1046 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1047 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1048 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1049 DescType typeCode;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1050 char *dataPtr__in__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1051 long dataPtr__len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1052 int dataPtr__in_len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1053 AEDesc theAEDesc;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1054 #ifndef AEReplaceDescData
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1055 PyMac_PRECHECK(AEReplaceDescData);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1056 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1057 if (!PyArg_ParseTuple(_args, "O&s#",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1058 PyMac_GetOSType, &typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1059 &dataPtr__in__, &dataPtr__in_len__))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1060 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1061 dataPtr__len__ = dataPtr__in_len__;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1062 _err = AEReplaceDescData(typeCode,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1063 dataPtr__in__, dataPtr__len__,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1064 &theAEDesc);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1065 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1066 _res = Py_BuildValue("O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1067 AEDesc_New, &theAEDesc);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1068 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1069 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1070
21448
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1071 static PyObject *AE_AEProcessAppleEvent(PyObject *_self, PyObject *_args)
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1072 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1073 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1074 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1075 EventRecord theEventRecord;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1076 #ifndef AEProcessAppleEvent
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1077 PyMac_PRECHECK(AEProcessAppleEvent);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1078 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1079 if (!PyArg_ParseTuple(_args, "O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1080 PyMac_GetEventRecord, &theEventRecord))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1081 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1082 _err = AEProcessAppleEvent(&theEventRecord);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1083 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1084 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1085 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1086 return _res;
21448
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1087 }
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1088
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1089 static PyObject *AE_AEGetInteractionAllowed(PyObject *_self, PyObject *_args)
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1090 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1091 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1092 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1093 AEInteractAllowed level;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1094 #ifndef AEGetInteractionAllowed
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1095 PyMac_PRECHECK(AEGetInteractionAllowed);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1096 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1097 if (!PyArg_ParseTuple(_args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1098 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1099 _err = AEGetInteractionAllowed(&level);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1100 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1101 _res = Py_BuildValue("b",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1102 level);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1103 return _res;
21448
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1104 }
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1105
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1106 static PyObject *AE_AESetInteractionAllowed(PyObject *_self, PyObject *_args)
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1107 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1108 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1109 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1110 AEInteractAllowed level;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1111 #ifndef AESetInteractionAllowed
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1112 PyMac_PRECHECK(AESetInteractionAllowed);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1113 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1114 if (!PyArg_ParseTuple(_args, "b",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1115 &level))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1116 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1117 _err = AESetInteractionAllowed(level);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1118 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1119 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1120 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1121 return _res;
21448
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1122 }
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1123
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1124 static PyObject *AE_AEInteractWithUser(PyObject *_self, PyObject *_args)
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1125 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1126 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1127 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1128 long timeOutInTicks;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1129 #ifndef AEInteractWithUser
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1130 PyMac_PRECHECK(AEInteractWithUser);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1131 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1132 if (!PyArg_ParseTuple(_args, "l",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1133 &timeOutInTicks))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1134 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1135 _err = AEInteractWithUser(timeOutInTicks,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1136 (NMRecPtr)0,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1137 upp_AEIdleProc);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1138 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1139 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1140 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1141 return _res;
21448
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1142 }
97f099671bbc There's a new include file AEInteraction.h which contains AESend and friends.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21442
diff changeset
1143
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1144 static PyObject *AE_AEInstallEventHandler(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
1145 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1146 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1147 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1148 AEEventClass theAEEventClass;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1149 AEEventID theAEEventID;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1150 AEEventHandlerUPP handler__proc__ = upp_GenericEventHandler;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1151 PyObject *handler;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1152 #ifndef AEInstallEventHandler
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1153 PyMac_PRECHECK(AEInstallEventHandler);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1154 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1155 if (!PyArg_ParseTuple(_args, "O&O&O",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1156 PyMac_GetOSType, &theAEEventClass,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1157 PyMac_GetOSType, &theAEEventID,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1158 &handler))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1159 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1160 _err = AEInstallEventHandler(theAEEventClass,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1161 theAEEventID,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1162 handler__proc__, (SRefCon)handler,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1163 0);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1164 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1165 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1166 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1167 Py_INCREF(handler); /* XXX leak, but needed */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1168 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1169 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1170
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1171 static PyObject *AE_AERemoveEventHandler(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
1172 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1173 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1174 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1175 AEEventClass theAEEventClass;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1176 AEEventID theAEEventID;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1177 #ifndef AERemoveEventHandler
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1178 PyMac_PRECHECK(AERemoveEventHandler);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1179 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1180 if (!PyArg_ParseTuple(_args, "O&O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1181 PyMac_GetOSType, &theAEEventClass,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1182 PyMac_GetOSType, &theAEEventID))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1183 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1184 _err = AERemoveEventHandler(theAEEventClass,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1185 theAEEventID,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1186 upp_GenericEventHandler,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1187 0);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1188 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1189 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1190 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1191 return _res;
19443
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1194 static PyObject *AE_AEGetEventHandler(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
1195 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1196 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1197 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1198 AEEventClass theAEEventClass;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1199 AEEventID theAEEventID;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1200 AEEventHandlerUPP handler__proc__ = upp_GenericEventHandler;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1201 PyObject *handler;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1202 #ifndef AEGetEventHandler
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1203 PyMac_PRECHECK(AEGetEventHandler);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1204 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1205 if (!PyArg_ParseTuple(_args, "O&O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1206 PyMac_GetOSType, &theAEEventClass,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1207 PyMac_GetOSType, &theAEEventID))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1208 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1209 _err = AEGetEventHandler(theAEEventClass,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1210 theAEEventID,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1211 &handler__proc__, (SRefCon *)&handler,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1212 0);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1213 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1214 _res = Py_BuildValue("O",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1215 handler);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1216 Py_INCREF(handler); /* XXX leak, but needed */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1217 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1218 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1219
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1220 static PyObject *AE_AEInstallSpecialHandler(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
1221 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1222 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1223 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1224 AEKeyword functionClass;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1225 #ifndef AEInstallSpecialHandler
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1226 PyMac_PRECHECK(AEInstallSpecialHandler);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1227 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1228 if (!PyArg_ParseTuple(_args, "O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1229 PyMac_GetOSType, &functionClass))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1230 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1231 _err = AEInstallSpecialHandler(functionClass,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1232 upp_GenericEventHandler,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1233 0);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1234 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1235 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1236 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1237 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1238 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1239
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1240 static PyObject *AE_AERemoveSpecialHandler(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
1241 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1242 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1243 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1244 AEKeyword functionClass;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1245 #ifndef AERemoveSpecialHandler
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1246 PyMac_PRECHECK(AERemoveSpecialHandler);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1247 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1248 if (!PyArg_ParseTuple(_args, "O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1249 PyMac_GetOSType, &functionClass))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1250 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1251 _err = AERemoveSpecialHandler(functionClass,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1252 upp_GenericEventHandler,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1253 0);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1254 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1255 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1256 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1257 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1258 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1259
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1260 static PyObject *AE_AEManagerInfo(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
1261 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1262 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1263 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1264 AEKeyword keyWord;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1265 long result;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1266 #ifndef AEManagerInfo
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1267 PyMac_PRECHECK(AEManagerInfo);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1268 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1269 if (!PyArg_ParseTuple(_args, "O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1270 PyMac_GetOSType, &keyWord))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1271 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1272 _err = AEManagerInfo(keyWord,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1273 &result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1274 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1275 _res = Py_BuildValue("l",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1276 result);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1277 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1278 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1279
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1280 static PyObject *AE_AEObjectInit(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
1281 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1282 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1283 OSErr _err;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1284 #ifndef AEObjectInit
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1285 PyMac_PRECHECK(AEObjectInit);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1286 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1287 if (!PyArg_ParseTuple(_args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1288 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1289 _err = AEObjectInit();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1290 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1291 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1292 _res = Py_None;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1293 return _res;
19443
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1296 static PyObject *AE_AEDisposeToken(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
1297 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1298 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1299 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1300 AEDesc theToken;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1301 #ifndef AEDisposeToken
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1302 PyMac_PRECHECK(AEDisposeToken);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1303 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1304 if (!PyArg_ParseTuple(_args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1305 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1306 _err = AEDisposeToken(&theToken);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1307 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1308 _res = Py_BuildValue("O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1309 AEDesc_New, &theToken);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1310 return _res;
19443
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
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1313 static PyObject *AE_AECallObjectAccessor(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
1314 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1315 PyObject *_res = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1316 OSErr _err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1317 DescType desiredClass;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1318 AEDesc containerToken;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1319 DescType containerClass;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1320 DescType keyForm;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1321 AEDesc keyData;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1322 AEDesc token;
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1323 #ifndef AECallObjectAccessor
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1324 PyMac_PRECHECK(AECallObjectAccessor);
22511
205c10632f08 Backport of _AEmodule.c 1.10 and aesupport.py 1.26:
Jack Jansen <jack.jansen@cwi.nl>
parents: 21630
diff changeset
1325 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1326 if (!PyArg_ParseTuple(_args, "O&O&O&O&O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1327 PyMac_GetOSType, &desiredClass,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1328 AEDesc_Convert, &containerToken,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1329 PyMac_GetOSType, &containerClass,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1330 PyMac_GetOSType, &keyForm,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1331 AEDesc_Convert, &keyData))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1332 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1333 _err = AECallObjectAccessor(desiredClass,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1334 &containerToken,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1335 containerClass,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1336 keyForm,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1337 &keyData,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1338 &token);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1339 if (_err != noErr) return PyMac_Error(_err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1340 _res = Py_BuildValue("O&",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1341 AEDesc_New, &token);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1342 return _res;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1343 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1344
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1345 static PyMethodDef AE_methods[] = {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1346 {"AECoercePtr", (PyCFunction)AE_AECoercePtr, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1347 PyDoc_STR("(DescType typeCode, Buffer dataPtr, DescType toType) -> (AEDesc result)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1348 {"AECreateDesc", (PyCFunction)AE_AECreateDesc, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1349 PyDoc_STR("(DescType typeCode, Buffer dataPtr) -> (AEDesc result)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1350 {"AECreateList", (PyCFunction)AE_AECreateList, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1351 PyDoc_STR("(Buffer factoringPtr, Boolean isRecord) -> (AEDescList resultList)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1352 {"AECreateAppleEvent", (PyCFunction)AE_AECreateAppleEvent, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1353 PyDoc_STR("(AEEventClass theAEEventClass, AEEventID theAEEventID, AEAddressDesc target, AEReturnID returnID, AETransactionID transactionID) -> (AppleEvent result)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1354 {"AEReplaceDescData", (PyCFunction)AE_AEReplaceDescData, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1355 PyDoc_STR("(DescType typeCode, Buffer dataPtr) -> (AEDesc theAEDesc)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1356 {"AEProcessAppleEvent", (PyCFunction)AE_AEProcessAppleEvent, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1357 PyDoc_STR("(EventRecord theEventRecord) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1358 {"AEGetInteractionAllowed", (PyCFunction)AE_AEGetInteractionAllowed, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1359 PyDoc_STR("() -> (AEInteractAllowed level)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1360 {"AESetInteractionAllowed", (PyCFunction)AE_AESetInteractionAllowed, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1361 PyDoc_STR("(AEInteractAllowed level) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1362 {"AEInteractWithUser", (PyCFunction)AE_AEInteractWithUser, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1363 PyDoc_STR("(long timeOutInTicks) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1364 {"AEInstallEventHandler", (PyCFunction)AE_AEInstallEventHandler, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1365 PyDoc_STR("(AEEventClass theAEEventClass, AEEventID theAEEventID, EventHandler handler) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1366 {"AERemoveEventHandler", (PyCFunction)AE_AERemoveEventHandler, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1367 PyDoc_STR("(AEEventClass theAEEventClass, AEEventID theAEEventID) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1368 {"AEGetEventHandler", (PyCFunction)AE_AEGetEventHandler, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1369 PyDoc_STR("(AEEventClass theAEEventClass, AEEventID theAEEventID) -> (EventHandler handler)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1370 {"AEInstallSpecialHandler", (PyCFunction)AE_AEInstallSpecialHandler, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1371 PyDoc_STR("(AEKeyword functionClass) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1372 {"AERemoveSpecialHandler", (PyCFunction)AE_AERemoveSpecialHandler, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1373 PyDoc_STR("(AEKeyword functionClass) -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1374 {"AEManagerInfo", (PyCFunction)AE_AEManagerInfo, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1375 PyDoc_STR("(AEKeyword keyWord) -> (long result)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1376 {"AEObjectInit", (PyCFunction)AE_AEObjectInit, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1377 PyDoc_STR("() -> None")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1378 {"AEDisposeToken", (PyCFunction)AE_AEDisposeToken, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1379 PyDoc_STR("() -> (AEDesc theToken)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1380 {"AECallObjectAccessor", (PyCFunction)AE_AECallObjectAccessor, 1,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1381 PyDoc_STR("(DescType desiredClass, AEDesc containerToken, DescType containerClass, DescType keyForm, AEDesc keyData) -> (AEDesc token)")},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1382 {NULL, NULL, 0}
19443
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
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 static pascal OSErr
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1388 GenericEventHandler(const AppleEvent *request, AppleEvent *reply, refcontype refcon)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1389 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1390 PyObject *handler = (PyObject *)refcon;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1391 AEDescObject *requestObject, *replyObject;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1392 PyObject *args, *res;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1393 if ((requestObject = (AEDescObject *)AEDesc_New((AppleEvent *)request)) == NULL) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1394 return -1;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1395 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1396 if ((replyObject = (AEDescObject *)AEDesc_New(reply)) == NULL) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1397 Py_DECREF(requestObject);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1398 return -1;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1399 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1400 if ((args = Py_BuildValue("OO", requestObject, replyObject)) == NULL) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1401 Py_DECREF(requestObject);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1402 Py_DECREF(replyObject);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1403 return -1;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1404 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1405 res = PyEval_CallObject(handler, args);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1406 requestObject->ob_itself.descriptorType = 'null';
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1407 requestObject->ob_itself.dataHandle = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1408 replyObject->ob_itself.descriptorType = 'null';
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1409 replyObject->ob_itself.dataHandle = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1410 Py_DECREF(args);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1411 if (res == NULL) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1412 PySys_WriteStderr("Exception in AE event handler function\n");
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1413 PyErr_Print();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1414 return -1;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1415 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1416 Py_DECREF(res);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1417 return noErr;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1418 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1419
27286
04e5610c5efe It turns out that some calls return AEDesc records that are "borrowed",
Jack Jansen <jack.jansen@cwi.nl>
parents: 26769
diff changeset
1420 PyObject *AEDesc_NewBorrowed(AEDesc *itself)
04e5610c5efe It turns out that some calls return AEDesc records that are "borrowed",
Jack Jansen <jack.jansen@cwi.nl>
parents: 26769
diff changeset
1421 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1422 PyObject *it;
35200
5df1c692bb41 Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents: 30982
diff changeset
1423
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1424 it = AEDesc_New(itself);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1425 if (it)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1426 ((AEDescObject *)it)->ob_owned = 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1427 return (PyObject *)it;
27286
04e5610c5efe It turns out that some calls return AEDesc records that are "borrowed",
Jack Jansen <jack.jansen@cwi.nl>
parents: 26769
diff changeset
1428 }
04e5610c5efe It turns out that some calls return AEDesc records that are "borrowed",
Jack Jansen <jack.jansen@cwi.nl>
parents: 26769
diff changeset
1429
04e5610c5efe It turns out that some calls return AEDesc records that are "borrowed",
Jack Jansen <jack.jansen@cwi.nl>
parents: 26769
diff changeset
1430
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1431
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1432 void init_AE(void)
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1433 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1434 PyObject *m;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1435 PyObject *d;
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1436
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1437 upp_AEIdleProc = NewAEIdleUPP(AEIdleProc);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1438 upp_GenericEventHandler = NewAEEventHandlerUPP(GenericEventHandler);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1439 PyMac_INIT_TOOLBOX_OBJECT_NEW(AEDesc *, AEDesc_New);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1440 PyMac_INIT_TOOLBOX_OBJECT_NEW(AEDesc *, AEDesc_NewBorrowed);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1441 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(AEDesc, AEDesc_Convert);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1442
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1443 m = Py_InitModule("_AE", AE_methods);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1444 d = PyModule_GetDict(m);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1445 AE_Error = PyMac_GetOSErrException();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1446 if (AE_Error == NULL ||
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1447 PyDict_SetItemString(d, "Error", AE_Error) != 0)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1448 return;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1449 AEDesc_Type.ob_type = &PyType_Type;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1450 if (PyType_Ready(&AEDesc_Type) < 0) return;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1451 Py_INCREF(&AEDesc_Type);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1452 PyModule_AddObject(m, "AEDesc", (PyObject *)&AEDesc_Type);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1453 /* Backward-compatible name */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1454 Py_INCREF(&AEDesc_Type);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 47527
diff changeset
1455 PyModule_AddObject(m, "AEDescType", (PyObject *)&AEDesc_Type);
19443
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1456 }
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1457
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1458 /* ========================= End module _AE ========================= */
0922d609acd1 Renamed the Mac toolbox modules to have an initial _ in their name.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1459