Changeset e2ea8d7e in mainline for uspace/app/bdsh/scli.c
- Timestamp:
- 2008-08-27T05:36:12Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1b4b7b6
- Parents:
- b510d52
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/scli.c
rb510d52 re2ea8d7e 43 43 static cliuser_t usr; 44 44 45 /* Modified by the 'quit' module, which is compiled before this */ 46 extern unsigned int cli_quit; 47 48 /* Globals that are modified during start-up that modules/builtins should 49 * be aware of. */ 45 /* Globals that are modified during start-up that modules/builtins 46 * should be aware of. */ 47 volatile unsigned int cli_quit = 0; 50 48 volatile unsigned int cli_interactive = 1; 51 49 volatile unsigned int cli_verbocity = 1; … … 55 53 const char *progname = PACKAGE_NAME; 56 54 55 /* These are not exposed, even to builtins */ 56 static int cli_init(cliuser_t *usr); 57 static void cli_finit(cliuser_t *usr); 58 57 59 /* (re)allocates memory to store the current working directory, gets 58 * and updates the current working directory, formats the prompt string */ 60 * and updates the current working directory, formats the prompt 61 * string */ 59 62 unsigned int cli_set_prompt(cliuser_t *usr) 60 63 { … … 78 81 snprintf(usr->cwd, PATH_MAX, "(unknown)"); 79 82 80 snprintf(usr->prompt,81 PATH_MAX,82 "%s # ",83 usr->cwd);83 if (1 < cli_psprintf(&usr->prompt, "%s # ", usr->cwd)) { 84 cli_error(cli_errno, "Failed to set prompt"); 85 return 1; 86 } 84 87 85 88 return 0; 86 89 } 87 90 88 int cli_init(cliuser_t *usr) 91 /* Constructor */ 92 static int cli_init(cliuser_t *usr) 89 93 { 90 94 usr->line = (char *) NULL; … … 99 103 100 104 /* Destructor */ 101 void cli_finit(cliuser_t *usr)105 static void cli_finit(cliuser_t *usr) 102 106 { 103 107 if (NULL != usr->line)
Note:
See TracChangeset
for help on using the changeset viewer.