summaryrefslogtreecommitdiff
path: root/src/analysis/types
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-10-16 16:03:28 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-10-16 16:03:28 (GMT)
commit6f9563a0184e36fab8d0c2c38d151827784e331e (patch)
tree2d0e13667bc9efcc0f26c17572c9d38dabd89db7 /src/analysis/types
parentc7a14e50bd002e3922969e9bae7816753aefb073 (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')
-rw-r--r--src/analysis/types/basic.c36
-rw-r--r--src/analysis/types/cse-int.h3
-rw-r--r--src/analysis/types/cse.c25
-rw-r--r--src/analysis/types/encaps.c27
-rw-r--r--src/analysis/types/literal.c36
-rw-r--r--src/analysis/types/template.c42
6 files changed, 169 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. *
diff --git a/src/analysis/types/cse-int.h b/src/analysis/types/cse-int.h
index 2599329..9ee020f 100644
--- a/src/analysis/types/cse-int.h
+++ b/src/analysis/types/cse-int.h
@@ -51,6 +51,9 @@ struct _GClassEnumTypeClass
/* Décrit le type fourni sous forme de caractères. */
char *g_class_enum_type_to_string(const GClassEnumType *);
+/* Procède à l'impression de la description d'un type. */
+void g_class_enum_type_output(const GClassEnumType *, GLangOutput *, GBufferLine *, bool, bool);
+
#endif /* _ANALYSIS_TYPES_CSE_INT_H */
diff --git a/src/analysis/types/cse.c b/src/analysis/types/cse.c
index 40d726e..4ee03ef 100644
--- a/src/analysis/types/cse.c
+++ b/src/analysis/types/cse.c
@@ -84,6 +84,7 @@ static void g_class_enum_type_init(GClassEnumType *type)
data_type->dup = (type_dup_fc)g_class_enum_type_dup;
data_type->to_string = (type_to_string_fc)g_class_enum_type_to_string;
+ data_type->output = (output_type_fc)g_class_enum_type_output;
}
@@ -151,3 +152,27 @@ char *g_class_enum_type_to_string(const GClassEnumType *type)
return strdup(type->name);
}
+
+
+/******************************************************************************
+* *
+* 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 : - *
+* *
+******************************************************************************/
+
+void g_class_enum_type_output(const GClassEnumType *type, GLangOutput *lang, GBufferLine *line, bool info, bool full)
+{
+ g_buffer_line_insert_text(line, BLC_LAST_USED, type->name, strlen(type->name),
+ info ? RTT_COMMENT : RTT_RAW);
+
+}
diff --git a/src/analysis/types/encaps.c b/src/analysis/types/encaps.c
index 492fd46..1d4b6f4 100644
--- a/src/analysis/types/encaps.c
+++ b/src/analysis/types/encaps.c
@@ -61,6 +61,9 @@ static GDataType *g_encapsulated_type_dup(const GEncapsulatedType *);
/* Décrit le type fourni sous forme de caractères. */
static char *g_encapsulated_type_to_string(const GEncapsulatedType *);
+/* Procède à l'impression de la description d'un type. */
+static void g_encapsulated_type_output(const GEncapsulatedType *, GLangOutput *, GBufferLine *, bool, bool);
+
/* Indique le type défini pour un type encapsulé. */
@@ -105,6 +108,7 @@ static void g_encapsulated_type_init(GEncapsulatedType *type)
data_type->dup = (type_dup_fc)g_encapsulated_type_dup;
data_type->to_string = (type_to_string_fc)g_encapsulated_type_to_string;
+ data_type->output = (output_type_fc)g_encapsulated_type_output;
}
@@ -256,6 +260,29 @@ static char *g_encapsulated_type_to_string(const GEncapsulatedType *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_encapsulated_type_output(const GEncapsulatedType *type, GLangOutput *lang, GBufferLine *line, bool info, bool full)
+{
+ g_buffer_line_insert_text(line, BLC_LAST_USED, "!TODO!", 6, info ? RTT_COMMENT : RTT_RAW);
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : type = type à consulter. *
* *
* Description : Fournit le type d'encapsulation gérée par le type. *
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);
+
+}
diff --git a/src/analysis/types/template.c b/src/analysis/types/template.c
index 29d39bc..f26e038 100644
--- a/src/analysis/types/template.c
+++ b/src/analysis/types/template.c
@@ -64,6 +64,9 @@ static GDataType *g_template_type_dup(const GTemplateType *);
/* Décrit le type fourni sous forme de caractères. */
static char *g_template_type_to_string(const GTemplateType *);
+/* Procède à l'impression de la description d'un type. */
+static void g_template_type_output(const GTemplateType *, GLangOutput *, GBufferLine *, bool, bool);
+
/* Indique le type défini pour un type reposant sur des gabarits. */
@@ -109,6 +112,7 @@ static void g_template_type_init(GTemplateType *type)
data_type->dup = (type_dup_fc)g_template_type_dup;
data_type->to_string = (type_to_string_fc)g_template_type_to_string;
+ data_type->output = (output_type_fc)g_template_type_output;
ce_type = G_CLASS_ENUM_TYPE(type);
@@ -216,6 +220,44 @@ static char *g_template_type_to_string(const GTemplateType *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_template_type_output(const GTemplateType *type, GLangOutput *lang, GBufferLine *line, bool info, bool full)
+{
+ size_t i; /* Boucle de parcours */
+
+ g_class_enum_type_output(G_CLASS_ENUM_TYPE(type), lang, line, info, full);
+
+ g_buffer_line_insert_text(line, BLC_LAST_USED, "<", 1, info ? RTT_COMMENT : RTT_LTGT);
+
+ for (i = 0; i < type->models_count; i++)
+ {
+ if (i > 0)
+ g_buffer_line_insert_text(line, BLC_LAST_USED, ", ", 2, info ? RTT_COMMENT : RTT_SIGNS);
+
+ g_data_type_output(type->models[i], lang, line, info, full);
+
+ }
+
+ g_buffer_line_insert_text(line, BLC_LAST_USED, ">", 1, info ? RTT_COMMENT : RTT_LTGT);
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : type = type à mettre à jour. *
* list = élements du modèle sur lequel doit reposer le type. *
* *