| 1 | #ifndef _BABELTRACE_CONTEXT_INTERNAL_H |
| 2 | #define _BABELTRACE_CONTEXT_INTERNAL_H |
| 3 | |
| 4 | /* |
| 5 | * BabelTrace |
| 6 | * |
| 7 | * context header (internal) |
| 8 | * |
| 9 | * Copyright 2012 EfficiOS Inc. and Linux Foundation |
| 10 | * |
| 11 | * Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| 12 | * Julien Desfossez <julien.desfossez@efficios.com> |
| 13 | * |
| 14 | * Permission is hereby granted, free of charge, to any person obtaining |
| 15 | * a copy of this software and associated documentation files (the |
| 16 | * "Software"), to deal in the Software without restriction, including |
| 17 | * without limitation the rights to use, copy, modify, merge, publish, |
| 18 | * distribute, sublicense, and/or sell copies of the Software, and to |
| 19 | * permit persons to whom the Software is furnished to do so, subject to |
| 20 | * the following conditions: |
| 21 | * |
| 22 | * The above copyright notice and this permission notice shall be |
| 23 | * included in all copies or substantial portions of the Software. |
| 24 | * |
| 25 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 26 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 27 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 28 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 29 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 30 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 31 | * SOFTWARE. |
| 32 | */ |
| 33 | |
| 34 | #include <glib.h> |
| 35 | |
| 36 | struct trace_collection; |
| 37 | struct GHashTable; |
| 38 | |
| 39 | /* |
| 40 | * The context represents the object in which a trace_collection is |
| 41 | * open. As long as this structure is allocated, the trace_collection is |
| 42 | * open and the traces it contains can be read and seeked by the |
| 43 | * iterators and callbacks. |
| 44 | * |
| 45 | * It has to be created with the bt_context_create() function and |
| 46 | * destroyed by calling one more bt_context_put() than bt_context_get() |
| 47 | */ |
| 48 | struct bt_context { |
| 49 | struct trace_collection *tc; |
| 50 | GHashTable *trace_handles; |
| 51 | int refcount; |
| 52 | int last_trace_handle_id; |
| 53 | struct bt_iter *current_iterator; |
| 54 | }; |
| 55 | |
| 56 | #endif /* _BABELTRACE_CONTEXT_INTERNAL_H */ |