| OLD | NEW |
| (Empty) |
| 1 /* Generated by Pyrex 0.9.3 on Sat Mar 12 04:43:18 2005 */ | |
| 2 | |
| 3 #include "Python.h" | |
| 4 #include "structmember.h" | |
| 5 #ifndef PY_LONG_LONG | |
| 6 #define PY_LONG_LONG LONG_LONG | |
| 7 #endif | |
| 8 #include "pymactoolbox.h" | |
| 9 | |
| 10 | |
| 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 *na
me, 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*/ | |
| 33 | |
| 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; | |
| 39 | |
| 40 /* Declarations from cfsupport */ | |
| 41 | |
| 42 staticforward PyTypeObject __pyx_type_9cfsupport_PyCFSocket; | |
| 43 | |
| 44 struct __pyx_obj_9cfsupport_PyCFSocket { | |
| 45 PyObject_HEAD | |
| 46 PyObject *readcallback; | |
| 47 PyObject *writecallback; | |
| 48 PyObject *connectcallback; | |
| 49 PyObject *reading; | |
| 50 PyObject *writing; | |
| 51 CFSocketRef cf; | |
| 52 CFRunLoopSourceRef source; | |
| 53 CFSocketNativeHandle fileno; | |
| 54 CFSocketContext context; | |
| 55 }; | |
| 56 | |
| 57 staticforward PyTypeObject __pyx_type_9cfsupport_PyCFRunLoopTimer; | |
| 58 | |
| 59 struct __pyx_obj_9cfsupport_PyCFRunLoopTimer { | |
| 60 PyObject_HEAD | |
| 61 CFRunLoopTimerRef cf; | |
| 62 PyObject *callout; | |
| 63 CFRunLoopTimerContext context; | |
| 64 }; | |
| 65 | |
| 66 staticforward PyTypeObject __pyx_type_9cfsupport_PyCFRunLoop; | |
| 67 | |
| 68 struct __pyx_obj_9cfsupport_PyCFRunLoop { | |
| 69 PyObject_HEAD | |
| 70 PyObject *cf; | |
| 71 }; | |
| 72 | |
| 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 ,CFSocketCallBackT
ype ,CFDataRef ,void (*),void (*))); /*proto*/ | |
| 82 static void (__pyx_f_9cfsupport_runLoopTimerCallBack(CFRunLoopTimerRef ,void (*)
)); /*proto*/ | |
| 83 static void (__pyx_f_9cfsupport_gilRunLoopTimerCallBack(CFRunLoopTimerRef ,void
(*))); /*proto*/ | |
| 84 | |
| 85 /* Implementation of cfsupport */ | |
| 86 | |
| 87 static char (__pyx_k7[]) = "0.4"; | |
| 88 | |
| 89 static PyObject *__pyx_n_now; | |
| 90 static PyObject *__pyx_n_traceback; | |
| 91 static PyObject *__pyx_n___version__; | |
| 92 | |
| 93 static PyObject *__pyx_k7p; | |
| 94 | |
| 95 static PyObject *__pyx_f_9cfsupport_now(PyObject *__pyx_self, PyObject *__pyx_ar
gs, PyObject *__pyx_kwds); /*proto*/ | |
| 96 static PyObject *__pyx_f_9cfsupport_now(PyObject *__pyx_self, PyObject *__pyx_ar
gs, PyObject *__pyx_kwds) { | |
| 97 PyObject *__pyx_r; | |
| 98 PyObject *__pyx_1 = 0; | |
| 99 static char *__pyx_argnames[] = {0}; | |
| 100 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames))
return 0; | |
| 101 | |
| 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;} | |
| 104 __pyx_r = __pyx_1; | |
| 105 __pyx_1 = 0; | |
| 106 goto __pyx_L0; | |
| 107 | |
| 108 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 109 goto __pyx_L0; | |
| 110 __pyx_L1:; | |
| 111 Py_XDECREF(__pyx_1); | |
| 112 __Pyx_AddTraceback("cfsupport.now"); | |
| 113 __pyx_r = 0; | |
| 114 __pyx_L0:; | |
| 115 return __pyx_r; | |
| 116 } | |
| 117 | |
| 118 static PyObject *__pyx_n_print_exc; | |
| 119 | |
| 120 static void __pyx_f_9cfsupport_socketCallBack(CFSocketRef __pyx_v_s,CFSocketCall
BackType __pyx_v__type,CFDataRef __pyx_v_address,void (*__pyx_v_data),void (*__p
yx_v_info)) { | |
| 121 struct __pyx_obj_9cfsupport_PyCFSocket *__pyx_v_socket; | |
| 122 int __pyx_v_res; | |
| 123 int __pyx_v_mask; | |
| 124 PyObject *__pyx_1 = 0; | |
| 125 int __pyx_2; | |
| 126 PyObject *__pyx_3 = 0; | |
| 127 PyObject *__pyx_4 = 0; | |
| 128 ((PyObject*)__pyx_v_socket) = Py_None; Py_INCREF(((PyObject*)__pyx_v_socket)); | |
| 129 | |
| 130 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":9 */ | |
| 131 __pyx_1 = (PyObject *)__pyx_v_info; | |
| 132 Py_INCREF(__pyx_1); | |
| 133 Py_DECREF(((PyObject *)__pyx_v_socket)); | |
| 134 ((PyObject *)__pyx_v_socket) = __pyx_1; | |
| 135 __pyx_1 = 0; | |
| 136 | |
| 137 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":11 */ | |
| 138 /*try:*/ { | |
| 139 | |
| 140 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":12 *
/ | |
| 141 __pyx_2 = (__pyx_v__type == kCFSocketReadCallBack); | |
| 142 if (__pyx_2) { | |
| 143 | |
| 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;} | |
| 146 if (__pyx_2) { | |
| 147 | |
| 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; | |
| 153 goto __pyx_L5; | |
| 154 } | |
| 155 __pyx_L5:; | |
| 156 goto __pyx_L4; | |
| 157 } | |
| 158 __pyx_2 = (__pyx_v__type == kCFSocketWriteCallBack); | |
| 159 if (__pyx_2) { | |
| 160 | |
| 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;} | |
| 163 if (__pyx_2) { | |
| 164 | |
| 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); i
f (!__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; | |
| 170 goto __pyx_L6; | |
| 171 } | |
| 172 __pyx_L6:; | |
| 173 goto __pyx_L4; | |
| 174 } | |
| 175 __pyx_2 = (__pyx_v__type == kCFSocketConnectCallBack); | |
| 176 if (__pyx_2) { | |
| 177 | |
| 178 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":19
*/ | |
| 179 __pyx_2 = (__pyx_v_data == 0); | |
| 180 if (__pyx_2) { | |
| 181 | |
| 182 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":
20 */ | |
| 183 __pyx_v_res = 0; | |
| 184 goto __pyx_L7; | |
| 185 } | |
| 186 /*else*/ { | |
| 187 | |
| 188 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":
22 */ | |
| 189 __pyx_v_res = (((int (*))__pyx_v_data)[0]); | |
| 190 } | |
| 191 __pyx_L7:; | |
| 192 | |
| 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;} | |
| 195 if (__pyx_2) { | |
| 196 | |
| 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); | |
| 201 __pyx_1 = 0; | |
| 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; | |
| 205 goto __pyx_L8; | |
| 206 } | |
| 207 __pyx_L8:; | |
| 208 goto __pyx_L4; | |
| 209 } | |
| 210 __pyx_L4:; | |
| 211 } | |
| 212 goto __pyx_L3; | |
| 213 __pyx_L2:; | |
| 214 Py_XDECREF(__pyx_3); __pyx_3 = 0; | |
| 215 Py_XDECREF(__pyx_1); __pyx_1 = 0; | |
| 216 | |
| 217 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":25 */ | |
| 218 /*except:*/ { | |
| 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; | |
| 222 | |
| 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_fi
lename = __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_filena
me = __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; | |
| 232 goto __pyx_L3; | |
| 233 } | |
| 234 __pyx_L3:; | |
| 235 | |
| 236 goto __pyx_L0; | |
| 237 __pyx_L1:; | |
| 238 Py_XDECREF(__pyx_1); | |
| 239 Py_XDECREF(__pyx_3); | |
| 240 Py_XDECREF(__pyx_4); | |
| 241 __Pyx_WriteUnraisable("cfsupport.socketCallBack"); | |
| 242 __pyx_L0:; | |
| 243 Py_DECREF(__pyx_v_socket); | |
| 244 } | |
| 245 | |
| 246 static void __pyx_f_9cfsupport_gilSocketCallBack(CFSocketRef __pyx_v_s,CFSocketC
allBackType __pyx_v__type,CFDataRef __pyx_v_address,void (*__pyx_v_data),void (*
__pyx_v_info)) { | |
| 247 PyGILState_STATE __pyx_v_gil; | |
| 248 | |
| 249 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":30 */ | |
| 250 __pyx_v_gil = PyGILState_Ensure(); | |
| 251 | |
| 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,__py
x_v_data,__pyx_v_info); | |
| 254 | |
| 255 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":32 */ | |
| 256 PyGILState_Release(__pyx_v_gil); | |
| 257 | |
| 258 goto __pyx_L0; | |
| 259 __pyx_L1:; | |
| 260 __Pyx_WriteUnraisable("cfsupport.gilSocketCallBack"); | |
| 261 __pyx_L0:; | |
| 262 } | |
| 263 | |
| 264 static PyObject *__pyx_n_False; | |
| 265 static PyObject *__pyx_n_ValueError; | |
| 266 | |
| 267 static PyObject *__pyx_k8p; | |
| 268 static PyObject *__pyx_k9p; | |
| 269 | |
| 270 static char (__pyx_k8[]) = "Invalid Socket"; | |
| 271 static char (__pyx_k9[]) = "Couldn't create runloop source"; | |
| 272 | |
| 273 static int __pyx_f_9cfsupport_10PyCFSocket___new__(PyObject *__pyx_v_self, PyObj
ect *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
| 274 static int __pyx_f_9cfsupport_10PyCFSocket___new__(PyObject *__pyx_v_self, PyObj
ect *__pyx_args, PyObject *__pyx_kwds) { | |
| 275 int __pyx_v_fileno; | |
| 276 PyObject *__pyx_v_readcallback = 0; | |
| 277 PyObject *__pyx_v_writecallback = 0; | |
| 278 PyObject *__pyx_v_connectcallback = 0; | |
| 279 int __pyx_r; | |
| 280 PyObject *__pyx_1 = 0; | |
| 281 int __pyx_2; | |
| 282 PyObject *__pyx_3 = 0; | |
| 283 PyObject *__pyx_4 = 0; | |
| 284 static char *__pyx_argnames[] = {"fileno","readcallback","writecallback","conn
ectcallback",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_argnam
es, &__pyx_v_fileno, &__pyx_v_readcallback, &__pyx_v_writecallback, &__pyx_v_con
nectcallback)) 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); | |
| 293 | |
| 294 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":47 */ | |
| 295 ((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->fileno = __pyx_v_fil
eno; | |
| 296 | |
| 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)->readcallba
ck); | |
| 300 ((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->readcallback = __pyx
_v_readcallback; | |
| 301 | |
| 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)->writecallb
ack); | |
| 305 ((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writecallback = __py
x_v_writecallback; | |
| 306 | |
| 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)->connectcal
lback); | |
| 310 ((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->connectcallback = __
pyx_v_connectcallback; | |
| 311 | |
| 312 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":51 */ | |
| 313 ((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.version = 0; | |
| 314 | |
| 315 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":52 */ | |
| 316 ((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.info = ((voi
d (*))__pyx_v_self); | |
| 317 | |
| 318 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":53 */ | |
| 319 ((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.retain = 0; | |
| 320 | |
| 321 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":54 */ | |
| 322 ((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.release = 0; | |
| 323 | |
| 324 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":55 */ | |
| 325 ((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.copyDescript
ion = 0; | |
| 326 | |
| 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; | |
| 331 __pyx_1 = 0; | |
| 332 | |
| 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; | |
| 337 __pyx_1 = 0; | |
| 338 | |
| 339 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":58 */ | |
| 340 ((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf = CFSocketCreateW
ithNative(kCFAllocatorDefault,__pyx_v_fileno,((kCFSocketConnectCallBack | kCFSoc
ketReadCallBack) | kCFSocketWriteCallBack),((CFSocketCallBack )(&__pyx_f_9cfsupp
ort_gilSocketCallBack)),(&((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_sel
f)->context)); | |
| 341 | |
| 342 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":59 */ | |
| 343 __pyx_2 = (((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf == 0); | |
| 344 if (__pyx_2) { | |
| 345 | |
| 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_f
ilename = __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_filena
me = __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;} | |
| 357 goto __pyx_L2; | |
| 358 } | |
| 359 __pyx_L2:; | |
| 360 | |
| 361 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":61 */ | |
| 362 ((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->source = CFSocketCre
ateRunLoopSource(kCFAllocatorDefault,((struct __pyx_obj_9cfsupport_PyCFSocket *)
__pyx_v_self)->cf,10000); | |
| 363 | |
| 364 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":62 */ | |
| 365 __pyx_2 = (((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->source ==
0); | |
| 366 if (__pyx_2) { | |
| 367 | |
| 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_f
ilename = __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_filena
me = __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;} | |
| 379 goto __pyx_L3; | |
| 380 } | |
| 381 __pyx_L3:; | |
| 382 | |
| 383 __pyx_r = 0; | |
| 384 goto __pyx_L0; | |
| 385 __pyx_L1:; | |
| 386 Py_XDECREF(__pyx_1); | |
| 387 Py_XDECREF(__pyx_3); | |
| 388 Py_XDECREF(__pyx_4); | |
| 389 __Pyx_AddTraceback("cfsupport.PyCFSocket.__new__"); | |
| 390 __pyx_r = -1; | |
| 391 __pyx_L0:; | |
| 392 Py_DECREF(__pyx_v_self); | |
| 393 Py_DECREF(__pyx_v_readcallback); | |
| 394 Py_DECREF(__pyx_v_writecallback); | |
| 395 Py_DECREF(__pyx_v_connectcallback); | |
| 396 return __pyx_r; | |
| 397 } | |
| 398 | |
| 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) { | |
| 401 int __pyx_v_mask; | |
| 402 int __pyx_v_offmask; | |
| 403 int __pyx_v_automask; | |
| 404 PyObject *__pyx_r; | |
| 405 int __pyx_1; | |
| 406 static char *__pyx_argnames[] = {0}; | |
| 407 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames))
return 0; | |
| 408 Py_INCREF(__pyx_v_self); | |
| 409 | |
| 410 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":70 */ | |
| 411 __pyx_v_mask = (kCFSocketConnectCallBack | kCFSocketAcceptCallBack); | |
| 412 | |
| 413 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":71 */ | |
| 414 __pyx_v_offmask = 0; | |
| 415 | |
| 416 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":72 */ | |
| 417 __pyx_v_automask = kCFSocketAutomaticallyReenableAcceptCallBack; | |
| 418 | |
| 419 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":73 */ | |
| 420 __pyx_1 = PyObject_IsTrue(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_s
elf)->reading); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73
; goto __pyx_L1;} | |
| 421 if (__pyx_1) { | |
| 422 | |
| 423 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":74 *
/ | |
| 424 __pyx_v_mask = (__pyx_v_mask | kCFSocketReadCallBack); | |
| 425 | |
| 426 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":75 *
/ | |
| 427 __pyx_v_automask = (__pyx_v_automask | kCFSocketAutomaticallyReenableReadCal
lBack); | |
| 428 goto __pyx_L2; | |
| 429 } | |
| 430 /*else*/ { | |
| 431 | |
| 432 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":77 *
/ | |
| 433 __pyx_v_offmask = (__pyx_v_offmask | kCFSocketReadCallBack); | |
| 434 } | |
| 435 __pyx_L2:; | |
| 436 | |
| 437 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":78 */ | |
| 438 __pyx_1 = PyObject_IsTrue(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_s
elf)->writing); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 78
; goto __pyx_L1;} | |
| 439 if (__pyx_1) { | |
| 440 | |
| 441 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":79 *
/ | |
| 442 __pyx_v_mask = (__pyx_v_mask | kCFSocketWriteCallBack); | |
| 443 | |
| 444 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":80 *
/ | |
| 445 __pyx_v_automask = (__pyx_v_automask | kCFSocketAutomaticallyReenableWriteCa
llBack); | |
| 446 goto __pyx_L3; | |
| 447 } | |
| 448 /*else*/ { | |
| 449 | |
| 450 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":82 *
/ | |
| 451 __pyx_v_offmask = (__pyx_v_offmask | kCFSocketWriteCallBack); | |
| 452 } | |
| 453 __pyx_L3:; | |
| 454 | |
| 455 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":83 */ | |
| 456 CFSocketDisableCallBacks(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_se
lf)->cf,__pyx_v_offmask); | |
| 457 | |
| 458 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":84 */ | |
| 459 CFSocketEnableCallBacks(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_sel
f)->cf,__pyx_v_mask); | |
| 460 | |
| 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); | |
| 463 | |
| 464 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 465 goto __pyx_L0; | |
| 466 __pyx_L1:; | |
| 467 __Pyx_AddTraceback("cfsupport.PyCFSocket.update"); | |
| 468 __pyx_r = 0; | |
| 469 __pyx_L0:; | |
| 470 Py_DECREF(__pyx_v_self); | |
| 471 return __pyx_r; | |
| 472 } | |
| 473 | |
| 474 static PyObject *__pyx_n_True; | |
| 475 static PyObject *__pyx_n_update; | |
| 476 | |
| 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) { | |
| 479 PyObject *__pyx_r; | |
| 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); | |
| 486 | |
| 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; | |
| 491 __pyx_1 = 0; | |
| 492 | |
| 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_li
neno = 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; | |
| 500 | |
| 501 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 502 goto __pyx_L0; | |
| 503 __pyx_L1:; | |
| 504 Py_XDECREF(__pyx_1); | |
| 505 Py_XDECREF(__pyx_2); | |
| 506 Py_XDECREF(__pyx_3); | |
| 507 __Pyx_AddTraceback("cfsupport.PyCFSocket.startReading"); | |
| 508 __pyx_r = 0; | |
| 509 __pyx_L0:; | |
| 510 Py_DECREF(__pyx_v_self); | |
| 511 return __pyx_r; | |
| 512 } | |
| 513 | |
| 514 static PyObject *__pyx_f_9cfsupport_10PyCFSocket_stopReading(PyObject *__pyx_v_s
elf, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
| 515 static PyObject *__pyx_f_9cfsupport_10PyCFSocket_stopReading(PyObject *__pyx_v_s
elf, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
| 516 PyObject *__pyx_r; | |
| 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); | |
| 523 | |
| 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; | |
| 528 __pyx_1 = 0; | |
| 529 | |
| 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_li
neno = 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; | |
| 537 | |
| 538 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 539 goto __pyx_L0; | |
| 540 __pyx_L1:; | |
| 541 Py_XDECREF(__pyx_1); | |
| 542 Py_XDECREF(__pyx_2); | |
| 543 Py_XDECREF(__pyx_3); | |
| 544 __Pyx_AddTraceback("cfsupport.PyCFSocket.stopReading"); | |
| 545 __pyx_r = 0; | |
| 546 __pyx_L0:; | |
| 547 Py_DECREF(__pyx_v_self); | |
| 548 return __pyx_r; | |
| 549 } | |
| 550 | |
| 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) { | |
| 553 PyObject *__pyx_r; | |
| 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); | |
| 560 | |
| 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; | |
| 565 __pyx_1 = 0; | |
| 566 | |
| 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_li
neno = 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; | |
| 574 | |
| 575 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 576 goto __pyx_L0; | |
| 577 __pyx_L1:; | |
| 578 Py_XDECREF(__pyx_1); | |
| 579 Py_XDECREF(__pyx_2); | |
| 580 Py_XDECREF(__pyx_3); | |
| 581 __Pyx_AddTraceback("cfsupport.PyCFSocket.startWriting"); | |
| 582 __pyx_r = 0; | |
| 583 __pyx_L0:; | |
| 584 Py_DECREF(__pyx_v_self); | |
| 585 return __pyx_r; | |
| 586 } | |
| 587 | |
| 588 static PyObject *__pyx_f_9cfsupport_10PyCFSocket_stopWriting(PyObject *__pyx_v_s
elf, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
| 589 static PyObject *__pyx_f_9cfsupport_10PyCFSocket_stopWriting(PyObject *__pyx_v_s
elf, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
| 590 PyObject *__pyx_r; | |
| 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); | |
| 597 | |
| 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; | |
| 602 __pyx_1 = 0; | |
| 603 | |
| 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_li
neno = 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; | |
| 611 | |
| 612 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 613 goto __pyx_L0; | |
| 614 __pyx_L1:; | |
| 615 Py_XDECREF(__pyx_1); | |
| 616 Py_XDECREF(__pyx_2); | |
| 617 Py_XDECREF(__pyx_3); | |
| 618 __Pyx_AddTraceback("cfsupport.PyCFSocket.stopWriting"); | |
| 619 __pyx_r = 0; | |
| 620 __pyx_L0:; | |
| 621 Py_DECREF(__pyx_v_self); | |
| 622 return __pyx_r; | |
| 623 } | |
| 624 | |
| 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)
{ | |
| 627 int __pyx_1; | |
| 628 Py_INCREF(__pyx_v_self); | |
| 629 | |
| 630 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":106 */ | |
| 631 __pyx_1 = (((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->source !=
0); | |
| 632 if (__pyx_1) { | |
| 633 | |
| 634 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":107
*/ | |
| 635 CFRelease(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->source); | |
| 636 goto __pyx_L2; | |
| 637 } | |
| 638 __pyx_L2:; | |
| 639 | |
| 640 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":108 */ | |
| 641 __pyx_1 = (((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf != 0); | |
| 642 if (__pyx_1) { | |
| 643 | |
| 644 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":109
*/ | |
| 645 CFSocketInvalidate(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)-
>cf); | |
| 646 | |
| 647 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":110
*/ | |
| 648 CFRelease(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf); | |
| 649 goto __pyx_L3; | |
| 650 } | |
| 651 __pyx_L3:; | |
| 652 | |
| 653 goto __pyx_L0; | |
| 654 __pyx_L1:; | |
| 655 __Pyx_AddTraceback("cfsupport.PyCFSocket.__dealloc__"); | |
| 656 __pyx_L0:; | |
| 657 Py_DECREF(__pyx_v_self); | |
| 658 } | |
| 659 | |
| 660 static PyObject *__pyx_k10p; | |
| 661 | |
| 662 static char (__pyx_k10[]) = "Invalid Socket"; | |
| 663 | |
| 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; | |
| 669 int __pyx_r; | |
| 670 int __pyx_1; | |
| 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); | |
| 678 | |
| 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)->call
out); | |
| 682 ((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->callout = __py
x_v_callout; | |
| 683 | |
| 684 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":12 */ | |
| 685 ((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context.versio
n = 0; | |
| 686 | |
| 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); | |
| 689 | |
| 690 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":14 */ | |
| 691 ((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context.retain
= 0; | |
| 692 | |
| 693 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":15 */ | |
| 694 ((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context.releas
e = 0; | |
| 695 | |
| 696 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":16 */ | |
| 697 ((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context.copyDe
scription = 0; | |
| 698 | |
| 699 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":17 */ | |
| 700 ((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf = CFRunLoop
TimerCreate(kCFAllocatorDefault,__pyx_v_fireDate,__pyx_v_interval,0,0,((CFRunLoo
pTimerCallBack )(&__pyx_f_9cfsupport_gilRunLoopTimerCallBack)),(&((struct __pyx_
obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context)); | |
| 701 | |
| 702 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":18 */ | |
| 703 __pyx_1 = (((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf
== 0); | |
| 704 if (__pyx_1) { | |
| 705 | |
| 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_f
ilename = __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_filena
me = __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;} | |
| 717 goto __pyx_L2; | |
| 718 } | |
| 719 __pyx_L2:; | |
| 720 | |
| 721 __pyx_r = 0; | |
| 722 goto __pyx_L0; | |
| 723 __pyx_L1:; | |
| 724 Py_XDECREF(__pyx_2); | |
| 725 Py_XDECREF(__pyx_3); | |
| 726 Py_XDECREF(__pyx_4); | |
| 727 __Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.__new__"); | |
| 728 __pyx_r = -1; | |
| 729 __pyx_L0:; | |
| 730 Py_DECREF(__pyx_v_self); | |
| 731 Py_DECREF(__pyx_v_callout); | |
| 732 return __pyx_r; | |
| 733 } | |
| 734 | |
| 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) { | |
| 737 PyObject *__pyx_r; | |
| 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); | |
| 742 | |
| 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;} | |
| 745 __pyx_r = __pyx_1; | |
| 746 __pyx_1 = 0; | |
| 747 goto __pyx_L0; | |
| 748 | |
| 749 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 750 goto __pyx_L0; | |
| 751 __pyx_L1:; | |
| 752 Py_XDECREF(__pyx_1); | |
| 753 __Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.getNextFireDate"); | |
| 754 __pyx_r = 0; | |
| 755 __pyx_L0:; | |
| 756 Py_DECREF(__pyx_v_self); | |
| 757 return __pyx_r; | |
| 758 } | |
| 759 | |
| 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; | |
| 763 PyObject *__pyx_r; | |
| 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); | |
| 767 | |
| 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); | |
| 770 | |
| 771 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 772 goto __pyx_L0; | |
| 773 __pyx_L1:; | |
| 774 __Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.setNextFireDate"); | |
| 775 __pyx_r = 0; | |
| 776 __pyx_L0:; | |
| 777 Py_DECREF(__pyx_v_self); | |
| 778 return __pyx_r; | |
| 779 } | |
| 780 | |
| 781 static PyObject *__pyx_f_9cfsupport_16PyCFRunLoopTimer_invalidate(PyObject *__py
x_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
| 782 static PyObject *__pyx_f_9cfsupport_16PyCFRunLoopTimer_invalidate(PyObject *__py
x_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
| 783 PyObject *__pyx_r; | |
| 784 static char *__pyx_argnames[] = {0}; | |
| 785 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames))
return 0; | |
| 786 Py_INCREF(__pyx_v_self); | |
| 787 | |
| 788 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":28 */ | |
| 789 CFRunLoopTimerInvalidate(((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__py
x_v_self)->cf); | |
| 790 | |
| 791 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 792 goto __pyx_L0; | |
| 793 __pyx_L1:; | |
| 794 __Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.invalidate"); | |
| 795 __pyx_r = 0; | |
| 796 __pyx_L0:; | |
| 797 Py_DECREF(__pyx_v_self); | |
| 798 return __pyx_r; | |
| 799 } | |
| 800 | |
| 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) { | |
| 803 int __pyx_1; | |
| 804 Py_INCREF(__pyx_v_self); | |
| 805 | |
| 806 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":31 */ | |
| 807 __pyx_1 = (((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf
!= 0); | |
| 808 if (__pyx_1) { | |
| 809 | |
| 810 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":32
*/ | |
| 811 CFRelease(((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf
); | |
| 812 goto __pyx_L2; | |
| 813 } | |
| 814 __pyx_L2:; | |
| 815 | |
| 816 goto __pyx_L0; | |
| 817 __pyx_L1:; | |
| 818 __Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.__dealloc__"); | |
| 819 __pyx_L0:; | |
| 820 Py_DECREF(__pyx_v_self); | |
| 821 } | |
| 822 | |
| 823 static void __pyx_f_9cfsupport_runLoopTimerCallBack(CFRunLoopTimerRef __pyx_v_ti
mer,void (*__pyx_v_info)) { | |
| 824 struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *__pyx_v_obj; | |
| 825 PyObject *__pyx_1 = 0; | |
| 826 int __pyx_2; | |
| 827 PyObject *__pyx_3 = 0; | |
| 828 PyObject *__pyx_4 = 0; | |
| 829 ((PyObject*)__pyx_v_obj) = Py_None; Py_INCREF(((PyObject*)__pyx_v_obj)); | |
| 830 | |
| 831 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":36 */ | |
| 832 __pyx_1 = (PyObject *)__pyx_v_info; | |
| 833 Py_INCREF(__pyx_1); | |
| 834 Py_DECREF(((PyObject *)__pyx_v_obj)); | |
| 835 ((PyObject *)__pyx_v_obj) = __pyx_1; | |
| 836 __pyx_1 = 0; | |
| 837 | |
| 838 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":37 */ | |
| 839 /*try:*/ { | |
| 840 | |
| 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_fil
ename = __pyx_f[2]; __pyx_lineno = 38; goto __pyx_L2;} | |
| 843 if (__pyx_2) { | |
| 844 | |
| 845 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":3
9 */ | |
| 846 __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __py
x_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; | |
| 850 goto __pyx_L4; | |
| 851 } | |
| 852 __pyx_L4:; | |
| 853 } | |
| 854 goto __pyx_L3; | |
| 855 __pyx_L2:; | |
| 856 Py_XDECREF(__pyx_1); __pyx_1 = 0; | |
| 857 Py_XDECREF(__pyx_3); __pyx_3 = 0; | |
| 858 | |
| 859 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":40 */ | |
| 860 /*except:*/ { | |
| 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; | |
| 864 | |
| 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_fi
lename = __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_filena
me = __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; | |
| 874 goto __pyx_L3; | |
| 875 } | |
| 876 __pyx_L3:; | |
| 877 | |
| 878 goto __pyx_L0; | |
| 879 __pyx_L1:; | |
| 880 Py_XDECREF(__pyx_1); | |
| 881 Py_XDECREF(__pyx_3); | |
| 882 Py_XDECREF(__pyx_4); | |
| 883 __Pyx_WriteUnraisable("cfsupport.runLoopTimerCallBack"); | |
| 884 __pyx_L0:; | |
| 885 Py_DECREF(__pyx_v_obj); | |
| 886 } | |
| 887 | |
| 888 static void __pyx_f_9cfsupport_gilRunLoopTimerCallBack(CFRunLoopTimerRef __pyx_v
_timer,void (*__pyx_v_info)) { | |
| 889 PyGILState_STATE __pyx_v_gil; | |
| 890 | |
| 891 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":45 */ | |
| 892 __pyx_v_gil = PyGILState_Ensure(); | |
| 893 | |
| 894 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":46 */ | |
| 895 __pyx_f_9cfsupport_runLoopTimerCallBack(__pyx_v_timer,__pyx_v_info); | |
| 896 | |
| 897 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":47 */ | |
| 898 PyGILState_Release(__pyx_v_gil); | |
| 899 | |
| 900 goto __pyx_L0; | |
| 901 __pyx_L1:; | |
| 902 __Pyx_WriteUnraisable("cfsupport.gilRunLoopTimerCallBack"); | |
| 903 __pyx_L0:; | |
| 904 } | |
| 905 | |
| 906 static int __pyx_f_9cfsupport_11PyCFRunLoop___new__(PyObject *__pyx_v_self, PyOb
ject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
| 907 static int __pyx_f_9cfsupport_11PyCFRunLoop___new__(PyObject *__pyx_v_self, PyOb
ject *__pyx_args, PyObject *__pyx_kwds) { | |
| 908 PyObject *__pyx_v_runLoop = 0; | |
| 909 CFTypeRef __pyx_v__runLoop; | |
| 910 int __pyx_r; | |
| 911 int __pyx_1; | |
| 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); | |
| 918 | |
| 919 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":54 */ | |
| 920 __pyx_1 = __pyx_v_runLoop == Py_None; | |
| 921 if (__pyx_1) { | |
| 922 | |
| 923 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":55
*/ | |
| 924 __pyx_v__runLoop = CFRunLoopGetCurrent(); | |
| 925 goto __pyx_L2; | |
| 926 } | |
| 927 /*else*/ { | |
| 928 | |
| 929 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":57
*/ | |
| 930 __pyx_1 = (CFObj_Convert(__pyx_v_runLoop,(&__pyx_v__runLoop)) == 0); | |
| 931 if (__pyx_1) { | |
| 932 | |
| 933 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":5
8 */ | |
| 934 __Pyx_ReRaise(); | |
| 935 {__pyx_filename = __pyx_f[2]; __pyx_lineno = 58; goto __pyx_L1;} | |
| 936 goto __pyx_L3; | |
| 937 } | |
| 938 __pyx_L3:; | |
| 939 } | |
| 940 __pyx_L2:; | |
| 941 | |
| 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; | |
| 946 __pyx_2 = 0; | |
| 947 | |
| 948 __pyx_r = 0; | |
| 949 goto __pyx_L0; | |
| 950 __pyx_L1:; | |
| 951 Py_XDECREF(__pyx_2); | |
| 952 __Pyx_AddTraceback("cfsupport.PyCFRunLoop.__new__"); | |
| 953 __pyx_r = -1; | |
| 954 __pyx_L0:; | |
| 955 Py_DECREF(__pyx_v_self); | |
| 956 Py_DECREF(__pyx_v_runLoop); | |
| 957 return __pyx_r; | |
| 958 } | |
| 959 | |
| 960 static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_run(PyObject *__pyx_v_self, Py
Object *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
| 961 static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_run(PyObject *__pyx_v_self, Py
Object *__pyx_args, PyObject *__pyx_kwds) { | |
| 962 PyObject *__pyx_r; | |
| 963 static char *__pyx_argnames[] = {0}; | |
| 964 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames))
return 0; | |
| 965 Py_INCREF(__pyx_v_self); | |
| 966 | |
| 967 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":64 */ | |
| 968 CFRunLoopRun(); | |
| 969 | |
| 970 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 971 goto __pyx_L0; | |
| 972 __pyx_L1:; | |
| 973 __Pyx_AddTraceback("cfsupport.PyCFRunLoop.run"); | |
| 974 __pyx_r = 0; | |
| 975 __pyx_L0:; | |
| 976 Py_DECREF(__pyx_v_self); | |
| 977 return __pyx_r; | |
| 978 } | |
| 979 | |
| 980 static PyObject *__pyx_k11p; | |
| 981 | |
| 982 static char (__pyx_k11[]) = "CFRunLoopReference is invalid"; | |
| 983 | |
| 984 static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_stop(PyObject *__pyx_v_self, P
yObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
| 985 static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_stop(PyObject *__pyx_v_self, P
yObject *__pyx_args, PyObject *__pyx_kwds) { | |
| 986 CFTypeRef __pyx_v__runLoop; | |
| 987 PyObject *__pyx_r; | |
| 988 int __pyx_1; | |
| 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); | |
| 993 | |
| 994 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":68 */ | |
| 995 __pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_s
elf)->cf,(&__pyx_v__runLoop)) == 0); | |
| 996 if (__pyx_1) { | |
| 997 | |
| 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_f
ilename = __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;} | |
| 1003 goto __pyx_L2; | |
| 1004 } | |
| 1005 __pyx_L2:; | |
| 1006 | |
| 1007 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":70 */ | |
| 1008 CFRunLoopStop(__pyx_v__runLoop); | |
| 1009 | |
| 1010 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 1011 goto __pyx_L0; | |
| 1012 __pyx_L1:; | |
| 1013 Py_XDECREF(__pyx_2); | |
| 1014 __Pyx_AddTraceback("cfsupport.PyCFRunLoop.stop"); | |
| 1015 __pyx_r = 0; | |
| 1016 __pyx_L0:; | |
| 1017 Py_DECREF(__pyx_v_self); | |
| 1018 return __pyx_r; | |
| 1019 } | |
| 1020 | |
| 1021 static PyObject *__pyx_k12p; | |
| 1022 | |
| 1023 static char (__pyx_k12[]) = "CFRunLoopReference is invalid"; | |
| 1024 | |
| 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; | |
| 1029 PyObject *__pyx_r; | |
| 1030 int __pyx_1; | |
| 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); | |
| 1035 | |
| 1036 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":75 */ | |
| 1037 __pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_s
elf)->cf,(&__pyx_v__runLoop)) == 0); | |
| 1038 if (__pyx_1) { | |
| 1039 | |
| 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_f
ilename = __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;} | |
| 1045 goto __pyx_L2; | |
| 1046 } | |
| 1047 __pyx_L2:; | |
| 1048 | |
| 1049 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":77 */ | |
| 1050 __pyx_v__currentMode = CFRunLoopCopyCurrentMode(__pyx_v__runLoop); | |
| 1051 | |
| 1052 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":78 */ | |
| 1053 __pyx_1 = (__pyx_v__currentMode == 0); | |
| 1054 if (__pyx_1) { | |
| 1055 | |
| 1056 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":79
*/ | |
| 1057 Py_INCREF(Py_None); | |
| 1058 __pyx_r = Py_None; | |
| 1059 goto __pyx_L0; | |
| 1060 goto __pyx_L3; | |
| 1061 } | |
| 1062 __pyx_L3:; | |
| 1063 | |
| 1064 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":80 */ | |
| 1065 __pyx_2 = CFObj_New(__pyx_v__currentMode); if (!__pyx_2) {__pyx_filename = __p
yx_f[2]; __pyx_lineno = 80; goto __pyx_L1;} | |
| 1066 __pyx_r = __pyx_2; | |
| 1067 __pyx_2 = 0; | |
| 1068 goto __pyx_L0; | |
| 1069 | |
| 1070 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 1071 goto __pyx_L0; | |
| 1072 __pyx_L1:; | |
| 1073 Py_XDECREF(__pyx_2); | |
| 1074 __Pyx_AddTraceback("cfsupport.PyCFRunLoop.currentMode"); | |
| 1075 __pyx_r = 0; | |
| 1076 __pyx_L0:; | |
| 1077 Py_DECREF(__pyx_v_self); | |
| 1078 return __pyx_r; | |
| 1079 } | |
| 1080 | |
| 1081 static PyObject *__pyx_k13p; | |
| 1082 | |
| 1083 static char (__pyx_k13[]) = "CFRunLoopReference is invalid"; | |
| 1084 | |
| 1085 static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_addSocket(PyObject *__pyx_v_se
lf, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
| 1086 static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_addSocket(PyObject *__pyx_v_se
lf, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
| 1087 struct __pyx_obj_9cfsupport_PyCFSocket *__pyx_v_socket = 0; | |
| 1088 CFTypeRef __pyx_v__runLoop; | |
| 1089 PyObject *__pyx_r; | |
| 1090 int __pyx_1; | |
| 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_Py
CFSocket, 0, "socket")) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; goto __
pyx_L1;} | |
| 1097 | |
| 1098 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":84 */ | |
| 1099 __pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_s
elf)->cf,(&__pyx_v__runLoop)) == 0); | |
| 1100 if (__pyx_1) { | |
| 1101 | |
| 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_f
ilename = __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;} | |
| 1107 goto __pyx_L2; | |
| 1108 } | |
| 1109 __pyx_L2:; | |
| 1110 | |
| 1111 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":86 */ | |
| 1112 CFRunLoopAddSource(__pyx_v__runLoop,__pyx_v_socket->source,kCFRunLoopCommonMod
es); | |
| 1113 | |
| 1114 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 1115 goto __pyx_L0; | |
| 1116 __pyx_L1:; | |
| 1117 Py_XDECREF(__pyx_2); | |
| 1118 __Pyx_AddTraceback("cfsupport.PyCFRunLoop.addSocket"); | |
| 1119 __pyx_r = 0; | |
| 1120 __pyx_L0:; | |
| 1121 Py_DECREF(__pyx_v_self); | |
| 1122 Py_DECREF(__pyx_v_socket); | |
| 1123 return __pyx_r; | |
| 1124 } | |
| 1125 | |
| 1126 static PyObject *__pyx_k14p; | |
| 1127 | |
| 1128 static char (__pyx_k14[]) = "CFRunLoopReference is invalid"; | |
| 1129 | |
| 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; | |
| 1134 PyObject *__pyx_r; | |
| 1135 int __pyx_1; | |
| 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_Py
CFSocket, 0, "socket")) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; goto __
pyx_L1;} | |
| 1142 | |
| 1143 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":90 */ | |
| 1144 __pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_s
elf)->cf,(&__pyx_v__runLoop)) == 0); | |
| 1145 if (__pyx_1) { | |
| 1146 | |
| 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_f
ilename = __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;} | |
| 1152 goto __pyx_L2; | |
| 1153 } | |
| 1154 __pyx_L2:; | |
| 1155 | |
| 1156 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":92 */ | |
| 1157 CFRunLoopRemoveSource(__pyx_v__runLoop,__pyx_v_socket->source,kCFRunLoopCommon
Modes); | |
| 1158 | |
| 1159 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 1160 goto __pyx_L0; | |
| 1161 __pyx_L1:; | |
| 1162 Py_XDECREF(__pyx_2); | |
| 1163 __Pyx_AddTraceback("cfsupport.PyCFRunLoop.removeSocket"); | |
| 1164 __pyx_r = 0; | |
| 1165 __pyx_L0:; | |
| 1166 Py_DECREF(__pyx_v_self); | |
| 1167 Py_DECREF(__pyx_v_socket); | |
| 1168 return __pyx_r; | |
| 1169 } | |
| 1170 | |
| 1171 static PyObject *__pyx_k15p; | |
| 1172 | |
| 1173 static char (__pyx_k15[]) = "CFRunLoopReference is invalid"; | |
| 1174 | |
| 1175 static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_addTimer(PyObject *__pyx_v_sel
f, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
| 1176 static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_addTimer(PyObject *__pyx_v_sel
f, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
| 1177 struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *__pyx_v_timer = 0; | |
| 1178 CFTypeRef __pyx_v__runLoop; | |
| 1179 PyObject *__pyx_r; | |
| 1180 int __pyx_1; | |
| 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_PyC
FRunLoopTimer, 0, "timer")) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; got
o __pyx_L1;} | |
| 1187 | |
| 1188 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":96 */ | |
| 1189 __pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_s
elf)->cf,(&__pyx_v__runLoop)) == 0); | |
| 1190 if (__pyx_1) { | |
| 1191 | |
| 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_f
ilename = __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;} | |
| 1197 goto __pyx_L2; | |
| 1198 } | |
| 1199 __pyx_L2:; | |
| 1200 | |
| 1201 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":98 */ | |
| 1202 CFRunLoopAddTimer(__pyx_v__runLoop,__pyx_v_timer->cf,kCFRunLoopCommonModes); | |
| 1203 | |
| 1204 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 1205 goto __pyx_L0; | |
| 1206 __pyx_L1:; | |
| 1207 Py_XDECREF(__pyx_2); | |
| 1208 __Pyx_AddTraceback("cfsupport.PyCFRunLoop.addTimer"); | |
| 1209 __pyx_r = 0; | |
| 1210 __pyx_L0:; | |
| 1211 Py_DECREF(__pyx_v_self); | |
| 1212 Py_DECREF(__pyx_v_timer); | |
| 1213 return __pyx_r; | |
| 1214 } | |
| 1215 | |
| 1216 static PyObject *__pyx_k16p; | |
| 1217 | |
| 1218 static char (__pyx_k16[]) = "CFRunLoopReference is invalid"; | |
| 1219 | |
| 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; | |
| 1224 PyObject *__pyx_r; | |
| 1225 int __pyx_1; | |
| 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_PyC
FRunLoopTimer, 0, "timer")) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; go
to __pyx_L1;} | |
| 1232 | |
| 1233 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":102 *
/ | |
| 1234 __pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_s
elf)->cf,(&__pyx_v__runLoop)) == 0); | |
| 1235 if (__pyx_1) { | |
| 1236 | |
| 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_f
ilename = __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;} | |
| 1242 goto __pyx_L2; | |
| 1243 } | |
| 1244 __pyx_L2:; | |
| 1245 | |
| 1246 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":104 *
/ | |
| 1247 CFRunLoopRemoveTimer(__pyx_v__runLoop,__pyx_v_timer->cf,kCFRunLoopCommonModes)
; | |
| 1248 | |
| 1249 __pyx_r = Py_None; Py_INCREF(__pyx_r); | |
| 1250 goto __pyx_L0; | |
| 1251 __pyx_L1:; | |
| 1252 Py_XDECREF(__pyx_2); | |
| 1253 __Pyx_AddTraceback("cfsupport.PyCFRunLoop.removeTimer"); | |
| 1254 __pyx_r = 0; | |
| 1255 __pyx_L0:; | |
| 1256 Py_DECREF(__pyx_v_self); | |
| 1257 Py_DECREF(__pyx_v_timer); | |
| 1258 return __pyx_r; | |
| 1259 } | |
| 1260 | |
| 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"}, | |
| 1270 {0, 0} | |
| 1271 }; | |
| 1272 | |
| 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)}, | |
| 1284 {0, 0, 0} | |
| 1285 }; | |
| 1286 | |
| 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_PyCFS
ocket *)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; | |
| 1297 } | |
| 1298 return o; | |
| 1299 } | |
| 1300 | |
| 1301 static void __pyx_tp_dealloc_9cfsupport_PyCFSocket(PyObject *o) { | |
| 1302 struct __pyx_obj_9cfsupport_PyCFSocket *p = (struct __pyx_obj_9cfsupport_PyCFS
ocket *)o; | |
| 1303 { | |
| 1304 PyObject *etype, *eval, *etb; | |
| 1305 PyErr_Fetch(&etype, &eval, &etb); | |
| 1306 ++o->ob_refcnt; | |
| 1307 __pyx_f_9cfsupport_10PyCFSocket___dealloc__(o); | |
| 1308 if (PyErr_Occurred()) PyErr_WriteUnraisable(o); | |
| 1309 --o->ob_refcnt; | |
| 1310 PyErr_Restore(etype, eval, etb); | |
| 1311 } | |
| 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); | |
| 1318 } | |
| 1319 | |
| 1320 static int __pyx_tp_traverse_9cfsupport_PyCFSocket(PyObject *o, visitproc v, voi
d *a) { | |
| 1321 int e; | |
| 1322 struct __pyx_obj_9cfsupport_PyCFSocket *p = (struct __pyx_obj_9cfsupport_PyCFS
ocket *)o; | |
| 1323 if (p->readcallback) { | |
| 1324 e = (*v)(p->readcallback, a); if (e) return e; | |
| 1325 } | |
| 1326 if (p->writecallback) { | |
| 1327 e = (*v)(p->writecallback, a); if (e) return e; | |
| 1328 } | |
| 1329 if (p->connectcallback) { | |
| 1330 e = (*v)(p->connectcallback, a); if (e) return e; | |
| 1331 } | |
| 1332 if (p->reading) { | |
| 1333 e = (*v)(p->reading, a); if (e) return e; | |
| 1334 } | |
| 1335 if (p->writing) { | |
| 1336 e = (*v)(p->writing, a); if (e) return e; | |
| 1337 } | |
| 1338 return 0; | |
| 1339 } | |
| 1340 | |
| 1341 static int __pyx_tp_clear_9cfsupport_PyCFSocket(PyObject *o) { | |
| 1342 struct __pyx_obj_9cfsupport_PyCFSocket *p = (struct __pyx_obj_9cfsupport_PyCFS
ocket *)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); | |
| 1353 return 0; | |
| 1354 } | |
| 1355 | |
| 1356 static struct PyMethodDef __pyx_methods_9cfsupport_PyCFSocket[] = { | |
| 1357 {"update", (PyCFunction)__pyx_f_9cfsupport_10PyCFSocket_update, METH_VARARGS|M
ETH_KEYWORDS, 0}, | |
| 1358 {"startReading", (PyCFunction)__pyx_f_9cfsupport_10PyCFSocket_startReading, ME
TH_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, ME
TH_VARARGS|METH_KEYWORDS, 0}, | |
| 1361 {"stopWriting", (PyCFunction)__pyx_f_9cfsupport_10PyCFSocket_stopWriting, METH
_VARARGS|METH_KEYWORDS, 0}, | |
| 1362 {0, 0, 0, 0} | |
| 1363 }; | |
| 1364 | |
| 1365 static struct PyMemberDef __pyx_members_9cfsupport_PyCFSocket[] = { | |
| 1366 {"readcallback", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFSocket, re
adcallback), 0, 0}, | |
| 1367 {"writecallback", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFSocket, w
ritecallback), 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), RE
ADONLY, 0}, | |
| 1372 {0, 0, 0, 0, 0} | |
| 1373 }; | |
| 1374 | |
| 1375 static PyNumberMethods __pyx_tp_as_number_PyCFSocket = { | |
| 1376 0, /*nb_add*/ | |
| 1377 0, /*nb_subtract*/ | |
| 1378 0, /*nb_multiply*/ | |
| 1379 0, /*nb_divide*/ | |
| 1380 0, /*nb_remainder*/ | |
| 1381 0, /*nb_divmod*/ | |
| 1382 0, /*nb_power*/ | |
| 1383 0, /*nb_negative*/ | |
| 1384 0, /*nb_positive*/ | |
| 1385 0, /*nb_absolute*/ | |
| 1386 0, /*nb_nonzero*/ | |
| 1387 0, /*nb_invert*/ | |
| 1388 0, /*nb_lshift*/ | |
| 1389 0, /*nb_rshift*/ | |
| 1390 0, /*nb_and*/ | |
| 1391 0, /*nb_xor*/ | |
| 1392 0, /*nb_or*/ | |
| 1393 0, /*nb_coerce*/ | |
| 1394 0, /*nb_int*/ | |
| 1395 0, /*nb_long*/ | |
| 1396 0, /*nb_float*/ | |
| 1397 0, /*nb_oct*/ | |
| 1398 0, /*nb_hex*/ | |
| 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*/ | |
| 1414 }; | |
| 1415 | |
| 1416 static PySequenceMethods __pyx_tp_as_sequence_PyCFSocket = { | |
| 1417 0, /*sq_length*/ | |
| 1418 0, /*sq_concat*/ | |
| 1419 0, /*sq_repeat*/ | |
| 1420 0, /*sq_item*/ | |
| 1421 0, /*sq_slice*/ | |
| 1422 0, /*sq_ass_item*/ | |
| 1423 0, /*sq_ass_slice*/ | |
| 1424 0, /*sq_contains*/ | |
| 1425 0, /*sq_inplace_concat*/ | |
| 1426 0, /*sq_inplace_repeat*/ | |
| 1427 }; | |
| 1428 | |
| 1429 static PyMappingMethods __pyx_tp_as_mapping_PyCFSocket = { | |
| 1430 0, /*mp_length*/ | |
| 1431 0, /*mp_subscript*/ | |
| 1432 0, /*mp_ass_subscript*/ | |
| 1433 }; | |
| 1434 | |
| 1435 static PyBufferProcs __pyx_tp_as_buffer_PyCFSocket = { | |
| 1436 0, /*bf_getreadbuffer*/ | |
| 1437 0, /*bf_getwritebuffer*/ | |
| 1438 0, /*bf_getsegcount*/ | |
| 1439 0, /*bf_getcharbuffer*/ | |
| 1440 }; | |
| 1441 | |
| 1442 statichere PyTypeObject __pyx_type_9cfsupport_PyCFSocket = { | |
| 1443 PyObject_HEAD_INIT(0) | |
| 1444 0, /*ob_size*/ | |
| 1445 "cfsupport.PyCFSocket", /*tp_name*/ | |
| 1446 sizeof(struct __pyx_obj_9cfsupport_PyCFSocket), /*tp_basicsize*/ | |
| 1447 0, /*tp_itemsize*/ | |
| 1448 __pyx_tp_dealloc_9cfsupport_PyCFSocket, /*tp_dealloc*/ | |
| 1449 0, /*tp_print*/ | |
| 1450 0, /*tp_getattr*/ | |
| 1451 0, /*tp_setattr*/ | |
| 1452 0, /*tp_compare*/ | |
| 1453 0, /*tp_repr*/ | |
| 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*/ | |
| 1457 0, /*tp_hash*/ | |
| 1458 0, /*tp_call*/ | |
| 1459 0, /*tp_str*/ | |
| 1460 0, /*tp_getattro*/ | |
| 1461 0, /*tp_setattro*/ | |
| 1462 &__pyx_tp_as_buffer_PyCFSocket, /*tp_as_buffer*/ | |
| 1463 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_G
C, /*tp_flags*/ | |
| 1464 0, /*tp_doc*/ | |
| 1465 __pyx_tp_traverse_9cfsupport_PyCFSocket, /*tp_traverse*/ | |
| 1466 __pyx_tp_clear_9cfsupport_PyCFSocket, /*tp_clear*/ | |
| 1467 0, /*tp_richcompare*/ | |
| 1468 0, /*tp_weaklistoffset*/ | |
| 1469 0, /*tp_iter*/ | |
| 1470 0, /*tp_iternext*/ | |
| 1471 __pyx_methods_9cfsupport_PyCFSocket, /*tp_methods*/ | |
| 1472 __pyx_members_9cfsupport_PyCFSocket, /*tp_members*/ | |
| 1473 0, /*tp_getset*/ | |
| 1474 0, /*tp_base*/ | |
| 1475 0, /*tp_dict*/ | |
| 1476 0, /*tp_descr_get*/ | |
| 1477 0, /*tp_descr_set*/ | |
| 1478 0, /*tp_dictoffset*/ | |
| 1479 0, /*tp_init*/ | |
| 1480 0, /*tp_alloc*/ | |
| 1481 __pyx_tp_new_9cfsupport_PyCFSocket, /*tp_new*/ | |
| 1482 0, /*tp_free*/ | |
| 1483 0, /*tp_is_gc*/ | |
| 1484 0, /*tp_bases*/ | |
| 1485 0, /*tp_mro*/ | |
| 1486 0, /*tp_cache*/ | |
| 1487 0, /*tp_subclasses*/ | |
| 1488 0, /*tp_weaklist*/ | |
| 1489 }; | |
| 1490 | |
| 1491 static PyObject *__pyx_tp_new_9cfsupport_PyCFRunLoopTimer(PyTypeObject *t, PyObj
ect *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; | |
| 1497 } | |
| 1498 return o; | |
| 1499 } | |
| 1500 | |
| 1501 static void __pyx_tp_dealloc_9cfsupport_PyCFRunLoopTimer(PyObject *o) { | |
| 1502 struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *p = (struct __pyx_obj_9cfsupport
_PyCFRunLoopTimer *)o; | |
| 1503 { | |
| 1504 PyObject *etype, *eval, *etb; | |
| 1505 PyErr_Fetch(&etype, &eval, &etb); | |
| 1506 ++o->ob_refcnt; | |
| 1507 __pyx_f_9cfsupport_16PyCFRunLoopTimer___dealloc__(o); | |
| 1508 if (PyErr_Occurred()) PyErr_WriteUnraisable(o); | |
| 1509 --o->ob_refcnt; | |
| 1510 PyErr_Restore(etype, eval, etb); | |
| 1511 } | |
| 1512 Py_XDECREF(p->callout); | |
| 1513 (*o->ob_type->tp_free)(o); | |
| 1514 } | |
| 1515 | |
| 1516 static int __pyx_tp_traverse_9cfsupport_PyCFRunLoopTimer(PyObject *o, visitproc
v, void *a) { | |
| 1517 int e; | |
| 1518 struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *p = (struct __pyx_obj_9cfsupport
_PyCFRunLoopTimer *)o; | |
| 1519 if (p->callout) { | |
| 1520 e = (*v)(p->callout, a); if (e) return e; | |
| 1521 } | |
| 1522 return 0; | |
| 1523 } | |
| 1524 | |
| 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); | |
| 1529 return 0; | |
| 1530 } | |
| 1531 | |
| 1532 static struct PyMethodDef __pyx_methods_9cfsupport_PyCFRunLoopTimer[] = { | |
| 1533 {"getNextFireDate", (PyCFunction)__pyx_f_9cfsupport_16PyCFRunLoopTimer_getNext
FireDate, METH_VARARGS|METH_KEYWORDS, 0}, | |
| 1534 {"setNextFireDate", (PyCFunction)__pyx_f_9cfsupport_16PyCFRunLoopTimer_setNext
FireDate, METH_VARARGS|METH_KEYWORDS, 0}, | |
| 1535 {"invalidate", (PyCFunction)__pyx_f_9cfsupport_16PyCFRunLoopTimer_invalidate,
METH_VARARGS|METH_KEYWORDS, 0}, | |
| 1536 {0, 0, 0, 0} | |
| 1537 }; | |
| 1538 | |
| 1539 static struct PyMemberDef __pyx_members_9cfsupport_PyCFRunLoopTimer[] = { | |
| 1540 {"callout", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFRunLoopTimer, c
allout), 0, 0}, | |
| 1541 {0, 0, 0, 0, 0} | |
| 1542 }; | |
| 1543 | |
| 1544 static PyNumberMethods __pyx_tp_as_number_PyCFRunLoopTimer = { | |
| 1545 0, /*nb_add*/ | |
| 1546 0, /*nb_subtract*/ | |
| 1547 0, /*nb_multiply*/ | |
| 1548 0, /*nb_divide*/ | |
| 1549 0, /*nb_remainder*/ | |
| 1550 0, /*nb_divmod*/ | |
| 1551 0, /*nb_power*/ | |
| 1552 0, /*nb_negative*/ | |
| 1553 0, /*nb_positive*/ | |
| 1554 0, /*nb_absolute*/ | |
| 1555 0, /*nb_nonzero*/ | |
| 1556 0, /*nb_invert*/ | |
| 1557 0, /*nb_lshift*/ | |
| 1558 0, /*nb_rshift*/ | |
| 1559 0, /*nb_and*/ | |
| 1560 0, /*nb_xor*/ | |
| 1561 0, /*nb_or*/ | |
| 1562 0, /*nb_coerce*/ | |
| 1563 0, /*nb_int*/ | |
| 1564 0, /*nb_long*/ | |
| 1565 0, /*nb_float*/ | |
| 1566 0, /*nb_oct*/ | |
| 1567 0, /*nb_hex*/ | |
| 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*/ | |
| 1583 }; | |
| 1584 | |
| 1585 static PySequenceMethods __pyx_tp_as_sequence_PyCFRunLoopTimer = { | |
| 1586 0, /*sq_length*/ | |
| 1587 0, /*sq_concat*/ | |
| 1588 0, /*sq_repeat*/ | |
| 1589 0, /*sq_item*/ | |
| 1590 0, /*sq_slice*/ | |
| 1591 0, /*sq_ass_item*/ | |
| 1592 0, /*sq_ass_slice*/ | |
| 1593 0, /*sq_contains*/ | |
| 1594 0, /*sq_inplace_concat*/ | |
| 1595 0, /*sq_inplace_repeat*/ | |
| 1596 }; | |
| 1597 | |
| 1598 static PyMappingMethods __pyx_tp_as_mapping_PyCFRunLoopTimer = { | |
| 1599 0, /*mp_length*/ | |
| 1600 0, /*mp_subscript*/ | |
| 1601 0, /*mp_ass_subscript*/ | |
| 1602 }; | |
| 1603 | |
| 1604 static PyBufferProcs __pyx_tp_as_buffer_PyCFRunLoopTimer = { | |
| 1605 0, /*bf_getreadbuffer*/ | |
| 1606 0, /*bf_getwritebuffer*/ | |
| 1607 0, /*bf_getsegcount*/ | |
| 1608 0, /*bf_getcharbuffer*/ | |
| 1609 }; | |
| 1610 | |
| 1611 statichere PyTypeObject __pyx_type_9cfsupport_PyCFRunLoopTimer = { | |
| 1612 PyObject_HEAD_INIT(0) | |
| 1613 0, /*ob_size*/ | |
| 1614 "cfsupport.PyCFRunLoopTimer", /*tp_name*/ | |
| 1615 sizeof(struct __pyx_obj_9cfsupport_PyCFRunLoopTimer), /*tp_basicsize*/ | |
| 1616 0, /*tp_itemsize*/ | |
| 1617 __pyx_tp_dealloc_9cfsupport_PyCFRunLoopTimer, /*tp_dealloc*/ | |
| 1618 0, /*tp_print*/ | |
| 1619 0, /*tp_getattr*/ | |
| 1620 0, /*tp_setattr*/ | |
| 1621 0, /*tp_compare*/ | |
| 1622 0, /*tp_repr*/ | |
| 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*/ | |
| 1626 0, /*tp_hash*/ | |
| 1627 0, /*tp_call*/ | |
| 1628 0, /*tp_str*/ | |
| 1629 0, /*tp_getattro*/ | |
| 1630 0, /*tp_setattro*/ | |
| 1631 &__pyx_tp_as_buffer_PyCFRunLoopTimer, /*tp_as_buffer*/ | |
| 1632 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_G
C, /*tp_flags*/ | |
| 1633 0, /*tp_doc*/ | |
| 1634 __pyx_tp_traverse_9cfsupport_PyCFRunLoopTimer, /*tp_traverse*/ | |
| 1635 __pyx_tp_clear_9cfsupport_PyCFRunLoopTimer, /*tp_clear*/ | |
| 1636 0, /*tp_richcompare*/ | |
| 1637 0, /*tp_weaklistoffset*/ | |
| 1638 0, /*tp_iter*/ | |
| 1639 0, /*tp_iternext*/ | |
| 1640 __pyx_methods_9cfsupport_PyCFRunLoopTimer, /*tp_methods*/ | |
| 1641 __pyx_members_9cfsupport_PyCFRunLoopTimer, /*tp_members*/ | |
| 1642 0, /*tp_getset*/ | |
| 1643 0, /*tp_base*/ | |
| 1644 0, /*tp_dict*/ | |
| 1645 0, /*tp_descr_get*/ | |
| 1646 0, /*tp_descr_set*/ | |
| 1647 0, /*tp_dictoffset*/ | |
| 1648 0, /*tp_init*/ | |
| 1649 0, /*tp_alloc*/ | |
| 1650 __pyx_tp_new_9cfsupport_PyCFRunLoopTimer, /*tp_new*/ | |
| 1651 0, /*tp_free*/ | |
| 1652 0, /*tp_is_gc*/ | |
| 1653 0, /*tp_bases*/ | |
| 1654 0, /*tp_mro*/ | |
| 1655 0, /*tp_cache*/ | |
| 1656 0, /*tp_subclasses*/ | |
| 1657 0, /*tp_weaklist*/ | |
| 1658 }; | |
| 1659 | |
| 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_PyCF
RunLoop *)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; | |
| 1666 } | |
| 1667 return o; | |
| 1668 } | |
| 1669 | |
| 1670 static void __pyx_tp_dealloc_9cfsupport_PyCFRunLoop(PyObject *o) { | |
| 1671 struct __pyx_obj_9cfsupport_PyCFRunLoop *p = (struct __pyx_obj_9cfsupport_PyCF
RunLoop *)o; | |
| 1672 Py_XDECREF(p->cf); | |
| 1673 (*o->ob_type->tp_free)(o); | |
| 1674 } | |
| 1675 | |
| 1676 static int __pyx_tp_traverse_9cfsupport_PyCFRunLoop(PyObject *o, visitproc v, vo
id *a) { | |
| 1677 int e; | |
| 1678 struct __pyx_obj_9cfsupport_PyCFRunLoop *p = (struct __pyx_obj_9cfsupport_PyCF
RunLoop *)o; | |
| 1679 if (p->cf) { | |
| 1680 e = (*v)(p->cf, a); if (e) return e; | |
| 1681 } | |
| 1682 return 0; | |
| 1683 } | |
| 1684 | |
| 1685 static int __pyx_tp_clear_9cfsupport_PyCFRunLoop(PyObject *o) { | |
| 1686 struct __pyx_obj_9cfsupport_PyCFRunLoop *p = (struct __pyx_obj_9cfsupport_PyCF
RunLoop *)o; | |
| 1687 Py_XDECREF(p->cf); | |
| 1688 p->cf = Py_None; Py_INCREF(p->cf); | |
| 1689 return 0; | |
| 1690 } | |
| 1691 | |
| 1692 static struct PyMethodDef __pyx_methods_9cfsupport_PyCFRunLoop[] = { | |
| 1693 {"run", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_run, METH_VARARGS|METH_K
EYWORDS, 0}, | |
| 1694 {"stop", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_stop, METH_VARARGS|METH
_KEYWORDS, 0}, | |
| 1695 {"currentMode", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_currentMode, MET
H_VARARGS|METH_KEYWORDS, 0}, | |
| 1696 {"addSocket", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_addSocket, METH_VA
RARGS|METH_KEYWORDS, 0}, | |
| 1697 {"removeSocket", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_removeSocket, M
ETH_VARARGS|METH_KEYWORDS, 0}, | |
| 1698 {"addTimer", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_addTimer, METH_VARA
RGS|METH_KEYWORDS, 0}, | |
| 1699 {"removeTimer", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_removeTimer, MET
H_VARARGS|METH_KEYWORDS, 0}, | |
| 1700 {0, 0, 0, 0} | |
| 1701 }; | |
| 1702 | |
| 1703 static struct PyMemberDef __pyx_members_9cfsupport_PyCFRunLoop[] = { | |
| 1704 {"cf", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFRunLoop, cf), 0, 0}, | |
| 1705 {0, 0, 0, 0, 0} | |
| 1706 }; | |
| 1707 | |
| 1708 static PyNumberMethods __pyx_tp_as_number_PyCFRunLoop = { | |
| 1709 0, /*nb_add*/ | |
| 1710 0, /*nb_subtract*/ | |
| 1711 0, /*nb_multiply*/ | |
| 1712 0, /*nb_divide*/ | |
| 1713 0, /*nb_remainder*/ | |
| 1714 0, /*nb_divmod*/ | |
| 1715 0, /*nb_power*/ | |
| 1716 0, /*nb_negative*/ | |
| 1717 0, /*nb_positive*/ | |
| 1718 0, /*nb_absolute*/ | |
| 1719 0, /*nb_nonzero*/ | |
| 1720 0, /*nb_invert*/ | |
| 1721 0, /*nb_lshift*/ | |
| 1722 0, /*nb_rshift*/ | |
| 1723 0, /*nb_and*/ | |
| 1724 0, /*nb_xor*/ | |
| 1725 0, /*nb_or*/ | |
| 1726 0, /*nb_coerce*/ | |
| 1727 0, /*nb_int*/ | |
| 1728 0, /*nb_long*/ | |
| 1729 0, /*nb_float*/ | |
| 1730 0, /*nb_oct*/ | |
| 1731 0, /*nb_hex*/ | |
| 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*/ | |
| 1747 }; | |
| 1748 | |
| 1749 static PySequenceMethods __pyx_tp_as_sequence_PyCFRunLoop = { | |
| 1750 0, /*sq_length*/ | |
| 1751 0, /*sq_concat*/ | |
| 1752 0, /*sq_repeat*/ | |
| 1753 0, /*sq_item*/ | |
| 1754 0, /*sq_slice*/ | |
| 1755 0, /*sq_ass_item*/ | |
| 1756 0, /*sq_ass_slice*/ | |
| 1757 0, /*sq_contains*/ | |
| 1758 0, /*sq_inplace_concat*/ | |
| 1759 0, /*sq_inplace_repeat*/ | |
| 1760 }; | |
| 1761 | |
| 1762 static PyMappingMethods __pyx_tp_as_mapping_PyCFRunLoop = { | |
| 1763 0, /*mp_length*/ | |
| 1764 0, /*mp_subscript*/ | |
| 1765 0, /*mp_ass_subscript*/ | |
| 1766 }; | |
| 1767 | |
| 1768 static PyBufferProcs __pyx_tp_as_buffer_PyCFRunLoop = { | |
| 1769 0, /*bf_getreadbuffer*/ | |
| 1770 0, /*bf_getwritebuffer*/ | |
| 1771 0, /*bf_getsegcount*/ | |
| 1772 0, /*bf_getcharbuffer*/ | |
| 1773 }; | |
| 1774 | |
| 1775 statichere PyTypeObject __pyx_type_9cfsupport_PyCFRunLoop = { | |
| 1776 PyObject_HEAD_INIT(0) | |
| 1777 0, /*ob_size*/ | |
| 1778 "cfsupport.PyCFRunLoop", /*tp_name*/ | |
| 1779 sizeof(struct __pyx_obj_9cfsupport_PyCFRunLoop), /*tp_basicsize*/ | |
| 1780 0, /*tp_itemsize*/ | |
| 1781 __pyx_tp_dealloc_9cfsupport_PyCFRunLoop, /*tp_dealloc*/ | |
| 1782 0, /*tp_print*/ | |
| 1783 0, /*tp_getattr*/ | |
| 1784 0, /*tp_setattr*/ | |
| 1785 0, /*tp_compare*/ | |
| 1786 0, /*tp_repr*/ | |
| 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*/ | |
| 1790 0, /*tp_hash*/ | |
| 1791 0, /*tp_call*/ | |
| 1792 0, /*tp_str*/ | |
| 1793 0, /*tp_getattro*/ | |
| 1794 0, /*tp_setattro*/ | |
| 1795 &__pyx_tp_as_buffer_PyCFRunLoop, /*tp_as_buffer*/ | |
| 1796 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_G
C, /*tp_flags*/ | |
| 1797 0, /*tp_doc*/ | |
| 1798 __pyx_tp_traverse_9cfsupport_PyCFRunLoop, /*tp_traverse*/ | |
| 1799 __pyx_tp_clear_9cfsupport_PyCFRunLoop, /*tp_clear*/ | |
| 1800 0, /*tp_richcompare*/ | |
| 1801 0, /*tp_weaklistoffset*/ | |
| 1802 0, /*tp_iter*/ | |
| 1803 0, /*tp_iternext*/ | |
| 1804 __pyx_methods_9cfsupport_PyCFRunLoop, /*tp_methods*/ | |
| 1805 __pyx_members_9cfsupport_PyCFRunLoop, /*tp_members*/ | |
| 1806 0, /*tp_getset*/ | |
| 1807 0, /*tp_base*/ | |
| 1808 0, /*tp_dict*/ | |
| 1809 0, /*tp_descr_get*/ | |
| 1810 0, /*tp_descr_set*/ | |
| 1811 0, /*tp_dictoffset*/ | |
| 1812 0, /*tp_init*/ | |
| 1813 0, /*tp_alloc*/ | |
| 1814 __pyx_tp_new_9cfsupport_PyCFRunLoop, /*tp_new*/ | |
| 1815 0, /*tp_free*/ | |
| 1816 0, /*tp_is_gc*/ | |
| 1817 0, /*tp_bases*/ | |
| 1818 0, /*tp_mro*/ | |
| 1819 0, /*tp_cache*/ | |
| 1820 0, /*tp_subclasses*/ | |
| 1821 0, /*tp_weaklist*/ | |
| 1822 }; | |
| 1823 | |
| 1824 static struct PyMethodDef __pyx_methods[] = { | |
| 1825 {"now", (PyCFunction)__pyx_f_9cfsupport_now, METH_VARARGS|METH_KEYWORDS, 0}, | |
| 1826 {0, 0, 0, 0} | |
| 1827 }; | |
| 1828 | |
| 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_filen
ame = __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]; __p
yx_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 = __p
yx_f[1]; __pyx_lineno = 34; goto __pyx_L1;} | |
| 1841 if (PyObject_SetAttrString(__pyx_m, "PyCFSocket", (PyObject *)&__pyx_type_9cfs
upport_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_typ
e_9cfsupport_PyCFRunLoopTimer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno =
5; goto __pyx_L1;} | |
| 1846 __pyx_ptype_9cfsupport_PyCFRunLoopTimer = &__pyx_type_9cfsupport_PyCFRunLoopTi
mer; | |
| 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_9cf
support_PyCFRunLoop) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; goto
__pyx_L1;} | |
| 1850 __pyx_ptype_9cfsupport_PyCFRunLoop = &__pyx_type_9cfsupport_PyCFRunLoop; | |
| 1851 | |
| 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; | |
| 1856 | |
| 1857 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":45 */ | |
| 1858 Py_INCREF(Py_None); | |
| 1859 __pyx_k2 = Py_None; | |
| 1860 Py_INCREF(Py_None); | |
| 1861 __pyx_k3 = Py_None; | |
| 1862 Py_INCREF(Py_None); | |
| 1863 __pyx_k4 = Py_None; | |
| 1864 | |
| 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; | |
| 1869 | |
| 1870 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":52 */ | |
| 1871 Py_INCREF(Py_None); | |
| 1872 __pyx_k6 = Py_None; | |
| 1873 | |
| 1874 /* "/Volumes/Crack/src/Twisted/twisted/internet/cfsupport/cfsupport.pyx":6 */ | |
| 1875 if (PyObject_SetAttr(__pyx_m, __pyx_n___version__, __pyx_k7p) < 0) {__pyx_file
name = __pyx_f[3]; __pyx_lineno = 6; goto __pyx_L1;} | |
| 1876 return; | |
| 1877 __pyx_L1:; | |
| 1878 Py_XDECREF(__pyx_1); | |
| 1879 __Pyx_AddTraceback("cfsupport"); | |
| 1880 } | |
| 1881 | |
| 1882 static char *__pyx_filenames[] = { | |
| 1883 "cfdate.pxi", | |
| 1884 "cfsocket.pxi", | |
| 1885 "cfrunloop.pxi", | |
| 1886 "cfsupport.pyx", | |
| 1887 }; | |
| 1888 statichere char **__pyx_f = __pyx_filenames; | |
| 1889 | |
| 1890 /* Runtime support code */ | |
| 1891 | |
| 1892 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed
, char *name) { | |
| 1893 if (!type) { | |
| 1894 PyErr_Format(PyExc_SystemError, "Missing type object"); | |
| 1895 return 0; | |
| 1896 } | |
| 1897 if ((none_allowed && obj == Py_None) || PyObject_TypeCheck(obj, type)) | |
| 1898 return 1; | |
| 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); | |
| 1902 return 0; | |
| 1903 } | |
| 1904 | |
| 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; | |
| 1911 PyObject *list; | |
| 1912 __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); | |
| 1913 if (!__import__) | |
| 1914 goto bad; | |
| 1915 if (from_list) | |
| 1916 list = from_list; | |
| 1917 else { | |
| 1918 empty_list = PyList_New(0); | |
| 1919 if (!empty_list) | |
| 1920 goto bad; | |
| 1921 list = empty_list; | |
| 1922 } | |
| 1923 global_dict = PyModule_GetDict(__pyx_m); | |
| 1924 if (!global_dict) | |
| 1925 goto bad; | |
| 1926 empty_dict = PyDict_New(); | |
| 1927 if (!empty_dict) | |
| 1928 goto bad; | |
| 1929 module = PyObject_CallFunction(__import__, "OOOO", | |
| 1930 name, global_dict, empty_dict, list); | |
| 1931 bad: | |
| 1932 Py_XDECREF(empty_list); | |
| 1933 Py_XDECREF(__import__); | |
| 1934 Py_XDECREF(empty_dict); | |
| 1935 return module; | |
| 1936 } | |
| 1937 | |
| 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()) | |
| 1945 goto bad; | |
| 1946 if (!value) { | |
| 1947 value = Py_None; | |
| 1948 Py_INCREF(value); | |
| 1949 } | |
| 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; | |
| 1956 result = value; | |
| 1957 Py_XINCREF(result); | |
| 1958 type = 0; | |
| 1959 value = 0; | |
| 1960 tb = 0; | |
| 1961 bad: | |
| 1962 Py_XDECREF(type); | |
| 1963 Py_XDECREF(value); | |
| 1964 Py_XDECREF(tb); | |
| 1965 return result; | |
| 1966 } | |
| 1967 | |
| 1968 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { | |
| 1969 PyObject *result; | |
| 1970 result = PyObject_GetAttr(dict, name); | |
| 1971 if (!result) | |
| 1972 PyErr_SetObject(PyExc_NameError, name); | |
| 1973 return result; | |
| 1974 } | |
| 1975 | |
| 1976 static void __Pyx_WriteUnraisable(char *name) { | |
| 1977 PyObject *old_exc, *old_val, *old_tb; | |
| 1978 PyObject *ctx; | |
| 1979 PyErr_Fetch(&old_exc, &old_val, &old_tb); | |
| 1980 ctx = PyString_FromString(name); | |
| 1981 PyErr_Restore(old_exc, old_val, old_tb); | |
| 1982 if (!ctx) | |
| 1983 ctx = Py_None; | |
| 1984 PyErr_WriteUnraisable(ctx); | |
| 1985 } | |
| 1986 | |
| 1987 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { | |
| 1988 Py_XINCREF(type); | |
| 1989 Py_XINCREF(value); | |
| 1990 Py_XINCREF(tb); | |
| 1991 /* First, check the traceback argument, replacing None with NULL. */ | |
| 1992 if (tb == Py_None) { | |
| 1993 Py_DECREF(tb); | |
| 1994 tb = 0; | |
| 1995 } | |
| 1996 else if (tb != NULL && !PyTraceBack_Check(tb)) { | |
| 1997 PyErr_SetString(PyExc_TypeError, | |
| 1998 "raise: arg 3 must be a traceback or None"); | |
| 1999 goto raise_error; | |
| 2000 } | |
| 2001 /* Next, replace a missing value with None */ | |
| 2002 if (value == NULL) { | |
| 2003 value = Py_None; | |
| 2004 Py_INCREF(value); | |
| 2005 } | |
| 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); | |
| 2010 Py_INCREF(type); | |
| 2011 Py_DECREF(tmp); | |
| 2012 } | |
| 2013 if (PyString_Check(type)) | |
| 2014 ; | |
| 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"); | |
| 2022 goto raise_error; | |
| 2023 } | |
| 2024 else { | |
| 2025 /* Normalize to raise <class>, <instance> */ | |
| 2026 Py_DECREF(value); | |
| 2027 value = type; | |
| 2028 type = (PyObject*) ((PyInstanceObject*)type)->in_class; | |
| 2029 Py_INCREF(type); | |
| 2030 } | |
| 2031 } | |
| 2032 else { | |
| 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); | |
| 2038 goto raise_error; | |
| 2039 } | |
| 2040 PyErr_Restore(type, value, tb); | |
| 2041 return; | |
| 2042 raise_error: | |
| 2043 Py_XDECREF(value); | |
| 2044 Py_XDECREF(type); | |
| 2045 Py_XDECREF(tb); | |
| 2046 return; | |
| 2047 } | |
| 2048 | |
| 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; | |
| 2054 Py_XINCREF(type); | |
| 2055 Py_XINCREF(value); | |
| 2056 Py_XINCREF(tb); | |
| 2057 PyErr_Restore(type, value, tb); | |
| 2058 } | |
| 2059 | |
| 2060 static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) { | |
| 2061 while (t->p) { | |
| 2062 *t->p = PyString_InternFromString(t->s); | |
| 2063 if (!*t->p) | |
| 2064 return -1; | |
| 2065 ++t; | |
| 2066 } | |
| 2067 return 0; | |
| 2068 } | |
| 2069 | |
| 2070 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { | |
| 2071 while (t->p) { | |
| 2072 *t->p = PyString_FromStringAndSize(t->s, t->n - 1); | |
| 2073 if (!*t->p) | |
| 2074 return -1; | |
| 2075 ++t; | |
| 2076 } | |
| 2077 return 0; | |
| 2078 } | |
| 2079 | |
| 2080 #include "compile.h" | |
| 2081 #include "frameobject.h" | |
| 2082 #include "traceback.h" | |
| 2083 | |
| 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; | |
| 2092 | |
| 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,*/ | |
| 2105 0, /*int nlocals,*/ | |
| 2106 0, /*int stacksize,*/ | |
| 2107 0, /*int flags,*/ | |
| 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*/ | |
| 2118 ); | |
| 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*/ | |
| 2125 ); | |
| 2126 if (!py_frame) goto bad; | |
| 2127 py_frame->f_lineno = __pyx_lineno; | |
| 2128 PyTraceBack_Here(py_frame); | |
| 2129 bad: | |
| 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); | |
| 2136 } | |
| OLD | NEW |