00001 #ifndef CMDS_H
00002 #define CMDS_H
00003
00004 #include "config.h"
00005 #include "scli.h"
00006
00007
00008 #define EXT_HELP "extended"
00009 #define SHORT_HELP "short"
00010 #define TEST_ANNOUNCE "Hello, this is :"
00011
00012
00013 #define HELP_SHORT 0
00014 #define HELP_LONG 1
00015
00016
00017
00018 #define BUFF_LARGE 1024
00019 #define BUFF_SMALL 255
00020
00021
00022 #define CMD_FAILURE 1
00023 #define CMD_SUCCESS 0
00024
00025
00026 typedef int (* mod_entry_t)(char **);
00027 typedef void (* mod_help_t)(unsigned int);
00028
00029
00030 typedef int (* builtin_entry_t)(char **, cliuser_t *);
00031 typedef void (* builtin_help_t)(unsigned int);
00032
00033
00034 typedef struct {
00035 const char *name;
00036 const char *desc;
00037 mod_entry_t entry;
00038 mod_help_t help;
00039 } module_t;
00040
00041
00042 typedef struct {
00043 const char *name;
00044 const char *desc;
00045 builtin_entry_t entry;
00046 builtin_help_t help;
00047 int restricted;
00048 } builtin_t;
00049
00050
00051
00052 extern module_t modules[];
00053 extern builtin_t builtins[];
00054
00055
00056 extern int module_is_restricted(int);
00057 extern int is_module(const char *);
00058 extern int is_module_alias(const char *);
00059 extern char *alias_for_module(const char *);
00060 extern int help_module(int, unsigned int);
00061 extern int run_module(int, char *[]);
00062
00063
00064 extern int builtin_is_restricted(int);
00065 extern int is_builtin(const char *);
00066 extern int is_builtin_alias(const char *);
00067 extern char *alias_for_builtin(const char *);
00068 extern int help_builtin(int, unsigned int);
00069 extern int run_builtin(int, char *[], cliuser_t *);
00070
00071 #endif