Changeset d752cf4 in mainline for uspace/app/bdsh/cmds/mod_cmds.c


Ignore:
Timestamp:
2009-01-22T07:13:13Z (16 years ago)
Author:
Tim Post <echo@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
491af07
Parents:
48c3d50
Message:

Eliminate 'restrict' from command structure, get rid of needless aliases.
Order of search is builtin → module → external, there is no need to
restrict commands to (non)interative shells only any longer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/mod_cmds.c

    r48c3d50 rd752cf4  
    5353
    5454extern volatile unsigned int cli_interactive;
    55 
    56 int module_is_restricted(int pos)
    57 {
    58         /* Restriction Levels:
    59          * -1 -> Available only in interactive mode
    60          *  0 -> Available in any mode
    61          *  1 -> Available only in non-interactive mode */
    62 
    63         module_t *mod = modules;
    64         mod += pos;
    65         /* We're interactive, and the module is OK to run */
    66         if (cli_interactive && mod->restricted <= 0)
    67                 return 0;
    68         /* We're not interactive, and the module is OK to run */
    69         if (!cli_interactive && mod->restricted >= 0)
    70                 return 0;
    71 
    72         /* Anything else is just a big fat no :) */
    73         return 1;
    74 }
    7555
    7656/* Checks if an entry function matching command exists in modules[], if so
Note: See TracChangeset for help on using the changeset viewer.