aboutsummaryrefslogtreecommitdiff
path: root/table.h
blob: af37c7ec2e78c890156d81146597eeef39f0e8cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once

#include "types.h"

struct table_index {
	struct string name;
	void *ptr;
};

struct table {
	struct table_index *array;
	size_t len;
};

extern int set_table_index(struct table *tbl, struct string name, void *ptr);
extern void * get_table_index(struct table tbl, struct string name);
extern void * remove_table_index(struct table *tbl, struct string name); // returns same as get_table_index