pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: mapping.c,v 1.115 2001/01/25 08:37:59 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.116 2001/01/31 13:14:43 grubba Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"   #include "svalue.h"   #include "array.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "pike_memory.h"   #include "dynamic_buffer.h"   #include "interpret.h"
pike.git/src/mapping.c:1643:    if(!m->data->size)    return mkefuncallnode("aggregate_mapping",0);       s.type=T_MAPPING;    s.subtype=0;    s.u.mapping=m;    return mkconstantsvaluenode(&s);    }   }    + /*! @decl mapping aggregate_mapping(mixed ... elems) +  *! +  *! Construct a mapping. +  *! +  *! Groups the arguments together two and two in key-index pairs and +  *! creates a mapping of those pairs. An alternative and more preferrable +  *! syntax is: +  *! @code{([ key1:val1, key2:val2, ... ])@} +  *! +  *! @seealso +  *! @[sizeof()], @[mappingp()], @[mkmapping()] +  */   PMOD_EXPORT void f_aggregate_mapping(INT32 args)   {    INT32 e;    struct keypair *k;    struct mapping *m;       if(args & 1)    Pike_error("Uneven number of arguments to aggregate_mapping.\n");       m=allocate_mapping(MAP_SLOTS(args / 2));