1
/* Generated by Pyrex 0.9.3 on Sat Mar 12 04:43:18 2005 */
4
#include "structmember.h"
6
#define PY_LONG_LONG LONG_LONG
8
#include "pymactoolbox.h"
11
typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
12
typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
13
static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/
14
static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
15
static int __Pyx_PrintItem(PyObject *); /*proto*/
16
static int __Pyx_PrintNewline(void); /*proto*/
17
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
18
static void __Pyx_ReRaise(void); /*proto*/
19
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
20
static PyObject *__Pyx_GetExcValue(void); /*proto*/
21
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
22
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
23
static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
24
static void __Pyx_WriteUnraisable(char *name); /*proto*/
25
static void __Pyx_AddTraceback(char *funcname); /*proto*/
26
static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
27
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
28
static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
29
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
30
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
31
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
32
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
34
static PyObject *__pyx_m;
35
static PyObject *__pyx_b;
36
static int __pyx_lineno;
37
static char *__pyx_filename;
38
staticforward char **__pyx_f;
40
/* Declarations from cfsupport */
42
staticforward PyTypeObject __pyx_type_9cfsupport_PyCFSocket;
44
struct __pyx_obj_9cfsupport_PyCFSocket {
46
PyObject *readcallback;
47
PyObject *writecallback;
48
PyObject *connectcallback;
52
CFRunLoopSourceRef source;
53
CFSocketNativeHandle fileno;
54
CFSocketContext context;
57
staticforward PyTypeObject __pyx_type_9cfsupport_PyCFRunLoopTimer;
59
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer {
63
CFRunLoopTimerContext context;
66
staticforward PyTypeObject __pyx_type_9cfsupport_PyCFRunLoop;
68
struct __pyx_obj_9cfsupport_PyCFRunLoop {
73
static PyTypeObject *__pyx_ptype_9cfsupport_PyCFSocket = 0;
74
static PyTypeObject *__pyx_ptype_9cfsupport_PyCFRunLoopTimer = 0;
75
static PyTypeObject *__pyx_ptype_9cfsupport_PyCFRunLoop = 0;
76
static PyObject *__pyx_k2;
77
static PyObject *__pyx_k3;
78
static PyObject *__pyx_k4;
79
static PyObject *__pyx_k6;
80
static void (__pyx_f_9cfsupport_socketCallBack(CFSocketRef ,CFSocketCallBackType ,CFDataRef ,void (*),void (*))); /*proto*/
81
static void (__pyx_f_9cfsupport_gilSocketCallBack(CFSocketRef ,CFSocketCallBackType ,CFDataRef ,void (*),void (*))); /*proto*/
82
static void (__pyx_f_9cfsupport_runLoopTimerCallBack(CFRunLoopTimerRef ,void (*))); /*proto*/
83
static void (__pyx_f_9cfsupport_gilRunLoopTimerCallBack(CFRunLoopTimerRef ,void (*))); /*proto*/
85
/* Implementation of cfsupport */
87
static char (__pyx_k7[]) = "0.4";
89
static PyObject *__pyx_n_now;
90
static PyObject *__pyx_n_traceback;
91
static PyObject *__pyx_n___version__;
93
static PyObject *__pyx_k7p;
95
static PyObject *__pyx_f_9cfsupport_now(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
96
static PyObject *__pyx_f_9cfsupport_now(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
98
PyObject *__pyx_1 = 0;
99
static char *__pyx_argnames[] = {0};
100
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
102
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfdate.pxi":2 */
103
__pyx_1 = PyFloat_FromDouble(CFAbsoluteTimeGetCurrent()); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;}
108
__pyx_r = Py_None; Py_INCREF(__pyx_r);
112
__Pyx_AddTraceback("cfsupport.now");
118
static PyObject *__pyx_n_print_exc;
120
static void __pyx_f_9cfsupport_socketCallBack(CFSocketRef __pyx_v_s,CFSocketCallBackType __pyx_v__type,CFDataRef __pyx_v_address,void (*__pyx_v_data),void (*__pyx_v_info)) {
121
struct __pyx_obj_9cfsupport_PyCFSocket *__pyx_v_socket;
124
PyObject *__pyx_1 = 0;
126
PyObject *__pyx_3 = 0;
127
PyObject *__pyx_4 = 0;
128
((PyObject*)__pyx_v_socket) = Py_None; Py_INCREF(((PyObject*)__pyx_v_socket));
130
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":9 */
131
__pyx_1 = (PyObject *)__pyx_v_info;
133
Py_DECREF(((PyObject *)__pyx_v_socket));
134
((PyObject *)__pyx_v_socket) = __pyx_1;
137
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":11 */
140
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":12 */
141
__pyx_2 = (__pyx_v__type == kCFSocketReadCallBack);
144
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":13 */
145
__pyx_2 = PyObject_IsTrue(__pyx_v_socket->readcallback); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 13; goto __pyx_L2;}
148
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":14 */
149
__pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; goto __pyx_L2;}
150
__pyx_3 = PyObject_CallObject(__pyx_v_socket->readcallback, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; goto __pyx_L2;}
151
Py_DECREF(__pyx_1); __pyx_1 = 0;
152
Py_DECREF(__pyx_3); __pyx_3 = 0;
158
__pyx_2 = (__pyx_v__type == kCFSocketWriteCallBack);
161
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":16 */
162
__pyx_2 = PyObject_IsTrue(__pyx_v_socket->writecallback); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 16; goto __pyx_L2;}
165
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":17 */
166
__pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; goto __pyx_L2;}
167
__pyx_3 = PyObject_CallObject(__pyx_v_socket->writecallback, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; goto __pyx_L2;}
168
Py_DECREF(__pyx_1); __pyx_1 = 0;
169
Py_DECREF(__pyx_3); __pyx_3 = 0;
175
__pyx_2 = (__pyx_v__type == kCFSocketConnectCallBack);
178
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":19 */
179
__pyx_2 = (__pyx_v_data == 0);
182
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":20 */
188
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":22 */
189
__pyx_v_res = (((int (*))__pyx_v_data)[0]);
193
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":23 */
194
__pyx_2 = PyObject_IsTrue(__pyx_v_socket->connectcallback); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; goto __pyx_L2;}
197
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":24 */
198
__pyx_1 = PyInt_FromLong(__pyx_v_res); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; goto __pyx_L2;}
199
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; goto __pyx_L2;}
200
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
202
__pyx_1 = PyObject_CallObject(__pyx_v_socket->connectcallback, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; goto __pyx_L2;}
203
Py_DECREF(__pyx_3); __pyx_3 = 0;
204
Py_DECREF(__pyx_1); __pyx_1 = 0;
214
Py_XDECREF(__pyx_3); __pyx_3 = 0;
215
Py_XDECREF(__pyx_1); __pyx_1 = 0;
217
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":25 */
219
__Pyx_AddTraceback("cfsupport.socketCallBack");
220
__pyx_3 = __Pyx_GetExcValue(); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; goto __pyx_L1;}
221
Py_DECREF(__pyx_3); __pyx_3 = 0;
223
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":26 */
224
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_traceback); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; goto __pyx_L1;}
225
__pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_print_exc); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; goto __pyx_L1;}
226
Py_DECREF(__pyx_1); __pyx_1 = 0;
227
__pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; goto __pyx_L1;}
228
__pyx_4 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; goto __pyx_L1;}
229
Py_DECREF(__pyx_3); __pyx_3 = 0;
230
Py_DECREF(__pyx_1); __pyx_1 = 0;
231
Py_DECREF(__pyx_4); __pyx_4 = 0;
241
__Pyx_WriteUnraisable("cfsupport.socketCallBack");
243
Py_DECREF(__pyx_v_socket);
246
static void __pyx_f_9cfsupport_gilSocketCallBack(CFSocketRef __pyx_v_s,CFSocketCallBackType __pyx_v__type,CFDataRef __pyx_v_address,void (*__pyx_v_data),void (*__pyx_v_info)) {
247
PyGILState_STATE __pyx_v_gil;
249
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":30 */
250
__pyx_v_gil = PyGILState_Ensure();
252
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":31 */
253
__pyx_f_9cfsupport_socketCallBack(__pyx_v_s,__pyx_v__type,__pyx_v_address,__pyx_v_data,__pyx_v_info);
255
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":32 */
256
PyGILState_Release(__pyx_v_gil);
260
__Pyx_WriteUnraisable("cfsupport.gilSocketCallBack");
264
static PyObject *__pyx_n_False;
265
static PyObject *__pyx_n_ValueError;
267
static PyObject *__pyx_k8p;
268
static PyObject *__pyx_k9p;
270
static char (__pyx_k8[]) = "Invalid Socket";
271
static char (__pyx_k9[]) = "Couldn't create runloop source";
273
static int __pyx_f_9cfsupport_10PyCFSocket___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
274
static int __pyx_f_9cfsupport_10PyCFSocket___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
276
PyObject *__pyx_v_readcallback = 0;
277
PyObject *__pyx_v_writecallback = 0;
278
PyObject *__pyx_v_connectcallback = 0;
280
PyObject *__pyx_1 = 0;
282
PyObject *__pyx_3 = 0;
283
PyObject *__pyx_4 = 0;
284
static char *__pyx_argnames[] = {"fileno","readcallback","writecallback","connectcallback",0};
285
__pyx_v_readcallback = __pyx_k2;
286
__pyx_v_writecallback = __pyx_k3;
287
__pyx_v_connectcallback = __pyx_k4;
288
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i|OOO", __pyx_argnames, &__pyx_v_fileno, &__pyx_v_readcallback, &__pyx_v_writecallback, &__pyx_v_connectcallback)) return -1;
289
Py_INCREF(__pyx_v_self);
290
Py_INCREF(__pyx_v_readcallback);
291
Py_INCREF(__pyx_v_writecallback);
292
Py_INCREF(__pyx_v_connectcallback);
294
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":47 */
295
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->fileno = __pyx_v_fileno;
297
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":48 */
298
Py_INCREF(__pyx_v_readcallback);
299
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->readcallback);
300
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->readcallback = __pyx_v_readcallback;
302
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":49 */
303
Py_INCREF(__pyx_v_writecallback);
304
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writecallback);
305
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writecallback = __pyx_v_writecallback;
307
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":50 */
308
Py_INCREF(__pyx_v_connectcallback);
309
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->connectcallback);
310
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->connectcallback = __pyx_v_connectcallback;
312
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":51 */
313
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.version = 0;
315
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":52 */
316
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.info = ((void (*))__pyx_v_self);
318
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":53 */
319
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.retain = 0;
321
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":54 */
322
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.release = 0;
324
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":55 */
325
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.copyDescription = 0;
327
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":56 */
328
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 56; goto __pyx_L1;}
329
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->reading);
330
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->reading = __pyx_1;
333
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":57 */
334
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; goto __pyx_L1;}
335
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writing);
336
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writing = __pyx_1;
339
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":58 */
340
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf = CFSocketCreateWithNative(kCFAllocatorDefault,__pyx_v_fileno,((kCFSocketConnectCallBack | kCFSocketReadCallBack) | kCFSocketWriteCallBack),((CFSocketCallBack )(&__pyx_f_9cfsupport_gilSocketCallBack)),(&((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context));
342
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":59 */
343
__pyx_2 = (((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf == 0);
346
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":60 */
347
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 60; goto __pyx_L1;}
348
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 60; goto __pyx_L1;}
349
Py_INCREF(__pyx_k8p);
350
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k8p);
351
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 60; goto __pyx_L1;}
352
Py_DECREF(__pyx_1); __pyx_1 = 0;
353
Py_DECREF(__pyx_3); __pyx_3 = 0;
354
__Pyx_Raise(__pyx_4, 0, 0);
355
Py_DECREF(__pyx_4); __pyx_4 = 0;
356
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 60; goto __pyx_L1;}
361
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":61 */
362
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->source = CFSocketCreateRunLoopSource(kCFAllocatorDefault,((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf,10000);
364
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":62 */
365
__pyx_2 = (((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->source == 0);
368
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":63 */
369
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; goto __pyx_L1;}
370
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; goto __pyx_L1;}
371
Py_INCREF(__pyx_k9p);
372
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k9p);
373
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; goto __pyx_L1;}
374
Py_DECREF(__pyx_1); __pyx_1 = 0;
375
Py_DECREF(__pyx_3); __pyx_3 = 0;
376
__Pyx_Raise(__pyx_4, 0, 0);
377
Py_DECREF(__pyx_4); __pyx_4 = 0;
378
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; goto __pyx_L1;}
389
__Pyx_AddTraceback("cfsupport.PyCFSocket.__new__");
392
Py_DECREF(__pyx_v_self);
393
Py_DECREF(__pyx_v_readcallback);
394
Py_DECREF(__pyx_v_writecallback);
395
Py_DECREF(__pyx_v_connectcallback);
399
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
400
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
403
int __pyx_v_automask;
406
static char *__pyx_argnames[] = {0};
407
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
408
Py_INCREF(__pyx_v_self);
410
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":70 */
411
__pyx_v_mask = (kCFSocketConnectCallBack | kCFSocketAcceptCallBack);
413
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":71 */
416
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":72 */
417
__pyx_v_automask = kCFSocketAutomaticallyReenableAcceptCallBack;
419
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":73 */
420
__pyx_1 = PyObject_IsTrue(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->reading); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; goto __pyx_L1;}
423
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":74 */
424
__pyx_v_mask = (__pyx_v_mask | kCFSocketReadCallBack);
426
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":75 */
427
__pyx_v_automask = (__pyx_v_automask | kCFSocketAutomaticallyReenableReadCallBack);
432
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":77 */
433
__pyx_v_offmask = (__pyx_v_offmask | kCFSocketReadCallBack);
437
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":78 */
438
__pyx_1 = PyObject_IsTrue(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writing); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 78; goto __pyx_L1;}
441
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":79 */
442
__pyx_v_mask = (__pyx_v_mask | kCFSocketWriteCallBack);
444
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":80 */
445
__pyx_v_automask = (__pyx_v_automask | kCFSocketAutomaticallyReenableWriteCallBack);
450
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":82 */
451
__pyx_v_offmask = (__pyx_v_offmask | kCFSocketWriteCallBack);
455
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":83 */
456
CFSocketDisableCallBacks(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf,__pyx_v_offmask);
458
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":84 */
459
CFSocketEnableCallBacks(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf,__pyx_v_mask);
461
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":85 */
462
CFSocketSetSocketFlags(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf,__pyx_v_automask);
464
__pyx_r = Py_None; Py_INCREF(__pyx_r);
467
__Pyx_AddTraceback("cfsupport.PyCFSocket.update");
470
Py_DECREF(__pyx_v_self);
474
static PyObject *__pyx_n_True;
475
static PyObject *__pyx_n_update;
477
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_startReading(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
478
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_startReading(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
480
PyObject *__pyx_1 = 0;
481
PyObject *__pyx_2 = 0;
482
PyObject *__pyx_3 = 0;
483
static char *__pyx_argnames[] = {0};
484
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
485
Py_INCREF(__pyx_v_self);
487
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":89 */
488
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; goto __pyx_L1;}
489
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->reading);
490
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->reading = __pyx_1;
493
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":90 */
494
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_update); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 90; goto __pyx_L1;}
495
__pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 90; goto __pyx_L1;}
496
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 90; goto __pyx_L1;}
497
Py_DECREF(__pyx_1); __pyx_1 = 0;
498
Py_DECREF(__pyx_2); __pyx_2 = 0;
499
Py_DECREF(__pyx_3); __pyx_3 = 0;
501
__pyx_r = Py_None; Py_INCREF(__pyx_r);
507
__Pyx_AddTraceback("cfsupport.PyCFSocket.startReading");
510
Py_DECREF(__pyx_v_self);
514
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_stopReading(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
515
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_stopReading(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
517
PyObject *__pyx_1 = 0;
518
PyObject *__pyx_2 = 0;
519
PyObject *__pyx_3 = 0;
520
static char *__pyx_argnames[] = {0};
521
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
522
Py_INCREF(__pyx_v_self);
524
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":93 */
525
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 93; goto __pyx_L1;}
526
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->reading);
527
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->reading = __pyx_1;
530
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":94 */
531
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_update); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; goto __pyx_L1;}
532
__pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; goto __pyx_L1;}
533
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; goto __pyx_L1;}
534
Py_DECREF(__pyx_1); __pyx_1 = 0;
535
Py_DECREF(__pyx_2); __pyx_2 = 0;
536
Py_DECREF(__pyx_3); __pyx_3 = 0;
538
__pyx_r = Py_None; Py_INCREF(__pyx_r);
544
__Pyx_AddTraceback("cfsupport.PyCFSocket.stopReading");
547
Py_DECREF(__pyx_v_self);
551
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_startWriting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
552
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_startWriting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
554
PyObject *__pyx_1 = 0;
555
PyObject *__pyx_2 = 0;
556
PyObject *__pyx_3 = 0;
557
static char *__pyx_argnames[] = {0};
558
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
559
Py_INCREF(__pyx_v_self);
561
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":97 */
562
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 97; goto __pyx_L1;}
563
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writing);
564
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writing = __pyx_1;
567
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":98 */
568
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_update); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; goto __pyx_L1;}
569
__pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; goto __pyx_L1;}
570
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; goto __pyx_L1;}
571
Py_DECREF(__pyx_1); __pyx_1 = 0;
572
Py_DECREF(__pyx_2); __pyx_2 = 0;
573
Py_DECREF(__pyx_3); __pyx_3 = 0;
575
__pyx_r = Py_None; Py_INCREF(__pyx_r);
581
__Pyx_AddTraceback("cfsupport.PyCFSocket.startWriting");
584
Py_DECREF(__pyx_v_self);
588
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_stopWriting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
589
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_stopWriting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
591
PyObject *__pyx_1 = 0;
592
PyObject *__pyx_2 = 0;
593
PyObject *__pyx_3 = 0;
594
static char *__pyx_argnames[] = {0};
595
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
596
Py_INCREF(__pyx_v_self);
598
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":101 */
599
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 101; goto __pyx_L1;}
600
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writing);
601
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writing = __pyx_1;
604
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":102 */
605
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_update); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; goto __pyx_L1;}
606
__pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; goto __pyx_L1;}
607
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; goto __pyx_L1;}
608
Py_DECREF(__pyx_1); __pyx_1 = 0;
609
Py_DECREF(__pyx_2); __pyx_2 = 0;
610
Py_DECREF(__pyx_3); __pyx_3 = 0;
612
__pyx_r = Py_None; Py_INCREF(__pyx_r);
618
__Pyx_AddTraceback("cfsupport.PyCFSocket.stopWriting");
621
Py_DECREF(__pyx_v_self);
625
static void __pyx_f_9cfsupport_10PyCFSocket___dealloc__(PyObject *__pyx_v_self); /*proto*/
626
static void __pyx_f_9cfsupport_10PyCFSocket___dealloc__(PyObject *__pyx_v_self) {
628
Py_INCREF(__pyx_v_self);
630
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":106 */
631
__pyx_1 = (((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->source != 0);
634
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":107 */
635
CFRelease(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->source);
640
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":108 */
641
__pyx_1 = (((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf != 0);
644
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":109 */
645
CFSocketInvalidate(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf);
647
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":110 */
648
CFRelease(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf);
655
__Pyx_AddTraceback("cfsupport.PyCFSocket.__dealloc__");
657
Py_DECREF(__pyx_v_self);
660
static PyObject *__pyx_k10p;
662
static char (__pyx_k10[]) = "Invalid Socket";
664
static int __pyx_f_9cfsupport_16PyCFRunLoopTimer___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
665
static int __pyx_f_9cfsupport_16PyCFRunLoopTimer___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
666
double __pyx_v_fireDate;
667
double __pyx_v_interval;
668
PyObject *__pyx_v_callout = 0;
671
PyObject *__pyx_2 = 0;
672
PyObject *__pyx_3 = 0;
673
PyObject *__pyx_4 = 0;
674
static char *__pyx_argnames[] = {"fireDate","interval","callout",0};
675
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "ddO", __pyx_argnames, &__pyx_v_fireDate, &__pyx_v_interval, &__pyx_v_callout)) return -1;
676
Py_INCREF(__pyx_v_self);
677
Py_INCREF(__pyx_v_callout);
679
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":11 */
680
Py_INCREF(__pyx_v_callout);
681
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->callout);
682
((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->callout = __pyx_v_callout;
684
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":12 */
685
((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context.version = 0;
687
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":13 */
688
((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context.info = ((void (*))__pyx_v_self);
690
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":14 */
691
((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context.retain = 0;
693
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":15 */
694
((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context.release = 0;
696
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":16 */
697
((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context.copyDescription = 0;
699
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":17 */
700
((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf = CFRunLoopTimerCreate(kCFAllocatorDefault,__pyx_v_fireDate,__pyx_v_interval,0,0,((CFRunLoopTimerCallBack )(&__pyx_f_9cfsupport_gilRunLoopTimerCallBack)),(&((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context));
702
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":18 */
703
__pyx_1 = (((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf == 0);
706
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":19 */
707
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; goto __pyx_L1;}
708
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; goto __pyx_L1;}
709
Py_INCREF(__pyx_k10p);
710
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k10p);
711
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; goto __pyx_L1;}
712
Py_DECREF(__pyx_2); __pyx_2 = 0;
713
Py_DECREF(__pyx_3); __pyx_3 = 0;
714
__Pyx_Raise(__pyx_4, 0, 0);
715
Py_DECREF(__pyx_4); __pyx_4 = 0;
716
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; goto __pyx_L1;}
727
__Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.__new__");
730
Py_DECREF(__pyx_v_self);
731
Py_DECREF(__pyx_v_callout);
735
static PyObject *__pyx_f_9cfsupport_16PyCFRunLoopTimer_getNextFireDate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
736
static PyObject *__pyx_f_9cfsupport_16PyCFRunLoopTimer_getNextFireDate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
738
PyObject *__pyx_1 = 0;
739
static char *__pyx_argnames[] = {0};
740
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
741
Py_INCREF(__pyx_v_self);
743
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":22 */
744
__pyx_1 = PyFloat_FromDouble(CFRunLoopTimerGetNextFireDate(((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 22; goto __pyx_L1;}
749
__pyx_r = Py_None; Py_INCREF(__pyx_r);
753
__Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.getNextFireDate");
756
Py_DECREF(__pyx_v_self);
760
static PyObject *__pyx_f_9cfsupport_16PyCFRunLoopTimer_setNextFireDate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
761
static PyObject *__pyx_f_9cfsupport_16PyCFRunLoopTimer_setNextFireDate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
762
double __pyx_v_fireDate;
764
static char *__pyx_argnames[] = {"fireDate",0};
765
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "d", __pyx_argnames, &__pyx_v_fireDate)) return 0;
766
Py_INCREF(__pyx_v_self);
768
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":25 */
769
CFRunLoopTimerSetNextFireDate(((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf,__pyx_v_fireDate);
771
__pyx_r = Py_None; Py_INCREF(__pyx_r);
774
__Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.setNextFireDate");
777
Py_DECREF(__pyx_v_self);
781
static PyObject *__pyx_f_9cfsupport_16PyCFRunLoopTimer_invalidate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
782
static PyObject *__pyx_f_9cfsupport_16PyCFRunLoopTimer_invalidate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
784
static char *__pyx_argnames[] = {0};
785
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
786
Py_INCREF(__pyx_v_self);
788
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":28 */
789
CFRunLoopTimerInvalidate(((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf);
791
__pyx_r = Py_None; Py_INCREF(__pyx_r);
794
__Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.invalidate");
797
Py_DECREF(__pyx_v_self);
801
static void __pyx_f_9cfsupport_16PyCFRunLoopTimer___dealloc__(PyObject *__pyx_v_self); /*proto*/
802
static void __pyx_f_9cfsupport_16PyCFRunLoopTimer___dealloc__(PyObject *__pyx_v_self) {
804
Py_INCREF(__pyx_v_self);
806
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":31 */
807
__pyx_1 = (((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf != 0);
810
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":32 */
811
CFRelease(((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf);
818
__Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.__dealloc__");
820
Py_DECREF(__pyx_v_self);
823
static void __pyx_f_9cfsupport_runLoopTimerCallBack(CFRunLoopTimerRef __pyx_v_timer,void (*__pyx_v_info)) {
824
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *__pyx_v_obj;
825
PyObject *__pyx_1 = 0;
827
PyObject *__pyx_3 = 0;
828
PyObject *__pyx_4 = 0;
829
((PyObject*)__pyx_v_obj) = Py_None; Py_INCREF(((PyObject*)__pyx_v_obj));
831
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":36 */
832
__pyx_1 = (PyObject *)__pyx_v_info;
834
Py_DECREF(((PyObject *)__pyx_v_obj));
835
((PyObject *)__pyx_v_obj) = __pyx_1;
838
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":37 */
841
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":38 */
842
__pyx_2 = PyObject_IsTrue(__pyx_v_obj->callout); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 38; goto __pyx_L2;}
845
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":39 */
846
__pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; goto __pyx_L2;}
847
__pyx_3 = PyObject_CallObject(__pyx_v_obj->callout, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; goto __pyx_L2;}
848
Py_DECREF(__pyx_1); __pyx_1 = 0;
849
Py_DECREF(__pyx_3); __pyx_3 = 0;
856
Py_XDECREF(__pyx_1); __pyx_1 = 0;
857
Py_XDECREF(__pyx_3); __pyx_3 = 0;
859
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":40 */
861
__Pyx_AddTraceback("cfsupport.runLoopTimerCallBack");
862
__pyx_1 = __Pyx_GetExcValue(); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; goto __pyx_L1;}
863
Py_DECREF(__pyx_1); __pyx_1 = 0;
865
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":41 */
866
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_traceback); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; goto __pyx_L1;}
867
__pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_print_exc); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; goto __pyx_L1;}
868
Py_DECREF(__pyx_3); __pyx_3 = 0;
869
__pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; goto __pyx_L1;}
870
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; goto __pyx_L1;}
871
Py_DECREF(__pyx_1); __pyx_1 = 0;
872
Py_DECREF(__pyx_3); __pyx_3 = 0;
873
Py_DECREF(__pyx_4); __pyx_4 = 0;
883
__Pyx_WriteUnraisable("cfsupport.runLoopTimerCallBack");
885
Py_DECREF(__pyx_v_obj);
888
static void __pyx_f_9cfsupport_gilRunLoopTimerCallBack(CFRunLoopTimerRef __pyx_v_timer,void (*__pyx_v_info)) {
889
PyGILState_STATE __pyx_v_gil;
891
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":45 */
892
__pyx_v_gil = PyGILState_Ensure();
894
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":46 */
895
__pyx_f_9cfsupport_runLoopTimerCallBack(__pyx_v_timer,__pyx_v_info);
897
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":47 */
898
PyGILState_Release(__pyx_v_gil);
902
__Pyx_WriteUnraisable("cfsupport.gilRunLoopTimerCallBack");
906
static int __pyx_f_9cfsupport_11PyCFRunLoop___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
907
static int __pyx_f_9cfsupport_11PyCFRunLoop___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
908
PyObject *__pyx_v_runLoop = 0;
909
CFTypeRef __pyx_v__runLoop;
912
PyObject *__pyx_2 = 0;
913
static char *__pyx_argnames[] = {"runLoop",0};
914
__pyx_v_runLoop = __pyx_k6;
915
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_runLoop)) return -1;
916
Py_INCREF(__pyx_v_self);
917
Py_INCREF(__pyx_v_runLoop);
919
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":54 */
920
__pyx_1 = __pyx_v_runLoop == Py_None;
923
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":55 */
924
__pyx_v__runLoop = CFRunLoopGetCurrent();
929
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":57 */
930
__pyx_1 = (CFObj_Convert(__pyx_v_runLoop,(&__pyx_v__runLoop)) == 0);
933
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":58 */
935
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; goto __pyx_L1;}
942
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":61 */
943
__pyx_2 = CFObj_New(CFRetain(__pyx_v__runLoop)); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; goto __pyx_L1;}
944
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf);
945
((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf = __pyx_2;
952
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.__new__");
955
Py_DECREF(__pyx_v_self);
956
Py_DECREF(__pyx_v_runLoop);
960
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
961
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
963
static char *__pyx_argnames[] = {0};
964
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
965
Py_INCREF(__pyx_v_self);
967
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":64 */
970
__pyx_r = Py_None; Py_INCREF(__pyx_r);
973
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.run");
976
Py_DECREF(__pyx_v_self);
980
static PyObject *__pyx_k11p;
982
static char (__pyx_k11[]) = "CFRunLoopReference is invalid";
984
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_stop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
985
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_stop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
986
CFTypeRef __pyx_v__runLoop;
989
PyObject *__pyx_2 = 0;
990
static char *__pyx_argnames[] = {0};
991
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
992
Py_INCREF(__pyx_v_self);
994
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":68 */
995
__pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf,(&__pyx_v__runLoop)) == 0);
998
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":69 */
999
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; goto __pyx_L1;}
1000
__Pyx_Raise(__pyx_2, __pyx_k11p, 0);
1001
Py_DECREF(__pyx_2); __pyx_2 = 0;
1002
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; goto __pyx_L1;}
1007
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":70 */
1008
CFRunLoopStop(__pyx_v__runLoop);
1010
__pyx_r = Py_None; Py_INCREF(__pyx_r);
1013
Py_XDECREF(__pyx_2);
1014
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.stop");
1017
Py_DECREF(__pyx_v_self);
1021
static PyObject *__pyx_k12p;
1023
static char (__pyx_k12[]) = "CFRunLoopReference is invalid";
1025
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_currentMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1026
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_currentMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1027
CFTypeRef __pyx_v__currentMode;
1028
CFTypeRef __pyx_v__runLoop;
1031
PyObject *__pyx_2 = 0;
1032
static char *__pyx_argnames[] = {0};
1033
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
1034
Py_INCREF(__pyx_v_self);
1036
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":75 */
1037
__pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf,(&__pyx_v__runLoop)) == 0);
1040
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":76 */
1041
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; goto __pyx_L1;}
1042
__Pyx_Raise(__pyx_2, __pyx_k12p, 0);
1043
Py_DECREF(__pyx_2); __pyx_2 = 0;
1044
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; goto __pyx_L1;}
1049
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":77 */
1050
__pyx_v__currentMode = CFRunLoopCopyCurrentMode(__pyx_v__runLoop);
1052
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":78 */
1053
__pyx_1 = (__pyx_v__currentMode == 0);
1056
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":79 */
1064
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":80 */
1065
__pyx_2 = CFObj_New(__pyx_v__currentMode); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; goto __pyx_L1;}
1070
__pyx_r = Py_None; Py_INCREF(__pyx_r);
1073
Py_XDECREF(__pyx_2);
1074
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.currentMode");
1077
Py_DECREF(__pyx_v_self);
1081
static PyObject *__pyx_k13p;
1083
static char (__pyx_k13[]) = "CFRunLoopReference is invalid";
1085
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_addSocket(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1086
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_addSocket(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1087
struct __pyx_obj_9cfsupport_PyCFSocket *__pyx_v_socket = 0;
1088
CFTypeRef __pyx_v__runLoop;
1091
PyObject *__pyx_2 = 0;
1092
static char *__pyx_argnames[] = {"socket",0};
1093
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_socket)) return 0;
1094
Py_INCREF(__pyx_v_self);
1095
Py_INCREF(__pyx_v_socket);
1096
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_socket), __pyx_ptype_9cfsupport_PyCFSocket, 0, "socket")) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; goto __pyx_L1;}
1098
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":84 */
1099
__pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf,(&__pyx_v__runLoop)) == 0);
1102
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":85 */
1103
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; goto __pyx_L1;}
1104
__Pyx_Raise(__pyx_2, __pyx_k13p, 0);
1105
Py_DECREF(__pyx_2); __pyx_2 = 0;
1106
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; goto __pyx_L1;}
1111
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":86 */
1112
CFRunLoopAddSource(__pyx_v__runLoop,__pyx_v_socket->source,kCFRunLoopCommonModes);
1114
__pyx_r = Py_None; Py_INCREF(__pyx_r);
1117
Py_XDECREF(__pyx_2);
1118
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.addSocket");
1121
Py_DECREF(__pyx_v_self);
1122
Py_DECREF(__pyx_v_socket);
1126
static PyObject *__pyx_k14p;
1128
static char (__pyx_k14[]) = "CFRunLoopReference is invalid";
1130
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_removeSocket(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1131
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_removeSocket(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1132
struct __pyx_obj_9cfsupport_PyCFSocket *__pyx_v_socket = 0;
1133
CFTypeRef __pyx_v__runLoop;
1136
PyObject *__pyx_2 = 0;
1137
static char *__pyx_argnames[] = {"socket",0};
1138
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_socket)) return 0;
1139
Py_INCREF(__pyx_v_self);
1140
Py_INCREF(__pyx_v_socket);
1141
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_socket), __pyx_ptype_9cfsupport_PyCFSocket, 0, "socket")) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; goto __pyx_L1;}
1143
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":90 */
1144
__pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf,(&__pyx_v__runLoop)) == 0);
1147
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":91 */
1148
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; goto __pyx_L1;}
1149
__Pyx_Raise(__pyx_2, __pyx_k14p, 0);
1150
Py_DECREF(__pyx_2); __pyx_2 = 0;
1151
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; goto __pyx_L1;}
1156
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":92 */
1157
CFRunLoopRemoveSource(__pyx_v__runLoop,__pyx_v_socket->source,kCFRunLoopCommonModes);
1159
__pyx_r = Py_None; Py_INCREF(__pyx_r);
1162
Py_XDECREF(__pyx_2);
1163
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.removeSocket");
1166
Py_DECREF(__pyx_v_self);
1167
Py_DECREF(__pyx_v_socket);
1171
static PyObject *__pyx_k15p;
1173
static char (__pyx_k15[]) = "CFRunLoopReference is invalid";
1175
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_addTimer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1176
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_addTimer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1177
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *__pyx_v_timer = 0;
1178
CFTypeRef __pyx_v__runLoop;
1181
PyObject *__pyx_2 = 0;
1182
static char *__pyx_argnames[] = {"timer",0};
1183
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_timer)) return 0;
1184
Py_INCREF(__pyx_v_self);
1185
Py_INCREF(__pyx_v_timer);
1186
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_timer), __pyx_ptype_9cfsupport_PyCFRunLoopTimer, 0, "timer")) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; goto __pyx_L1;}
1188
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":96 */
1189
__pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf,(&__pyx_v__runLoop)) == 0);
1192
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":97 */
1193
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 97; goto __pyx_L1;}
1194
__Pyx_Raise(__pyx_2, __pyx_k15p, 0);
1195
Py_DECREF(__pyx_2); __pyx_2 = 0;
1196
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 97; goto __pyx_L1;}
1201
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":98 */
1202
CFRunLoopAddTimer(__pyx_v__runLoop,__pyx_v_timer->cf,kCFRunLoopCommonModes);
1204
__pyx_r = Py_None; Py_INCREF(__pyx_r);
1207
Py_XDECREF(__pyx_2);
1208
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.addTimer");
1211
Py_DECREF(__pyx_v_self);
1212
Py_DECREF(__pyx_v_timer);
1216
static PyObject *__pyx_k16p;
1218
static char (__pyx_k16[]) = "CFRunLoopReference is invalid";
1220
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_removeTimer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1221
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_removeTimer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1222
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *__pyx_v_timer = 0;
1223
CFTypeRef __pyx_v__runLoop;
1226
PyObject *__pyx_2 = 0;
1227
static char *__pyx_argnames[] = {"timer",0};
1228
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_timer)) return 0;
1229
Py_INCREF(__pyx_v_self);
1230
Py_INCREF(__pyx_v_timer);
1231
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_timer), __pyx_ptype_9cfsupport_PyCFRunLoopTimer, 0, "timer")) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; goto __pyx_L1;}
1233
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":102 */
1234
__pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf,(&__pyx_v__runLoop)) == 0);
1237
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":103 */
1238
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; goto __pyx_L1;}
1239
__Pyx_Raise(__pyx_2, __pyx_k16p, 0);
1240
Py_DECREF(__pyx_2); __pyx_2 = 0;
1241
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; goto __pyx_L1;}
1246
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":104 */
1247
CFRunLoopRemoveTimer(__pyx_v__runLoop,__pyx_v_timer->cf,kCFRunLoopCommonModes);
1249
__pyx_r = Py_None; Py_INCREF(__pyx_r);
1252
Py_XDECREF(__pyx_2);
1253
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.removeTimer");
1256
Py_DECREF(__pyx_v_self);
1257
Py_DECREF(__pyx_v_timer);
1261
static __Pyx_InternTabEntry __pyx_intern_tab[] = {
1262
{&__pyx_n_False, "False"},
1263
{&__pyx_n_True, "True"},
1264
{&__pyx_n_ValueError, "ValueError"},
1265
{&__pyx_n___version__, "__version__"},
1266
{&__pyx_n_now, "now"},
1267
{&__pyx_n_print_exc, "print_exc"},
1268
{&__pyx_n_traceback, "traceback"},
1269
{&__pyx_n_update, "update"},
1273
static __Pyx_StringTabEntry __pyx_string_tab[] = {
1274
{&__pyx_k7p, __pyx_k7, sizeof(__pyx_k7)},
1275
{&__pyx_k8p, __pyx_k8, sizeof(__pyx_k8)},
1276
{&__pyx_k9p, __pyx_k9, sizeof(__pyx_k9)},
1277
{&__pyx_k10p, __pyx_k10, sizeof(__pyx_k10)},
1278
{&__pyx_k11p, __pyx_k11, sizeof(__pyx_k11)},
1279
{&__pyx_k12p, __pyx_k12, sizeof(__pyx_k12)},
1280
{&__pyx_k13p, __pyx_k13, sizeof(__pyx_k13)},
1281
{&__pyx_k14p, __pyx_k14, sizeof(__pyx_k14)},
1282
{&__pyx_k15p, __pyx_k15, sizeof(__pyx_k15)},
1283
{&__pyx_k16p, __pyx_k16, sizeof(__pyx_k16)},
1287
static PyObject *__pyx_tp_new_9cfsupport_PyCFSocket(PyTypeObject *t, PyObject *a, PyObject *k) {
1288
PyObject *o = (*t->tp_alloc)(t, 0);
1289
struct __pyx_obj_9cfsupport_PyCFSocket *p = (struct __pyx_obj_9cfsupport_PyCFSocket *)o;
1290
p->readcallback = Py_None; Py_INCREF(p->readcallback);
1291
p->writecallback = Py_None; Py_INCREF(p->writecallback);
1292
p->connectcallback = Py_None; Py_INCREF(p->connectcallback);
1293
p->reading = Py_None; Py_INCREF(p->reading);
1294
p->writing = Py_None; Py_INCREF(p->writing);
1295
if (__pyx_f_9cfsupport_10PyCFSocket___new__(o, a, k) < 0) {
1296
Py_DECREF(o); o = 0;
1301
static void __pyx_tp_dealloc_9cfsupport_PyCFSocket(PyObject *o) {
1302
struct __pyx_obj_9cfsupport_PyCFSocket *p = (struct __pyx_obj_9cfsupport_PyCFSocket *)o;
1304
PyObject *etype, *eval, *etb;
1305
PyErr_Fetch(&etype, &eval, &etb);
1307
__pyx_f_9cfsupport_10PyCFSocket___dealloc__(o);
1308
if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
1310
PyErr_Restore(etype, eval, etb);
1312
Py_XDECREF(p->readcallback);
1313
Py_XDECREF(p->writecallback);
1314
Py_XDECREF(p->connectcallback);
1315
Py_XDECREF(p->reading);
1316
Py_XDECREF(p->writing);
1317
(*o->ob_type->tp_free)(o);
1320
static int __pyx_tp_traverse_9cfsupport_PyCFSocket(PyObject *o, visitproc v, void *a) {
1322
struct __pyx_obj_9cfsupport_PyCFSocket *p = (struct __pyx_obj_9cfsupport_PyCFSocket *)o;
1323
if (p->readcallback) {
1324
e = (*v)(p->readcallback, a); if (e) return e;
1326
if (p->writecallback) {
1327
e = (*v)(p->writecallback, a); if (e) return e;
1329
if (p->connectcallback) {
1330
e = (*v)(p->connectcallback, a); if (e) return e;
1333
e = (*v)(p->reading, a); if (e) return e;
1336
e = (*v)(p->writing, a); if (e) return e;
1341
static int __pyx_tp_clear_9cfsupport_PyCFSocket(PyObject *o) {
1342
struct __pyx_obj_9cfsupport_PyCFSocket *p = (struct __pyx_obj_9cfsupport_PyCFSocket *)o;
1343
Py_XDECREF(p->readcallback);
1344
p->readcallback = Py_None; Py_INCREF(p->readcallback);
1345
Py_XDECREF(p->writecallback);
1346
p->writecallback = Py_None; Py_INCREF(p->writecallback);
1347
Py_XDECREF(p->connectcallback);
1348
p->connectcallback = Py_None; Py_INCREF(p->connectcallback);
1349
Py_XDECREF(p->reading);
1350
p->reading = Py_None; Py_INCREF(p->reading);
1351
Py_XDECREF(p->writing);
1352
p->writing = Py_None; Py_INCREF(p->writing);
1356
static struct PyMethodDef __pyx_methods_9cfsupport_PyCFSocket[] = {
1357
{"update", (PyCFunction)__pyx_f_9cfsupport_10PyCFSocket_update, METH_VARARGS|METH_KEYWORDS, 0},
1358
{"startReading", (PyCFunction)__pyx_f_9cfsupport_10PyCFSocket_startReading, METH_VARARGS|METH_KEYWORDS, 0},
1359
{"stopReading", (PyCFunction)__pyx_f_9cfsupport_10PyCFSocket_stopReading, METH_VARARGS|METH_KEYWORDS, 0},
1360
{"startWriting", (PyCFunction)__pyx_f_9cfsupport_10PyCFSocket_startWriting, METH_VARARGS|METH_KEYWORDS, 0},
1361
{"stopWriting", (PyCFunction)__pyx_f_9cfsupport_10PyCFSocket_stopWriting, METH_VARARGS|METH_KEYWORDS, 0},
1365
static struct PyMemberDef __pyx_members_9cfsupport_PyCFSocket[] = {
1366
{"readcallback", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFSocket, readcallback), 0, 0},
1367
{"writecallback", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFSocket, writecallback), 0, 0},
1368
{"connectcallback", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFSocket, connectcallback), 0, 0},
1369
{"reading", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFSocket, reading), 0, 0},
1370
{"writing", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFSocket, writing), 0, 0},
1371
{"fileno", T_INT, offsetof(struct __pyx_obj_9cfsupport_PyCFSocket, fileno), READONLY, 0},
1375
static PyNumberMethods __pyx_tp_as_number_PyCFSocket = {
1399
0, /*nb_inplace_add*/
1400
0, /*nb_inplace_subtract*/
1401
0, /*nb_inplace_multiply*/
1402
0, /*nb_inplace_divide*/
1403
0, /*nb_inplace_remainder*/
1404
0, /*nb_inplace_power*/
1405
0, /*nb_inplace_lshift*/
1406
0, /*nb_inplace_rshift*/
1407
0, /*nb_inplace_and*/
1408
0, /*nb_inplace_xor*/
1409
0, /*nb_inplace_or*/
1410
0, /*nb_floor_divide*/
1411
0, /*nb_true_divide*/
1412
0, /*nb_inplace_floor_divide*/
1413
0, /*nb_inplace_true_divide*/
1416
static PySequenceMethods __pyx_tp_as_sequence_PyCFSocket = {
1425
0, /*sq_inplace_concat*/
1426
0, /*sq_inplace_repeat*/
1429
static PyMappingMethods __pyx_tp_as_mapping_PyCFSocket = {
1432
0, /*mp_ass_subscript*/
1435
static PyBufferProcs __pyx_tp_as_buffer_PyCFSocket = {
1436
0, /*bf_getreadbuffer*/
1437
0, /*bf_getwritebuffer*/
1438
0, /*bf_getsegcount*/
1439
0, /*bf_getcharbuffer*/
1442
statichere PyTypeObject __pyx_type_9cfsupport_PyCFSocket = {
1443
PyObject_HEAD_INIT(0)
1445
"cfsupport.PyCFSocket", /*tp_name*/
1446
sizeof(struct __pyx_obj_9cfsupport_PyCFSocket), /*tp_basicsize*/
1448
__pyx_tp_dealloc_9cfsupport_PyCFSocket, /*tp_dealloc*/
1454
&__pyx_tp_as_number_PyCFSocket, /*tp_as_number*/
1455
&__pyx_tp_as_sequence_PyCFSocket, /*tp_as_sequence*/
1456
&__pyx_tp_as_mapping_PyCFSocket, /*tp_as_mapping*/
1462
&__pyx_tp_as_buffer_PyCFSocket, /*tp_as_buffer*/
1463
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
1465
__pyx_tp_traverse_9cfsupport_PyCFSocket, /*tp_traverse*/
1466
__pyx_tp_clear_9cfsupport_PyCFSocket, /*tp_clear*/
1467
0, /*tp_richcompare*/
1468
0, /*tp_weaklistoffset*/
1471
__pyx_methods_9cfsupport_PyCFSocket, /*tp_methods*/
1472
__pyx_members_9cfsupport_PyCFSocket, /*tp_members*/
1478
0, /*tp_dictoffset*/
1481
__pyx_tp_new_9cfsupport_PyCFSocket, /*tp_new*/
1487
0, /*tp_subclasses*/
1491
static PyObject *__pyx_tp_new_9cfsupport_PyCFRunLoopTimer(PyTypeObject *t, PyObject *a, PyObject *k) {
1492
PyObject *o = (*t->tp_alloc)(t, 0);
1493
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *p = (struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)o;
1494
p->callout = Py_None; Py_INCREF(p->callout);
1495
if (__pyx_f_9cfsupport_16PyCFRunLoopTimer___new__(o, a, k) < 0) {
1496
Py_DECREF(o); o = 0;
1501
static void __pyx_tp_dealloc_9cfsupport_PyCFRunLoopTimer(PyObject *o) {
1502
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *p = (struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)o;
1504
PyObject *etype, *eval, *etb;
1505
PyErr_Fetch(&etype, &eval, &etb);
1507
__pyx_f_9cfsupport_16PyCFRunLoopTimer___dealloc__(o);
1508
if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
1510
PyErr_Restore(etype, eval, etb);
1512
Py_XDECREF(p->callout);
1513
(*o->ob_type->tp_free)(o);
1516
static int __pyx_tp_traverse_9cfsupport_PyCFRunLoopTimer(PyObject *o, visitproc v, void *a) {
1518
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *p = (struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)o;
1520
e = (*v)(p->callout, a); if (e) return e;
1525
static int __pyx_tp_clear_9cfsupport_PyCFRunLoopTimer(PyObject *o) {
1526
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *p = (struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)o;
1527
Py_XDECREF(p->callout);
1528
p->callout = Py_None; Py_INCREF(p->callout);
1532
static struct PyMethodDef __pyx_methods_9cfsupport_PyCFRunLoopTimer[] = {
1533
{"getNextFireDate", (PyCFunction)__pyx_f_9cfsupport_16PyCFRunLoopTimer_getNextFireDate, METH_VARARGS|METH_KEYWORDS, 0},
1534
{"setNextFireDate", (PyCFunction)__pyx_f_9cfsupport_16PyCFRunLoopTimer_setNextFireDate, METH_VARARGS|METH_KEYWORDS, 0},
1535
{"invalidate", (PyCFunction)__pyx_f_9cfsupport_16PyCFRunLoopTimer_invalidate, METH_VARARGS|METH_KEYWORDS, 0},
1539
static struct PyMemberDef __pyx_members_9cfsupport_PyCFRunLoopTimer[] = {
1540
{"callout", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFRunLoopTimer, callout), 0, 0},
1544
static PyNumberMethods __pyx_tp_as_number_PyCFRunLoopTimer = {
1568
0, /*nb_inplace_add*/
1569
0, /*nb_inplace_subtract*/
1570
0, /*nb_inplace_multiply*/
1571
0, /*nb_inplace_divide*/
1572
0, /*nb_inplace_remainder*/
1573
0, /*nb_inplace_power*/
1574
0, /*nb_inplace_lshift*/
1575
0, /*nb_inplace_rshift*/
1576
0, /*nb_inplace_and*/
1577
0, /*nb_inplace_xor*/
1578
0, /*nb_inplace_or*/
1579
0, /*nb_floor_divide*/
1580
0, /*nb_true_divide*/
1581
0, /*nb_inplace_floor_divide*/
1582
0, /*nb_inplace_true_divide*/
1585
static PySequenceMethods __pyx_tp_as_sequence_PyCFRunLoopTimer = {
1594
0, /*sq_inplace_concat*/
1595
0, /*sq_inplace_repeat*/
1598
static PyMappingMethods __pyx_tp_as_mapping_PyCFRunLoopTimer = {
1601
0, /*mp_ass_subscript*/
1604
static PyBufferProcs __pyx_tp_as_buffer_PyCFRunLoopTimer = {
1605
0, /*bf_getreadbuffer*/
1606
0, /*bf_getwritebuffer*/
1607
0, /*bf_getsegcount*/
1608
0, /*bf_getcharbuffer*/
1611
statichere PyTypeObject __pyx_type_9cfsupport_PyCFRunLoopTimer = {
1612
PyObject_HEAD_INIT(0)
1614
"cfsupport.PyCFRunLoopTimer", /*tp_name*/
1615
sizeof(struct __pyx_obj_9cfsupport_PyCFRunLoopTimer), /*tp_basicsize*/
1617
__pyx_tp_dealloc_9cfsupport_PyCFRunLoopTimer, /*tp_dealloc*/
1623
&__pyx_tp_as_number_PyCFRunLoopTimer, /*tp_as_number*/
1624
&__pyx_tp_as_sequence_PyCFRunLoopTimer, /*tp_as_sequence*/
1625
&__pyx_tp_as_mapping_PyCFRunLoopTimer, /*tp_as_mapping*/
1631
&__pyx_tp_as_buffer_PyCFRunLoopTimer, /*tp_as_buffer*/
1632
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
1634
__pyx_tp_traverse_9cfsupport_PyCFRunLoopTimer, /*tp_traverse*/
1635
__pyx_tp_clear_9cfsupport_PyCFRunLoopTimer, /*tp_clear*/
1636
0, /*tp_richcompare*/
1637
0, /*tp_weaklistoffset*/
1640
__pyx_methods_9cfsupport_PyCFRunLoopTimer, /*tp_methods*/
1641
__pyx_members_9cfsupport_PyCFRunLoopTimer, /*tp_members*/
1647
0, /*tp_dictoffset*/
1650
__pyx_tp_new_9cfsupport_PyCFRunLoopTimer, /*tp_new*/
1656
0, /*tp_subclasses*/
1660
static PyObject *__pyx_tp_new_9cfsupport_PyCFRunLoop(PyTypeObject *t, PyObject *a, PyObject *k) {
1661
PyObject *o = (*t->tp_alloc)(t, 0);
1662
struct __pyx_obj_9cfsupport_PyCFRunLoop *p = (struct __pyx_obj_9cfsupport_PyCFRunLoop *)o;
1663
p->cf = Py_None; Py_INCREF(p->cf);
1664
if (__pyx_f_9cfsupport_11PyCFRunLoop___new__(o, a, k) < 0) {
1665
Py_DECREF(o); o = 0;
1670
static void __pyx_tp_dealloc_9cfsupport_PyCFRunLoop(PyObject *o) {
1671
struct __pyx_obj_9cfsupport_PyCFRunLoop *p = (struct __pyx_obj_9cfsupport_PyCFRunLoop *)o;
1673
(*o->ob_type->tp_free)(o);
1676
static int __pyx_tp_traverse_9cfsupport_PyCFRunLoop(PyObject *o, visitproc v, void *a) {
1678
struct __pyx_obj_9cfsupport_PyCFRunLoop *p = (struct __pyx_obj_9cfsupport_PyCFRunLoop *)o;
1680
e = (*v)(p->cf, a); if (e) return e;
1685
static int __pyx_tp_clear_9cfsupport_PyCFRunLoop(PyObject *o) {
1686
struct __pyx_obj_9cfsupport_PyCFRunLoop *p = (struct __pyx_obj_9cfsupport_PyCFRunLoop *)o;
1688
p->cf = Py_None; Py_INCREF(p->cf);
1692
static struct PyMethodDef __pyx_methods_9cfsupport_PyCFRunLoop[] = {
1693
{"run", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_run, METH_VARARGS|METH_KEYWORDS, 0},
1694
{"stop", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_stop, METH_VARARGS|METH_KEYWORDS, 0},
1695
{"currentMode", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_currentMode, METH_VARARGS|METH_KEYWORDS, 0},
1696
{"addSocket", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_addSocket, METH_VARARGS|METH_KEYWORDS, 0},
1697
{"removeSocket", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_removeSocket, METH_VARARGS|METH_KEYWORDS, 0},
1698
{"addTimer", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_addTimer, METH_VARARGS|METH_KEYWORDS, 0},
1699
{"removeTimer", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_removeTimer, METH_VARARGS|METH_KEYWORDS, 0},
1703
static struct PyMemberDef __pyx_members_9cfsupport_PyCFRunLoop[] = {
1704
{"cf", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFRunLoop, cf), 0, 0},
1708
static PyNumberMethods __pyx_tp_as_number_PyCFRunLoop = {
1732
0, /*nb_inplace_add*/
1733
0, /*nb_inplace_subtract*/
1734
0, /*nb_inplace_multiply*/
1735
0, /*nb_inplace_divide*/
1736
0, /*nb_inplace_remainder*/
1737
0, /*nb_inplace_power*/
1738
0, /*nb_inplace_lshift*/
1739
0, /*nb_inplace_rshift*/
1740
0, /*nb_inplace_and*/
1741
0, /*nb_inplace_xor*/
1742
0, /*nb_inplace_or*/
1743
0, /*nb_floor_divide*/
1744
0, /*nb_true_divide*/
1745
0, /*nb_inplace_floor_divide*/
1746
0, /*nb_inplace_true_divide*/
1749
static PySequenceMethods __pyx_tp_as_sequence_PyCFRunLoop = {
1758
0, /*sq_inplace_concat*/
1759
0, /*sq_inplace_repeat*/
1762
static PyMappingMethods __pyx_tp_as_mapping_PyCFRunLoop = {
1765
0, /*mp_ass_subscript*/
1768
static PyBufferProcs __pyx_tp_as_buffer_PyCFRunLoop = {
1769
0, /*bf_getreadbuffer*/
1770
0, /*bf_getwritebuffer*/
1771
0, /*bf_getsegcount*/
1772
0, /*bf_getcharbuffer*/
1775
statichere PyTypeObject __pyx_type_9cfsupport_PyCFRunLoop = {
1776
PyObject_HEAD_INIT(0)
1778
"cfsupport.PyCFRunLoop", /*tp_name*/
1779
sizeof(struct __pyx_obj_9cfsupport_PyCFRunLoop), /*tp_basicsize*/
1781
__pyx_tp_dealloc_9cfsupport_PyCFRunLoop, /*tp_dealloc*/
1787
&__pyx_tp_as_number_PyCFRunLoop, /*tp_as_number*/
1788
&__pyx_tp_as_sequence_PyCFRunLoop, /*tp_as_sequence*/
1789
&__pyx_tp_as_mapping_PyCFRunLoop, /*tp_as_mapping*/
1795
&__pyx_tp_as_buffer_PyCFRunLoop, /*tp_as_buffer*/
1796
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
1798
__pyx_tp_traverse_9cfsupport_PyCFRunLoop, /*tp_traverse*/
1799
__pyx_tp_clear_9cfsupport_PyCFRunLoop, /*tp_clear*/
1800
0, /*tp_richcompare*/
1801
0, /*tp_weaklistoffset*/
1804
__pyx_methods_9cfsupport_PyCFRunLoop, /*tp_methods*/
1805
__pyx_members_9cfsupport_PyCFRunLoop, /*tp_members*/
1811
0, /*tp_dictoffset*/
1814
__pyx_tp_new_9cfsupport_PyCFRunLoop, /*tp_new*/
1820
0, /*tp_subclasses*/
1824
static struct PyMethodDef __pyx_methods[] = {
1825
{"now", (PyCFunction)__pyx_f_9cfsupport_now, METH_VARARGS|METH_KEYWORDS, 0},
1829
DL_EXPORT(void) initcfsupport(void); /*proto*/
1830
DL_EXPORT(void) initcfsupport(void) {
1831
PyObject *__pyx_1 = 0;
1832
__pyx_m = Py_InitModule4("cfsupport", __pyx_methods, 0, 0, PYTHON_API_VERSION);
1833
if (!__pyx_m) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; goto __pyx_L1;};
1834
__pyx_b = PyImport_AddModule("__builtin__");
1835
if (!__pyx_b) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; goto __pyx_L1;};
1836
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; goto __pyx_L1;};
1837
if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; goto __pyx_L1;};
1838
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; goto __pyx_L1;};
1839
__pyx_type_9cfsupport_PyCFSocket.tp_free = _PyObject_GC_Del;
1840
if (PyType_Ready(&__pyx_type_9cfsupport_PyCFSocket) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; goto __pyx_L1;}
1841
if (PyObject_SetAttrString(__pyx_m, "PyCFSocket", (PyObject *)&__pyx_type_9cfsupport_PyCFSocket) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; goto __pyx_L1;}
1842
__pyx_ptype_9cfsupport_PyCFSocket = &__pyx_type_9cfsupport_PyCFSocket;
1843
__pyx_type_9cfsupport_PyCFRunLoopTimer.tp_free = _PyObject_GC_Del;
1844
if (PyType_Ready(&__pyx_type_9cfsupport_PyCFRunLoopTimer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; goto __pyx_L1;}
1845
if (PyObject_SetAttrString(__pyx_m, "PyCFRunLoopTimer", (PyObject *)&__pyx_type_9cfsupport_PyCFRunLoopTimer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; goto __pyx_L1;}
1846
__pyx_ptype_9cfsupport_PyCFRunLoopTimer = &__pyx_type_9cfsupport_PyCFRunLoopTimer;
1847
__pyx_type_9cfsupport_PyCFRunLoop.tp_free = _PyObject_GC_Del;
1848
if (PyType_Ready(&__pyx_type_9cfsupport_PyCFRunLoop) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; goto __pyx_L1;}
1849
if (PyObject_SetAttrString(__pyx_m, "PyCFRunLoop", (PyObject *)&__pyx_type_9cfsupport_PyCFRunLoop) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; goto __pyx_L1;}
1850
__pyx_ptype_9cfsupport_PyCFRunLoop = &__pyx_type_9cfsupport_PyCFRunLoop;
1852
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":1 */
1853
__pyx_1 = __Pyx_Import(__pyx_n_traceback, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; goto __pyx_L1;}
1854
if (PyObject_SetAttr(__pyx_m, __pyx_n_traceback, __pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; goto __pyx_L1;}
1855
Py_DECREF(__pyx_1); __pyx_1 = 0;
1857
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":45 */
1865
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":1 */
1866
__pyx_1 = __Pyx_Import(__pyx_n_traceback, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; goto __pyx_L1;}
1867
if (PyObject_SetAttr(__pyx_m, __pyx_n_traceback, __pyx_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; goto __pyx_L1;}
1868
Py_DECREF(__pyx_1); __pyx_1 = 0;
1870
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":52 */
1874
/* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsupport.pyx":6 */
1875
if (PyObject_SetAttr(__pyx_m, __pyx_n___version__, __pyx_k7p) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 6; goto __pyx_L1;}
1878
Py_XDECREF(__pyx_1);
1879
__Pyx_AddTraceback("cfsupport");
1882
static char *__pyx_filenames[] = {
1888
statichere char **__pyx_f = __pyx_filenames;
1890
/* Runtime support code */
1892
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name) {
1894
PyErr_Format(PyExc_SystemError, "Missing type object");
1897
if ((none_allowed && obj == Py_None) || PyObject_TypeCheck(obj, type))
1899
PyErr_Format(PyExc_TypeError,
1900
"Argument '%s' has incorrect type (expected %s, got %s)",
1901
name, type->tp_name, obj->ob_type->tp_name);
1905
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
1906
PyObject *__import__ = 0;
1907
PyObject *empty_list = 0;
1908
PyObject *module = 0;
1909
PyObject *global_dict = 0;
1910
PyObject *empty_dict = 0;
1912
__import__ = PyObject_GetAttrString(__pyx_b, "__import__");
1918
empty_list = PyList_New(0);
1923
global_dict = PyModule_GetDict(__pyx_m);
1926
empty_dict = PyDict_New();
1929
module = PyObject_CallFunction(__import__, "OOOO",
1930
name, global_dict, empty_dict, list);
1932
Py_XDECREF(empty_list);
1933
Py_XDECREF(__import__);
1934
Py_XDECREF(empty_dict);
1938
static PyObject *__Pyx_GetExcValue(void) {
1939
PyObject *type = 0, *value = 0, *tb = 0;
1940
PyObject *result = 0;
1941
PyThreadState *tstate = PyThreadState_Get();
1942
PyErr_Fetch(&type, &value, &tb);
1943
PyErr_NormalizeException(&type, &value, &tb);
1944
if (PyErr_Occurred())
1950
Py_XDECREF(tstate->exc_type);
1951
Py_XDECREF(tstate->exc_value);
1952
Py_XDECREF(tstate->exc_traceback);
1953
tstate->exc_type = type;
1954
tstate->exc_value = value;
1955
tstate->exc_traceback = tb;
1968
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
1970
result = PyObject_GetAttr(dict, name);
1972
PyErr_SetObject(PyExc_NameError, name);
1976
static void __Pyx_WriteUnraisable(char *name) {
1977
PyObject *old_exc, *old_val, *old_tb;
1979
PyErr_Fetch(&old_exc, &old_val, &old_tb);
1980
ctx = PyString_FromString(name);
1981
PyErr_Restore(old_exc, old_val, old_tb);
1984
PyErr_WriteUnraisable(ctx);
1987
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
1991
/* First, check the traceback argument, replacing None with NULL. */
1992
if (tb == Py_None) {
1996
else if (tb != NULL && !PyTraceBack_Check(tb)) {
1997
PyErr_SetString(PyExc_TypeError,
1998
"raise: arg 3 must be a traceback or None");
2001
/* Next, replace a missing value with None */
2002
if (value == NULL) {
2006
/* Next, repeatedly, replace a tuple exception with its first item */
2007
while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {
2008
PyObject *tmp = type;
2009
type = PyTuple_GET_ITEM(type, 0);
2013
if (PyString_Check(type))
2015
else if (PyClass_Check(type))
2016
; /*PyErr_NormalizeException(&type, &value, &tb);*/
2017
else if (PyInstance_Check(type)) {
2018
/* Raising an instance. The value should be a dummy. */
2019
if (value != Py_None) {
2020
PyErr_SetString(PyExc_TypeError,
2021
"instance exception may not have a separate value");
2025
/* Normalize to raise <class>, <instance> */
2028
type = (PyObject*) ((PyInstanceObject*)type)->in_class;
2033
/* Not something you can raise. You get an exception
2034
anyway, just not what you specified :-) */
2035
PyErr_Format(PyExc_TypeError,
2036
"exceptions must be strings, classes, or "
2037
"instances, not %s", type->ob_type->tp_name);
2040
PyErr_Restore(type, value, tb);
2049
static void __Pyx_ReRaise(void) {
2050
PyThreadState *tstate = PyThreadState_Get();
2051
PyObject *type = tstate->exc_type;
2052
PyObject *value = tstate->exc_value;
2053
PyObject *tb = tstate->exc_traceback;
2057
PyErr_Restore(type, value, tb);
2060
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
2062
*t->p = PyString_InternFromString(t->s);
2070
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
2072
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
2080
#include "compile.h"
2081
#include "frameobject.h"
2082
#include "traceback.h"
2084
static void __Pyx_AddTraceback(char *funcname) {
2085
PyObject *py_srcfile = 0;
2086
PyObject *py_funcname = 0;
2087
PyObject *py_globals = 0;
2088
PyObject *empty_tuple = 0;
2089
PyObject *empty_string = 0;
2090
PyCodeObject *py_code = 0;
2091
PyFrameObject *py_frame = 0;
2093
py_srcfile = PyString_FromString(__pyx_filename);
2094
if (!py_srcfile) goto bad;
2095
py_funcname = PyString_FromString(funcname);
2096
if (!py_funcname) goto bad;
2097
py_globals = PyModule_GetDict(__pyx_m);
2098
if (!py_globals) goto bad;
2099
empty_tuple = PyTuple_New(0);
2100
if (!empty_tuple) goto bad;
2101
empty_string = PyString_FromString("");
2102
if (!empty_string) goto bad;
2103
py_code = PyCode_New(
2104
0, /*int argcount,*/
2106
0, /*int stacksize,*/
2108
empty_string, /*PyObject *code,*/
2109
empty_tuple, /*PyObject *consts,*/
2110
empty_tuple, /*PyObject *names,*/
2111
empty_tuple, /*PyObject *varnames,*/
2112
empty_tuple, /*PyObject *freevars,*/
2113
empty_tuple, /*PyObject *cellvars,*/
2114
py_srcfile, /*PyObject *filename,*/
2115
py_funcname, /*PyObject *name,*/
2116
__pyx_lineno, /*int firstlineno,*/
2117
empty_string /*PyObject *lnotab*/
2119
if (!py_code) goto bad;
2120
py_frame = PyFrame_New(
2121
PyThreadState_Get(), /*PyThreadState *tstate,*/
2122
py_code, /*PyCodeObject *code,*/
2123
py_globals, /*PyObject *globals,*/
2124
0 /*PyObject *locals*/
2126
if (!py_frame) goto bad;
2127
py_frame->f_lineno = __pyx_lineno;
2128
PyTraceBack_Here(py_frame);
2130
Py_XDECREF(py_srcfile);
2131
Py_XDECREF(py_funcname);
2132
Py_XDECREF(empty_tuple);
2133
Py_XDECREF(empty_string);
2134
Py_XDECREF(py_code);
2135
Py_XDECREF(py_frame);