diff options
Diffstat (limited to 'src/analysis/types/literal.c')
-rw-r--r-- | src/analysis/types/literal.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/analysis/types/literal.c b/src/analysis/types/literal.c index 92c8254..50212ac 100644 --- a/src/analysis/types/literal.c +++ b/src/analysis/types/literal.c @@ -24,6 +24,7 @@ #include "literal.h" +#include <malloc.h> #include <stdio.h> #include <string.h> @@ -63,6 +64,9 @@ static GDataType *g_literal_type_dup(const GLiteralType *); /* Décrit le type fourni sous forme de caractères. */ static char *g_literal_type_to_string(const GLiteralType *); +/* Procède à l'impression de la description d'un type. */ +static void g_literal_type_output(const GLiteralType *, GLangOutput *, GBufferLine *, bool, bool); + /* Indique le type défini pour un type reposant sur des gabarits. */ @@ -107,6 +111,7 @@ static void g_literal_type_init(GLiteralType *type) data_type->dup = (type_dup_fc)g_literal_type_dup; data_type->to_string = (type_to_string_fc)g_literal_type_to_string; + data_type->output = (output_type_fc)g_literal_type_output; } @@ -203,3 +208,34 @@ static char *g_literal_type_to_string(const GLiteralType *type) return result; } + + +/****************************************************************************** +* * +* Paramètres : type = type à afficher. * +* lang = langage à utiliser pour la sortie humaine. * +* buffer = tampon mis à disposition pour la sortie. * +* info = nature du cadre de destination. * +* full = besoin de descriptions étendues ? * +* * +* Description : Procède à l'impression de la description d'un type. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_literal_type_output(const GLiteralType *type, GLangOutput *lang, GBufferLine *line, bool info, bool full) +{ + char *text; /* Version humaine à imprimer */ + size_t len; /* Taille de cette version */ + + text = g_literal_type_to_string(type); + len = strlen(text); + + g_buffer_line_insert_text(line, BLC_LAST_USED, text, len, info ? RTT_COMMENT : RTT_RAW); + + free(text); + +} |