src/common/map.c
// Given a hash, key, and value construct a map entry
Given a hash, key, and value construct a map entry
Given a hash key and value construct a map entry
enum natwm_error entry_init(uint32_t hash, const void *key, void *value, struct map_entry **dest)
{
        if (key == NULL || dest == NULL) {
                return GENERIC_ERROR;
        }
        *dest = malloc(sizeof(struct map_entry));
        if (*dest == NULL) {
                return MEMORY_ALLOCATION_ERROR;
        }
        (*dest)->hash = hash;
        (*dest)->key = key;
        (*dest)->value = value;
        return NO_ERROR;
}
enum natwm_error entry_init ( uint32_t hash , const void * key , void * value , struct map_entry * * dest ) { if ( key == NULL || dest == NULL ) { return GENERIC_ERROR ; } * dest = malloc ( sizeof ( struct map_entry ) ) ; if ( * dest == NULL ) { return MEMORY_ALLOCATION_ERROR ; } ( * dest ) -> hash = hash ; ( * dest ) -> key = key ; ( * dest ) -> value = value ; return NO_ERROR ; }
Given a hash, key, and value construct a map entry
Given a hash key and value construct a map entry