6 * Copyright 2011-2012 EfficiOS Inc. and Linux Foundation
8 * Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 * Julien Desfossez <julien.desfossez@efficios.com>
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
22 #include <babeltrace/babeltrace.h>
23 #include <babeltrace/context.h>
26 struct bt_context
*bt_context_create(struct trace_collection
*tc
)
28 struct bt_context
*ctx
;
30 ctx
= calloc(1, sizeof(struct bt_context
));
32 perror("allocating context");
38 ctx
->last_trace_handle_id
= 0;
46 int bt_context_destroy(struct bt_context
*ctx
)
49 if (ctx
->refcount
>= 1)
60 int bt_context_get(struct bt_context
*ctx
)
68 int bt_context_put(struct bt_context
*ctx
)
74 if (ctx
->refcount
== 0)
75 return bt_context_destroy(ctx
);
This page took 0.031187 seconds and 4 git commands to generate.