X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-writer%2Fevent-fields.h;h=ce13907a13b827c341ed162b41560db02350fe9f;hb=8c18d80b69a10f94980d33e6f1c1bdb26b447487;hp=3ab3e39fffa9f6a9bee82a76df8b1c98bb4530d1;hpb=faec0807cd032e833756c134daecb3668a780cf9;p=babeltrace.git diff --git a/include/babeltrace/ctf-writer/event-fields.h b/include/babeltrace/ctf-writer/event-fields.h index 3ab3e39f..ce13907a 100644 --- a/include/babeltrace/ctf-writer/event-fields.h +++ b/include/babeltrace/ctf-writer/event-fields.h @@ -1,3 +1,6 @@ +#ifndef BABELTRACE_CTF_WRITER_EVENT_FIELDS_H +#define BABELTRACE_CTF_WRITER_EVENT_FIELDS_H + /* * BabelTrace - CTF Writer: Event Fields * @@ -28,3 +31,32 @@ */ #include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * bt_ctf_field_get and bt_ctf_field_put: increment and decrement the + * field's reference count. + * + * You may also use bt_ctf_get() and bt_ctf_put() with field objects. + * + * These functions ensure that the field won't be destroyed when it + * is in use. The same number of get and put (plus one extra put to + * release the initial reference done at creation) have to be done to + * destroy a field. + * + * When the field's reference count is decremented to 0 by a bt_ctf_field_put, + * the field is freed. + * + * @param field Field instance. + */ +extern void bt_ctf_field_get(struct bt_ctf_field *field); +extern void bt_ctf_field_put(struct bt_ctf_field *field); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_CTF_WRITER_EVENT_FIELDS_H */