head 1.7; access; symbols act_first:1.1.1.1 act:1.1.1; locks; strict; comment @ * @; 1.7 date 2003.01.06.12.10.57; author rse; state Exp; branches; next 1.6; 1.6 date 2002.01.02.17.05.53; author rse; state Exp; branches; next 1.5; 1.5 date 2001.03.21.15.59.01; author rse; state Exp; branches; next 1.4; 1.4 date 2000.08.20.13.57.53; author rse; state Exp; branches; next 1.3; 1.3 date 2000.08.18.15.58.08; author rse; state Exp; branches; next 1.2; 1.2 date 2000.08.18.15.35.57; author rse; state Exp; branches; next 1.1; 1.1 date 99.11.12.20.37.19; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.11.12.20.37.19; author rse; state Exp; branches; next ; desc @@ 1.7 log @cleanup source tree @ text @/* ** OSSP act - Abstract Container Types ** Copyright (c) 1999-2003 Ralf S. Engelschall ** Copyright (c) 1999-2003 The OSSP Project ** ** This file is part of OSSP act, an abstract container type library ** which can be found at http://www.ossp.org/pkg/lib/act/. ** ** Permission to use, copy, modify, and distribute this software for ** any purpose with or without fee is hereby granted, provided that ** the above copyright notice and this permission notice appear in all ** copies. ** ** THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ** IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR ** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ** USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ** SUCH DAMAGE. ** ** act_hash.h: dynamic hash table API (declaration) */ #ifndef _ACT_HASH_H_ #define _ACT_HASH_H_ /* the opaque hashing data structure */ struct act_hash_st; typedef struct act_hash_st act_hash_t; /* context entries for hashing */ #define ACT_HASH_METHOD ACT_CTX_ID(ptr,HASH,0) #define ACT_HASH_FUNC ACT_CTX_ID(ptr,HASH,1) #define ACT_HASH_TABLESIZE ACT_CTX_ID(int,HASH,2) #define ACT_HASH_MAXLOADFCTR ACT_CTX_ID(int,HASH,3) #define ACT_HASH_MINLOADFCTR ACT_CTX_ID(int,HASH,4) /* types corresponding to the dispatch functions */ typedef void *(*act_hash_new_t) (act_ctx_t *); typedef int (*act_hash_insert_t) (act_ctx_t *, void *, void *, int, void *, int, int); typedef int (*act_hash_lookup_t) (act_ctx_t *, void *, void *, int, void **, int *); typedef int (*act_hash_delete_t) (act_ctx_t *, void *, void *, int); typedef int (*act_hash_size_t) (act_ctx_t *, void *, long *, long *); typedef int (*act_hash_status_t) (act_ctx_t *, void *, char *, int); typedef int (*act_hash_free_t) (act_ctx_t *, void *); /* the dispatch structure for the hash implementation method */ typedef struct act_hash_method_st { unsigned int m_tag; act_hash_new_t m_new; act_hash_insert_t m_insert; act_hash_lookup_t m_lookup; act_hash_delete_t m_delete; act_hash_size_t m_size; act_hash_status_t m_status; act_hash_free_t m_free; } act_hash_method_t; /* the magic cookie which identifies a method structure */ #define ACT_HASH_METHOD_TAG 0xBEEF /* the hashing API functions */ act_hash_t *act_hash_new(act_ctx_t *); act_ctx_t *act_hash_ctx(act_hash_t *); int act_hash_insert(act_hash_t *, void *, int, void *, int, int); int act_hash_lookup(act_hash_t *, void *, int, void **, int *); int act_hash_delete(act_hash_t *, void *, int); int act_hash_size(act_hash_t *, long *, long *); int act_hash_status(act_hash_t *, char *, int); int act_hash_free(act_hash_t *); #define act_hash_mth(name) \ &(act_hash_##name) #define __act_hash_mth_proto(name) \ extern act_hash_method_t act_hash_##name __act_hash_mth_proto(oh); __act_hash_mth_proto(lh); typedef unsigned long (*act_hash_fct_t)(unsigned char *, unsigned int); #define act_hash_fct(name) \ __act_hash_fct_##name #define __act_hash_fct_proto(name) \ extern unsigned long __act_hash_fct_##name(unsigned char *, unsigned int) __act_hash_fct_proto(djbx33a); __act_hash_fct_proto(djbx33x); __act_hash_fct_proto(jedi); __act_hash_fct_proto(vocong); __act_hash_fct_proto(cdt); __act_hash_fct_proto(jotcl); __act_hash_fct_proto(bjddj); __act_hash_fct_proto(crc32); __act_hash_fct_proto(teadm); __act_hash_fct_proto(cpoaat); __act_hash_fct_proto(ozsdbm); __act_hash_fct_proto(fonovo); __act_hash_fct_proto(kazlib); __act_hash_fct_proto(buzhash); __act_hash_fct_proto(pearson); __act_hash_fct_proto(rifkin); __act_hash_fct_proto(asu); __act_hash_fct_proto(holub); __act_hash_fct_proto(cbu); __act_hash_fct_proto(cvs); #endif /* _ACT_HASH_H_ */ @ 1.6 log @bump copyright year @ text @d1 4 a4 3 /* ** Act - Abstract Container Type Library ** Copyright (c) 1999-2002 Ralf S. Engelschall d6 2 a7 2 ** This file is part of Act, a library for dealing with Abstract ** Container Types which can be found at http://www.ossp.org/pkg/act/. d33 1 a33 1 /* the opaque hashing data structure */ d115 1 a115 1 @ 1.5 log @*** empty log message *** @ text @d3 1 a3 1 ** Copyright (c) 1999-2001 Ralf S. Engelschall @ 1.4 log @*** empty log message *** @ text @d3 1 a3 1 ** Copyright (c) 1999-2000 Ralf S. Engelschall @ 1.3 log @*** empty log message *** @ text @d49 1 d60 1 d74 1 d96 1 d98 2 d102 1 d109 3 a111 1 __act_hash_fct_proto(jotcl); @ 1.2 log @*** empty log message *** @ text @d1 26 a26 32 /* ==================================================================== * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * ==================================================================== */ /* ** act_hash.c -- Dynamic Hash Table @ 1.1 log @Initial revision @ text @d2 1 a2 1 * Copyright (c) 1999 Ralf S. Engelschall. All rights reserved. a86 1 __act_hash_mth_proto(sc); @ 1.1.1.1 log @ @ text @@