/* Chrysalide - Outil d'analyse de fichiers binaires
* tpmem-int.h - définitions internes propres à la mémorisation des types d'objets mis en cache
*
* Copyright (C) 2020-2025 Cyrille Bagard
*
* This file is part of Chrysalide.
*
* Chrysalide is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Chrysalide is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Chrysalide. If not, see .
*/
#ifndef _GLIBEXT_TPMEM_INT_H
#define _GLIBEXT_TPMEM_INT_H
#include "tpmem.h"
/* Conservation d'une référence sur un type */
typedef struct _gtype_ref_info_t
{
GType gtype; /* Type pour la GLib */
gpointer gclass; /* Lien vers sa classe */
/**
* La GLib n'est pas très claire sur la taille de GType comme le montre le
* code issu de /gobject/gtype.h :
*
* #if GLIB_SIZEOF_SIZE_T != GLIB_SIZEOF_LONG || !defined __cplusplus
* typedef gsize GType;
* #else // for historic reasons, C++ links against gulong GTypes
* typedef gulong GType;
* #endif
*
* Et :
*
* typedef unsigned $glib_size_type_define gsize;
*
* On prend donc le parti de conserver ces types sous forme de valeurs 64 bits
* lors des enregistrements.
*/
} gtype_ref_info_t;
/* Définition d'une mémoire de types d'objets (instance) */
struct _GTypeMemory
{
GObject parent; /* A laisser en premier */
gtype_ref_info_t *gtypes; /* Types des objets reconnus */
size_t count; /* Quantité de ces objets */
GMutex mutex; /* Contrôle d'accès à la liste */
};
/* Définition d'une mémoire de types d'objets (classe) */
struct _GTypeMemoryClass
{
GObjectClass parent; /* A laisser en premier */
};
#endif /* _GLIBEXT_TPMEM_INT_H */