Branch: Tag:

1998-05-14

1998-05-14 21:45:22 by Fredrik H├╝binette (Hubbe) <hubbe@hubbe.net>

fixed to export the definition of 'struct keypair'

Rev: src/mapping.c:1.33
Rev: src/mapping.h:1.12

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: mapping.c,v 1.32 1998/05/13 00:24:29 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.33 1998/05/14 21:45:21 hubbe Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"
23:   #define AVG_LINK_LENGTH 4   #define MIN_LINK_LENGTH 1   #define MAP_SLOTS(X) ((X)?((X)+((X)>>4)+8):0) - #define LOOP(m) for(e=0;e<m->hashsize;e++) for(k=m->hash[e];k;k=k->next) +     - struct keypair - { -  struct keypair *next; -  struct svalue ind, val; - }; -  +    struct mapping *first_mapping;      
46: Inside #if defined(DEBUG)
      ind_types=val_types=0;    -  LOOP(m) +  MAPPING_LOOP(m)    {    val_types |= 1 << k->val.type;    ind_types |= 1 << k->ind.type;
137:    fatal("really free mapping on mapping with nonzero refs.\n");   #endif    -  LOOP(m) +  MAPPING_LOOP(m)    {    free_svalue(& k->val);    free_svalue(& k->ind);
229:       val_types = ind_types = 0;    -  LOOP(m) +  MAPPING_LOOP(m)    {    val_types |= 1 << k->val.type;    ind_types |= 1 << k->ind.type;
543:    a=allocate_array(m->size);    s=ITEM(a);    -  LOOP(m) assign_svalue(s++, & k->ind); +  MAPPING_LOOP(m) assign_svalue(s++, & k->ind);       a->type_field = m->ind_types;   
564:    a=allocate_array(m->size);    s=ITEM(a);    -  LOOP(m) assign_svalue(s++, & k->val); +  MAPPING_LOOP(m) assign_svalue(s++, & k->val);       a->type_field = m->val_types;   
583:    struct svalue *s;    a=allocate_array(m->size);    s=ITEM(a); -  LOOP(m) +  MAPPING_LOOP(m)    {    struct array *b=allocate_array(2);    assign_svalue(b->item+0, & k->ind);
602:    INT32 e;    struct keypair *k;    -  LOOP(m) +  MAPPING_LOOP(m)    if(is_eq(& k->val, from))    assign_svalue(& k->val, to);   
641:       n=allocate_mapping(MAP_SLOTS(m->size));    -  LOOP(m) mapping_insert(n, &k->ind, &k->val); +  MAPPING_LOOP(m) mapping_insert(n, &k->ind, &k->val);       return n;   }
702:    for(e=d=0;d<args;d++) e+=argp[d].u.mapping->size;    ret=allocate_mapping(MAP_SLOTS(e));    for(d=0;d<args;d++) -  LOOP(argp[d].u.mapping) +  MAPPING_LOOP(argp[d].u.mapping)    mapping_insert(ret, &k->ind, &k->val);    return ret;   }
727:    check_mapping_for_destruct(a);    check_mapping_for_destruct(b);    -  LOOP(a) +  MAPPING_LOOP(a)    {    struct svalue *s;    if((s=low_mapping_lookup(b, & k->ind)))
770:       q=0;    -  LOOP(m) +  MAPPING_LOOP(m)    {    if(q)    {
874:       check_stack(2);    -  LOOP(m) +  MAPPING_LOOP(m)    {    copy_svalues_recursively_no_free(sp,&k->ind, 1, p);    sp++;
993:    {    if((m->ind_types | m->val_types) & BIT_COMPLEX)    { -  LOOP(m) +  MAPPING_LOOP(m)    {    /* We do not want to count this key:index pair if    * the index is a destructed object or function
1019:    {    if((m->ind_types | m->val_types) & BIT_COMPLEX)    { -  LOOP(m) +  MAPPING_LOOP(m)    {    /* We do not want to count this key:index pair if    * the index is a destructed object or function