projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
command parser: Add support for the GETVAL command.
[collectd.git]
/
src
/
utils_cmds.h
diff --git
a/src/utils_cmds.h
b/src/utils_cmds.h
index
12bf6a8
..
62cf8a9
100644
(file)
--- a/
src/utils_cmds.h
+++ b/
src/utils_cmds.h
@@
-34,11
+34,13
@@
typedef enum {
CMD_UNKNOWN = 0,
CMD_FLUSH = 1,
typedef enum {
CMD_UNKNOWN = 0,
CMD_FLUSH = 1,
- CMD_LISTVAL = 2,
- CMD_PUTVAL = 3,
+ CMD_GETVAL = 2,
+ CMD_LISTVAL = 3,
+ CMD_PUTVAL = 4,
} cmd_type_t;
#define CMD_TO_STRING(type) \
((type) == CMD_FLUSH) ? "FLUSH" \
} cmd_type_t;
#define CMD_TO_STRING(type) \
((type) == CMD_FLUSH) ? "FLUSH" \
+ : ((type) == CMD_GETVAL) ? "GETVAL" \
: ((type) == CMD_LISTVAL) ? "LISTVAL" \
: ((type) == CMD_PUTVAL) ? "PUTVAL" \
: "UNKNOWN"
: ((type) == CMD_LISTVAL) ? "LISTVAL" \
: ((type) == CMD_PUTVAL) ? "PUTVAL" \
: "UNKNOWN"
@@
-53,11
+55,16
@@
typedef struct {
} cmd_flush_t;
typedef struct {
} cmd_flush_t;
typedef struct {
+ char *raw_identifier;
+ identifier_t identifier;
+} cmd_getval_t;
+
+typedef struct {
} cmd_listval_t;
typedef struct {
/* The raw identifier as provided by the user. */
} cmd_listval_t;
typedef struct {
/* The raw identifier as provided by the user. */
- char *identifier;
+ char *
raw_
identifier;
/* An array of the fully parsed identifier and all value lists, and their
* options as provided by the user. */
/* An array of the fully parsed identifier and all value lists, and their
* options as provided by the user. */
@@
-76,6
+83,7
@@
typedef struct {
cmd_type_t type;
union {
cmd_flush_t flush;
cmd_type_t type;
union {
cmd_flush_t flush;
+ cmd_getval_t getval;
cmd_listval_t listval;
cmd_putval_t putval;
} cmd;
cmd_listval_t listval;
cmd_putval_t putval;
} cmd;