X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fterminal%2Fread-line.c;h=0fa145c98ac502edb7f29f25e471a2ca6ee885b7;hb=fddfbb3c47fe4234453350df5b4559d75c3bedc9;hp=e72f11458ac4112ede5e78c701dfb8cb9b153960;hpb=9b94efd7513afdb12a6023024e00e50801532fee;p=pspp-builds.git diff --git a/src/ui/terminal/read-line.c b/src/ui/terminal/read-line.c index e72f1145..0fa145c9 100644 --- a/src/ui/terminal/read-line.c +++ b/src/ui/terminal/read-line.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2007 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2007, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,18 +22,22 @@ #include #include #include +#if ! HAVE_READLINE +#include +#endif #include "msg-ui.h" #include #include #include +#include #include #include #include #include #include -#include +#include #include #include "xalloc.h" @@ -104,8 +108,7 @@ static bool read_interactive (struct getl_interface *s, struct string *line) { - struct readln_source *is = - (struct readln_source *) s ; + struct readln_source *is = UP_CAST (s, struct readln_source, parent); return is->interactive_func (line, prompt_get_style ()); } @@ -148,12 +151,11 @@ readln_read (struct string *line, enum prompt_style style) assert (initialised); - reset_msg_count (); + msg_ui_reset_counts (); welcome (); - if (style == PROMPT_FIRST) - som_flush (); + output_flush (); #if HAVE_READLINE rl_attempted_completion_function = (style == PROMPT_FIRST @@ -173,7 +175,7 @@ readln_read (struct string *line, enum prompt_style style) #else fputs (prompt, stdout); fflush (stdout); - if (ds_read_line (line, stdin)) + if (ds_read_line (line, stdin, SIZE_MAX)) { ds_chomp (line, '\n'); eof = false; @@ -212,7 +214,7 @@ create_readln_source (void) rlns->parent.read = read_interactive; rlns->parent.close = readln_close; - return (struct getl_interface *) rlns; + return &rlns->parent; }