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

version» Context lines:

pike.git/lib/modules/Stdio.pmod/Terminfo.pmod:336:       protected private string swab(string s)    {    return predef::map(s/2, reverse)*"";    }       protected private int load_cap(.File f, int|void bug_compat)    {    int magic, sname, nbool, nnum, nstr, sstr;    +  // terminfo(F): +  // +  // The header section begins the file. This section contains six +  // short integers in the format described below. These integers +  // are (1) the magic number (octal 0432); (2) the size, in bytes, +  // of the names section; (3) the number of bytes in the boolean +  // section; (4) the number of short integers in the numbers +  // section; (5) the number of offsets (short integers) in the +  // strings section; (6) the size, in bytes, of the string table. +     if (6!=sscanf(swab(f->read(12)), "%2c%2c%2c%2c%2c%2c",    magic, sname, nbool, nnum, nstr, sstr) ||    (magic != MAGIC && magic != MAGIC2))    return 0;    aliases = (f->read(sname)-"\0")/"|";    {    int blen = nbool;    if(((nbool+sname)&1) && !bug_compat)    blen++;    array(int) bools = values(f->read(blen)[..nbool-1]);