Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3504 → Rev 3403

/branches/dynload/uspace/app/bdsh/cmds/modules/cp/cp_def.h
File deleted
/branches/dynload/uspace/app/bdsh/cmds/modules/cp/entry.h
File deleted
/branches/dynload/uspace/app/bdsh/cmds/modules/cp/cp.h
File deleted
/branches/dynload/uspace/app/bdsh/cmds/modules/cp/cp.c
File deleted
/branches/dynload/uspace/app/bdsh/cmds/modules/sleep/sleep.c
File deleted
/branches/dynload/uspace/app/bdsh/cmds/modules/sleep/sleep_def.h
File deleted
/branches/dynload/uspace/app/bdsh/cmds/modules/sleep/sleep.h
File deleted
/branches/dynload/uspace/app/bdsh/cmds/modules/sleep/entry.h
File deleted
/branches/dynload/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;
return CMD_VOID;
}
 
/* 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;
/branches/dynload/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 */
 
/branches/dynload/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;
return CMD_VOID;
}
 
/* 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;
/branches/dynload/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 */
 
/branches/dynload/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;
return CMD_VOID;
}
 
static unsigned int cat_file(const char *fname, size_t blen)
121,6 → 121,12
return 1;
}
 
/* Debug stuff, newline not added purposefully */
printf("** %s is a file with the size of %ld bytes\n",
fname, total);
printf( "** %d bytes were read in a buffer of %d bytes in %d reads\n",
count, blen, reads);
printf("** Read %s\n", count == total ? "Succeeded" : "Failed");
free(buff);
 
return 0;
127,7 → 133,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;
/branches/dynload/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 */
 
/branches/dynload/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;
return CMD_VOID;
}
 
int cmd_help(char *argv[])
int *cmd_help(char *argv[])
{
module_t *mod;
builtin_t *cmd;
/branches/dynload/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
/branches/dynload/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;
return CMD_VOID;
}
 
int cmd_ls(char **argv)
int * cmd_ls(char **argv)
{
unsigned int argc;
unsigned int scope;
/branches/dynload/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 */
 
/branches/dynload/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;
return CMD_VOID;
}
 
/* 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;
/branches/dynload/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 */
 
/branches/dynload/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;
return CMD_VOID;
}
 
/* 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;
/branches/dynload/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
 
/branches/dynload/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
 
/branches/dynload/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;
return CMD_VOID;
}
 
int cmd_pwd(char *argv[])
int * cmd_pwd(char *argv[])
{
char *buff;
 
/branches/dynload/uspace/app/bdsh/cmds/modules/modules.h
25,8 → 25,6
#include "touch/entry.h"
#include "ls/entry.h"
#include "pwd/entry.h"
#include "sleep/entry.h"
#include "cp/entry.h"
 
/* Each .def function fills the module_t struct with the individual name, entry
* point, help entry point, etc. You can use config.h to control what modules
41,8 → 39,6
#include "touch/touch_def.h"
#include "ls/ls_def.h"
#include "pwd/pwd_def.h"
#include "sleep/sleep_def.h"
#include "cp/cp_def.h"
{NULL, NULL, NULL, NULL}
};