diff options
Diffstat (limited to 'src/glibext/serialize.h')
-rw-r--r-- | src/glibext/serialize.h | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/src/glibext/serialize.h b/src/glibext/serialize.h index 93a4496..c95ac30 100644 --- a/src/glibext/serialize.h +++ b/src/glibext/serialize.h @@ -2,7 +2,7 @@ /* Chrysalide - Outil d'analyse de fichiers binaires * serialize.h - prototypes pour les objets entreposables dans un cache * - * Copyright (C) 2020 Cyrille Bagard + * Copyright (C) 2020-2025 Cyrille Bagard * * This file is part of Chrysalide. * @@ -21,44 +21,32 @@ */ -#ifndef _ANALYSIS_STORAGE_SERIALIZE_H -#define _ANALYSIS_STORAGE_SERIALIZE_H +#ifndef _GLIBEXT_SERIALIZE_H +#define _GLIBEXT_SERIALIZE_H -#include <glib-object.h> +#include <stdbool.h> -#include "../../common/packed.h" +#include "helpers.h" -#define G_TYPE_SERIALIZABLE_OBJECT g_serializable_object_get_type() -#define G_SERIALIZABLE_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_SERIALIZABLE_OBJECT, GSerializableObject)) -#define G_SERIALIZABLE_OBJECT_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST((vtable), G_TYPE_SERIALIZABLE_OBJECT, GSerializableObjectIface)) -#define G_IS_SERIALIZABLE_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_SERIALIZABLE_OBJECT)) -#define G_IS_SERIALIZABLE_OBJECT_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE((vtable), G_TYPE_SERIALIZABLE_OBJECT)) -#define G_SERIALIZABLE_OBJECT_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), G_TYPE_SERIALIZABLE_OBJECT, GSerializableObjectIface)) +#define G_TYPE_SERIALIZABLE_OBJECT (g_serializable_object_get_type()) +DECLARE_INTERFACE(GSerializableObject, g_serializable_object, G, SERIALIZABLE_OBJECT); -/* Intermédiaire pour la mise en cache d'objet (coquille vide) */ -typedef struct _GSerializableObject GSerializableObject; - -/* Intermédiaire pour la mise en cache d'objet (interface) */ -typedef struct _GSerializableObjectIface GSerializableObjectIface; - - -/* Détermine le type d'une interface pour la mise en cache d'objet. */ -GType g_serializable_object_get_type(void) G_GNUC_CONST; /* storage.h : définition d'une conservation d'objets construits */ typedef struct _GObjectStorage GObjectStorage; -/* Charge un objet depuis une mémoire tampon. */ -bool g_serializable_object_load(GSerializableObject *, GObjectStorage *, packed_buffer_t *); -/* Sauvegarde un objet dans une mémoire tampon. */ -bool g_serializable_object_store(const GSerializableObject *, GObjectStorage *, packed_buffer_t *); +/* Charge un objet depuis un flux de données. */ +bool g_serializable_object_load(GSerializableObject *, GObjectStorage *, int); + +/* Sauvegarde un objet dans un flux de données. */ +bool g_serializable_object_store(const GSerializableObject *, GObjectStorage *, int); -#endif /* _ANALYSIS_STORAGE_SERIALIZE_H */ +#endif /* _GLIBEXT_SERIALIZE_H */ |