diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-10-16 16:03:28 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-10-16 16:03:28 (GMT) |
commit | 6f9563a0184e36fab8d0c2c38d151827784e331e (patch) | |
tree | 2d0e13667bc9efcc0f26c17572c9d38dabd89db7 /src/analysis/types/basic.c | |
parent | c7a14e50bd002e3922969e9bae7816753aefb073 (diff) |
Properly output routines documentation.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@268 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/types/basic.c')
-rw-r--r-- | src/analysis/types/basic.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/analysis/types/basic.c b/src/analysis/types/basic.c index 436b04e..f8b3100 100644 --- a/src/analysis/types/basic.c +++ b/src/analysis/types/basic.c @@ -24,6 +24,7 @@ #include "basic.h" +#include <malloc.h> #include <string.h> @@ -60,6 +61,9 @@ static GDataType *g_basic_type_dup(const GBasicType *); /* Décrit le type fourni sous forme de caractères. */ static char *g_basic_type_to_string(const GBasicType *); +/* Procède à l'impression de la description d'un type. */ +static void g_basic_type_output(const GBasicType *, GLangOutput *, GBufferLine *, bool, bool); + /* Indique le type défini pour un type basique. */ @@ -104,6 +108,7 @@ static void g_basic_type_init(GBasicType *type) data_type->dup = (type_dup_fc)g_basic_type_dup; data_type->to_string = (type_to_string_fc)g_basic_type_to_string; + data_type->output = (output_type_fc)g_basic_type_output; } @@ -292,6 +297,37 @@ static char *g_basic_type_to_string(const GBasicType *type) /****************************************************************************** * * +* 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_basic_type_output(const GBasicType *type, GLangOutput *lang, GBufferLine *line, bool info, bool full) +{ + char *text; /* Version humaine à imprimer */ + size_t len; /* Taille de cette version */ + + text = g_basic_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); + +} + + +/****************************************************************************** +* * * Paramètres : type = type à consulter. * * * * Description : Fournit le type de base géré par le type. * |