Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3363 → Rev 3364

/trunk/uspace/app/bdsh/cmds/modules/touch/touch.def
1,6 → 1,6
{
"touch",
"The touch command",
"Create files or update access times",
&cmd_touch,
&help_cmd_touch,
0
/trunk/uspace/app/bdsh/cmds/modules/mkdir/mkdir.def
1,6 → 1,6
{
"mkdir",
"The mkdir command",
"Create new directories",
&cmd_mkdir,
&help_cmd_mkdir,
0
/trunk/uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
83,7 → 83,7
}
 
/* This is kind of clunky, but effective for now */
unsigned int
static unsigned int
create_directory(const char *path, unsigned int p)
{
DIR *dirp;
/trunk/uspace/app/bdsh/cmds/modules/mkdir/mkdir.h
3,6 → 3,6
 
/* Prototypes for the mkdir command, excluding entry points */
 
extern unsigned int create_directory(const char *, unsigned int);
static unsigned int create_directory(const char *, unsigned int);
#endif /* MKDIR_H */
 
/trunk/uspace/app/bdsh/cmds/modules/cat/cat.c
81,7 → 81,7
return CMD_VOID;
}
 
unsigned int cat_file(const char *fname, size_t blen)
static unsigned int cat_file(const char *fname, size_t blen)
{
int fd, bytes = 0, count = 0, reads = 0;
off_t total = 0;
/trunk/uspace/app/bdsh/cmds/modules/cat/cat.h
3,7 → 3,7
 
/* Prototypes for the cat command, excluding entry points */
 
extern unsigned int cat_file(const char *, size_t);
static unsigned int cat_file(const char *, size_t);
 
#endif /* CAT_H */
 
/trunk/uspace/app/bdsh/cmds/modules/help/help.c
49,7 → 49,7
volatile int mod_switch = -1;
 
/* Just use a pointer here, no need for mod_switch */
int is_mod_or_builtin(char *cmd)
static int is_mod_or_builtin(char *cmd)
{
int rc = HELP_IS_RUBBISH;
 
/trunk/uspace/app/bdsh/cmds/modules/help/help.h
2,6 → 2,6
#define HELP_H
 
/* Prototypes for the help command (excluding entry points) */
extern int is_mod_or_builtin(char *);
static int is_mod_or_builtin(char *);
 
#endif
/trunk/uspace/app/bdsh/cmds/modules/ls/ls.c
50,7 → 50,7
 
static char *cmdname = "ls";
 
unsigned int ls_scope(const char *path)
static unsigned int ls_scope(const char *path)
{
int fd;
DIR *dirp;
70,7 → 70,7
return LS_BOGUS;
}
 
void ls_scan_dir(const char *d, DIR *dirp)
static void ls_scan_dir(const char *d, DIR *dirp)
{
struct dirent *dp;
unsigned int scope;
118,7 → 118,7
*
* Now we just print basic DOS style lists */
 
void ls_print_dir(const char *d)
static void ls_print_dir(const char *d)
{
printf("%-40s\t<DIR>\n", d);
 
125,7 → 125,7
return;
}
 
void ls_print_file(const char *f)
static void ls_print_file(const char *f)
{
printf("%-40s\n", f);
 
/trunk/uspace/app/bdsh/cmds/modules/ls/ls.h
6,13 → 6,11
#define LS_FILE 1
#define LS_DIR 2
 
/* Protoypes for non entry points, intrinsic to ls. Stuff like ls_scope()
* is also duplicated in rm, while rm sort of duplicates ls_scan_dir().
* TODO make some more shared functions and don't expose the stuff below */
extern unsigned int ls_scope(const char *);
extern void ls_scan_dir(const char *, DIR *);
extern void ls_print_dir(const char *);
extern void ls_print_file(const char *);
 
static unsigned int ls_scope(const char *);
static void ls_scan_dir(const char *, DIR *);
static void ls_print_dir(const char *);
static void ls_print_file(const char *);
 
#endif /* LS_H */
 
/trunk/uspace/app/bdsh/cmds/modules/ls/ls.def
1,6 → 1,6
{
"ls",
"The ls command",
"List files and directories",
&cmd_ls,
&help_cmd_ls,
0
/trunk/uspace/app/bdsh/cmds/modules/rm/rm.c
57,7 → 57,7
{ 0, 0, 0, 0 }
};
 
unsigned int rm_start(rm_job_t *rm)
static unsigned int rm_start(rm_job_t *rm)
{
rm->recursive = 0;
rm->force = 0;
85,7 → 85,7
return 1;
}
 
void rm_end(rm_job_t *rm)
static void rm_end(rm_job_t *rm)
{
if (NULL != rm->nwd)
free(rm->nwd);
99,7 → 99,7
return;
}
 
unsigned int rm_recursive(const char *path)
static unsigned int rm_recursive(const char *path)
{
int rc;
 
114,7 → 114,7
return 1;
}
 
unsigned int rm_single(const char *path)
static unsigned int rm_single(const char *path)
{
if (unlink(path)) {
cli_error(CL_EFAIL, "rm: could not remove file %s", path);
123,7 → 123,7
return 0;
}
 
unsigned int rm_scope(const char *path)
static unsigned int rm_scope(const char *path)
{
int fd;
DIR *dirp;
/trunk/uspace/app/bdsh/cmds/modules/rm/rm.h
33,11 → 33,11
 
 
/* Prototypes for the rm command, excluding entry points */
extern unsigned int rm_start(rm_job_t *);
extern void rm_end(rm_job_t *rm);
extern unsigned int rm_recursive(const char *);
extern unsigned int rm_single(const char *);
extern unsigned int rm_scope(const char *);
static unsigned int rm_start(rm_job_t *);
static void rm_end(rm_job_t *rm);
static unsigned int rm_recursive(const char *);
static unsigned int rm_single(const char *);
static unsigned int rm_scope(const char *);
 
#endif /* RM_H */
 
/trunk/uspace/app/bdsh/cmds/modules/rm/rm.def
1,6 → 1,6
{
"rm",
"The rm command",
"Remove files and directories",
&cmd_rm,
&help_cmd_rm,
0