Mercurial > repos > blastem
view tern.h @ 567:8e395210f50f
Refactor gen_x86 to use an interface more like gen_arm and to remove the need for the caller to decide whether an 8-bit or 32-bit displacement is needed in the rdisp functions. Update m68k_to_x86 to use the new version of the gen_x86 functions and do some minor refactoring there in the process
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 02 Mar 2014 14:45:36 -0800 |
parents | 51bf87f76d15 |
children | de6f00204fa2 |
line wrap: on
line source
/* Copyright 2013 Michael Pavone This file is part of BlastEm. BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text. */ #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_default(tern_node * head, char * key, void * def); void * tern_find_ptr(tern_node * head, char * key); tern_node * tern_insert_ptr(tern_node * head, char * key, void * value); #endif //TERN_H_