#ifndef HAVE_XTREE_PRIVATE_H #define HAVE_XTREE_PRIVATE_H /* ----------------------------------------------------------------- */ /* Copyright (c) 2007 by Richard Harter */ /* */ /* Permission is hereby granted, free of charge, to any person */ /* obtaining a copy of this software and associated documentation */ /* files (the "Software"), to deal in the Software without */ /* restriction, including without limitation the rights to use, */ /* copy, modify, merge, publish, distribute, sublicense, and/or */ /* sell copies of the Software, and to permit persons to whom the */ /* Software is furnished to do so, subject to the following */ /* conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the */ /* Software. */ /* */ /* Derivative works shall include a notice that the software is a */ /* modified version of the copyrighted software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY */ /* KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE */ /* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR */ /* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR */ /* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER */ /* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR */ /* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* */ /* ----------------------------------------------------------------- */ /* Revision History */ /* */ /* April 22, 2007 - Base release 1.0.0 */ /* */ /* ----------------------------------------------------------------- */ #include #include "urtree_public.h" #define URT_MAX_SMALL_STRING_SIZE 255 #define URT_NODE struct urt_node #define URT_VALUE struct urt_data #define URT_BAGS struct urt_bags #define URT_STACKREC struct stackrec #define URT_STACKHDR struct stackhdr #define URT_INTNODE struct intnode #define ADDKEY_RET struct addkey_ret #define UN_NODE union un_node #define N_SIB_FREELISTS 6 #define BAG_SIZE 680 #define MISC_ERROR 0 #define BAD_INSERT 1 #define ADD_OK 2 UN_NODE { URT_NODE * kids; /* Children node */ URT_NODE * link; /* Link field for free list */ URT_VALUE * data; /* Data field if a leaf */ URT_INTNODE * pair; /* (node, integer) pair */ }; URT_VALUE { int len; /* Length of the data item in bytes */ unsigned char * data; /* The data item in char array form */ VAL_ALT id; /* A handle to be used elsewhere */ }; URT_NODE { int index; /* Char position for this node */ UN_NODE un[16]; /* Array of pointers */ int mode; /* Un bit flags: 1 = kids, 0=data */ }; URT_BAGS { URT_BAGS * link; int pos; void * space; }; URT_STACKREC { URT_NODE * node; int nibble; }; URT_STACKHDR { URT_STACKREC * stack; int max; int used; }; URT_INTNODE { URT_NODE * node; int ival; }; ADDKEY_RET { int success; VAL_ALT value; }; URT_HANDLE { URT_NODE * roots[URT_MAX_SMALL_STRING_SIZE + 1]; URT_BAGS * node_bags; URT_NODE * node_freelist; URT_BAGS * data_bags; URT_VALUE * data_freelist; URT_BAGS * bag_list; URT_BAGS * int_bags; URT_BAGS * pair_bags; URT_STACKHDR stkhdr; FILE * errfile; URT_NODE * big_data; int id_type; /* int = 0, ptr = 1 */ }; #endif