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.6 1998/05/09 22:38:58 noring Exp $ + // $Id: Table.pmod,v 1.7 1998/06/18 13:21:34 noring Exp $      #define TABLE_ERR(msg) throw(({ "(Table) "+msg+"\n", backtrace() }))      class table {    static private mapping fieldmap;    static private array table, fields, types;       static private array|int remap(array|string|int cs, int|void forgive)    {    array v = ({});
pike.git/lib/modules/ADT.pmod/Table.pmod:149:    }       object remove(int|string ... cs)    {    return select(@remap(fields) - remap(cs, 1));    }       object where(array(int|string)|int|string cs, function f, mixed ... args)    {    array t = ({}); +  f = f || lambda(mixed x) { return x; };    cs = remap(arrayp(cs)?cs:({ cs }));    foreach(table, mixed row)    if(f(@rows(row, cs), @args))    t += ({ row });    return copy(t, fields, types);    }       object group(mapping(int|string:function)|function f, mixed ... args)    {    if(!sizeof(table))