|
GDAL
|
00001 /********************************************************************** 00002 * $Id: cpl_hash_set.h 34931 2016-08-05 17:13:05Z rouault $ 00003 * 00004 * Name: cpl_hash_set.h 00005 * Project: CPL - Common Portability Library 00006 * Purpose: Hash set functions. 00007 * Author: Even Rouault, <even dot rouault at mines dash paris dot org> 00008 * 00009 ********************************************************************** 00010 * Copyright (c) 2008-2009, Even Rouault <even dot rouault at mines-paris dot org> 00011 * 00012 * Permission is hereby granted, free of charge, to any person obtaining a 00013 * copy of this software and associated documentation files (the "Software"), 00014 * to deal in the Software without restriction, including without limitation 00015 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00016 * and/or sell copies of the Software, and to permit persons to whom the 00017 * Software is furnished to do so, subject to the following conditions: 00018 * 00019 * The above copyright notice and this permission notice shall be included 00020 * in all copies or substantial portions of the Software. 00021 * 00022 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00023 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00024 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00025 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00026 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00027 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00028 * DEALINGS IN THE SOFTWARE. 00029 ****************************************************************************/ 00030 00031 #ifndef CPL_HASH_SET_H_INCLUDED 00032 #define CPL_HASH_SET_H_INCLUDED 00033 00034 #include "cpl_port.h" 00035 00047 CPL_C_START 00048 00049 /* Types */ 00050 00052 typedef struct _CPLHashSet CPLHashSet; 00053 00055 typedef unsigned long (*CPLHashSetHashFunc)(const void* elt); 00056 00058 typedef int (*CPLHashSetEqualFunc)(const void* elt1, const void* elt2); 00059 00061 typedef void (*CPLHashSetFreeEltFunc)(void* elt); 00062 00064 typedef int (*CPLHashSetIterEltFunc)(void* elt, void* user_data); 00065 00066 /* Functions */ 00067 00068 CPLHashSet CPL_DLL * CPLHashSetNew(CPLHashSetHashFunc fnHashFunc, 00069 CPLHashSetEqualFunc fnEqualFunc, 00070 CPLHashSetFreeEltFunc fnFreeEltFunc); 00071 00072 void CPL_DLL CPLHashSetDestroy(CPLHashSet* set); 00073 00074 void CPL_DLL CPLHashSetClear(CPLHashSet* set); 00075 00076 int CPL_DLL CPLHashSetSize(const CPLHashSet* set); 00077 00078 void CPL_DLL CPLHashSetForeach(CPLHashSet* set, 00079 CPLHashSetIterEltFunc fnIterFunc, 00080 void* user_data); 00081 00082 int CPL_DLL CPLHashSetInsert(CPLHashSet* set, void* elt); 00083 00084 void CPL_DLL * CPLHashSetLookup(CPLHashSet* set, const void* elt); 00085 00086 int CPL_DLL CPLHashSetRemove(CPLHashSet* set, const void* elt); 00087 int CPL_DLL CPLHashSetRemoveDeferRehash(CPLHashSet* set, const void* elt); 00088 00089 unsigned long CPL_DLL CPLHashSetHashPointer(const void* elt); 00090 00091 int CPL_DLL CPLHashSetEqualPointer(const void* elt1, const void* elt2); 00092 00093 unsigned long CPL_DLL CPLHashSetHashStr(const void * pszStr); 00094 00095 int CPL_DLL CPLHashSetEqualStr(const void* pszStr1, const void* pszStr2); 00096 00097 CPL_C_END 00098 00099 #endif /* CPL_HASH_SET_H_INCLUDED */
1.7.6.1.