documentation bits in comments, no code changes

This commit is contained in:
Denis Vlasenko 2007-09-25 18:35:28 +00:00
parent ea7645bab6
commit 6a5377ac14
4 changed files with 12 additions and 3 deletions

View File

@ -82,7 +82,6 @@ static int bad_nums(int num1, int num2, const char *for_what)
static char *skip_blank(const char *cp) static char *skip_blank(const char *cp)
{ {
// NB: fix comment in skip_whitespace!
while (isblank(*cp)) while (isblank(*cp))
cp++; cp++;
return (char *)cp; return (char *)cp;
@ -125,7 +124,6 @@ static void doCommands(void)
smallint have1, have2; smallint have1, have2;
while (TRUE) { while (TRUE) {
// NB: fix comment in lineedit.c!
/* Returns: /* Returns:
* -1 on read errors or EOF, or on bare Ctrl-D. * -1 on read errors or EOF, or on bare Ctrl-D.
* 0 on ctrl-C, * 0 on ctrl-C,

View File

@ -892,6 +892,12 @@ enum {
FOR_SHELL = DO_HISTORY | SAVE_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION, FOR_SHELL = DO_HISTORY | SAVE_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION,
}; };
line_input_t *new_line_input_t(int flags); line_input_t *new_line_input_t(int flags);
/* Returns:
* -1 on read errors or EOF, or on bare Ctrl-D.
* 0 on ctrl-C,
* >0 length of input string, including terminating '\n'
* [is this true? stores "" in 'command' if return value is 0 or -1]
*/
int read_line_input(const char* prompt, char* command, int maxsize, line_input_t *state); int read_line_input(const char* prompt, char* command, int maxsize, line_input_t *state);
#else #else
int read_line_input(const char* prompt, char* command, int maxsize); int read_line_input(const char* prompt, char* command, int maxsize);

View File

@ -1253,6 +1253,11 @@ static void win_changed(int nsig)
#undef CTRL #undef CTRL
#define CTRL(a) ((a) & ~0x40) #define CTRL(a) ((a) & ~0x40)
/* Returns:
* -1 on read errors or EOF, or on bare Ctrl-D.
* 0 on ctrl-C,
* >0 length of input string, including terminating '\n'
*/
int read_line_input(const char* prompt, char* command, int maxsize, line_input_t *st) int read_line_input(const char* prompt, char* command, int maxsize, line_input_t *st)
{ {
int lastWasTab = FALSE; int lastWasTab = FALSE;

View File

@ -11,7 +11,7 @@
char *skip_whitespace(const char *s) char *skip_whitespace(const char *s)
{ {
/* NB: isspace('0') returns 0 */ /* NB: isspace('\0') returns 0 */
while (isspace(*s)) ++s; while (isspace(*s)) ++s;
return (char *) s; return (char *) s;