pike.git / lib / modules / ADT.pmod / Table.pmod

version» Context lines:

pike.git/lib/modules/ADT.pmod/Table.pmod:1:   // Table.pmod by Fredrik Noring, 1998 - // $Id: Table.pmod,v 1.27 2004/01/11 00:38:16 nilsson Exp $ + // $Id: Table.pmod,v 1.28 2004/09/25 02:51:20 nilsson Exp $      #pike __REAL_VERSION__   #define TABLE_ERR(msg) error("(Table) "+msg+"\n")      //! ADT.Table is a generic module for manipulating tables.   //!   //! Each table contains one or several columns.   //! Each column is associated with a name, the column name.   //! Optionally, one can provide a column type. The Table module can do a number   //! of operations on a given table, like computing the sum of a column,
pike.git/lib/modules/ADT.pmod/Table.pmod:291:    mapping m = ([]);    for(int r = 0; r < sizeof(t); r++)    {    mixed d;    if(!m[d = t[r][c]])    m[d] = ({ t[r] });    else    m[d] += ({ t[r] });    }    array i = indices(m), v = values(m); +  if(types[c] && types[c]->type=="num") +  i = (array(float))i;    predef::sort(i, v);    t = (is_reversed ? predef::reverse(v) : v)*({});    }    return is_reversed ?    copy(t, fields, types)->rsort(@cs[0..(sizeof(cs)-2)]) :    copy(t, fields, types)->sort(@cs[0..(sizeof(cs)-2)]);    }       //! This method sorts the table in ascendent order on one or several columns    //! and returns a new table object. The left most column is sorted last. Note