I am trying to make some of my code bash 3.X compatible and I have a key-binding that utilizes READLINE_LINE inside its callback function.  3.0 versions of Bash don't supply the READLINE_LINE, so I need an alternative way to get at the currently typed, but unexecuted line.  I think I need some simple code (C hopefully) to grab the currently typed but unexecuted command from a Bash terminal and print it out to stdout (I'll capture it from there).  My function will then manipulate it and then put it back (I can do this already)I've explored Readline, and looked at command completion neither of those seem to be what I need.  I've spent many hours reading about tty and readline and am at my whits end, the command is on the terminal so it must exist somewhere, right?
Simulating READLINE_LINE in Bash < 4.0
bash;terminal;readline;line editor