Changeset 88944695 in mainline for uspace/app/bdsh/input.c
- Timestamp:
- 2008-08-28T08:32:06Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a56f4b2
- Parents:
- 69145dae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/input.c
r69145dae r88944695 44 44 extern volatile unsigned int cli_interactive; 45 45 46 /* Not exposed in input.h */ 47 static void cli_restricted(char *); 48 static void read_line(char *, int); 49 46 50 /* More than a macro than anything */ 47 void cli_restricted(char *cmd)51 static void cli_restricted(char *cmd) 48 52 { 49 53 printf("%s is not available in %s mode\n", cmd, … … 82 86 } 83 87 84 /* Check what kind of command argv[0] might be, TODO: move this to 85 * a function */ 88 /* Its a builtin command */ 86 89 if ((i = (is_builtin(cmd[0]))) > -1) { 90 /* Its not available in this mode, see what try_exec() thinks */ 87 91 if (builtin_is_restricted(i)) { 88 92 rc = try_exec(cmd[0], cmd); 89 93 if (rc) 94 /* No external matching it could be found, tell the 95 * user that the command does exist, but is not 96 * available in this mode. */ 90 97 cli_restricted(cmd[0]); 91 98 goto finit; 92 99 } 100 /* Its a builtin, its available, run it */ 93 101 rc = run_builtin(i, cmd, usr); 94 102 goto finit; 103 /* We repeat the same dance for modules */ 95 104 } else if ((i = (is_module(cmd[0]))) > -1) { 96 105 if (module_is_restricted(i)) { … … 103 112 goto finit; 104 113 } else { 114 /* Its not a module or builtin, restricted or otherwise. 115 * See what try_exec() thinks of it and just pass its return 116 * value back to the caller */ 105 117 rc = try_exec(cmd[0], cmd); 106 118 goto finit; … … 119 131 120 132 /* Borrowed from Jiri Svoboda's 'cli' uspace app */ 121 void read_line(char *buffer, int n)133 static void read_line(char *buffer, int n) 122 134 { 123 135 char c; … … 145 157 } 146 158 159 /* TODO: 160 * Implement something like editline() / readline(), if even 161 * just for command history and making arrows work. */ 147 162 void get_input(cliuser_t *usr) 148 163 {
Note:
See TracChangeset
for help on using the changeset viewer.