diff options
Diffstat (limited to 'plugins/pychrysalide/analysis/storage')
-rw-r--r-- | plugins/pychrysalide/analysis/storage/serialize.c | 71 |
1 files changed, 30 insertions, 41 deletions
diff --git a/plugins/pychrysalide/analysis/storage/serialize.c b/plugins/pychrysalide/analysis/storage/serialize.c index 3bf5183..6e1dd41 100644 --- a/plugins/pychrysalide/analysis/storage/serialize.c +++ b/plugins/pychrysalide/analysis/storage/serialize.c @@ -32,7 +32,6 @@ #include "storage.h" -#include "tpmem.h" #include "../../access.h" #include "../../helpers.h" #include "../../common/packed.h" @@ -46,10 +45,10 @@ static void py_serializable_object_interface_init(GSerializableObjectIface *, gpointer *); /* Charge un objet depuis une mémoire tampon. */ -static bool py_serializable_object_load_wrapper(GSerializableObject *, GObjectStorage *, GTypeMemory *, packed_buffer *); +static bool py_serializable_object_load_wrapper(GSerializableObject *, GObjectStorage *, packed_buffer *); /* Sauvegarde un objet dans une mémoire tampon. */ -static bool py_serializable_object_store_wrapper(const GSerializableObject *, GObjectStorage *, GTypeMemory *, packed_buffer *); +static bool py_serializable_object_store_wrapper(const GSerializableObject *, GObjectStorage *, packed_buffer *); @@ -108,7 +107,6 @@ static void py_serializable_object_interface_init(GSerializableObjectIface *ifac * * * Paramètres : object = instruction d'assemblage à consulter. * * storage = conservateur de données à manipuler ou NULL. * -* tpmem = mémoire des types d'objets à compléter. * * pbuf = zone tampon à remplir. * * * * Description : Charge un objet depuis une mémoire tampon. * @@ -119,7 +117,7 @@ static void py_serializable_object_interface_init(GSerializableObjectIface *ifac * * ******************************************************************************/ -static bool py_serializable_object_load_wrapper(GSerializableObject *object, GObjectStorage *storage, GTypeMemory *tpmem, packed_buffer *pbuf) +static bool py_serializable_object_load_wrapper(GSerializableObject *object, GObjectStorage *storage, packed_buffer *pbuf) { bool result; /* Bilan à retourner */ PyGILState_STATE gstate; /* Sauvegarde d'environnement */ @@ -130,15 +128,14 @@ static bool py_serializable_object_load_wrapper(GSerializableObject *object, GOb #define SERIALIZABLE_OBJECT_LOAD_WRAPPER PYTHON_WRAPPER_DEF \ ( \ - _load, "$self, storage, tpmem, pbuf, /", \ + _load, "$self, storage, pbuf, /", \ METH_VARARGS, \ "Abstract method used to load an object definition from buffered data.\n" \ "\n" \ "The *storage* is a pychrysalide.analysis.storage.ObjectStorage instance" \ - " provided to store inner objects, if relevant, or None. The *tpmem* object"\ - " is a pychrysalide.analysis.storage.TypeMemory remembering all involved" \ - " GLib types. The *pbuf* argument points to a" \ - " pychrysalide.common.PackedBuffer object containing the data to process.\n"\ + " provided to store inner objects, if relevant, or None. The *pbuf*" \ + " argument points to a pychrysalide.common.PackedBuffer object containing" \ + " the data to process.\n" \ "\n" \ "The result is a boolean indicating the status of the operation." \ ) @@ -159,10 +156,9 @@ static bool py_serializable_object_load_wrapper(GSerializableObject *object, GOb else storage_obj = pygobject_new(G_OBJECT(storage)); - args = PyTuple_New(3); + args = PyTuple_New(2); PyTuple_SetItem(args, 0, storage_obj); - PyTuple_SetItem(args, 1, pygobject_new(G_OBJECT(tpmem))); - PyTuple_SetItem(args, 2, build_from_internal_packed_buffer(pbuf)); + PyTuple_SetItem(args, 1, build_from_internal_packed_buffer(pbuf)); pyret = run_python_method(pyobj, "_load", args); @@ -187,7 +183,6 @@ static bool py_serializable_object_load_wrapper(GSerializableObject *object, GOb * * * Paramètres : object = instruction d'assemblage à consulter. * * storage = conservateur de données à manipuler ou NULL. * -* tpmem = mémoire des types d'objets à compléter. * * pbuf = zone tampon à remplir. * * * * Description : Sauvegarde un objet dans une mémoire tampon. * @@ -198,7 +193,7 @@ static bool py_serializable_object_load_wrapper(GSerializableObject *object, GOb * * ******************************************************************************/ -static bool py_serializable_object_store_wrapper(const GSerializableObject *object, GObjectStorage *storage, GTypeMemory *tpmem, packed_buffer *pbuf) +static bool py_serializable_object_store_wrapper(const GSerializableObject *object, GObjectStorage *storage, packed_buffer *pbuf) { bool result; /* Bilan à retourner */ PyGILState_STATE gstate; /* Sauvegarde d'environnement */ @@ -209,15 +204,14 @@ static bool py_serializable_object_store_wrapper(const GSerializableObject *obje #define SERIALIZABLE_OBJECT_STORE_WRAPPER PYTHON_WRAPPER_DEF \ ( \ - _store, "$self, storage, tpmem, pbuf, /", \ + _store, "$self, storage, pbuf, /", \ METH_VARARGS, \ "Abstract method used to store an object definition into buffered data.\n" \ "\n" \ "The *storage* is a pychrysalide.analysis.storage.ObjectStorage instance" \ - " provided to store inner objects, if relevant, or None. The *tpmem* object"\ - " is a pychrysalide.analysis.storage.TypeMemory remembering all involved" \ - " GLib types. The *pbuf* argument points to a" \ - " pychrysalide.common.PackedBuffer object containing the data to process.\n"\ + " provided to store inner objects, if relevant, or None. The *pbuf*" \ + " argument points to a pychrysalide.common.PackedBuffer object containing" \ + " the data to process.\n" \ "\n" \ "The result is a boolean indicating the status of the operation." \ ) @@ -238,10 +232,9 @@ static bool py_serializable_object_store_wrapper(const GSerializableObject *obje else storage_obj = pygobject_new(G_OBJECT(storage)); - args = PyTuple_New(3); + args = PyTuple_New(2); PyTuple_SetItem(args, 0, storage_obj); - PyTuple_SetItem(args, 1, pygobject_new(G_OBJECT(tpmem))); - PyTuple_SetItem(args, 2, build_from_internal_packed_buffer(pbuf)); + PyTuple_SetItem(args, 1, build_from_internal_packed_buffer(pbuf)); pyret = run_python_method(pyobj, "_store", args); @@ -285,7 +278,6 @@ static bool py_serializable_object_load(PyObject *self, PyObject *args) { PyObject *result; /* Bilan à retourner */ GObjectStorage *storage; /* Conservateur à manipuler */ - GTypeMemory *tpmem; /* Gestionnaire de types */ packed_buffer *pbuf; /* Tampon de données à employer*/ int ret; /* Bilan de lecture des args. */ GSerializableObject *object; /* Version native */ @@ -293,26 +285,25 @@ static bool py_serializable_object_load(PyObject *self, PyObject *args) #define SERIALIZABLE_OBJECT_LOAD_METHOD PYTHON_METHOD_DEF \ ( \ - load, "$self, storage, tpmem, pbuf, /", \ + load, "$self, storage, pbuf, /", \ METH_VARARGS, py_serializable_object, \ "Load an object definition from buffered data.\n" \ "\n" \ "The *storage* is a pychrysalide.analysis.storage.ObjectStorage instance" \ - " provided to store inner objects, if relevant, or None. The *tpmem* object"\ - " is a pychrysalide.analysis.storage.TypeMemory remembering all involved" \ - " GLib types. The *pbuf* argument points to a" \ - " pychrysalide.common.PackedBuffer object containing the data to process.\n"\ + " provided to store inner objects, if relevant, or None. The *pbuf*" \ + " argument points to a pychrysalide.common.PackedBuffer object containing" \ + " the data to process.\n" \ "\n" \ "The result is a boolean indicating the status of the operation." \ ) - ret = PyArg_ParseTuple(args, "O&O&O&", convert_to_object_storage_or_none, &storage, - convert_to_type_memory, &tpmem, convert_to_packed_buffer, &pbuf); + ret = PyArg_ParseTuple(args, "O&O&", convert_to_object_storage_or_none, &storage, + convert_to_packed_buffer, &pbuf); if (!ret) return NULL; object = G_SERIALIZABLE_OBJECT(pygobject_get(self)); - status = g_serializable_object_load(object, storage, tpmem, pbuf); + status = g_serializable_object_load(object, storage, pbuf); result = status ? Py_True : Py_False; Py_INCREF(result); @@ -339,7 +330,6 @@ static bool py_serializable_object_store(PyObject *self, PyObject *args) { PyObject *result; /* Bilan à retourner */ GObjectStorage *storage; /* Conservateur à manipuler */ - GTypeMemory *tpmem; /* Gestionnaire de types */ packed_buffer *pbuf; /* Tampon de données à employer*/ int ret; /* Bilan de lecture des args. */ GSerializableObject *object; /* Version native */ @@ -347,26 +337,25 @@ static bool py_serializable_object_store(PyObject *self, PyObject *args) #define SERIALIZABLE_OBJECT_STORE_METHOD PYTHON_METHOD_DEF \ ( \ - store, "$self, storage, tpmem, pbuf, /", \ + store, "$self, storage, pbuf, /", \ METH_VARARGS, py_serializable_object, \ "Store an object definition into buffered data.\n" \ "\n" \ "The *storage* is a pychrysalide.analysis.storage.ObjectStorage instance" \ - " provided to store inner objects, if relevant, or None. The *tpmem* object"\ - " is a pychrysalide.analysis.storage.TypeMemory remembering all involved" \ - " GLib types. The *pbuf* argument points to a" \ - " pychrysalide.common.PackedBuffer object containing the data to process.\n"\ + " provided to store inner objects, if relevant, or None. The *pbuf*" \ + " argument points to a pychrysalide.common.PackedBuffer object containing" \ + " the data to process.\n" \ "\n" \ "The result is a boolean indicating the status of the operation." \ ) - ret = PyArg_ParseTuple(args, "O&O&O&", convert_to_object_storage_or_none, &storage, - convert_to_type_memory, &tpmem, convert_to_packed_buffer, &pbuf); + ret = PyArg_ParseTuple(args, "O&O&", convert_to_object_storage_or_none, &storage, + convert_to_packed_buffer, &pbuf); if (!ret) return NULL; object = G_SERIALIZABLE_OBJECT(pygobject_get(self)); - status = g_serializable_object_store(object, storage, tpmem, pbuf); + status = g_serializable_object_store(object, storage, pbuf); result = status ? Py_True : Py_False; Py_INCREF(result); |