Following the same principle as get_char_array and get_(un)signed_int,
this function returns a char* to a string from an event field.

Signed-off-by: Julien Desfossez <[email protected]>
---
 types/string.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/types/string.c b/types/string.c
index 9eaa9df..bff569d 100644
--- a/types/string.c
+++ b/types/string.c
@@ -99,3 +99,13 @@ void _string_definition_free(struct definition *definition)
        g_free(string->value);
        g_free(string);
 }
+
+char *get_string(struct definition *field)
+{
+       struct definition_string *string_definition =
+               container_of(field, struct definition_string, p);
+
+       assert(string_definition->value != NULL);
+
+       return string_definition->value;
+}
-- 
1.7.7.1


_______________________________________________
ltt-dev mailing list
[email protected]
http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev

Reply via email to