Esempio n. 1
0
static int
coro_wrapper_traverse(PyCoroWrapper *cw, visitproc visit, void *arg)
{
    Py_VISIT((PyObject *)cw->cw_coroutine);
    return 0;
}
Esempio n. 2
0
static int myextension_traverse(PyObject *m, visitproc visit, void *arg) {
    Py_VISIT(GETSTATE(m)->error);
    return 0;
}
Esempio n. 3
0
static int
instancemethod_traverse(PyObject *self, visitproc visit, void *arg) {
    Py_VISIT(PyInstanceMethod_GET_FUNCTION(self));
    return 0;
}
Esempio n. 4
0
static int
skipdictiter_traverse(SkipDictIterObject *it, visitproc visit, void *arg)
{
    Py_VISIT(it->skipdict);
    return 0;
}
Esempio n. 5
0
static int entity_traverse(EntityObject *self, visitproc visit, void *arg)
{
  Py_VISIT(self->unparsed_entities);
  return DomletteContainer_Type.tp_traverse((PyObject *)self, visit, arg);
}
Esempio n. 6
0
static int turnstile_traverse(PyObject *m, visitproc visit, void *arg) {
    Py_VISIT(GETSTATE(m)->error);
    return 0;
}
Esempio n. 7
0
static int
_curses_panel_traverse(PyObject *m, visitproc visit, void *arg)
{
    Py_VISIT(_curses_panelstate(m)->PyCursesError);
    return 0;
}
Esempio n. 8
0
static int DCRenderTargetTraverse(DCRenderTarget* self, visitproc visit, void* arg)
{
	Py_VISIT(self->colorTextures);
	Py_VISIT(self->depthTexture);
	return 0;
}
Esempio n. 9
0
File: tcp.c Progetto: eagles125/pyuv
static int
TCP_tp_traverse(TCP *self, visitproc visit, void *arg)
{
    Py_VISIT(self->on_new_connection_cb);
    return StreamType.tp_traverse((PyObject *)self, visit, arg);
}
static int _cmessage_traverse(PyObject *m, visitproc visit, void *arg) {
    Py_VISIT(GETSTATE(m)->_cbson);
    return 0;
}
Esempio n. 11
0
int BaseMathObject_traverse(BaseMathObject *self, visitproc visit, void *arg)
{
	Py_VISIT(self->cb_user);
	return 0;
}
Esempio n. 12
0
static int
Dispatcher_traverse(DispatcherObject *self, visitproc visit, void *arg)
{
    Py_VISIT(self->defargs);
    return 0;
}
Esempio n. 13
0
static int
gc_traverse(PyWeakReference *self, visitproc visit, void *arg)
{
    Py_VISIT(self->wr_callback);
    return 0;
}
Esempio n. 14
0
PyObject * mlabraw_put(PyObject *, PyObject *args)
{
  char *lName;
  PyObject *lHandle;
  PyObject *lSource;
  PyObject *encoded_source;
  mxArray *lArray = NULL;
  //FIXME should make these objects const
  if (! PyArg_ParseTuple(args, "OsO:put", &lHandle, &lName, &lSource)) return NULL;
  if (! PyCapsule_CheckExact(lHandle)) {
    PyErr_SetString(PyExc_TypeError, "Invalid object passed as mlabraw session handle");
    return NULL;
  }
  Py_INCREF(lSource);

#ifdef PY3K
  if (PyUnicode_Check(lSource)) {
      encoded_source = PyUnicode_AsUTF8String(lSource);
    lArray = char2mx(encoded_source);
    Py_DECREF(encoded_source);
#else
  if (PyString_Check(lSource)) {
    lArray = char2mx(lSource);
#endif
  } else {
    lArray = numeric2mx(lSource);
  }
  Py_DECREF(lSource);

  if (lArray == NULL) {
    return NULL;   // Above converter already set error message
  }


// for matlab version >= 6.5 (FIXME UNTESTED)
#ifdef _V6_5_OR_LATER
  if (engPutVariable((Engine *)PyCapsule_GetPointer(lHandle, NULL), lName, lArray) != 0) {
#else
  mxSetName(lArray, lName);
  if (engPutArray((Engine *)PyCapsule_GetPointer(lHandle, NULL), lArray) != 0) {
#endif
    PyErr_SetString(mlabraw_error,
                   "Unable to put matrix into MATLAB(TM) workspace");
    mxDestroyArray(lArray);
    return NULL;
  }
  mxDestroyArray(lArray);
  Py_INCREF(Py_None);
  return Py_None;
}

static const char * DOC = 
    "Mlabraw -- Low-level MATLAB(tm) Engine Interface\n"
    "\n"
    "  open  - Open a MATLAB(tm) engine session\n"
    "  close - Close a MATLAB(tm) engine session\n"
    "  eval  - Evaluates a string in the MATLAB(tm) session\n"
    "  get   - Gets a matrix from the MATLAB(tm) session\n"
    "  put   - Places a matrix into the MATLAB(tm) session\n"
    "\n"
    "The Numeric package must be installed for this module to be used.\n"
    "\n"
    "Copyright & Disclaimer\n"
    "======================\n"
    "Copyright (c) 2002-2007 Alexander Schmolck <*****@*****.**>\n"
    "\n"
    "Copyright (c) 1998,1999 Andrew Sterian. All Rights Reserved. mailto: [email protected]\n"
    "\n"
    "Copyright (c) 1998,1999 THE REGENTS OF THE UNIVERSITY OF MICHIGAN. ALL RIGHTS RESERVED \n"
    "\n"
    "Permission to use, copy, modify, and distribute this software and its\n"
    "documentation for any purpose and without fee is hereby granted, provided\n"
    "that the above copyright notices appear in all copies and that both these\n"
    "copyright notices and this permission notice appear in supporting\n"
    "documentation, and that the name of The University of Michigan not be used\n"
    "in advertising or publicity pertaining to distribution of the software\n"
    "without specific, written prior permission.\n"
    "\n"
    "THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION AS TO ITS FITNESS\n"
    "FOR ANY PURPOSE, AND WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR\n"
    "IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF\n"
    "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE REGENTS OF THE\n"
    "UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE FOR ANY DAMAGES, INCLUDING\n"
    "SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY\n"
    "CLAIM ARISING OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN IF\n"
    "IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n"
    "\n";

static PyMethodDef MlabrawMethods[] = {
  { "open",       mlabraw_open,       METH_VARARGS, open_doc },
  { "close",      mlabraw_close,      METH_VARARGS, close_doc },
  { "oldeval",    mlabraw_oldeval,    METH_VARARGS, ""       },
  { "eval",       mlabraw_eval,       METH_VARARGS, eval_doc },  //FIXME doc
  { "get",        mlabraw_get,        METH_VARARGS, get_doc },
  { "put",        mlabraw_put,        METH_VARARGS, put_doc },
  { NULL,         NULL,               0           , NULL}, // sentinel
};

struct module_state {
    PyObject *error;
};

#ifdef PY3K
    #define GETSTATE(m) ((struct module_state*)PyModule_GetState(m))
#else
    #define GETSTATE(m) (&_state)
    static struct module_state _state;
#endif

#ifdef PY3K
    static int myextension_traverse(PyObject *m, visitproc visit, void *arg) {
        Py_VISIT(GETSTATE(m)->error);
        return 0;
    }
    static int myextension_clear(PyObject *m) {
        Py_CLEAR(GETSTATE(m)->error);
        return 0;
    }
Esempio n. 15
0
static int
MidiListener_traverse(MidiListener *self, visitproc visit, void *arg)
{
    Py_VISIT(self->midicallable);
    return 0;
}
Esempio n. 16
0
static int
func_traverse(PyFunctionObject *f, visitproc visit, void *arg)
{
    Py_VISIT(f->func_code);
    Py_VISIT(f->func_globals);
    Py_VISIT(f->func_module);
    Py_VISIT(f->func_defaults);
    Py_VISIT(f->func_kwdefaults);
    Py_VISIT(f->func_doc);
    Py_VISIT(f->func_name);
    Py_VISIT(f->func_dict);
    Py_VISIT(f->func_closure);
    Py_VISIT(f->func_annotations);
    Py_VISIT(f->func_qualname);
    return 0;
}
Esempio n. 17
0
static int
iobase_traverse(iobase *self, visitproc visit, void *arg)
{
    Py_VISIT(self->dict);
    return 0;
}
Esempio n. 18
0
static int PageLauncherHook_traverse(PyObject *m, visitproc visit, void *arg) {
	Py_VISIT(((struct module_state*)PyModule_GetState(m))->Error);
	return 0;
}
Esempio n. 19
0
static int
Stream_tp_traverse(Stream *self, visitproc visit, void *arg)
{
    Py_VISIT(self->on_read_cb);
    return HandleType.tp_traverse((PyObject *)self, visit, arg);
}
Esempio n. 20
0
static int
iter_traverse(seqiterobject *it, visitproc visit, void *arg)
{
    Py_VISIT(it->it_seq);
    return 0;
}
static int
Channel_tp_traverse(Channel *self, visitproc visit, void *arg)
{
    Py_VISIT(self->sock_state_cb);
    return 0;
}
Esempio n. 22
0
static int
frame_traverse(PyFrameObject *f, visitproc visit, void *arg)
{
	PyObject **fastlocals, **p;
	int i, slots;

	Py_VISIT(f->f_back);
	Py_VISIT(f->f_code);
	Py_VISIT(f->f_builtins);
	Py_VISIT(f->f_globals);
	Py_VISIT(f->f_locals);
	Py_VISIT(f->f_trace);
	Py_VISIT(f->f_exc_type);
	Py_VISIT(f->f_exc_value);
	Py_VISIT(f->f_exc_traceback);

	/* locals */
	slots = f->f_code->co_nlocals + PyTuple_GET_SIZE(f->f_code->co_cellvars) + PyTuple_GET_SIZE(f->f_code->co_freevars);
	fastlocals = f->f_localsplus;
	for (i = slots; --i >= 0; ++fastlocals)
		Py_VISIT(*fastlocals);

	/* stack */
	if (f->f_stacktop != NULL) {
		for (p = f->f_valuestack; p < f->f_stacktop; p++)
			Py_VISIT(*p);
	}
	return 0;
}
Esempio n. 23
0
static int
PyCField_traverse(CFieldObject *self, visitproc visit, void *arg)
{
    Py_VISIT(self->proto);
    return 0;
}
Esempio n. 24
0
File: timer.c Progetto: iyedb/pyuv
static int
Timer_tp_traverse(Timer *self, visitproc visit, void *arg)
{
    Py_VISIT(self->callback);
    return HandleType.tp_traverse((PyObject *)self, visit, arg);
}
Esempio n. 25
0
static int
cell_traverse(PyCellObject *op, visitproc visit, void *arg)
{
	Py_VISIT(op->ob_ref);
	return 0;
}
Esempio n. 26
0
static int rpmModuleTraverse(PyObject *m, visitproc visit, void *arg) {
    Py_VISIT(pyrpmError);
    return 0;
}
Esempio n. 27
0
int
Repository_traverse(Repository *self, visitproc visit, void *arg)
{
    Py_VISIT(self->index);
    return 0;
}
Esempio n. 28
0
int
Config_traverse(Config *self, visitproc visit, void *arg)
{
    Py_VISIT(self->repo);
    return 0;
}
Esempio n. 29
0
static int Nuitka_Frame_tp_traverse( PyFrameObject *frame, visitproc visit, void *arg )
{
    Py_VISIT( frame->f_back );
    Py_VISIT( frame->f_code );
    Py_VISIT( frame->f_builtins );
    Py_VISIT( frame->f_globals );
    Py_VISIT( frame->f_locals );
    Py_VISIT( frame->f_trace );
    Py_VISIT( frame->f_exc_type );
    Py_VISIT( frame->f_exc_value );
    Py_VISIT( frame->f_exc_traceback );

    // locals
    Py_ssize_t slots = frame->f_code->co_nlocals + PyTuple_GET_SIZE( frame->f_code->co_cellvars ) + PyTuple_GET_SIZE( frame->f_code->co_freevars );
    PyObject **fastlocals = frame->f_localsplus;
    for ( Py_ssize_t i = slots; --i >= 0; ++fastlocals )
    {
        Py_VISIT( *fastlocals );
    }

    // stack if any
    if ( frame->f_stacktop != NULL )
    {
        for ( PyObject **p = frame->f_valuestack; p < frame->f_stacktop; p++ )
        {
            Py_VISIT( *p );
        }
    }

    return 0;
}
Esempio n. 30
0
static int
LDAPValueList_traverse(LDAPValueList *self, visitproc visit, void *arg) {
    Py_VISIT(self->deleted);
	Py_VISIT(self->added);
    return 0;
}