Revision: 600 http://rpy.svn.sourceforge.net/rpy/?rev=600&view=rev Author: lgautier Date: 2008-08-02 22:25:02 +0000 (Sat, 02 Aug 2008)
Log Message: ----------- New type for R objects of type "language" Modified Paths: -------------- branches/rpy_nextgen/rpy/rinterface/rinterface.c Modified: branches/rpy_nextgen/rpy/rinterface/rinterface.c =================================================================== --- branches/rpy_nextgen/rpy/rinterface/rinterface.c 2008-08-02 15:37:43 UTC (rev 599) +++ branches/rpy_nextgen/rpy/rinterface/rinterface.c 2008-08-02 22:25:02 UTC (rev 600) @@ -1777,8 +1777,60 @@ 0 /*tp_is_gc*/ }; +//FIXME: write more doc +PyDoc_STRVAR(LangSexp_Type_doc, +"Language object."); +static PyTypeObject LangSexp_Type = { + /* The ob_type field must be initialized in the module init function + * to be portable to Windows without using C++. */ + PyObject_HEAD_INIT(NULL) + 0, /*ob_size*/ + "rinterface.SexpLang", /*tp_name*/ + sizeof(PySexpObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + /* methods */ + 0, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0,//Sexp_str, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + LangSexp_Type_doc, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0,//Sexp_getset, /*tp_getset*/ + &Sexp_Type, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + //FIXME: add new method + 0, //S4Sexp_new, /*tp_new*/ + 0, /*tp_free*/ + 0 /*tp_is_gc*/ +}; + + /* --- Create a SEXP object --- */ static PySexpObject* newPySexpObject(const SEXP sexp) @@ -1829,6 +1881,9 @@ case S4SXP: object = (PySexpObject *)Sexp_new(&S4Sexp_Type, Py_None, Py_None); break; + case LANGSXP: + object = (PySexpObject *)Sexp_new(&LangSexp_Type, Py_None, Py_None); + break; default: object = (PySexpObject *)Sexp_new(&Sexp_Type, Py_None, Py_None); break; @@ -2179,6 +2234,8 @@ return; if (PyType_Ready(&S4Sexp_Type) < 0) return; + if (PyType_Ready(&LangSexp_Type) < 0) + return; PyObject *m, *d; m = Py_InitModule3("rinterface", EmbeddedR_methods, module_doc); @@ -2212,6 +2269,7 @@ PyModule_AddObject(m, "SexpVector", (PyObject *)&VectorSexp_Type); PyModule_AddObject(m, "SexpEnvironment", (PyObject *)&EnvironmentSexp_Type); PyModule_AddObject(m, "SexpS4", (PyObject *)&S4Sexp_Type); + PyModule_AddObject(m, "SexpLang", (PyObject *)&LangSexp_Type); if (RPyExc_RuntimeError == NULL) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list