Changeset 88944695 in mainline for uspace/app/bdsh/input.c


Ignore:
Timestamp:
2008-08-28T08:32:06Z (16 years ago)
Author:
Tim Post <echo@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a56f4b2
Parents:
69145dae
Message:

More house cleaning, don't expose beyond what's needed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/input.c

    r69145dae r88944695  
    4444extern volatile unsigned int cli_interactive;
    4545
     46/* Not exposed in input.h */
     47static void cli_restricted(char *);
     48static void read_line(char *, int);
     49
    4650/* More than a macro than anything */
    47 void cli_restricted(char *cmd)
     51static void cli_restricted(char *cmd)
    4852{
    4953        printf("%s is not available in %s mode\n", cmd,
     
    8286        }
    8387
    84         /* Check what kind of command argv[0] might be, TODO: move this to
    85          * a function */
     88        /* Its a builtin command */
    8689        if ((i = (is_builtin(cmd[0]))) > -1) {
     90                /* Its not available in this mode, see what try_exec() thinks */
    8791                if (builtin_is_restricted(i)) {
    8892                                rc = try_exec(cmd[0], cmd);
    8993                                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. */
    9097                                        cli_restricted(cmd[0]);
    9198                                goto finit;
    9299                }
     100                /* Its a builtin, its available, run it */
    93101                rc = run_builtin(i, cmd, usr);
    94102                goto finit;
     103        /* We repeat the same dance for modules */
    95104        } else if ((i = (is_module(cmd[0]))) > -1) {
    96105                if (module_is_restricted(i)) {
     
    103112                goto finit;
    104113        } 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 */
    105117                rc = try_exec(cmd[0], cmd);
    106118                goto finit;
     
    119131
    120132/* Borrowed from Jiri Svoboda's 'cli' uspace app */
    121 void read_line(char *buffer, int n)
     133static void read_line(char *buffer, int n)
    122134{
    123135        char c;
     
    145157}
    146158
     159/* TODO:
     160 * Implement something like editline() / readline(), if even
     161 * just for command history and making arrows work. */
    147162void get_input(cliuser_t *usr)
    148163{
Note: See TracChangeset for help on using the changeset viewer.