view tern.h @ 437:afbea09d7fb4

Restore one of the VDP debugging modes
author Mike Pavone <pavone@retrodev.com>
date Mon, 15 Jul 2013 23:07:45 -0700
parents 440efd7d27a9
children 140af5509ce7
line wrap: on
line source

#ifndef TERN_H_
#define TERN_H_

#include <stdint.h>

typedef union {
	void     *ptrval;
	intptr_t intval;
} tern_val;

typedef struct tern_node {
	struct tern_node *left;
	union {
		struct tern_node *next;
		tern_val         value;
	} straight;
	struct tern_node *right;
	char             el;
} tern_node;

tern_node * tern_insert(tern_node * head, char * key, tern_val value);
int tern_find(tern_node * head, char * key, tern_val *ret);
tern_node * tern_find_prefix(tern_node * head, char * key);
intptr_t tern_find_int(tern_node * head, char * key, intptr_t def);
tern_node * tern_insert_int(tern_node * head, char * key, intptr_t value);
void * tern_find_ptr(tern_node * head, char * key);
tern_node * tern_insert_ptr(tern_node * head, char * key, void * value);

#endif //TERN_H_