2008-12-14 14:55:46 +03:00
|
|
|
|
2013-10-26 22:53:48 +04:00
|
|
|
#define SHELL_VERSION "0.7.2"
|
2008-12-14 14:55:46 +03:00
|
|
|
|
|
|
|
extern char PATH[256];
|
|
|
|
extern char PARAM[256];
|
|
|
|
|
|
|
|
char title[64];
|
|
|
|
char cur_dir[256];
|
|
|
|
|
|
|
|
/// ===========================================================
|
|
|
|
|
|
|
|
char *ALIASES = NULL;
|
|
|
|
unsigned ALIAS_NUM = 0;
|
|
|
|
|
|
|
|
/// ===========================================================
|
|
|
|
|
2013-02-16 15:25:37 +04:00
|
|
|
#define CMD_HISTORY_NUM 10
|
2008-12-14 14:55:46 +03:00
|
|
|
|
|
|
|
char CMD[256];
|
|
|
|
char CMD_HISTORY[CMD_HISTORY_NUM][256];
|
2013-10-19 11:13:02 +04:00
|
|
|
char CMD_NUM = 0;
|
2012-06-04 16:54:51 +04:00
|
|
|
char CMD_HISTORY_NUM_REAL = 0;
|
2008-12-14 14:55:46 +03:00
|
|
|
|
|
|
|
/// ===========================================================
|
|
|
|
|
|
|
|
char script_sign[] = {"#SHS"};
|
|
|
|
|
|
|
|
/// ===========================================================
|
|
|
|
|
2010-10-07 17:43:56 +04:00
|
|
|
int NUM_OF_CMD;
|
|
|
|
|
|
|
|
/// ===========================================================
|
2008-12-14 14:55:46 +03:00
|
|
|
|
2010-10-07 17:43:56 +04:00
|
|
|
typedef struct
|
2008-12-14 14:55:46 +03:00
|
|
|
{
|
2010-10-07 17:43:56 +04:00
|
|
|
const char* name;
|
|
|
|
const char* help;
|
|
|
|
const void* handler;
|
|
|
|
} command_t;
|
|
|
|
|
|
|
|
/// ===========================================================
|
2008-12-14 14:55:46 +03:00
|
|
|
|
2010-10-07 17:43:56 +04:00
|
|
|
int cmd_about(char arg[]);
|
|
|
|
int cmd_alias(char arg[]);
|
|
|
|
int cmd_cd(char dir[]);
|
|
|
|
int cmd_clear(char arg[]);
|
|
|
|
int cmd_date(char arg[]);
|
|
|
|
int cmd_echo(char text[]);
|
|
|
|
int cmd_exit(char arg[]);
|
2010-10-21 03:58:36 +04:00
|
|
|
int cmd_memory(char arg[]);
|
2010-10-07 17:43:56 +04:00
|
|
|
int cmd_help(char cmd[]);
|
|
|
|
int cmd_kill(char process[]);
|
|
|
|
int cmd_ls(char dir[]);
|
|
|
|
int cmd_mkdir(char dir[]);
|
|
|
|
int cmd_more(char file[]);
|
|
|
|
int cmd_ps(char arg[]);
|
|
|
|
int cmd_pwd(char arg[]);
|
|
|
|
int cmd_reboot(char arg[]);
|
|
|
|
int cmd_rm(char file[]);
|
|
|
|
int cmd_rmdir(char dir[]);
|
|
|
|
int cmd_touch(char file[]);
|
|
|
|
int cmd_ver(char arg[]);
|
|
|
|
int cmd_sleep(char arg[]);
|
2010-10-21 08:37:59 +04:00
|
|
|
int cmd_shutdown(char arg[]);
|
2010-10-21 03:58:36 +04:00
|
|
|
int cmd_uptime(char param[]);
|
2010-10-24 18:32:14 +04:00
|
|
|
int cmd_killall(char process_name[]);
|
2012-06-04 16:54:51 +04:00
|
|
|
int cmd_history(char arg[]);
|
2013-02-16 15:25:37 +04:00
|
|
|
int cmd_cp(char param[]);
|
|
|
|
|
2010-10-07 17:43:56 +04:00
|
|
|
|
|
|
|
/// ===========================================================
|
|
|
|
|
2010-10-21 03:58:36 +04:00
|
|
|
#if LANG_ENG
|
|
|
|
#include "locale/eng/globals.h"
|
|
|
|
#elif LANG_RUS
|
|
|
|
#include "locale/rus/globals.h"
|
|
|
|
#endif
|
2008-12-14 14:55:46 +03:00
|
|
|
|
|
|
|
/// ===========================================================
|
2010-10-07 17:43:56 +04:00
|
|
|
|
|
|
|
|