Changeset 809813d in mainline


Ignore:
Timestamp:
2008-09-14T15:43:22Z (16 years ago)
Author:
Tim Post <echo@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6279151
Parents:
211b0c13
Message:

Simplify entry types (and return values) for commands

Location:
uspace/app/bdsh/cmds
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/builtins/cd/cd.c

    r211b0c13 r809813d  
    4343static char * cmdname = "cd";
    4444
    45 void * help_cmd_cd(unsigned int level)
     45void help_cmd_cd(unsigned int level)
    4646{
    4747        if (level == HELP_SHORT) {
     
    5454        }
    5555
    56         return CMD_VOID;
     56        return;
    5757}
    5858
    5959/* This is a very rudamentary 'cd' command. It is not 'link smart' (yet) */
    6060
    61 int * cmd_cd(char **argv, cliuser_t *usr)
     61int cmd_cd(char **argv, cliuser_t *usr)
    6262{
    6363        int argc, rc = 0;
  • uspace/app/bdsh/cmds/builtins/cd/entry.h

    r211b0c13 r809813d  
    55
    66/* Entry points for the cd command */
    7 extern void * help_cmd_cd(unsigned int);
    8 extern int * cmd_cd(char **, cliuser_t *);
     7extern void help_cmd_cd(unsigned int);
     8extern int cmd_cd(char **, cliuser_t *);
    99
    1010#endif
  • uspace/app/bdsh/cmds/cmds.h

    r211b0c13 r809813d  
    2020
    2121/* Return macros for int type entry points */
    22 #define CMD_FAILURE (int*)1
     22#define CMD_FAILURE 1
    2323#define CMD_SUCCESS 0
    24 #define CMD_VOID (void *)NULL
    2524
    2625/* Types for module command entry and help */
    27 typedef int * (* mod_entry_t)(char **);
    28 typedef void * (* mod_help_t)(unsigned int);
     26typedef int (* mod_entry_t)(char **);
     27typedef void (* mod_help_t)(unsigned int);
    2928
    3029/* Built-in commands need to be able to modify cliuser_t */
    31 typedef int * (* builtin_entry_t)(char **, cliuser_t *);
    32 typedef void * (* builtin_help_t)(unsigned int);
     30typedef int (* builtin_entry_t)(char **, cliuser_t *);
     31typedef void (* builtin_help_t)(unsigned int);
    3332
    3433/* Module structure */
  • uspace/app/bdsh/cmds/modules/cat/cat.c

    r211b0c13 r809813d  
    6060
    6161/* Dispays help for cat in various levels */
    62 void * help_cmd_cat(unsigned int level)
     62void help_cmd_cat(unsigned int level)
    6363{
    6464        if (level == HELP_SHORT) {
     
    7979        }
    8080
    81         return CMD_VOID;
     81        return;
    8282}
    8383
     
    128128
    129129/* Main entry point for cat, accepts an array of arguments */
    130 int * cmd_cat(char **argv)
     130int cmd_cat(char **argv)
    131131{
    132132        unsigned int argc, i, ret = 0, buffer = 0;
  • uspace/app/bdsh/cmds/modules/cat/entry.h

    r211b0c13 r809813d  
    33
    44/* Entry points for the cat command */
    5 extern int * cmd_cat(char **);
    6 extern void * help_cmd_cat(unsigned int);
     5extern int cmd_cat(char **);
     6extern void help_cmd_cat(unsigned int);
    77
    88#endif /* CAT_ENTRY_H */
  • uspace/app/bdsh/cmds/modules/help/entry.h

    r211b0c13 r809813d  
    33
    44/* Entry points for the help command */
    5 extern void * help_cmd_help(unsigned int);
    6 extern int * cmd_help(char *[]);
     5extern void help_cmd_help(unsigned int);
     6extern int cmd_help(char *[]);
    77
    88#endif
  • uspace/app/bdsh/cmds/modules/help/help.c

    r211b0c13 r809813d  
    7070}
    7171
    72 void *help_cmd_help(unsigned int level)
     72void help_cmd_help(unsigned int level)
    7373{
    7474        if (level == HELP_SHORT) {
     
    8787        }
    8888
    89         return CMD_VOID;
     89        return;
    9090}
    9191
    92 int *cmd_help(char *argv[])
     92int cmd_help(char *argv[])
    9393{
    9494        module_t *mod;
  • uspace/app/bdsh/cmds/modules/ls/entry.h

    r211b0c13 r809813d  
    33
    44/* Entry points for the ls command */
    5 extern int * cmd_ls(char **);
    6 extern void * help_cmd_ls(unsigned int);
     5extern int cmd_ls(char **);
     6extern void help_cmd_ls(unsigned int);
    77
    88#endif /* LS_ENTRY_H */
  • uspace/app/bdsh/cmds/modules/ls/ls.c

    r211b0c13 r809813d  
    133133}
    134134
    135 void * help_cmd_ls(unsigned int level)
     135void help_cmd_ls(unsigned int level)
    136136{
    137137        if (level == HELP_SHORT) {
     
    143143        }
    144144
    145         return CMD_VOID;
     145        return;
    146146}
    147147
    148 int * cmd_ls(char **argv)
     148int cmd_ls(char **argv)
    149149{
    150150        unsigned int argc;
  • uspace/app/bdsh/cmds/modules/mkdir/entry.h

    r211b0c13 r809813d  
    33
    44/* Entry points for the mkdir command */
    5 extern int * cmd_mkdir(char **);
    6 extern void * help_cmd_mkdir(unsigned int);
     5extern int cmd_mkdir(char **);
     6extern void help_cmd_mkdir(unsigned int);
    77
    88#endif /* MKDIR_ENTRY_H */
  • uspace/app/bdsh/cmds/modules/mkdir/mkdir.c

    r211b0c13 r809813d  
    6161
    6262
    63 void * help_cmd_mkdir(unsigned int level)
     63void help_cmd_mkdir(unsigned int level)
    6464{
    6565        if (level == HELP_SHORT) {
     
    8080        }
    8181
    82         return CMD_VOID;
     82        return;
    8383}
    8484
     
    182182}
    183183
    184 int * cmd_mkdir(char **argv)
     184int cmd_mkdir(char **argv)
    185185{
    186186        unsigned int argc, create_parents = 0, i, ret = 0, follow = 0;
  • uspace/app/bdsh/cmds/modules/pwd/entry.h

    r211b0c13 r809813d  
    55
    66/* Entry points for the pwd command */
    7 extern void * help_cmd_pwd(unsigned int);
    8 extern int * cmd_pwd(char **);
     7extern void help_cmd_pwd(unsigned int);
     8extern int cmd_pwd(char **);
    99
    1010#endif
  • uspace/app/bdsh/cmds/modules/pwd/pwd.c

    r211b0c13 r809813d  
    4040static char * cmdname = "pwd";
    4141
    42 void * help_cmd_pwd(unsigned int level)
     42void help_cmd_pwd(unsigned int level)
    4343{
    4444        printf("`%s' prints your current working directory.\n", cmdname);
    45         return CMD_VOID;
     45        return;
    4646}
    4747
    48 int * cmd_pwd(char *argv[])
     48int cmd_pwd(char *argv[])
    4949{
    5050        char *buff;
  • uspace/app/bdsh/cmds/modules/quit/entry.h

    r211b0c13 r809813d  
    33
    44/* Entry points for the quit command */
    5 extern void * help_cmd_quit(unsigned int);
    6 extern int * cmd_quit(char *[]);
     5extern void help_cmd_quit(unsigned int);
     6extern int cmd_quit(char *[]);
    77
    88#endif
  • uspace/app/bdsh/cmds/modules/quit/quit.c

    r211b0c13 r809813d  
    4040extern const char *progname;
    4141
    42 void * help_cmd_quit(unsigned int level)
     42void help_cmd_quit(unsigned int level)
    4343{
    4444        printf("Type `%s' to exit %s\n", cmdname, progname);
    45         return CMD_VOID;
     45        return;
    4646}
    4747
    4848/* Quits the program and returns the status of whatever command
    4949 * came before invoking 'quit' */
    50 int * cmd_quit(char *argv[])
     50int cmd_quit(char *argv[])
    5151{
    5252        /* Inform that we're outta here */
  • uspace/app/bdsh/cmds/modules/rm/entry.h

    r211b0c13 r809813d  
    33
    44/* Entry points for the rm command */
    5 extern int * cmd_rm(char **);
    6 extern void * help_cmd_rm(unsigned int);
     5extern int cmd_rm(char **);
     6extern void help_cmd_rm(unsigned int);
    77
    88#endif /* RM_ENTRY_H */
  • uspace/app/bdsh/cmds/modules/rm/rm.c

    r211b0c13 r809813d  
    145145
    146146/* Dispays help for rm in various levels */
    147 void * help_cmd_rm(unsigned int level)
     147void help_cmd_rm(unsigned int level)
    148148{
    149149        if (level == HELP_SHORT) {
     
    162162                cmdname, cmdname);
    163163        }
    164         return CMD_VOID;
     164        return;
    165165}
    166166
    167167/* Main entry point for rm, accepts an array of arguments */
    168 int * cmd_rm(char **argv)
     168int cmd_rm(char **argv)
    169169{
    170170        unsigned int argc;
  • uspace/app/bdsh/cmds/modules/touch/entry.h

    r211b0c13 r809813d  
    33
    44/* Entry points for the touch command */
    5 extern int * cmd_touch(char **);
    6 extern void * help_cmd_touch(unsigned int);
     5extern int cmd_touch(char **);
     6extern void help_cmd_touch(unsigned int);
    77
    88#endif /* TOUCH_ENTRY_H */
  • uspace/app/bdsh/cmds/modules/touch/touch.c

    r211b0c13 r809813d  
    4949
    5050/* Dispays help for touch in various levels */
    51 void * help_cmd_touch(unsigned int level)
     51void help_cmd_touch(unsigned int level)
    5252{
    5353        if (level == HELP_SHORT) {
     
    5959        }
    6060
    61         return CMD_VOID;
     61        return;
    6262}
    6363
    6464/* Main entry point for touch, accepts an array of arguments */
    65 int * cmd_touch(char **argv)
     65int cmd_touch(char **argv)
    6666{
    6767        unsigned int argc, i = 0, ret = 0;
Note: See TracChangeset for help on using the changeset viewer.