pike.git / lib / modules / Stdio.pmod / Readline.pike

version» Context lines:

pike.git/lib/modules/Stdio.pmod/Readline.pike:1: - // $Id: Readline.pike,v 1.41 2002/07/14 21:05:59 nilsson Exp $ + // $Id: Readline.pike,v 1.42 2002/10/29 20:09:33 bill Exp $   #pike __REAL_VERSION__      class OutputController   {    static private object(Stdio.File) outfd;    static private object(Stdio.Terminfo.Termcap) term;    static private int xpos = 0, columns = 0;    static private mapping oldattrs = 0;      #define BLINK 1
pike.git/lib/modules/Stdio.pmod/Readline.pike:1088:   static private string text="", readtext;   static private function(string:void) newline_func;   static private int cursorpos = 0;   static private int mark = 0;   /*static private */ object(History) historyobj = 0;   static private int hide = 0;      static private array(string) kill_ring=({});   static private int kill_ring_size=30;    - //! @fixme - //! Document this function + //! get current output control object + //! @returns + //! Terminal output controller object   object(OutputController) get_output_controller()   {    return output_controller;   }    - //! @fixme - //! Document this function + //! get current input control object + //! @returns + //! Terminal input controller object   object(InputController) get_input_controller()   {    return input_controller;   }    - //! @fixme - //! Document this function + //! Return the current prompt string.   string get_prompt()   {    return prompt;   }    - //! @fixme - //! Document this function + //! Set the prompt string. + //! @param newp + //! New prompt string + //! @param newattrs + //! Terminal attributes   string set_prompt(string newp, array(string)|void newattrs)   {   // werror("READLINE: Set prompt: %O\n",newp);    string oldp = prompt;    if(newp!=prompt || !equal(prompt_attrs, newattrs))    {    prompt = newp;    prompt_attrs = newattrs && copy_value(newattrs);    if(newline_func) redisplay(0);       }    return oldp;   }    - //! @fixme - //! Document this function + //! Set text echo on or off. + //! @param onoff + //! 1 for echo, 0 for no echo.   void set_echo(int onoff)   {    hide=!onoff;   }      //! @fixme   //! Document this function   string gettext()   {    return text;
pike.git/lib/modules/Stdio.pmod/Readline.pike:1367:   //! Document this function   void eof()   {    if (historyobj)    historyobj->finishline(text);    initline();    if(newline_func)    newline_func(0);   }    - //! @fixme - //! Document this function + //! Print a message to the output device   void message(string msg)   {    int p = cursorpos;    setcursorpos(strlen(text));    output_controller->newline();    foreach(msg/"\n", string l) {    output_controller->write(l);    output_controller->newline();    }    redisplay(0, 1);