set permissions to 644 for data files
[enigma2.git] / lib / python / python.h
index 76f6aa88b03ee9df28ffaba1e0451004729ff2f5..52ec6c1eaba64b86ad37e2a5137c1669063f4746 100644 (file)
@@ -24,6 +24,7 @@ public:
 #ifdef PYTHON_REFCOUNT_DEBUG
        inline ePyObject(PyObject *ob, const char *file, int line);
 #endif
+       inline ePyObject(PyVarObject *ob);
        inline ePyObject(PyDictObject *ob);
        inline ePyObject(PyTupleObject *ob);
        inline ePyObject(PyListObject *ob);
@@ -32,11 +33,13 @@ public:
        operator bool() { return !!m_ob; }
        ePyObject &operator=(const ePyObject &);
        ePyObject &operator=(PyObject *);
+       ePyObject &operator=(PyVarObject *ob) { return operator=((PyObject*)ob); }
        ePyObject &operator=(PyDictObject *ob) { return operator=((PyObject*)ob); }
        ePyObject &operator=(PyTupleObject *ob) { return operator=((PyObject*)ob); }
        ePyObject &operator=(PyListObject *ob) { return operator=((PyObject*)ob); }
        ePyObject &operator=(PyStringObject *ob) { return operator=((PyObject*)ob); }
        operator PyObject*();
+       operator PyVarObject*() { return (PyVarObject*)operator PyVarObject*(); }
        operator PyTupleObject*() { return (PyTupleObject*)operator PyObject*(); }
        operator PyListObject*() { return (PyListObject*)operator PyObject*(); }
        operator PyStringObject*() { return (PyStringObject*)operator PyObject*(); }
@@ -84,6 +87,14 @@ inline ePyObject::ePyObject(PyObject *ob, const char* file, int line)
 }
 #endif
 
+inline ePyObject::ePyObject(PyVarObject *ob)
+       :m_ob((PyObject*)ob)
+#ifdef PYTHON_REFCOUNT_DEBUG
+       ,m_file(0), m_line(0), m_from(0), m_to(0), m_erased(false)
+#endif
+{
+}
+
 inline ePyObject::ePyObject(PyDictObject *ob)
        :m_ob((PyObject*)ob)
 #ifdef PYTHON_REFCOUNT_DEBUG
@@ -314,10 +325,16 @@ inline ePyObject Impl_PyTuple_GET_ITEM(ePyObject list, unsigned int pos)
 }
 #endif
 
+inline void Impl_INCREF(PyObject *ob)
+{
+       Py_INCREF(ob);
+}
+
 inline void Impl_DECREF(PyObject *ob)
 {
        Py_DECREF(ob);
 }
+#define Org_Py_INCREF(obj) Impl_INCREF(obj)
 #define Org_Py_DECREF(obj) Impl_DECREF(obj)
 #undef Py_DECREF
 #undef Py_XDECREF
@@ -364,6 +381,7 @@ class ePython
 public:
        ePython();
        ~ePython();
+       int execFile(const char *file);
        int execute(const std::string &pythonfile, const std::string &funcname);
        static int call(ePyObject pFunc, ePyObject args);
        static ePyObject resolve(const std::string &pythonfile, const std::string &funcname);