/* Chrysalide - Outil d'analyse de fichiers binaires * type.h - prototypes pour la manipulation des types en tout genre * * Copyright (C) 2010-2013 Cyrille Bagard * * This file is part of Chrysalide. * * OpenIDA 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. * * OpenIDA 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 Foobar. If not, see . */ #ifndef _ANALYSIS_TYPE_H #define _ANALYSIS_TYPE_H #include #include #include #include "../arch/archbase.h" #include "../decomp/output.h" #include "../glibext/gbufferline.h" /* ------------------------ REPRESENTATION INTERNE DES TYPES ------------------------ */ #define G_TYPE_DATA_TYPE g_data_type_get_type() #define G_DATA_TYPE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_data_type_get_type(), GDataType)) #define G_IS_DATA_TYPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_data_type_get_type())) #define G_DATA_TYPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_DATA_TYPE, GDataTypeClass)) #define G_IS_DATA_TYPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_DATA_TYPE)) #define G_DATA_TYPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_DATA_TYPE, GDataTypeClass)) /* Description de type quelconque (instance) */ typedef struct _GDataType GDataType; /* Description de type quelconque (classe) */ typedef struct _GDataTypeClass GDataTypeClass; /* Qualificatifs de variables */ typedef enum _TypeQualifier { TQF_NONE = (0 << 0), /* Néant */ TQF_RESTRICT = (1 << 0), /* restrict (C99) */ TQF_VOLATILE = (1 << 1), /* volatile */ TQF_CONST = (1 << 2) /* const */ } TypeQualifier; /* Indique le type défini pour un type quelconque. */ GType g_data_type_get_type(void); /* Crée un copie d'un type existant. */ GDataType *g_data_type_dup(const GDataType *); /* Définit le groupe d'appartenance d'un type donné. */ void g_data_type_set_namespace(GDataType *, GDataType *); /* Décrit le type fourni sous forme de caractères. */ char *_g_data_type_to_string(const GDataType *, bool); #define g_data_type_to_string(t) _g_data_type_to_string((t), true) /* Ajoute un qualificatif à une instance de type. */ void g_data_type_add_qualifier(GDataType *, TypeQualifier); /* Indique la terminaison de la représentation du type. */ bool g_data_type_is_pointer(const GDataType *, bool); /* Procède à l'impression de la description d'un type. */ void g_data_type_output(const GDataType *, GLangOutput *, GBufferLine *, bool, bool); /* -------------------------- COLLECTE ET GESTION DE TYPES -------------------------- */ #define G_TYPE_TYPES_MANAGER g_types_manager_get_type() #define G_TYPES_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_types_manager_get_type(), GTypesManager)) #define G_IS_TYPES_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_types_manager_get_type())) #define G_TYPES_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_TYPES_MANAGER, GTypesManagerClass)) #define G_IS_TYPES_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_TYPES_MANAGER)) #define G_TYPES_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_TYPES_MANAGER, GTypesManagerClass)) /* Description d'un gestionnaire de types (instance) */ typedef struct _GTypesManager GTypesManager; /* Description d'un gestionnaire de types (classe) */ typedef struct _GTypesManagerClass GTypesManagerClass; /* Indique le type défini pour un gestionnaire de types. */ GType g_types_manager_get_type(void); #endif /* _ANALYSIS_TYPE_H */