X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-ir%2Fevent-fields.h;h=b102d6323a51b6b8056655b61e5ec762560099b4;hp=489c2bf8ee0a5f9c2722b90dfb4bcf21af409965;hb=f98c6554b0e1dd37e0f992f7b5e67c4431f911a6;hpb=a31f4869a9aa86226823ae5f93a1a61b3df7fc2b diff --git a/include/babeltrace/ctf-ir/event-fields.h b/include/babeltrace/ctf-ir/event-fields.h index 489c2bf8..b102d632 100644 --- a/include/babeltrace/ctf-ir/event-fields.h +++ b/include/babeltrace/ctf-ir/event-fields.h @@ -304,6 +304,28 @@ extern int bt_ctf_field_string_set_value(struct bt_ctf_field *string_field, extern int bt_ctf_field_string_append(struct bt_ctf_field *string_field, const char *value); +/* + * bt_ctf_field_string_append_len: append a string of a given length to + * a string field's current value. + * + * Append a string of a given length to the current value of a string + * field. If the string field was never set using + * bt_ctf_field_string_set_value(), it is first set to an empty string, + * and then the concatenation happens. + * + * If a null byte is encountered before the given length, only the + * substring before the first null byte is appended. + * + * @param string_field String field instance. + * @param value String to append to the current string field's value. + * @param length Length of string value to append. + * + * Returns 0 on success, a negative value on error. + */ +extern int bt_ctf_field_string_append_len( + struct bt_ctf_field *string_field, const char *value, + unsigned int length); + /* * bt_ctf_field_get_type: get a field's type *