From 169c3c77f169f2dec9b8fd3d67de37282425ba57 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 30 Jul 2015 12:40:39 -0600 Subject: [PATCH] Fix some bad conditional compilation and update some comments --- include/readline.h | 14 +++++++------- system/readline/readline_common.c | 17 +++++++++-------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/include/readline.h b/include/readline.h index bc2bbf175..0cc85b98c 100644 --- a/include/readline.h +++ b/include/readline.h @@ -55,7 +55,6 @@ # define CONFIG_READLINE_MAX_EXTCMDS 64 #endif - /**************************************************************************** * Public Types ****************************************************************************/ @@ -88,7 +87,7 @@ extern "C" * Name: readline_prompt * * If a prompt string is used by the application, then the application - * must provide the prompt string to readline by calling this function. + * must provide the prompt string to readline() by calling this function. * This is needed only for tab completion in cases where is it necessary * to reprint the prompt string. * @@ -97,13 +96,14 @@ extern "C" * called with that value in order to restore the previous vtable. * * Returned values: - * Returns the previous value of the prompt string + * Returns the previous value of the prompt string. This function may + * then be called with that value in order to restore the previous prompt. * * Assumptions: - * The prompt string is statically allocated a global. readline will + * The prompt string is statically allocated a global. readline() will * simply remember the pointer to the string. The string must stay * allocated and available. Only one prompt string is supported. If - * there are multiple clients of readline, they must all share the same + * there are multiple clients of readline(), they must all share the same * prompt string (with exceptions in the case of the kernel build). * **************************************************************************/ @@ -129,10 +129,10 @@ FAR const char *readline_prompt(FAR const char *prompt); * called with that value in order to restore the previous vtable. * * Assumptions: - * The vtbl string is statically allocated a global. readline will + * The vtbl string is statically allocated a global. readline() will * simply remember the pointer to the structure. The structure must stay * allocated and available. Only one instance of such a structure is - * upported. If there are multiple clients of readline, they must all + * supported. If there are multiple clients of readline(), they must all * share the same tab-completion logic (with exceptions in the case of * the kernel build). * diff --git a/system/readline/readline_common.c b/system/readline/readline_common.c index ca46406a8..3aa6faa9a 100644 --- a/system/readline/readline_common.c +++ b/system/readline/readline_common.c @@ -139,7 +139,7 @@ static void tab_completion(FAR struct rl_common_s *vtbl, char *buf, int nr_builtin_matches = 0; int builtin_matches[CONFIG_READLINE_MAX_BUILTINS]; #endif -#ifdef CONFIG_BUILTIN +#ifdef CONFIG_READLINE_HAVE_EXTMATCH int nr_ext_matches = 0; int ext_matches[CONFIG_READLINE_MAX_EXTCMDS]; #endif @@ -294,7 +294,7 @@ static void tab_completion(FAR struct rl_common_s *vtbl, char *buf, * Name: readline_prompt * * If a prompt string is used by the application, then the application - * must provide the prompt string to readline by calling this function. + * must provide the prompt string to readline() by calling this function. * This is needed only for tab completion in cases where is it necessary * to reprint the prompt string. * @@ -303,13 +303,14 @@ static void tab_completion(FAR struct rl_common_s *vtbl, char *buf, * called with that value in order to restore the previous vtable. * * Returned values: - * Returns the previous value of the prompt string + * Returns the previous value of the prompt string. This function may + * then be called with that value in order to restore the previous prompt. * * Assumptions: - * The prompt string is statically allocated a global. readline will + * The prompt string is statically allocated a global. readline() will * simply remember the pointer to the string. The string must stay * allocated and available. Only one prompt string is supported. If - * there are multiple clients of readline, they must all share the same + * there are multiple clients of readline(), they must all share the same * prompt string (with exceptions in the case of the kernel build). * **************************************************************************/ @@ -327,7 +328,7 @@ FAR const char *readline_prompt(FAR const char *prompt) * Name: readline_extmatch * * If the applications supports a command set, then it may call this - * function in order to provide support for tab complete on these\ + * function in order to provide support for tab complete on these * "external" commands * * Input Parameters: @@ -338,10 +339,10 @@ FAR const char *readline_prompt(FAR const char *prompt) * called with that value in order to restore the previous vtable. * * Assumptions: - * The vtbl string is statically allocated a global. readline will + * The vtbl string is statically allocated a global. readline() will * simply remember the pointer to the structure. The structure must stay * allocated and available. Only one instance of such a structure is - * upported. If there are multiple clients of readline, they must all + * supported. If there are multiple clients of readline(), they must all * share the same tab-completion logic (with exceptions in the case of * the kernel build). *