* On 2002.07.23, in <[EMAIL PROTECTED]>,
* "Sven Guckes" <[EMAIL PROTECTED]> wrote:
>
> oops! indeed - i completely misread that.
> hmm... so what about mutt and readline? *grin*
> i remember that linkitn with readline would add
> quite a lot to the binary. how true is that?
shell$ ll demo.*
1 -rw-r--r-- 1 dgc 2052 226 Jul 23 09:54 demo.c
568 -rwxr-xr-x 1 dgc 2052 572984 Jul 23 09:55 demo.readline*
7 -rwxr-xr-x 1 dgc 2052 6368 Jul 23 09:55 demo.stdio*
shell$ strip demo.{r,s}*
shell$ ll demo.*
1 -rw-r--r-- 1 dgc 2052 226 Jul 23 09:54 demo.c
136 -rwxr-xr-x 1 dgc 2052 124172 Jul 23 09:55 demo.readline*
4 -rwxr-xr-x 1 dgc 2052 3876 Jul 23 09:55 demo.stdio*
120K for basic line editing, without history support, on SPARC Solaris.
Adding history calls doesn't add much code (just a few K); the bulk of
the code is already linked with a single readline() call.
--
-D. Fresh fruit enriches everyone. Takes the thirst
Sun Project, APC/UCCO out of everyday time. A pure whiff of oxygen,
University of Chicago painting over a monochrome world in primary colors.
[EMAIL PROTECTED] We all know that. It's why everyone loves fruit.
#include <stdio.h>
#include <readline/readline.h>
main()
{
char *s, buf[512];
#ifdef READLINE
s = readline(">> ");
#else
fputs(">> ", stdout);
fgets(buf, 511, stdin);
s = buf;
#endif
printf("<< %s\n", s);
exit(0);
}