/trunk/uspace/app/bdsh/cmds/modules/quit/quit.c |
---|
39,15 → 39,15 |
extern volatile unsigned int cli_quit; |
extern const char *progname; |
void * help_cmd_quit(unsigned int level) |
void help_cmd_quit(unsigned int level) |
{ |
printf("Type `%s' to exit %s\n", cmdname, progname); |
return CMD_VOID; |
return; |
} |
/* Quits the program and returns the status of whatever command |
* came before invoking 'quit' */ |
int * cmd_quit(char *argv[]) |
int cmd_quit(char *argv[]) |
{ |
/* Inform that we're outta here */ |
cli_quit = 1; |
/trunk/uspace/app/bdsh/cmds/modules/quit/entry.h |
---|
2,8 → 2,8 |
#define QUIT_ENTRY_H_ |
/* Entry points for the quit command */ |
extern void * help_cmd_quit(unsigned int); |
extern int * cmd_quit(char *[]); |
extern void help_cmd_quit(unsigned int); |
extern int cmd_quit(char *[]); |
#endif |
/trunk/uspace/app/bdsh/cmds/modules/touch/touch.c |
---|
48,7 → 48,7 |
static char *cmdname = "touch"; |
/* Dispays help for touch in various levels */ |
void * help_cmd_touch(unsigned int level) |
void help_cmd_touch(unsigned int level) |
{ |
if (level == HELP_SHORT) { |
printf("`%s' updates access times for files\n", cmdname); |
58,11 → 58,11 |
"created\n", cmdname); |
} |
return CMD_VOID; |
return; |
} |
/* Main entry point for touch, accepts an array of arguments */ |
int * cmd_touch(char **argv) |
int cmd_touch(char **argv) |
{ |
unsigned int argc, i = 0, ret = 0; |
int fd; |
/trunk/uspace/app/bdsh/cmds/modules/touch/entry.h |
---|
2,8 → 2,8 |
#define TOUCH_ENTRY_H |
/* Entry points for the touch command */ |
extern int * cmd_touch(char **); |
extern void * help_cmd_touch(unsigned int); |
extern int cmd_touch(char **); |
extern void help_cmd_touch(unsigned int); |
#endif /* TOUCH_ENTRY_H */ |
/trunk/uspace/app/bdsh/cmds/modules/mkdir/entry.h |
---|
2,8 → 2,8 |
#define MKDIR_ENTRY_H |
/* Entry points for the mkdir command */ |
extern int * cmd_mkdir(char **); |
extern void * help_cmd_mkdir(unsigned int); |
extern int cmd_mkdir(char **); |
extern void help_cmd_mkdir(unsigned int); |
#endif /* MKDIR_ENTRY_H */ |
/trunk/uspace/app/bdsh/cmds/modules/mkdir/mkdir.c |
---|
60,7 → 60,7 |
}; |
void * help_cmd_mkdir(unsigned int level) |
void help_cmd_mkdir(unsigned int level) |
{ |
if (level == HELP_SHORT) { |
printf("`%s' creates a new directory\n", cmdname); |
79,7 → 79,7 |
cmdname, cmdname); |
} |
return CMD_VOID; |
return; |
} |
/* This is kind of clunky, but effective for now */ |
181,7 → 181,7 |
return ret; |
} |
int * cmd_mkdir(char **argv) |
int cmd_mkdir(char **argv) |
{ |
unsigned int argc, create_parents = 0, i, ret = 0, follow = 0; |
unsigned int verbose = 0; |
/trunk/uspace/app/bdsh/cmds/modules/cat/entry.h |
---|
2,8 → 2,8 |
#define CAT_ENTRY_H |
/* Entry points for the cat command */ |
extern int * cmd_cat(char **); |
extern void * help_cmd_cat(unsigned int); |
extern int cmd_cat(char **); |
extern void help_cmd_cat(unsigned int); |
#endif /* CAT_ENTRY_H */ |
/trunk/uspace/app/bdsh/cmds/modules/cat/cat.c |
---|
59,7 → 59,7 |
}; |
/* Dispays help for cat in various levels */ |
void * help_cmd_cat(unsigned int level) |
void help_cmd_cat(unsigned int level) |
{ |
if (level == HELP_SHORT) { |
printf("`%s' shows the contents of files\n", cmdname); |
78,7 → 78,7 |
cmdname, cmdname); |
} |
return CMD_VOID; |
return; |
} |
static unsigned int cat_file(const char *fname, size_t blen) |
127,7 → 127,7 |
} |
/* Main entry point for cat, accepts an array of arguments */ |
int * cmd_cat(char **argv) |
int cmd_cat(char **argv) |
{ |
unsigned int argc, i, ret = 0, buffer = 0; |
int c, opt_ind; |
/trunk/uspace/app/bdsh/cmds/modules/help/entry.h |
---|
2,7 → 2,7 |
#define HELP_ENTRY_H_ |
/* Entry points for the help command */ |
extern void * help_cmd_help(unsigned int); |
extern int * cmd_help(char *[]); |
extern void help_cmd_help(unsigned int); |
extern int cmd_help(char *[]); |
#endif |
/trunk/uspace/app/bdsh/cmds/modules/help/help.c |
---|
69,7 → 69,7 |
return HELP_IS_RUBBISH; |
} |
void *help_cmd_help(unsigned int level) |
void help_cmd_help(unsigned int level) |
{ |
if (level == HELP_SHORT) { |
printf( |
86,10 → 86,10 |
cmdname, cmdname, cmdname, cmdname); |
} |
return CMD_VOID; |
return; |
} |
int *cmd_help(char *argv[]) |
int cmd_help(char *argv[]) |
{ |
module_t *mod; |
builtin_t *cmd; |
/trunk/uspace/app/bdsh/cmds/modules/pwd/entry.h |
---|
4,8 → 4,8 |
#include "scli.h" |
/* Entry points for the pwd command */ |
extern void * help_cmd_pwd(unsigned int); |
extern int * cmd_pwd(char **); |
extern void help_cmd_pwd(unsigned int); |
extern int cmd_pwd(char **); |
#endif |
/trunk/uspace/app/bdsh/cmds/modules/pwd/pwd.c |
---|
39,13 → 39,13 |
static char * cmdname = "pwd"; |
void * help_cmd_pwd(unsigned int level) |
void help_cmd_pwd(unsigned int level) |
{ |
printf("`%s' prints your current working directory.\n", cmdname); |
return CMD_VOID; |
return; |
} |
int * cmd_pwd(char *argv[]) |
int cmd_pwd(char *argv[]) |
{ |
char *buff; |
/trunk/uspace/app/bdsh/cmds/modules/ls/ls.c |
---|
132,7 → 132,7 |
return; |
} |
void * help_cmd_ls(unsigned int level) |
void help_cmd_ls(unsigned int level) |
{ |
if (level == HELP_SHORT) { |
printf("`%s' lists files and directories.\n", cmdname); |
142,10 → 142,10 |
"working directory is used.\n", cmdname); |
} |
return CMD_VOID; |
return; |
} |
int * cmd_ls(char **argv) |
int cmd_ls(char **argv) |
{ |
unsigned int argc; |
unsigned int scope; |
/trunk/uspace/app/bdsh/cmds/modules/ls/entry.h |
---|
2,8 → 2,8 |
#define LS_ENTRY_H |
/* Entry points for the ls command */ |
extern int * cmd_ls(char **); |
extern void * help_cmd_ls(unsigned int); |
extern int cmd_ls(char **); |
extern void help_cmd_ls(unsigned int); |
#endif /* LS_ENTRY_H */ |
/trunk/uspace/app/bdsh/cmds/modules/rm/rm.c |
---|
144,7 → 144,7 |
} |
/* Dispays help for rm in various levels */ |
void * help_cmd_rm(unsigned int level) |
void help_cmd_rm(unsigned int level) |
{ |
if (level == HELP_SHORT) { |
printf("`%s' removes files and directories.\n", cmdname); |
161,11 → 161,11 |
"Currently, %s is under development, some options don't work.\n", |
cmdname, cmdname); |
} |
return CMD_VOID; |
return; |
} |
/* Main entry point for rm, accepts an array of arguments */ |
int * cmd_rm(char **argv) |
int cmd_rm(char **argv) |
{ |
unsigned int argc; |
unsigned int i, scope, ret = 0; |
/trunk/uspace/app/bdsh/cmds/modules/rm/entry.h |
---|
2,8 → 2,8 |
#define RM_ENTRY_H |
/* Entry points for the rm command */ |
extern int * cmd_rm(char **); |
extern void * help_cmd_rm(unsigned int); |
extern int cmd_rm(char **); |
extern void help_cmd_rm(unsigned int); |
#endif /* RM_ENTRY_H */ |
/trunk/uspace/app/bdsh/cmds/builtins/cd/cd.c |
---|
42,7 → 42,7 |
static char * cmdname = "cd"; |
void * help_cmd_cd(unsigned int level) |
void help_cmd_cd(unsigned int level) |
{ |
if (level == HELP_SHORT) { |
printf("`%s' changes the current working directory.\n", cmdname); |
53,12 → 53,12 |
cmdname, cmdname); |
} |
return CMD_VOID; |
return; |
} |
/* This is a very rudamentary 'cd' command. It is not 'link smart' (yet) */ |
int * cmd_cd(char **argv, cliuser_t *usr) |
int cmd_cd(char **argv, cliuser_t *usr) |
{ |
int argc, rc = 0; |
/trunk/uspace/app/bdsh/cmds/builtins/cd/entry.h |
---|
4,8 → 4,8 |
#include "scli.h" |
/* Entry points for the cd command */ |
extern void * help_cmd_cd(unsigned int); |
extern int * cmd_cd(char **, cliuser_t *); |
extern void help_cmd_cd(unsigned int); |
extern int cmd_cd(char **, cliuser_t *); |
#endif |
/trunk/uspace/app/bdsh/cmds/cmds.h |
---|
19,17 → 19,16 |
#define BUFF_SMALL 255 |
/* Return macros for int type entry points */ |
#define CMD_FAILURE (int*)1 |
#define CMD_FAILURE 1 |
#define CMD_SUCCESS 0 |
#define CMD_VOID (void *)NULL |
/* Types for module command entry and help */ |
typedef int * (* mod_entry_t)(char **); |
typedef void * (* mod_help_t)(unsigned int); |
typedef int (* mod_entry_t)(char **); |
typedef void (* mod_help_t)(unsigned int); |
/* Built-in commands need to be able to modify cliuser_t */ |
typedef int * (* builtin_entry_t)(char **, cliuser_t *); |
typedef void * (* builtin_help_t)(unsigned int); |
typedef int (* builtin_entry_t)(char **, cliuser_t *); |
typedef void (* builtin_help_t)(unsigned int); |
/* Module structure */ |
typedef struct { |