BeRTOS
Data Structures | Defines | Typedefs | Enumerations | Functions
parser.h File Reference
#include "cfg/cfg_parser.h"
#include <cpu/types.h>

Go to the source code of this file.

Data Structures

union  parms
 union that contains parameters passed to and from commands More...
struct  CmdTemplate
 Define a command that can be tokenized by the parser. More...

Defines

#define REGISTER_CMD(NAME)   REGISTER_FUNCTION(&cmd_ ## NAME ## _template)
 Utility function to register a command.
#define MAKE_TEMPLATE(NAME, ARGS, RES, FLAGS)
 Utility macro to create a command template.
#define MAKE_CMD(NAME, ARGS, RES, BODY, FLAGS)
 Utility macro to create command templates and callback functions.

Typedefs

typedef ResultCode(* CmdFuncPtr )(parms args_results[])
 pointer to commands

Enumerations

enum  ResultCode { RC_ERROR = -1, RC_OK = 0, RC_REPLY = 1, RC_SKIP = 2 }
 Error generated by the commands through the return code. More...

Functions

void parser_init (void)
 Initialize the parser module.
void parser_register_cmd (const struct CmdTemplate *cmd)
 Register a new command into the parser.
const char * parser_rl_match (void *dummy, const char *word, int word_len)
 Hook for readline to provide completion support for the commands registered in the parser.
bool parser_process_line (const char *line)
 Command input handler.
bool parser_execute_cmd (const struct CmdTemplate *templ, parms args[CONFIG_PARSER_MAX_ARGS])
 Execute a command with its arguments, and fetch its results.
struct CmdTemplateparser_get_cmd_template (const char *line)
 Find the template for the command contained in the text line.
bool parser_get_cmd_arguments (const char *line, const struct CmdTemplate *templ, parms args[CONFIG_PARSER_MAX_ARGS])
 Extract the arguments for the command contained in the text line.

Detailed Description

Definition in file parser.h.