/* $Id: shell.h,v 1.21 2003/09/28 09:05:15 jmuelmen Exp $ */ /* This contains the headers for all the shell functions */ #ifndef _MOD_SHELL_INC_ #define _MOD_SHELL_INC_ #include "parse.h" #include /* * Types used in various parts of the shell: */ /* this is disgusting. It's an identifier. It can be a function * identifier or a variable identifier. */ #define IDENT_NAME_LEN 1000 typedef struct { char name[IDENT_NAME_LEN]; enum { func, var } type; union { func_t func; value_t val; } cont; short int is_declared; } ident_t; /* * Function declarations */ void *shell (void *); /* parse buffer */ int parsebuf_buf (parse_action_t *); parse_action_t *parsebuf_get_idx (int); int parsebuf_clear (); int parsebuf_process (); void parsebuf_dump (); void parsebuf_init (); void parsebuf_save_pos (); void parsebuf_clear_after_pos (); /* identifiers */ int ident_add (ident_t *); ident_t *ident_get (const char *); ident_t *ident_get_idx (int); int ident_index (const char *); ident_t *ident_create (const char *); void ident_destroy (ident_t *); void ident_dump (); void ident_save_pos (); void ident_clear_after_pos (); /* register all the (builtin) functions */ void func_register (); void print_help (); /* convert string to time */ void atot (time_t *, const char *); #define SHELL_DEBUG_LEVEL 1000 #ifdef SHELL_DEBUG_LEVEL /* #define SHELL_DEBUG(n, args...) if (SHELL_DEBUG_LEVEL > (n)) \ */ /* fprintf(stderr, "shell: "); \ */ /* fprintf(stderr, (args)); \ */ /* fprintf(stderr, "\n"); */ #endif /* SHELL_DEBUG_LEVEL */ #endif /* _MOD_SHELL_INC_ */