Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3810 → Rev 3811

/trunk/uspace/app/bdsh/cmds/modules/quit/quit.c
File deleted
/trunk/uspace/app/bdsh/cmds/modules/quit/quit_def.h
File deleted
/trunk/uspace/app/bdsh/cmds/modules/quit/entry.h
File deleted
/trunk/uspace/app/bdsh/cmds/modules/quit/quit.h
File deleted
/trunk/uspace/app/bdsh/cmds/modules/modules.h
18,7 → 18,6
/* Prototypes for each module's entry (help/exec) points */
 
#include "help/entry.h"
#include "quit/entry.h"
#include "mkdir/entry.h"
#include "rm/entry.h"
#include "cat/entry.h"
34,7 → 33,6
 
module_t modules[] = {
#include "help/help_def.h"
#include "quit/quit_def.h"
#include "mkdir/mkdir_def.h"
#include "rm/rm_def.h"
#include "cat/cat_def.h"
/trunk/uspace/app/bdsh/cmds/builtins/builtins.h
4,9 → 4,11
#include "config.h"
 
#include "cd/entry.h"
#include "exit/entry.h"
 
builtin_t builtins[] = {
#include "cd/cd_def.h"
#include "exit/exit_def.h"
{NULL, NULL, NULL, NULL}
};
 
/trunk/uspace/app/bdsh/cmds/builtins/exit/exit.h
0,0 → 1,6
#ifndef EXIT_H
#define EXIT_H
 
/* Prototypes for the quit command (excluding entry points) */
 
#endif
/trunk/uspace/app/bdsh/cmds/builtins/exit/entry.h
0,0 → 1,12
#ifndef EXIT_ENTRY_H_
#define EXIT_ENTRY_H_
 
#include "scli.h"
 
/* Entry points for the quit command */
extern void help_cmd_exit(unsigned int);
extern int cmd_exit(char *[], cliuser_t *);
 
#endif
 
 
/trunk/uspace/app/bdsh/cmds/builtins/exit/exit.c
0,0 → 1,55
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the original program's authors nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
 
#include <stdio.h>
#include <stdlib.h>
#include "entry.h"
#include "exit.h"
#include "cmds.h"
 
static const char *cmdname = "exit";
 
extern volatile unsigned int cli_quit;
extern const char *progname;
 
void help_cmd_exit(unsigned int level)
{
printf("Type `%s' to exit %s\n", cmdname, progname);
return;
}
 
/* Quits the program and returns the status of whatever command
* came before invoking 'quit' */
int cmd_exit(char *argv[], cliuser_t *usr)
{
/* Inform that we're outta here */
cli_quit = 1;
return CMD_SUCCESS;
}
/trunk/uspace/app/bdsh/cmds/builtins/exit/exit_def.h
0,0 → 1,6
{
"exit",
"Exit the shell",
&cmd_exit,
&help_cmd_exit,
},
/trunk/uspace/app/bdsh/Makefile
57,7 → 57,6
cmds/ \
cmds/modules/ \
cmds/modules/help/ \
cmds/modules/quit/ \
cmds/modules/mkdir/ \
cmds/modules/rm/ \
cmds/modules/cat/ \
67,11 → 66,11
cmds/modules/sleep/ \
cmds/modules/cp/ \
cmds/builtins/ \
cmds/builtins/exit/\
cmds/builtins/cd/
 
SOURCES = \
cmds/modules/help/help.c \
cmds/modules/quit/quit.c \
cmds/modules/mkdir/mkdir.c \
cmds/modules/rm/rm.c \
cmds/modules/cat/cat.c \
80,6 → 79,7
cmds/modules/pwd/pwd.c \
cmds/modules/sleep/sleep.c \
cmds/modules/cp/cp.c \
cmds/builtins/exit/exit.c \
cmds/builtins/cd/cd.c \
cmds/mod_cmds.c \
cmds/builtin_cmds.c \