lttng: factor out declaration of commands
[lttng-tools.git] / src / bin / lttng / command.h
CommitLineData
f3ed775e
DG
1/*
2 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
3 *
d14d33bf
AM
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License, version 2 only,
6 * as published by the Free Software Foundation.
f3ed775e
DG
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
d14d33bf
AM
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
f3ed775e
DG
16 */
17
18#ifndef _LTTNG_CMD_H
19#define _LTTNG_CMD_H
20
21#include <lttng/lttng.h>
990570ed
DG
22#include <common/common.h>
23#include <common/defaults.h>
f3ed775e 24
c399183f
DG
25#include "conf.h"
26#include "utils.h"
27
5e71a0e8
PP
28#define DECL_COMMAND(_name) \
29 extern int cmd_##_name(int, const char **)
30
f3ed775e 31enum cmd_error_code {
42224349 32 CMD_SUCCESS = 0,
f3ed775e
DG
33 CMD_ERROR,
34 CMD_UNDEFINED,
f3ed775e 35 CMD_FATAL,
d16c1a4c 36 CMD_WARNING,
4ce78777 37 CMD_UNSUPPORTED,
f3ed775e
DG
38};
39
40struct cmd_struct {
41 const char *name;
42 int (*func)(int argc, const char **argv);
43};
44
5e71a0e8
PP
45DECL_COMMAND(list);
46DECL_COMMAND(create);
47DECL_COMMAND(destroy);
48DECL_COMMAND(start);
49DECL_COMMAND(stop);
50DECL_COMMAND(enable_events);
51DECL_COMMAND(disable_events);
52DECL_COMMAND(enable_channels);
53DECL_COMMAND(disable_channels);
54DECL_COMMAND(add_context);
55DECL_COMMAND(set_session);
56DECL_COMMAND(version);
57DECL_COMMAND(calibrate);
58DECL_COMMAND(view);
59DECL_COMMAND(enable_consumer);
60DECL_COMMAND(disable_consumer);
61DECL_COMMAND(snapshot);
62DECL_COMMAND(save);
63DECL_COMMAND(load);
64DECL_COMMAND(track);
65DECL_COMMAND(untrack);
f3ed775e
DG
66
67#endif /* _LTTNG_CMD_H */
This page took 0.040028 seconds and 4 git commands to generate.