X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Futils_cmds.h;h=205e89a0496df73a7b4cb80bc6ce511445113ff3;hp=62cf8a9204cc72a028688f54ec01560b9eb575d7;hb=f5fdf24ccec9318baf11eec25d6dba881dc77332;hpb=5bed427b409db41140d5799c979ee556dd66393d diff --git a/src/utils_cmds.h b/src/utils_cmds.h index 62cf8a92..205e89a0 100644 --- a/src/utils_cmds.h +++ b/src/utils_cmds.h @@ -91,6 +91,19 @@ typedef struct { /* * NAME + * cmd_options_t + * + * DESCRIPTIONS + * Optional settings for tuning the parser behavior. + */ +typedef struct { + /* identifier_default_host: If non-NULL, the hostname is optional and will + * default to the specified value. */ + char *identifier_default_host; +} cmd_options_t; + +/* + * NAME * cmd_status_t * * DESCRIPTION @@ -140,16 +153,17 @@ void cmd_error (cmd_status_t status, cmd_error_handler_t *err, * PARAMETERS * `buffer' The command string to be parsed. * `ret_cmd' The parse result will be stored at this location. + * `opts' Parser options. If NULL, defaults will be used. * `err' An optional error handler to invoke on error. * * RETURN VALUE * CMD_OK on success or the respective error code otherwise. */ -cmd_status_t cmd_parse (char *buffer, - cmd_t *ret_cmd, cmd_error_handler_t *err); +cmd_status_t cmd_parse (char *buffer, cmd_t *ret_cmd, + const cmd_options_t *opts, cmd_error_handler_t *err); -cmd_status_t cmd_parsev (size_t argc, char **argv, - cmd_t *ret_cmd, cmd_error_handler_t *err); +cmd_status_t cmd_parsev (size_t argc, char **argv, cmd_t *ret_cmd, + const cmd_options_t *opts, cmd_error_handler_t *err); void cmd_destroy (cmd_t *cmd);