diff --git a/src/utils_cmds.h b/src/utils_cmds.h
index 62cf8a9204cc72a028688f54ec01560b9eb575d7..205e89a0496df73a7b4cb80bc6ce511445113ff3 100644 (file)
--- a/src/utils_cmds.h
+++ b/src/utils_cmds.h
} cmd;
} cmd_t;
+/*
+ * 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
* 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);