Changeset f3db4ac8 in rtems


Ignore:
Timestamp:
Aug 27, 2008, 12:48:41 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
2c4d2133
Parents:
f9c186c6
Message:

2008-08-27 Joel Sherrill <joel.sherrill@…>

  • libmisc/Makefile.am, libmisc/shell/shell.c, libmisc/shell/shell.h: Split out rtems_shell_get_prompt() so it can be overridden by the user.
  • libmisc/shell/shell_getprompt.c: New file.
Location:
cpukit
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rf9c186c6 rf3db4ac8  
     12008-08-27      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * libmisc/Makefile.am, libmisc/shell/shell.c, libmisc/shell/shell.h:
     4        Split out rtems_shell_get_prompt() so it can be overridden by the
     5        user.
     6        * libmisc/shell/shell_getprompt.c: New file.
     7
    182008-08-27      Ralf Corsépius <ralf.corsepius@rtems.org>
    29
  • cpukit/libmisc/Makefile.am

    rf9c186c6 rf3db4ac8  
    7878    shell/main_stackuse.c shell/main_tty.c shell/main_umask.c \
    7979    shell/main_unmount.c shell/main_blksync.c shell/main_whoami.c \
    80     shell/shell.c shell/shell_cmdset.c shell/shell_getchar.c shell/shellconfig.c \
     80    shell/shell.c shell/shell_cmdset.c shell/shell_getchar.c \
     81    shell/shell_getprompt.c shell/shellconfig.c \
     82\
    8183    shell/shellconfig.h shell/shell.h shell/shell_makeargs.c \
    8284    shell/str2int.c shell/filemode.c shell/pwcache.c shell/print-ls.c\
  • cpukit/libmisc/shell/shell.c

    rf9c186c6 rf3db4ac8  
    653653}
    654654
    655 void rtems_shell_get_prompt(
    656   rtems_shell_env_t *shell_env,
    657   char              *prompt,
    658   int                size)
    659 {
    660   char curdir[256];
    661  
    662   /* XXX: show_prompt user adjustable */
    663   getcwd(curdir,sizeof(curdir));
    664   snprintf(prompt, size - 1, "%s%s[%s] %c ",
    665           ((shell_env->taskname) ? shell_env->taskname : ""),
    666           ((shell_env->taskname) ? " " : ""),
    667           curdir,
    668           geteuid()?'$':'#');
    669 }
    670 
    671655#define RTEMS_SHELL_MAXIMUM_ARGUMENTS (128)
    672656#define RTEMS_SHELL_CMD_SIZE          (128)
  • cpukit/libmisc/shell/shell.h

    rf9c186c6 rf3db4ac8  
    226226};
    227227
     228/**
     229 *  This method dynamically builds the command line prompt string
     230 *  and places it in @a prompt.
     231 *
     232 *  @param[in] shell_env is the shell execution environment
     233 *  @param[in] prompt is a pointer to a string buffer area
     234 *  @param[in] size is length of the prompt buffer area
     235 *
     236 *  @return This method fills in the memory pointed to by @a prompt.
     237 *
     238 *  @note An application specific implementation can be provided
     239 *        by the user.
     240 */
     241void rtems_shell_get_prompt(
     242  rtems_shell_env_t *shell_env,
     243  char              *prompt,
     244  size_t             size
     245);
     246
    228247#ifdef __cplusplus
    229248}
Note: See TracChangeset for help on using the changeset viewer.