summaryrefslogtreecommitdiff
path: root/src/format/strsym.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/strsym.c')
-rw-r--r--src/format/strsym.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/format/strsym.c b/src/format/strsym.c
index b60bd02..073e77f 100644
--- a/src/format/strsym.c
+++ b/src/format/strsym.c
@@ -220,6 +220,47 @@ GBinSymbol *g_string_symbol_new_read_only(GBinFormat *format, const mrange_t *ra
/******************************************************************************
* *
+* Paramètres : string = contenu de la chaîne de caractères. *
+* addr = emplacement de cette chaîne virtuelle. *
+* encoding = encodage de la chaîne de caractères à représenter.*
+* *
+* Description : Crée un nouveau symbole pour chaîne de caractères. *
+* *
+* Retour : Adresse de l'instance mise en place ou NULL en cas d'échec. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GBinSymbol *g_string_symbol_new_dynamic(const char *string, const vmpa2t *addr, StringEncodingType encoding)
+{
+ GStrSymbol *result; /* Nouveau symbole à renvoyer */
+ GBinSymbol *parent; /* Type d'instance parent */
+ mrange_t range; /* Emplacement à constituer */
+
+ result = g_object_new(G_TYPE_STR_SYMBOL, NULL);
+
+ parent = G_BIN_SYMBOL(result);
+
+ init_mrange(&range, addr, strlen(string));
+
+ g_binary_symbol_set_range(parent, &range);
+ g_binary_symbol_set_target_type(parent, STP_DYN_STRING);
+
+ result->encoding = encoding;
+
+ result->string = strdup(string);
+ result->has_content = false;
+
+ g_string_symbol_check_encoding(result);
+
+ return G_BIN_SYMBOL(result);
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : symbol = symbole à venir consulter. *
* *
* Description : Vérifie la pertinence de l'encodage attribué à une chaîne. *