/* Generated by Pyrex 0.9 on Thu Apr 1 21:39:25 2004 */
#include "Python.h"
#include "structmember.h"
#include "pymactoolbox.h"
static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/
static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
static int __Pyx_PrintItem(PyObject *); /*proto*/
static int __Pyx_PrintNewline(void); /*proto*/
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static void __Pyx_ReRaise(void); /*proto*/
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
static PyObject *__Pyx_GetExcValue(void); /*proto*/
static PyObject *__Pyx_GetName(PyObject *dict, char *name); /*proto*/
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
static void __Pyx_WriteUnraisable(char *name); /*proto*/
static void __Pyx_AddTraceback(char *funcname); /*proto*/
static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
static int __Pyx_GetVtable(PyObject *dict, void **vtabptr); /*proto*/
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static int __pyx_lineno;
static char *__pyx_filename;
staticforward char **__pyx_f;
/* Declarations from cfsupport */
staticforward PyTypeObject __pyx_type_9cfsupport_PyCFSocket;
struct __pyx_obj_9cfsupport_PyCFSocket {
PyObject_HEAD
PyObject *readcallback;
PyObject *writecallback;
PyObject *connectcallback;
PyObject *reading;
PyObject *writing;
void (*cf);
void (*source);
int fileno;
CFSocketContext context;
};
staticforward PyTypeObject __pyx_type_9cfsupport_PyCFRunLoopTimer;
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer {
PyObject_HEAD
void (*cf);
PyObject *callout;
CFRunLoopTimerContext context;
};
staticforward PyTypeObject __pyx_type_9cfsupport_PyCFRunLoop;
struct __pyx_obj_9cfsupport_PyCFRunLoop {
PyObject_HEAD
PyObject *cf;
};
static PyTypeObject *__pyx_ptype_9cfsupport_PyCFSocket = 0;
static PyTypeObject *__pyx_ptype_9cfsupport_PyCFRunLoopTimer = 0;
static PyTypeObject *__pyx_ptype_9cfsupport_PyCFRunLoop = 0;
static PyObject *__pyx_k1;
static PyObject *__pyx_k2;
static PyObject *__pyx_k3;
static PyObject *__pyx_k5;
static void (__pyx_f_9cfsupport_socketCallBack(void (*),CFSocketCallBackType ,void (*),void (*),void (*))); /*proto*/
static void (__pyx_f_9cfsupport_runLoopTimerCallBack(void (*),void (*))); /*proto*/
/* Implementation of cfsupport */
static char (__pyx_k4[]) = "_CarbonEvt";
static char (__pyx_k6[]) = "0.2";
static PyObject *__pyx_f_9cfsupport_now(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_now(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfdate.pxi":2 */
__pyx_1 = PyFloat_FromDouble(CFAbsoluteTimeGetCurrent()); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("cfsupport.now");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}
static void __pyx_f_9cfsupport_socketCallBack(void (*__pyx_v_s),CFSocketCallBackType __pyx_v__type,void (*__pyx_v_address),void (*__pyx_v_data),void (*__pyx_v_info)) {
struct __pyx_obj_9cfsupport_PyCFSocket *__pyx_v_socket;
int __pyx_v_res;
int __pyx_v_mask;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
((PyObject*)__pyx_v_socket) = Py_None; Py_INCREF(((PyObject*)__pyx_v_socket));
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":7 */
__pyx_1 = (PyObject *)__pyx_v_info;
Py_INCREF(__pyx_1);
Py_DECREF(((PyObject *)__pyx_v_socket));
((PyObject *)__pyx_v_socket) = __pyx_1;
__pyx_1 = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":9 */
__pyx_2 = (__pyx_v__type == kCFSocketReadCallBack);
if (__pyx_2) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":10 */
__pyx_2 = PyObject_IsTrue(__pyx_v_socket->readcallback); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 10; goto __pyx_L1;}
if (__pyx_2) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":11 */
__pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_v_socket->readcallback, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
goto __pyx_L3;
}
__pyx_L3:;
goto __pyx_L2;
}
__pyx_2 = (__pyx_v__type == kCFSocketWriteCallBack);
if (__pyx_2) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":13 */
__pyx_2 = PyObject_IsTrue(__pyx_v_socket->writecallback); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 13; goto __pyx_L1;}
if (__pyx_2) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":14 */
__pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_v_socket->writecallback, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
goto __pyx_L4;
}
__pyx_L4:;
goto __pyx_L2;
}
__pyx_2 = (__pyx_v__type == kCFSocketConnectCallBack);
if (__pyx_2) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":16 */
__pyx_2 = (__pyx_v_data == 0);
if (__pyx_2) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":17 */
__pyx_v_res = 0;
goto __pyx_L5;
}
/*else*/ {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":19 */
__pyx_v_res = (((int (*))__pyx_v_data)[0]);
}
__pyx_L5:;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":20 */
__pyx_2 = PyObject_IsTrue(__pyx_v_socket->connectcallback); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; goto __pyx_L1;}
if (__pyx_2) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":21 */
__pyx_1 = PyInt_FromLong(__pyx_v_res); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
__pyx_1 = 0;
__pyx_1 = PyObject_CallObject(__pyx_v_socket->connectcallback, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
goto __pyx_L6;
}
__pyx_L6:;
goto __pyx_L2;
}
__pyx_L2:;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
__Pyx_WriteUnraisable("cfsupport.socketCallBack");
__pyx_L0:;
Py_DECREF(__pyx_v_socket);
}
static char (__pyx_k7[]) = "Invalid Socket";
static char (__pyx_k8[]) = "Couldn't create runloop source";
static int __pyx_f_9cfsupport_10PyCFSocket___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_9cfsupport_10PyCFSocket___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_fileno;
PyObject *__pyx_v_readcallback = 0;
PyObject *__pyx_v_writecallback = 0;
PyObject *__pyx_v_connectcallback = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"fileno","readcallback","writecallback","connectcallback",0};
__pyx_v_readcallback = __pyx_k1;
__pyx_v_writecallback = __pyx_k2;
__pyx_v_connectcallback = __pyx_k3;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i|OOO", __pyx_argnames, &__pyx_v_fileno, &__pyx_v_readcallback, &__pyx_v_writecallback, &__pyx_v_connectcallback)) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_readcallback);
Py_INCREF(__pyx_v_writecallback);
Py_INCREF(__pyx_v_connectcallback);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":37 */
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->fileno = __pyx_v_fileno;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":38 */
Py_INCREF(__pyx_v_readcallback);
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->readcallback);
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->readcallback = __pyx_v_readcallback;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":39 */
Py_INCREF(__pyx_v_writecallback);
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writecallback);
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writecallback = __pyx_v_writecallback;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":40 */
Py_INCREF(__pyx_v_connectcallback);
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->connectcallback);
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->connectcallback = __pyx_v_connectcallback;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":41 */
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.version = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":42 */
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.info = ((void (*))__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":43 */
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.retain = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":44 */
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.release = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":45 */
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context.copyDescription = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":46 */
__pyx_1 = __Pyx_GetName(__pyx_b, "False"); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->reading);
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->reading = __pyx_1;
__pyx_1 = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":47 */
__pyx_1 = __Pyx_GetName(__pyx_b, "False"); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writing);
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writing = __pyx_1;
__pyx_1 = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":48 */
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf = CFSocketCreateWithNative(kCFAllocatorDefault,__pyx_v_fileno,((kCFSocketConnectCallBack | kCFSocketReadCallBack) | kCFSocketWriteCallBack),((void ((*)(void (*),CFSocketCallBackType ,void (*),void (*),void (*))))(&__pyx_f_9cfsupport_socketCallBack)),(&((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->context));
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":49 */
__pyx_2 = (((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf == 0);
if (__pyx_2) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":50 */
__pyx_1 = __Pyx_GetName(__pyx_b, "ValueError"); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; goto __pyx_L1;}
__pyx_3 = PyString_FromString(__pyx_k7); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":51 */
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->source = CFSocketCreateRunLoopSource(kCFAllocatorDefault,((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf,10000);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":52 */
__pyx_2 = (((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->source == 0);
if (__pyx_2) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":53 */
__pyx_1 = __Pyx_GetName(__pyx_b, "ValueError"); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 53; goto __pyx_L1;}
__pyx_4 = PyString_FromString(__pyx_k8); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 53; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 53; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
__pyx_4 = 0;
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 53; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 53; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("cfsupport.PyCFSocket.__new__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_readcallback);
Py_DECREF(__pyx_v_writecallback);
Py_DECREF(__pyx_v_connectcallback);
return __pyx_r;
}
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_mask;
int __pyx_v_offmask;
int __pyx_v_automask;
PyObject *__pyx_r;
int __pyx_1;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":60 */
__pyx_v_mask = (kCFSocketConnectCallBack | kCFSocketAcceptCallBack);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":61 */
__pyx_v_offmask = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":62 */
__pyx_v_automask = kCFSocketAutomaticallyReenableAcceptCallBack;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":63 */
__pyx_1 = PyObject_IsTrue(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->reading); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 63; goto __pyx_L1;}
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":64 */
__pyx_v_mask = (__pyx_v_mask | kCFSocketReadCallBack);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":65 */
__pyx_v_automask = (__pyx_v_automask | kCFSocketAutomaticallyReenableReadCallBack);
goto __pyx_L2;
}
/*else*/ {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":67 */
__pyx_v_offmask = (__pyx_v_offmask | kCFSocketReadCallBack);
}
__pyx_L2:;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":68 */
__pyx_1 = PyObject_IsTrue(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writing); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 68; goto __pyx_L1;}
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":69 */
__pyx_v_mask = (__pyx_v_mask | kCFSocketWriteCallBack);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":70 */
__pyx_v_automask = (__pyx_v_automask | kCFSocketAutomaticallyReenableWriteCallBack);
goto __pyx_L3;
}
/*else*/ {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":72 */
__pyx_v_offmask = (__pyx_v_offmask | kCFSocketWriteCallBack);
}
__pyx_L3:;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":73 */
CFSocketDisableCallBacks(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf,__pyx_v_offmask);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":74 */
CFSocketEnableCallBacks(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf,__pyx_v_mask);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":75 */
CFSocketSetSocketFlags(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf,__pyx_v_automask);
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("cfsupport.PyCFSocket.update");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_startReading(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_startReading(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":79 */
__pyx_1 = __Pyx_GetName(__pyx_b, "True"); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->reading);
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->reading = __pyx_1;
__pyx_1 = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":80 */
__pyx_1 = PyObject_GetAttrString(__pyx_v_self, "update"); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 80; goto __pyx_L1;}
__pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 80; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 80; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("cfsupport.PyCFSocket.startReading");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_stopReading(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_stopReading(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":83 */
__pyx_1 = __Pyx_GetName(__pyx_b, "False"); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->reading);
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->reading = __pyx_1;
__pyx_1 = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":84 */
__pyx_1 = PyObject_GetAttrString(__pyx_v_self, "update"); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; goto __pyx_L1;}
__pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("cfsupport.PyCFSocket.stopReading");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_startWriting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_startWriting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":87 */
__pyx_1 = __Pyx_GetName(__pyx_b, "True"); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writing);
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writing = __pyx_1;
__pyx_1 = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":88 */
__pyx_1 = PyObject_GetAttrString(__pyx_v_self, "update"); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; goto __pyx_L1;}
__pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("cfsupport.PyCFSocket.startWriting");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_stopWriting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_10PyCFSocket_stopWriting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":91 */
__pyx_1 = __Pyx_GetName(__pyx_b, "False"); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writing);
((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->writing = __pyx_1;
__pyx_1 = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":92 */
__pyx_1 = PyObject_GetAttrString(__pyx_v_self, "update"); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; goto __pyx_L1;}
__pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("cfsupport.PyCFSocket.stopWriting");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static void __pyx_f_9cfsupport_10PyCFSocket___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_f_9cfsupport_10PyCFSocket___dealloc__(PyObject *__pyx_v_self) {
int __pyx_1;
Py_INCREF(__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":96 */
__pyx_1 = (((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->source != 0);
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":97 */
CFRelease(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->source);
goto __pyx_L2;
}
__pyx_L2:;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":98 */
__pyx_1 = (((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf != 0);
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":99 */
CFSocketInvalidate(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":100 */
CFRelease(((struct __pyx_obj_9cfsupport_PyCFSocket *)__pyx_v_self)->cf);
goto __pyx_L3;
}
__pyx_L3:;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("cfsupport.PyCFSocket.__dealloc__");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
}
static char (__pyx_k9[]) = "Invalid Socket";
static int __pyx_f_9cfsupport_16PyCFRunLoopTimer___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_9cfsupport_16PyCFRunLoopTimer___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
double __pyx_v_fireDate;
double __pyx_v_interval;
PyObject *__pyx_v_callout = 0;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"fireDate","interval","callout",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "ddO", __pyx_argnames, &__pyx_v_fireDate, &__pyx_v_interval, &__pyx_v_callout)) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_callout);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":11 */
Py_INCREF(__pyx_v_callout);
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->callout);
((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->callout = __pyx_v_callout;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":12 */
((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context.version = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":13 */
((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context.info = ((void (*))__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":14 */
((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context.retain = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":15 */
((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context.release = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":16 */
((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context.copyDescription = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":17 */
((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf = CFRunLoopTimerCreate(kCFAllocatorDefault,__pyx_v_fireDate,__pyx_v_interval,0,0,((void ((*)(void (*),void (*))))(&__pyx_f_9cfsupport_runLoopTimerCallBack)),(&((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->context));
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":18 */
__pyx_1 = (((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf == 0);
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":19 */
__pyx_2 = __Pyx_GetName(__pyx_b, "ValueError"); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; goto __pyx_L1;}
__pyx_3 = PyString_FromString(__pyx_k9); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
__pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.__new__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_callout);
return __pyx_r;
}
static PyObject *__pyx_f_9cfsupport_16PyCFRunLoopTimer_getNextFireDate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_16PyCFRunLoopTimer_getNextFireDate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":22 */
__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;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.getNextFireDate");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static PyObject *__pyx_f_9cfsupport_16PyCFRunLoopTimer_setNextFireDate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_16PyCFRunLoopTimer_setNextFireDate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
double __pyx_v_fireDate;
PyObject *__pyx_r;
static char *__pyx_argnames[] = {"fireDate",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "d", __pyx_argnames, &__pyx_v_fireDate)) return 0;
Py_INCREF(__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":25 */
CFRunLoopTimerSetNextFireDate(((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf,__pyx_v_fireDate);
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.setNextFireDate");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static PyObject *__pyx_f_9cfsupport_16PyCFRunLoopTimer_invalidate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_16PyCFRunLoopTimer_invalidate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":28 */
CFRunLoopTimerInvalidate(((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf);
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.invalidate");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static void __pyx_f_9cfsupport_16PyCFRunLoopTimer___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_f_9cfsupport_16PyCFRunLoopTimer___dealloc__(PyObject *__pyx_v_self) {
int __pyx_1;
Py_INCREF(__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":31 */
__pyx_1 = (((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf != 0);
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":32 */
CFRelease(((struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)__pyx_v_self)->cf);
goto __pyx_L2;
}
__pyx_L2:;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("cfsupport.PyCFRunLoopTimer.__dealloc__");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
}
static void __pyx_f_9cfsupport_runLoopTimerCallBack(void (*__pyx_v_timer),void (*__pyx_v_info)) {
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *__pyx_v_obj;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
((PyObject*)__pyx_v_obj) = Py_None; Py_INCREF(((PyObject*)__pyx_v_obj));
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":36 */
__pyx_1 = (PyObject *)__pyx_v_info;
Py_INCREF(__pyx_1);
Py_DECREF(((PyObject *)__pyx_v_obj));
((PyObject *)__pyx_v_obj) = __pyx_1;
__pyx_1 = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":37 */
__pyx_2 = PyObject_IsTrue(__pyx_v_obj->callout); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; goto __pyx_L1;}
if (__pyx_2) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":38 */
__pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 38; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_v_obj->callout, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 38; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
goto __pyx_L2;
}
__pyx_L2:;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
__Pyx_WriteUnraisable("cfsupport.runLoopTimerCallBack");
__pyx_L0:;
Py_DECREF(__pyx_v_obj);
}
static int __pyx_f_9cfsupport_11PyCFRunLoop___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_9cfsupport_11PyCFRunLoop___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_runLoop = 0;
void (*__pyx_v__runLoop);
void (*__pyx_v__evtLoop);
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"runLoop",0};
__pyx_v_runLoop = __pyx_k5;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_runLoop)) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_runLoop);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":46 */
__pyx_1 = __pyx_v_runLoop == Py_None;
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":47 */
__pyx_v__runLoop = CFRunLoopGetCurrent();
goto __pyx_L2;
}
__pyx_2 = __Pyx_GetName(__pyx_b, "isinstance"); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; goto __pyx_L1;}
__pyx_3 = __Pyx_GetName(__pyx_m, "_CarbonEvt"); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; goto __pyx_L1;}
__pyx_4 = PyObject_GetAttrString(__pyx_3, "EventLoopRef"); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; goto __pyx_L1;}
Py_INCREF(__pyx_v_runLoop);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_runLoop);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);
__pyx_4 = 0;
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":53 */
__pyx_v__evtLoop = GetCurrentEventLoop();
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":54 */
__pyx_v__runLoop = GetCFRunLoopFromEventLoop(__pyx_v__evtLoop);
goto __pyx_L2;
}
/*else*/ {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":56 */
__pyx_1 = (CFObj_Convert(__pyx_v_runLoop,(&__pyx_v__runLoop)) == 0);
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":57 */
__Pyx_ReRaise();
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
}
__pyx_L2:;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":59 */
__pyx_2 = CFObj_New(CFRetain(__pyx_v__runLoop)); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf);
((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf = __pyx_2;
__pyx_2 = 0;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.__new__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_runLoop);
return __pyx_r;
}
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":62 */
CFRunLoopRun();
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.run");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static char (__pyx_k10[]) = "CFRunLoopReference is invalid";
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_stop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_stop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
void (*__pyx_v__runLoop);
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":66 */
__pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf,(&__pyx_v__runLoop)) == 0);
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":67 */
__pyx_2 = __Pyx_GetName(__pyx_b, "ValueError"); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; goto __pyx_L1;}
__pyx_3 = PyString_FromString(__pyx_k10); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; goto __pyx_L1;}
__Pyx_Raise(__pyx_2, __pyx_3, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":68 */
CFRunLoopStop(__pyx_v__runLoop);
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.stop");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static char (__pyx_k11[]) = "CFRunLoopReference is invalid";
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_currentMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_currentMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
void (*__pyx_v__currentMode);
void (*__pyx_v__runLoop);
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":73 */
__pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf,(&__pyx_v__runLoop)) == 0);
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":74 */
__pyx_2 = __Pyx_GetName(__pyx_b, "ValueError"); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; goto __pyx_L1;}
__pyx_3 = PyString_FromString(__pyx_k11); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; goto __pyx_L1;}
__Pyx_Raise(__pyx_2, __pyx_3, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":75 */
__pyx_v__currentMode = CFRunLoopCopyCurrentMode(__pyx_v__runLoop);
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":76 */
__pyx_1 = (__pyx_v__currentMode == 0);
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":77 */
Py_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
goto __pyx_L3;
}
__pyx_L3:;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":78 */
__pyx_2 = CFObj_New(__pyx_v__currentMode); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.currentMode");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static char (__pyx_k12[]) = "CFRunLoopReference is invalid";
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_addSocket(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_addSocket(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9cfsupport_PyCFSocket *__pyx_v_socket = 0;
void (*__pyx_v__runLoop);
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"socket",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_socket)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_socket);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_socket), __pyx_ptype_9cfsupport_PyCFSocket, 0, "socket")) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; goto __pyx_L1;}
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":82 */
__pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf,(&__pyx_v__runLoop)) == 0);
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":83 */
__pyx_2 = __Pyx_GetName(__pyx_b, "ValueError"); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; goto __pyx_L1;}
__pyx_3 = PyString_FromString(__pyx_k12); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; goto __pyx_L1;}
__Pyx_Raise(__pyx_2, __pyx_3, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":84 */
CFRunLoopAddSource(__pyx_v__runLoop,__pyx_v_socket->source,kCFRunLoopCommonModes);
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.addSocket");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_socket);
return __pyx_r;
}
static char (__pyx_k13[]) = "CFRunLoopReference is invalid";
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_removeSocket(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_removeSocket(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9cfsupport_PyCFSocket *__pyx_v_socket = 0;
void (*__pyx_v__runLoop);
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"socket",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_socket)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_socket);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_socket), __pyx_ptype_9cfsupport_PyCFSocket, 0, "socket")) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 86; goto __pyx_L1;}
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":88 */
__pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf,(&__pyx_v__runLoop)) == 0);
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":89 */
__pyx_2 = __Pyx_GetName(__pyx_b, "ValueError"); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; goto __pyx_L1;}
__pyx_3 = PyString_FromString(__pyx_k13); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; goto __pyx_L1;}
__Pyx_Raise(__pyx_2, __pyx_3, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":90 */
CFRunLoopRemoveSource(__pyx_v__runLoop,__pyx_v_socket->source,kCFRunLoopCommonModes);
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.removeSocket");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_socket);
return __pyx_r;
}
static char (__pyx_k14[]) = "CFRunLoopReference is invalid";
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_addTimer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_addTimer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *__pyx_v_timer = 0;
void (*__pyx_v__runLoop);
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"timer",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_timer)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_timer);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_timer), __pyx_ptype_9cfsupport_PyCFRunLoopTimer, 0, "timer")) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; goto __pyx_L1;}
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":94 */
__pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf,(&__pyx_v__runLoop)) == 0);
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":95 */
__pyx_2 = __Pyx_GetName(__pyx_b, "ValueError"); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; goto __pyx_L1;}
__pyx_3 = PyString_FromString(__pyx_k14); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; goto __pyx_L1;}
__Pyx_Raise(__pyx_2, __pyx_3, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":96 */
CFRunLoopAddTimer(__pyx_v__runLoop,__pyx_v_timer->cf,kCFRunLoopCommonModes);
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.addTimer");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_timer);
return __pyx_r;
}
static char (__pyx_k15[]) = "CFRunLoopReference is invalid";
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_removeTimer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_9cfsupport_11PyCFRunLoop_removeTimer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *__pyx_v_timer = 0;
void (*__pyx_v__runLoop);
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"timer",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_timer)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_timer);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_timer), __pyx_ptype_9cfsupport_PyCFRunLoopTimer, 0, "timer")) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; goto __pyx_L1;}
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":100 */
__pyx_1 = (CFObj_Convert(((struct __pyx_obj_9cfsupport_PyCFRunLoop *)__pyx_v_self)->cf,(&__pyx_v__runLoop)) == 0);
if (__pyx_1) {
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":101 */
__pyx_2 = __Pyx_GetName(__pyx_b, "ValueError"); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; goto __pyx_L1;}
__pyx_3 = PyString_FromString(__pyx_k15); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; goto __pyx_L1;}
__Pyx_Raise(__pyx_2, __pyx_3, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
{__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":102 */
CFRunLoopRemoveTimer(__pyx_v__runLoop,__pyx_v_timer->cf,kCFRunLoopCommonModes);
__pyx_r = Py_None; Py_INCREF(__pyx_r);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("cfsupport.PyCFRunLoop.removeTimer");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_timer);
return __pyx_r;
}
static PyObject *__pyx_tp_new_9cfsupport_PyCFSocket(struct _typeobject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_9cfsupport_PyCFSocket *p = (struct __pyx_obj_9cfsupport_PyCFSocket *)o;
p->readcallback = Py_None; Py_INCREF(p->readcallback);
p->writecallback = Py_None; Py_INCREF(p->writecallback);
p->connectcallback = Py_None; Py_INCREF(p->connectcallback);
p->reading = Py_None; Py_INCREF(p->reading);
p->writing = Py_None; Py_INCREF(p->writing);
if (__pyx_f_9cfsupport_10PyCFSocket___new__(o, a, k) < 0) {
Py_DECREF(o); o = 0;
}
return o;
}
static void __pyx_tp_dealloc_9cfsupport_PyCFSocket(PyObject *o) {
struct __pyx_obj_9cfsupport_PyCFSocket *p = (struct __pyx_obj_9cfsupport_PyCFSocket *)o;
{
PyObject *etype, *eval, *etb;
PyErr_Fetch(&etype, &eval, &etb);
++o->ob_refcnt;
__pyx_f_9cfsupport_10PyCFSocket___dealloc__(o);
if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
--o->ob_refcnt;
PyErr_Restore(etype, eval, etb);
}
Py_XDECREF(p->readcallback);
Py_XDECREF(p->writecallback);
Py_XDECREF(p->connectcallback);
Py_XDECREF(p->reading);
Py_XDECREF(p->writing);
(*o->ob_type->tp_free)(o);
}
static int __pyx_tp_traverse_9cfsupport_PyCFSocket(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_9cfsupport_PyCFSocket *p = (struct __pyx_obj_9cfsupport_PyCFSocket *)o;
e = (*v)(p->readcallback, a); if (e) return e;
e = (*v)(p->writecallback, a); if (e) return e;
e = (*v)(p->connectcallback, a); if (e) return e;
e = (*v)(p->reading, a); if (e) return e;
e = (*v)(p->writing, a); if (e) return e;
return 0;
}
static int __pyx_tp_clear_9cfsupport_PyCFSocket(PyObject *o) {
struct __pyx_obj_9cfsupport_PyCFSocket *p = (struct __pyx_obj_9cfsupport_PyCFSocket *)o;
Py_XDECREF(p->readcallback);
p->readcallback = Py_None; Py_INCREF(p->readcallback);
Py_XDECREF(p->writecallback);
p->writecallback = Py_None; Py_INCREF(p->writecallback);
Py_XDECREF(p->connectcallback);
p->connectcallback = Py_None; Py_INCREF(p->connectcallback);
Py_XDECREF(p->reading);
p->reading = Py_None; Py_INCREF(p->reading);
Py_XDECREF(p->writing);
p->writing = Py_None; Py_INCREF(p->writing);
return 0;
}
static struct PyMethodDef __pyx_methods_9cfsupport_PyCFSocket[] = {
{"update", (PyCFunction)__pyx_f_9cfsupport_10PyCFSocket_update, METH_VARARGS|METH_KEYWORDS, 0},
{"startReading", (PyCFunction)__pyx_f_9cfsupport_10PyCFSocket_startReading, METH_VARARGS|METH_KEYWORDS, 0},
{"stopReading", (PyCFunction)__pyx_f_9cfsupport_10PyCFSocket_stopReading, METH_VARARGS|METH_KEYWORDS, 0},
{"startWriting", (PyCFunction)__pyx_f_9cfsupport_10PyCFSocket_startWriting, METH_VARARGS|METH_KEYWORDS, 0},
{"stopWriting", (PyCFunction)__pyx_f_9cfsupport_10PyCFSocket_stopWriting, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};
static struct PyMemberDef __pyx_members_9cfsupport_PyCFSocket[] = {
{"readcallback", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFSocket, readcallback), 0, 0},
{"writecallback", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFSocket, writecallback), 0, 0},
{"connectcallback", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFSocket, connectcallback), 0, 0},
{"reading", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFSocket, reading), 0, 0},
{"writing", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFSocket, writing), 0, 0},
{"fileno", T_INT, offsetof(struct __pyx_obj_9cfsupport_PyCFSocket, fileno), READONLY, 0},
{0, 0, 0, 0, 0}
};
static PyNumberMethods __pyx_tp_as_number_PyCFSocket = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
};
static PySequenceMethods __pyx_tp_as_sequence_PyCFSocket = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};
static PyMappingMethods __pyx_tp_as_mapping_PyCFSocket = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
static PyBufferProcs __pyx_tp_as_buffer_PyCFSocket = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};
statichere PyTypeObject __pyx_type_9cfsupport_PyCFSocket = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"cfsupport.PyCFSocket", /*tp_name*/
sizeof(struct __pyx_obj_9cfsupport_PyCFSocket), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_9cfsupport_PyCFSocket, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_PyCFSocket, /*tp_as_number*/
&__pyx_tp_as_sequence_PyCFSocket, /*tp_as_sequence*/
&__pyx_tp_as_mapping_PyCFSocket, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_PyCFSocket, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_9cfsupport_PyCFSocket, /*tp_traverse*/
__pyx_tp_clear_9cfsupport_PyCFSocket, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_9cfsupport_PyCFSocket, /*tp_methods*/
__pyx_members_9cfsupport_PyCFSocket, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_9cfsupport_PyCFSocket, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static PyObject *__pyx_tp_new_9cfsupport_PyCFRunLoopTimer(struct _typeobject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *p = (struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)o;
p->callout = Py_None; Py_INCREF(p->callout);
if (__pyx_f_9cfsupport_16PyCFRunLoopTimer___new__(o, a, k) < 0) {
Py_DECREF(o); o = 0;
}
return o;
}
static void __pyx_tp_dealloc_9cfsupport_PyCFRunLoopTimer(PyObject *o) {
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *p = (struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)o;
{
PyObject *etype, *eval, *etb;
PyErr_Fetch(&etype, &eval, &etb);
++o->ob_refcnt;
__pyx_f_9cfsupport_16PyCFRunLoopTimer___dealloc__(o);
if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
--o->ob_refcnt;
PyErr_Restore(etype, eval, etb);
}
Py_XDECREF(p->callout);
(*o->ob_type->tp_free)(o);
}
static int __pyx_tp_traverse_9cfsupport_PyCFRunLoopTimer(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *p = (struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)o;
e = (*v)(p->callout, a); if (e) return e;
return 0;
}
static int __pyx_tp_clear_9cfsupport_PyCFRunLoopTimer(PyObject *o) {
struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *p = (struct __pyx_obj_9cfsupport_PyCFRunLoopTimer *)o;
Py_XDECREF(p->callout);
p->callout = Py_None; Py_INCREF(p->callout);
return 0;
}
static struct PyMethodDef __pyx_methods_9cfsupport_PyCFRunLoopTimer[] = {
{"getNextFireDate", (PyCFunction)__pyx_f_9cfsupport_16PyCFRunLoopTimer_getNextFireDate, METH_VARARGS|METH_KEYWORDS, 0},
{"setNextFireDate", (PyCFunction)__pyx_f_9cfsupport_16PyCFRunLoopTimer_setNextFireDate, METH_VARARGS|METH_KEYWORDS, 0},
{"invalidate", (PyCFunction)__pyx_f_9cfsupport_16PyCFRunLoopTimer_invalidate, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};
static struct PyMemberDef __pyx_members_9cfsupport_PyCFRunLoopTimer[] = {
{"callout", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFRunLoopTimer, callout), 0, 0},
{0, 0, 0, 0, 0}
};
static PyNumberMethods __pyx_tp_as_number_PyCFRunLoopTimer = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
};
static PySequenceMethods __pyx_tp_as_sequence_PyCFRunLoopTimer = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};
static PyMappingMethods __pyx_tp_as_mapping_PyCFRunLoopTimer = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
static PyBufferProcs __pyx_tp_as_buffer_PyCFRunLoopTimer = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};
statichere PyTypeObject __pyx_type_9cfsupport_PyCFRunLoopTimer = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"cfsupport.PyCFRunLoopTimer", /*tp_name*/
sizeof(struct __pyx_obj_9cfsupport_PyCFRunLoopTimer), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_9cfsupport_PyCFRunLoopTimer, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_PyCFRunLoopTimer, /*tp_as_number*/
&__pyx_tp_as_sequence_PyCFRunLoopTimer, /*tp_as_sequence*/
&__pyx_tp_as_mapping_PyCFRunLoopTimer, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_PyCFRunLoopTimer, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_9cfsupport_PyCFRunLoopTimer, /*tp_traverse*/
__pyx_tp_clear_9cfsupport_PyCFRunLoopTimer, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_9cfsupport_PyCFRunLoopTimer, /*tp_methods*/
__pyx_members_9cfsupport_PyCFRunLoopTimer, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_9cfsupport_PyCFRunLoopTimer, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static PyObject *__pyx_tp_new_9cfsupport_PyCFRunLoop(struct _typeobject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_9cfsupport_PyCFRunLoop *p = (struct __pyx_obj_9cfsupport_PyCFRunLoop *)o;
p->cf = Py_None; Py_INCREF(p->cf);
if (__pyx_f_9cfsupport_11PyCFRunLoop___new__(o, a, k) < 0) {
Py_DECREF(o); o = 0;
}
return o;
}
static void __pyx_tp_dealloc_9cfsupport_PyCFRunLoop(PyObject *o) {
struct __pyx_obj_9cfsupport_PyCFRunLoop *p = (struct __pyx_obj_9cfsupport_PyCFRunLoop *)o;
Py_XDECREF(p->cf);
(*o->ob_type->tp_free)(o);
}
static int __pyx_tp_traverse_9cfsupport_PyCFRunLoop(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_9cfsupport_PyCFRunLoop *p = (struct __pyx_obj_9cfsupport_PyCFRunLoop *)o;
e = (*v)(p->cf, a); if (e) return e;
return 0;
}
static int __pyx_tp_clear_9cfsupport_PyCFRunLoop(PyObject *o) {
struct __pyx_obj_9cfsupport_PyCFRunLoop *p = (struct __pyx_obj_9cfsupport_PyCFRunLoop *)o;
Py_XDECREF(p->cf);
p->cf = Py_None; Py_INCREF(p->cf);
return 0;
}
static struct PyMethodDef __pyx_methods_9cfsupport_PyCFRunLoop[] = {
{"run", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_run, METH_VARARGS|METH_KEYWORDS, 0},
{"stop", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_stop, METH_VARARGS|METH_KEYWORDS, 0},
{"currentMode", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_currentMode, METH_VARARGS|METH_KEYWORDS, 0},
{"addSocket", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_addSocket, METH_VARARGS|METH_KEYWORDS, 0},
{"removeSocket", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_removeSocket, METH_VARARGS|METH_KEYWORDS, 0},
{"addTimer", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_addTimer, METH_VARARGS|METH_KEYWORDS, 0},
{"removeTimer", (PyCFunction)__pyx_f_9cfsupport_11PyCFRunLoop_removeTimer, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};
static struct PyMemberDef __pyx_members_9cfsupport_PyCFRunLoop[] = {
{"cf", T_OBJECT, offsetof(struct __pyx_obj_9cfsupport_PyCFRunLoop, cf), 0, 0},
{0, 0, 0, 0, 0}
};
static PyNumberMethods __pyx_tp_as_number_PyCFRunLoop = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
};
static PySequenceMethods __pyx_tp_as_sequence_PyCFRunLoop = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};
static PyMappingMethods __pyx_tp_as_mapping_PyCFRunLoop = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
static PyBufferProcs __pyx_tp_as_buffer_PyCFRunLoop = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};
statichere PyTypeObject __pyx_type_9cfsupport_PyCFRunLoop = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"cfsupport.PyCFRunLoop", /*tp_name*/
sizeof(struct __pyx_obj_9cfsupport_PyCFRunLoop), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_9cfsupport_PyCFRunLoop, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_PyCFRunLoop, /*tp_as_number*/
&__pyx_tp_as_sequence_PyCFRunLoop, /*tp_as_sequence*/
&__pyx_tp_as_mapping_PyCFRunLoop, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_PyCFRunLoop, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_9cfsupport_PyCFRunLoop, /*tp_traverse*/
__pyx_tp_clear_9cfsupport_PyCFRunLoop, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_9cfsupport_PyCFRunLoop, /*tp_methods*/
__pyx_members_9cfsupport_PyCFRunLoop, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_9cfsupport_PyCFRunLoop, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct PyMethodDef __pyx_methods[] = {
{"now", (PyCFunction)__pyx_f_9cfsupport_now, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};
DL_EXPORT(void) initcfsupport(void); /*proto*/
DL_EXPORT(void) initcfsupport(void) {
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
__pyx_m = Py_InitModule4("cfsupport", __pyx_methods, 0, 0, PYTHON_API_VERSION);
__pyx_b = PyImport_AddModule("__builtin__");
PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b);
if (PyType_Ready(&__pyx_type_9cfsupport_PyCFSocket) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "PyCFSocket", (PyObject *)&__pyx_type_9cfsupport_PyCFSocket) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; goto __pyx_L1;}
__pyx_ptype_9cfsupport_PyCFSocket = &__pyx_type_9cfsupport_PyCFSocket;
if (PyType_Ready(&__pyx_type_9cfsupport_PyCFRunLoopTimer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "PyCFRunLoopTimer", (PyObject *)&__pyx_type_9cfsupport_PyCFRunLoopTimer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; goto __pyx_L1;}
__pyx_ptype_9cfsupport_PyCFRunLoopTimer = &__pyx_type_9cfsupport_PyCFRunLoopTimer;
if (PyType_Ready(&__pyx_type_9cfsupport_PyCFRunLoop) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "PyCFRunLoop", (PyObject *)&__pyx_type_9cfsupport_PyCFRunLoop) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; goto __pyx_L1;}
__pyx_ptype_9cfsupport_PyCFRunLoop = &__pyx_type_9cfsupport_PyCFRunLoop;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi":35 */
Py_INCREF(Py_None);
__pyx_k1 = Py_None;
Py_INCREF(Py_None);
__pyx_k2 = Py_None;
Py_INCREF(Py_None);
__pyx_k3 = Py_None;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":1 */
__pyx_1 = PyString_FromString(__pyx_k4); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; goto __pyx_L1;}
__pyx_2 = __Pyx_Import(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (PyObject_SetAttrString(__pyx_m, "_CarbonEvt", __pyx_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi":43 */
Py_INCREF(Py_None);
__pyx_k5 = Py_None;
/* "/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsupport.pyx":6 */
__pyx_1 = PyString_FromString(__pyx_k6); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 6; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "__version__", __pyx_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 6; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
return;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("cfsupport");
}
static char *__pyx_filenames[] = {
"/Users/bob/src/Twisted/twisted/internet/cfsupport/cfdate.pxi",
"/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsocket.pxi",
"/Users/bob/src/Twisted/twisted/internet/cfsupport/cfrunloop.pxi",
"/Users/bob/src/Twisted/twisted/internet/cfsupport/cfsupport.pyx",
};
statichere char **__pyx_f = __pyx_filenames;
/* Runtime support code */
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name) {
if (!type) {
PyErr_Format(PyExc_SystemError, "Missing type object");
return 0;
}
if ((none_allowed && obj == Py_None) || PyObject_TypeCheck(obj, type))
return 1;
PyErr_Format(PyExc_TypeError,
"Argument '%s' has incorrect type (expected %s, got %s)",
name, type->tp_name, obj->ob_type->tp_name);
return 0;
}
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
PyObject *__import__ = 0;
PyObject *empty_list = 0;
PyObject *module = 0;
PyObject *global_dict = 0;
PyObject *empty_dict = 0;
PyObject *list;
__import__ = PyObject_GetAttrString(__pyx_b, "__import__");
if (!__import__)
goto bad;
if (from_list)
list = from_list;
else {
empty_list = PyList_New(0);
if (!empty_list)
goto bad;
list = empty_list;
}
global_dict = PyModule_GetDict(__pyx_m);
if (!global_dict)
goto bad;
empty_dict = PyDict_New();
if (!empty_dict)
goto bad;
module = PyObject_CallFunction(__import__, "OOOO",
name, global_dict, empty_dict, list);
bad:
Py_XDECREF(empty_list);
Py_XDECREF(__import__);
Py_XDECREF(empty_dict);
return module;
}
static void __Pyx_WriteUnraisable(char *name) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
PyErr_Fetch(&old_exc, &old_val, &old_tb);
ctx = PyString_FromString(name);
PyErr_Restore(old_exc, old_val, old_tb);
if (!ctx)
ctx = Py_None;
PyErr_WriteUnraisable(ctx);
}
static PyObject *__Pyx_GetName(PyObject *dict, char *name) {
PyObject *result;
result = PyObject_GetAttrString(dict, name);
if (!result)
PyErr_SetString(PyExc_NameError, name);
return result;
}
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
Py_XINCREF(type);
Py_XINCREF(value);
Py_XINCREF(tb);
/* First, check the traceback argument, replacing None with NULL. */
if (tb == Py_None) {
Py_DECREF(tb);
tb = 0;
}
else if (tb != NULL && !PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError,
"raise: arg 3 must be a traceback or None");
goto raise_error;
}
/* Next, replace a missing value with None */
if (value == NULL) {
value = Py_None;
Py_INCREF(value);
}
/* Next, repeatedly, replace a tuple exception with its first item */
while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {
PyObject *tmp = type;
type = PyTuple_GET_ITEM(type, 0);
Py_INCREF(type);
Py_DECREF(tmp);
}
if (PyString_Check(type))
;
else if (PyClass_Check(type))
; /*PyErr_NormalizeException(&type, &value, &tb);*/
else if (PyInstance_Check(type)) {
/* Raising an instance. The value should be a dummy. */
if (value != Py_None) {
PyErr_SetString(PyExc_TypeError,
"instance exception may not have a separate value");
goto raise_error;
}
else {
/* Normalize to raise <class>, <instance> */
Py_DECREF(value);
value = type;
type = (PyObject*) ((PyInstanceObject*)type)->in_class;
Py_INCREF(type);
}
}
else {
/* Not something you can raise. You get an exception
anyway, just not what you specified :-) */
PyErr_Format(PyExc_TypeError,
"exceptions must be strings, classes, or "
"instances, not %s", type->ob_type->tp_name);
goto raise_error;
}
PyErr_Restore(type, value, tb);
return;
raise_error:
Py_XDECREF(value);
Py_XDECREF(type);
Py_XDECREF(tb);
return;
}
static void __Pyx_ReRaise(void) {
PyThreadState *tstate = PyThreadState_Get();
PyObject *type = tstate->exc_type;
PyObject *value = tstate->exc_value;
PyObject *tb = tstate->exc_traceback;
Py_XINCREF(type);
Py_XINCREF(value);
Py_XINCREF(tb);
PyErr_Restore(type, value, tb);
}
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static void __Pyx_AddTraceback(char *funcname) {
PyObject *py_srcfile = 0;
PyObject *py_funcname = 0;
PyObject *py_globals = 0;
PyObject *empty_tuple = 0;
PyObject *empty_string = 0;
PyCodeObject *py_code = 0;
PyFrameObject *py_frame = 0;
py_srcfile = PyString_FromString(__pyx_filename);
if (!py_srcfile) goto bad;
py_funcname = PyString_FromString(funcname);
if (!py_funcname) goto bad;
py_globals = PyModule_GetDict(__pyx_m);
if (!py_globals) goto bad;
empty_tuple = PyTuple_New(0);
if (!empty_tuple) goto bad;
empty_string = PyString_FromString("");
if (!empty_string) goto bad;
py_code = PyCode_New(
0, /*int argcount,*/
0, /*int nlocals,*/
0, /*int stacksize,*/
0, /*int flags,*/
empty_string, /*PyObject *code,*/
empty_tuple, /*PyObject *consts,*/
empty_tuple, /*PyObject *names,*/
empty_tuple, /*PyObject *varnames,*/
empty_tuple, /*PyObject *freevars,*/
empty_tuple, /*PyObject *cellvars,*/
py_srcfile, /*PyObject *filename,*/
py_funcname, /*PyObject *name,*/
__pyx_lineno, /*int firstlineno,*/
empty_string /*PyObject *lnotab*/
);
if (!py_code) goto bad;
py_frame = PyFrame_New(
PyThreadState_Get(), /*PyThreadState *tstate,*/
py_code, /*PyCodeObject *code,*/
py_globals, /*PyObject *globals,*/
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
py_frame->f_lineno = __pyx_lineno;
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_srcfile);
Py_XDECREF(py_funcname);
Py_XDECREF(empty_tuple);
Py_XDECREF(empty_string);
Py_XDECREF(py_code);
Py_XDECREF(py_frame);
}
syntax highlighted by Code2HTML, v. 0.9.1