pike.git / src / mapping.h

version» Context lines:

pike.git/src/mapping.h:54:      extern struct mapping *first_mapping;   extern struct mapping *gc_internal_mapping;      #define map_delete(m,key) map_delete_no_free(m, key, 0)   #define m_sizeof(m) ((m)->data->size)   #define m_ind_types(m) ((m)->data->ind_types)   #define m_val_types(m) ((m)->data->val_types)   #define mapping_get_flags(m) ((m)->data->flags)   #define mapping_data_is_shared(m) ((m)->data->refs > 1) + #define keypair_ind(k) ((k)->ind) + #define keypair_val(k) ((k)->val)      #define MD_KEYPAIRS(MD, HSIZE) \    ( (struct keypair *) \    DO_ALIGN( PTR_TO_INT(((struct mapping_data *)(MD))->hash + HSIZE), \    ALIGNOF(struct keypair)) )      #ifndef PIKE_MAPPING_KEYPAIR_LOOP   #define NEW_MAPPING_LOOP(md) \    for((e=0) DO_IF_DMALLOC( ?0:(debug_malloc_touch(md)) ) ;e<(md)->hashsize;e++) for(k=(md)->hash[e];k;k=k->next)   
pike.git/src/mapping.h:250:    * @param m mapping to insert the new entry into    * @param p a Pike string to be used as the new entry key    * @param val an svalue representing the new entry's value    * @see mapping_insert    * @see low_mapping_insert    * @see mapping_string_insert_string    */   PMOD_EXPORT void mapping_string_insert(struct mapping *m,    struct pike_string *p,    const struct svalue *val); + PMOD_EXPORT struct keypair * mapping_lookup_random(const struct mapping * m);      /** A shortcut function for inserting an entry into a mapping for cases    * where both the key and the value are Pike strings.    *    * @param m mapping to insert the new entry into    * @param p a Pike string to be used as the new entry key    * @param val a Pike string to be used as the new entry's value    * @see mapping_string_insert    * @see low_mapping_insert    * @see mapping_string_insert