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.49 2003/07/19 01:02:58 nilsson Exp $ + // $Id: Readline.pike,v 1.50 2003/07/23 11:42:24 grubba Exp $   #pike __REAL_VERSION__      //! -  + //! @fixme + //! Ought to have support for charset conversion.   class OutputController   {    static private .File outfd;    static private .Terminfo.Termcap term;    static private int xpos = 0, columns = 0;    static private mapping oldattrs = 0;      #define BLINK 1   #define BOLD 2   #define DIM 4
pike.git/lib/modules/Stdio.pmod/Readline.pike:121:    else    catch { outfd->tcsetattr((["OPOST":1,"ONLCR":1,"OCRNL":0,"OLCUC":0,    "OFILL":1,"OFDEL":0,"ONLRET":0,"ONOCR":0]));};    }       static void destroy()    {    disable();    }    -  //! Check the terminal width. +  //! Check and return the terminal width. +  //! +  //! @note +  //! In Pike 7.4 and earlier this function returned @expr{void@}. +  //!    //! @seealso    //! @[get_number_of_columns] -  void check_columns() +  int check_columns()    {    catch {    int c = outfd->tcgetattr()->columns;    if(c)    columns = c;    };    if(!columns)    columns = term->tgetnum("co") || 80; -  +  return columns;    }       //! Returns the width of the terminal.    //! @note    //! Does not check the width of the terminal.    //! @seealso    //! @[check_columns]    int get_number_of_columns()    {    return columns;
pike.git/lib/modules/Stdio.pmod/Readline.pike:410:    .Terminfo.Termcap|string|void _term)    {    outfd = _outfd || Stdio.File( "stdout", "w" );    term = objectp(_term)? _term : .Terminfo.getTerm(_term);    catch { oldattrs = outfd->tcgetattr(); };    check_columns();    }   }      //! + //! @fixme + //! Ought to have support for charset conversion.   class InputController   {    static private object infd, term;    static private int enabled = -1;    static private function(:int) close_callback = 0;    static private string prefix="";    static private mapping(int:function|mapping(string:function)) bindings=([]);    static private function grab_binding = 0;    static private mapping oldattrs = 0;