cmd.h
Go to the documentation of this file.
43 #define CMD_REGISTER(N, U, D) co_cmd_register(#N, sizeof(#N), U, sizeof(U), D, sizeof(D), cmd_##N )
45 #define CMD_OUTPUT(K, V) if(*output == NULL) *output = co_tree16_create(); co_tree_insert(*output, K, sizeof(K), V)
72 int co_cmd_register(const char *name, const size_t nlen, const char *usage, const size_t ulen, const char *desc, const size_t dlen, co_cb_t handler);
co_obj_t * co_cmd_usage(co_obj_t *key)
returns command usage format
Definition: cmd.c:122
co_obj_t * co_cmd_desc(co_obj_t *key)
returns command description (what the command does)
Definition: cmd.c:135
Commotion object model.
int co_cmd_process(co_iter_t iter, void *context)
process all registered commands with given iterator
Definition: cmd.c:182
int co_cmd_exec(co_obj_t *key, co_obj_t **output, co_obj_t *param)
executes a command by running the function linked to in the command struct
Definition: cmd.c:109
int co_cmd_hook(const co_obj_t *key, co_obj_t *cb)
hooks callback function into a command
Definition: cmd.c:164
int co_cmd_hook_str(const char *key, const size_t klen, co_obj_t *cb)
hooks callback function into a command
Definition: cmd.c:148
Definition: obj.h:131
a struct containing all the relevant information for a specific command
Definition: cmd.h:61
Generated on Fri Jun 6 2014 13:22:05 for commotiond by 1.8.7