diff options
author | FreeArtMan <=> | 2016-02-04 23:02:20 +0000 |
---|---|---|
committer | FreeArtMan <=> | 2016-02-04 23:02:20 +0000 |
commit | ebe6923b17de88d37d97846be2567fb75f53292c (patch) | |
tree | ca14f19a6634546d93a02775b407e8197c805760 /cmd.h | |
download | ihe-ebe6923b17de88d37d97846be2567fb75f53292c.tar.gz ihe-ebe6923b17de88d37d97846be2567fb75f53292c.zip |
Initial commit
Diffstat (limited to 'cmd.h')
-rw-r--r-- | cmd.h | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -0,0 +1,33 @@ +#ifndef __IHE_CMD_H +#define __IHE_CMD_H + +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> +#include <string.h> +#include <unistd.h> + +typedef struct cmd_arg +{ + int argc; + char **argv; +} cmd_arg; + + +typedef struct cmd_table +{ + char *cmd; + int (*clb)(cmd_arg*); +} cmd_table; + + +int cnt_sep( char *s ); +char* cmd_line( char *prompt ); +cmd_arg* cmd_parse( char *str ); +int cmd_exec( cmd_arg *cmd, cmd_table *table ); +void cmd_arg_free( cmd_arg *arg ); +void cmd_sub_arg_free( cmd_arg *arg ); +cmd_arg* sub_cmd( cmd_arg *arg ); + + +#endif |