Helper function to extract string from fields
[babeltrace.git] / types / string.c
index 9eaa9df800e25219e6d817e98c57daa2b94f4565..bff569db93bb11118b0904d48fcc5f1454623863 100644 (file)
@@ -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;
+}
This page took 0.022908 seconds and 4 git commands to generate.