[BACK]Return to readline.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libedit

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libedit/readline.c between version 1.31 and 1.32

version 1.31, 2003/06/19 16:04:57 version 1.32, 2003/09/14 21:48:54
Line 94  char *rl_completer_word_break_characters
Line 94  char *rl_completer_word_break_characters
 char *rl_completer_quote_characters = NULL;  char *rl_completer_quote_characters = NULL;
 CPFunction *rl_completion_entry_function = NULL;  CPFunction *rl_completion_entry_function = NULL;
 CPPFunction *rl_attempted_completion_function = NULL;  CPPFunction *rl_attempted_completion_function = NULL;
   Function *rl_pre_input_hook = NULL;
   Function *rl_startup1_hook = NULL;
   Function *rl_getc_function = NULL;
   char *rl_terminal_name = NULL;
   int rl_already_prompted = 0;
   int rl_filename_completion_desired = 0;
   int rl_ignore_completion_duplicates = 0;
   VFunction *rl_redisplay_function = NULL;
   Function *rl_completion_display_matches_hook = NULL;
   Function *rl_prep_term_function = NULL;
   Function *rl_deprep_term_function = NULL;
   
 /*  /*
    * The current prompt string.
    */
   char *rl_prompt = NULL;
   /*
  * This is set to character indicating type of completion being done by   * This is set to character indicating type of completion being done by
  * rl_complete_internal(); this is available for application completion   * rl_complete_internal(); this is available for application completion
  * functions.   * functions.
Line 141  static char  *_rl_compat_sub(const char 
Line 156  static char  *_rl_compat_sub(const char 
 static int               rl_complete_internal(int);  static int               rl_complete_internal(int);
 static int               _rl_qsort_string_compare(const void *, const void *);  static int               _rl_qsort_string_compare(const void *, const void *);
   
 /*  
  * needed for prompt switching in readline()  
  */  
 static char *el_rl_prompt = NULL;  
   
   
 /* ARGSUSED */  /* ARGSUSED */
 static char *  static char *
 _get_prompt(EditLine *el __attribute__((__unused__)))  _get_prompt(EditLine *el __attribute__((__unused__)))
 {  {
         return (el_rl_prompt);          rl_already_prompted = 1;
           return (rl_prompt);
 }  }
   
   
Line 221  rl_initialize(void)
Line 232  rl_initialize(void)
         el_set(e, EL_HIST, history, h);          el_set(e, EL_HIST, history, h);
   
         /* for proper prompt printing in readline() */          /* for proper prompt printing in readline() */
         el_rl_prompt = strdup("");          rl_prompt = strdup("");
         if (el_rl_prompt == NULL) {          if (rl_prompt == NULL) {
                 history_end(h);                  history_end(h);
                 el_end(e);                  el_end(e);
                 return -1;                  return -1;
Line 233  rl_initialize(void)
Line 244  rl_initialize(void)
         /* set default mode to "emacs"-style and read setting afterwards */          /* set default mode to "emacs"-style and read setting afterwards */
         /* so this can be overriden */          /* so this can be overriden */
         el_set(e, EL_EDITOR, "emacs");          el_set(e, EL_EDITOR, "emacs");
           if (rl_terminal_name != NULL)
                   el_set(e, EL_TERMINAL, rl_terminal_name);
           else
                   el_get(e, EL_TERMINAL, &rl_terminal_name);
   
         /*          /*
          * Word completition - this has to go AFTER rebinding keys           * Word completition - this has to go AFTER rebinding keys
Line 242  rl_initialize(void)
Line 257  rl_initialize(void)
             "ReadLine compatible completition function",              "ReadLine compatible completition function",
             _el_rl_complete);              _el_rl_complete);
         el_set(e, EL_BIND, "^I", "rl_complete", NULL);          el_set(e, EL_BIND, "^I", "rl_complete", NULL);
   
         /*          /*
          * Find out where the rl_complete function was added; this is           * Find out where the rl_complete function was added; this is
          * used later to detect that lastcmd was also rl_complete.           * used later to detect that lastcmd was also rl_complete.
Line 266  rl_initialize(void)
Line 280  rl_initialize(void)
         rl_line_buffer = memchr(li->buffer, *li->buffer, 1);          rl_line_buffer = memchr(li->buffer, *li->buffer, 1);
         rl_point = rl_end = 0;          rl_point = rl_end = 0;
   
           if (rl_startup_hook)
                   (*rl_startup_hook)(NULL, 0);
   
         return (0);          return (0);
 }  }
   
Line 288  readline(const char *prompt)
Line 305  readline(const char *prompt)
         /* update prompt accordingly to what has been passed */          /* update prompt accordingly to what has been passed */
         if (!prompt)          if (!prompt)
                 prompt = "";                  prompt = "";
         if (strcmp(el_rl_prompt, prompt) != 0) {          if (strcmp(rl_prompt, prompt) != 0) {
                 free(el_rl_prompt);                  free(rl_prompt);
                 el_rl_prompt = strdup(prompt);                  rl_prompt = strdup(prompt);
                 if (el_rl_prompt == NULL)                  if (rl_prompt == NULL)
                         return NULL;                          return NULL;
         }          }
   
           if (rl_pre_input_hook)
                   (*rl_pre_input_hook)(NULL, 0);
   
           rl_already_prompted = 0;
   
         /* get one line from input stream */          /* get one line from input stream */
         ret = el_gets(e, &count);          ret = el_gets(e, &count);
   

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

CVSweb <webmaster@jp.NetBSD.org>