GNU readline problem

GNU readline problem

Post by Wolfgang Mei » Sat, 11 Jul 1992 01:18:09



Is there anyone, who has experience with the GNU readline
library? (that one distributed with bash)

I don't know any way to preset the input line with a
changeable string.
A call of readline only needs the prompt.

Does something like rl_intitialize exits?
(I tried some of the undocumented functions :-( )

An assignment to rl_line_buffer before the readline call
caused an segmentation fault. Are there other useable
variables?

Thanks in advance


 
 
 

GNU readline problem

Post by Chet Ram » Sat, 11 Jul 1992 04:28:26



Quote:>Is there anyone, who has experience with the GNU readline
>library? (that one distributed with bash)

>I don't know any way to preset the input line with a
>changeable string.
>A call of readline only needs the prompt.

>Does something like rl_intitialize exits?
>(I tried some of the undocumented functions :-( )

There is a function pointer rl_startup_hook that, if valid, is called at
initialization.  What you want is something like this:

static char *pushed_line;

static void
pushline()
{
        if (pushed_line) {
                rl_insert_text(pushed_line);
                free (pushed_line);
                pushed_line = (char *)NULL;
        }

Quote:}

void
preload_line(line)
char    *line;
{
        if (pushed_line)
                free(pushed_line);
        pushed_line = strdup(line);
        rl_startup_hook = (Function *)pushline;

Quote:}

Chet
--
``The use of history as therapy means the corruption of history as history.''
        -- Arthur Schlesinger



 
 
 

1. GNU Readline library linking problems

I'm trying to link readline into my program, and it says this:

/lib/libreadline.a(readline.o): Undefined symbol __IO_stdin_ referenced from text segment
/lib/libreadline.a(readline.o): Undefined symbol __IO_stdout_ referenced from text segment
/lib/libreadline.a(readline.o): Undefined symbol __IO_stderr_ referenced from text segment
/lib/libreadline.a(readline.o): Undefined symbol __IO_stderr_ referenced from text segment
/lib/libreadline.a(xmalloc.o): Undefined symbol __IO_stderr_ referenced from text segment

When I compile the examples from the readline archive it says the same
thing, in addition to some other symbols..

Anyone?

--

2. High Ierr Rate on hme0

3. GNU Readline install problem

4. KSH Script Question: Passwords

5. problem building GNU readline 2.1/shared

6. Wacom Tablet with gpm??

7. GNU readline: make show-all-if-ambiguous the default ???

8. sed question about removing C comments: Summary

9. gnu readline on Solaris 2.2

10. GNU readline

11. DBX error with GNU readline

12. readline-2.0 from GNU

13. Substitute for GNU readline, that can handle UTF-8?