#ifndef HAVE_XTREE_PUBLIC_H #define HAVE_XTREE_PUBLIC_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 */ /* */ /* ----------------------------------------------------------------- */ #define URT_HANDLE struct urt_handle #define VAL_ALT union urt_value_alt #define URT_RET struct urt_search_results #define ID_TYPE_INT 0 #define ID_TYPE_PTR 1 URT_HANDLE; VAL_ALT { int is_int; /* Value is an integer */ void * is_ptr; /* Value is a pointer */ }; URT_RET { int success; /* Flag =0 not present, =1 present */ VAL_ALT value; /* Value returned, if any */ }; URT_RET urtree_search (URT_HANDLE *, unsigned char *, long); URT_RET urtree_insert (URT_HANDLE *, unsigned char *, long, VAL_ALT,int); int urtree_delete (URT_HANDLE *, unsigned char *, long, VAL_ALT); int urtree_verify (long, unsigned char *, unsigned char *); URT_HANDLE * urtree_init (FILE *, int); int urtree_close (URT_HANDLE *); void urtree_print_forest (FILE *, URT_HANDLE *); #endif