Add jul.c/.h to sessiond code
[lttng-tools.git] / src / bin / lttng-sessiond / jul.h
CommitLineData
0475c50c
DG
1/*
2 * Copyright (C) 2013 - David Goulet <dgoulet@efficios.com>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License, version 2 only, as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 51
15 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 */
17
18#ifndef _JUL_H
19#define _JUL_H
20
21#include <common/hashtable/hashtable.h>
22#include <lttng/lttng.h>
23
24/*
25 * Java Util Logging event representation.
26 */
27struct jul_event {
28 /*
29 * Name of the event which is directly mapped to a Logger object name in
30 * the JUL API.
31 */
32 char name[LTTNG_SYMBOL_NAME_LEN];
33
34 /*
35 * Tells if the event is enabled or not on the JUL Agent.
36 */
37 unsigned int enabled:1;
38
39 /*
40 * Hash table nodes of the JUL domain. Indexed by name string.
41 */
42 struct lttng_ht_node_str node;
43};
44
45/*
46 * Top level data structure in a UST session containing JUL event name created
47 * for it.
48 */
49struct jul_domain {
50 /*
51 * Contains JUL event indexed by name.
52 */
53 struct lttng_ht *events;
54};
55
56int jul_init_domain(struct jul_domain *dom);
57struct jul_event *jul_create_event(const char *name);
58void jul_add_event(struct jul_event *event, struct jul_domain *dom);
59struct jul_event *jul_find_by_name(const char *name, struct jul_domain *dom);
60void jul_delete_event(struct jul_event *event, struct jul_domain *dom);
61void jul_destroy_event(struct jul_event *event);
62void jul_destroy_domain(struct jul_domain *dom);
63
64#endif /* _JUL_H */
This page took 0.024681 seconds and 4 git commands to generate.