00001 /* Copyright 2005 Ben Hyde 00002 * 00003 * Licensed under the Apache License, Version 2.0 (the "License"); 00004 * you may not use this file except in compliance with the License. 00005 * You may obtain a copy of the License at 00006 * 00007 * http://www.apache.org/licenses/LICENSE-2.0 00008 * 00009 * Unless required by applicable law or agreed to in writing, software 00010 * distributed under the License is distributed on an "AS IS" BASIS, 00011 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00012 * See the License for the specific language governing permissions and 00013 * limitations under the License. 00014 */ 00015 00016 /** \file ssp_items.h 00017 * \brief Item abstraction 00018 * 00019 * The bloom filter and counter work on sets or streams of items. 00020 * Items are represented by data of type \c void \c * and the 00021 * only operation on those are hash functions. 00022 */ 00023 00024 #ifndef SSP_ITEMS_S 00025 #define SSP_ITEMS_S 00026 00027 #include <apr.h> 00028 00029 /** \brief Signature for user provided hash functions. 00030 * 00031 * The type ssp_hash_function_t defines the signature of 00032 * of the two hash functions the user must provide on his 00033 * items. They take a items, represented by a void * 00034 * pointer, and return up to 32 bits of psuedo random hash 00035 * derived from the item. If fewer bits are needed in 00036 * the filter/counters you instantiate only the low order 00037 * bits are used. Of course, in that scenario the user's 00038 * hash functions need not create more hash bits. 00039 */ 00040 typedef apr_uint32_t (ssp_hash_function_t)(void *item); 00041 00042 #endif /* SSP_ITEMS_S */ 00043
1.4.4