in agent/src/c/common/strmap.c [129:157]
int sm_get(const StrMap *map, const char *key, struct map_object **out_buf)
{
unsigned int index;
Bucket *bucket;
Pair *pair;
if (map == NULL) {
return 0;
}
if (key == NULL) {
return 0;
}
index = hash(key) % map->count;
bucket = &(map->buckets[index]);
pair = get_pair(bucket, key);
if (pair == NULL) {
return 0;
}
if (out_buf == NULL) {
return sizeof(*(pair->value));
}
if (out_buf == NULL) {
return 0;
}
//memcpy(out_buf, pair->value,sizeof(*out_buf));
*out_buf = pair->value;
return 1;
}