1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
/* Chrysalide - Outil d'analyse de fichiers binaires
* type.h - prototypes pour la manipulation des types en tout genre
*
* Copyright (C) 2010-2017 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 <http://www.gnu.org/licenses/>.
*/
#ifndef _ANALYSIS_TYPE_H
#define _ANALYSIS_TYPE_H
#include <glib-object.h>
#include <stdbool.h>
#define G_TYPE_DATA_TYPE g_data_type_get_type()
#define G_DATA_TYPE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_DATA_TYPE, GDataType))
#define G_IS_DATA_TYPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_DATA_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;
/* Masque de tous les qualificatifs */
#define TQF_ALL ((1 << 3) - 1)
/* 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écrit le type fourni sous forme de caractères. */
char *g_data_type_to_string(const GDataType *, bool);
/* Définit le groupe d'appartenance d'un type donné. */
void g_data_type_set_namespace(GDataType *, GDataType *, char *);
/* Fournit le groupe d'appartenance d'un type donné. */
GDataType *g_data_type_get_namespace(const GDataType *);
/* Définit l'ensemble des qualificatifs d'une instance de type. */
void g_data_type_set_qualifiers(GDataType *, TypeQualifier);
/* Ajoute un qualificatif à une instance de type. */
void g_data_type_add_qualifier(GDataType *, TypeQualifier);
/* Fournit les qualificatifs associés à une instance de type. */
TypeQualifier g_data_type_get_qualifiers(const GDataType *);
/* Indique si le type est un pointeur. */
bool g_data_type_is_pointer(const GDataType *);
/* Indique si le type est une référence. */
bool g_data_type_is_reference(const GDataType *);
#endif /* _ANALYSIS_TYPE_H */
|