This repository has been archived on 2022-05-21. You can view files and clone it, but cannot push or open issues or pull requests.
LEFTONE/util/dictres/dictres.h
falsycat 84c3a02b9a [RELEASE] u22-v03
This version is submitted to U22 breau.
2020-09-14 00:00:00 +00:00

28 lines
554 B
C

#pragma once
#include <stddef.h>
#include <stdint.h>
typedef struct {
const char* key;
const char* value;
uint64_t hash;
} dictres_item_t;
void
dictres_optimize_(
dictres_item_t* items,
size_t length
);
#define dictres_optimize(items) \
dictres_optimize_(items, sizeof(items)/sizeof(items[0]))
const char*
dictres_find_(
const dictres_item_t* items,
size_t length,
const char* key
);
#define dictres_find(items, key) \
dictres_find_(items, sizeof(items)/sizeof(items[0]), key)