head 1.4; access; symbols; locks; strict; comment @ * @; 1.4 date 2002.01.17.08.02.44; author thl; state dead; branches; next 1.3; 1.3 date 2002.01.16.09.46.52; author thl; state Exp; branches; next 1.2; 1.2 date 2002.01.15.11.57.31; author thl; state Exp; branches; next 1.1; 1.1 date 2002.01.14.14.49.07; author thl; state Exp; branches; next ; desc @@ 1.4 log @remove lh, it was relocated to lib val @ text @/* ** Act - Abstract Container Type Library ** Copyright (c) 1999-2002 Ralf S. Engelschall ** ** 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/. ** ** 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. */ #ifndef __LH_H__ #define __LH_H__ #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE !FALSE #endif struct lh_st; typedef struct lh_st lh_t; typedef int (*lh_cb_t)(void *ctx, const void *keyptr, int keylen, const void *datptr, int datlen); lh_t *lh_create (void); int lh_insert (lh_t *h, const void *keyptr, int keylen, const void *datptr, int datlen, int override); int lh_lookup (lh_t *h, const void *keyptr, int keylen, void **datptr, int *datlen); int lh_delete (lh_t *h, const void *keyptr, int keylen); int lh_apply (lh_t *h, lh_cb_t cb, void *ctx); int lh_destroy(lh_t *h); #endif /* __LH_H__ */ @ 1.3 log @val now supports OO-style variable names. lh now supports iteration through all elements and applying a callback to each. lmtp2nntp_config.c currently has sample code for lib val embedded, including a data dumper. @ text @@ 1.2 log @constification @ text @d30 7 d40 2 d46 1 @ 1.1 log @include a stripped down version of OSSP act's linae hashing library @ text @d33 5 a37 5 lh_t *lh_new (void); int lh_insert(lh_t *h, void *keyptr, int keylen, void *datptr, int datlen, int override); int lh_lookup(lh_t *h, void *keyptr, int keylen, void **datptr, int *datlen); int lh_delete(lh_t *h, void *keyptr, int keylen); int lh_free (lh_t *h); @