coan 4.2.4
ptr_set.h
Go to the documentation of this file.
00001 #ifndef PTR_SET_H
00002 #define PTR_SET_H
00003 /***************************************************************************
00004  *   Copyright (C) 2007-2011 Mike Kinghan, imk@strudl.org                  *
00005  *   All rights reserved.                                                  *
00006  *                                                                         *
00007  *   Contributed originally by Mike Kinghan, imk@strudl.org                *
00008  *                                                                         *
00009  *   Redistribution and use in source and binary forms, with or without    *
00010  *   modification, are permitted provided that the following conditions    *
00011  *   are met:                                                              *
00012  *                                                                         *
00013  *   Redistributions of source code must retain the above copyright        *
00014  *   notice, this list of conditions and the following disclaimer.         *
00015  *                                                                         *
00016  *   Redistributions in binary form must reproduce the above copyright     *
00017  *   notice, this list of conditions and the following disclaimer in the   *
00018  *   documentation and/or other materials provided with the distribution.  *
00019  *                                                                         *
00020  *   Neither the name of Symbian Software Ltd. nor the names of its        *
00021  *   contributors may be used to endorse or promote products derived from  *
00022  *   this software without specific prior written permission.              *
00023  *                                                                         *
00024  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   *
00025  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     *
00026  *   LIMITED TO, THE IMPLIED WARRANTIES OF  MERCHANTABILITY AND FITNESS    *
00027  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE        *
00028  *   COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,   *
00029  *   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,  *
00030  *   BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS *
00031  *   OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED    *
00032  *   AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,*
00033  *   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF *
00034  *   THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH  *
00035  *   DAMAGE.                                                               *
00036  *                                                                         *
00037  ***************************************************************************/
00038 
00039 #include "opts.h"
00040 #include "ptr_vector.h"
00041 
00048 typedef struct ptr_set * ptr_set_h;
00049 
00051 typedef struct ptr_set const * ptr_set_const_h;
00052 
00053 
00065 extern ptr_set_h
00066 ptr_set_new(comparator_t compare, dtor_t dtor, cloner_t cloner);
00067 
00077 extern void
00078 ptr_set_dispose(ptr_set_h ps);
00079 
00084 extern ptr_set_h
00085 ptr_set_copy(ptr_set_const_h src);
00086 
00088 extern void
00089 ptr_set_swap(ptr_set_h lhs, ptr_set_h rhs);
00090 
00095 extern void
00096 ptr_set_assign(ptr_set_h dest, ptr_set_const_h src);
00097 
00105 extern bool
00106 ptr_set_equal(ptr_set_const_h lhs, ptr_set_const_h rhs);
00107 
00109 extern comparator_t
00110 ptr_set_comparator(ptr_set_const_h ps);
00111 
00113 extern dtor_t
00114 ptr_set_dtor(ptr_set_const_h ps);
00115 
00117 extern cloner_t
00118 ptr_set_cloner(ptr_set_const_h ps);
00119 
00121 extern size_t
00122 ptr_set_count(ptr_set_const_h ps);
00123 
00147 extern void *
00148 ptr_set_search(ptr_set_h ps, char const *key, locator_t keylen);
00149 
00152 extern void const *
00153 ptr_set_search_const(ptr_set_const_h ps, char const *key, locator_t keylen);
00154 
00155 
00165 extern bool
00166 ptr_set_insert(ptr_set_h ps, void const *obj);
00167 
00176 extern bool
00177 ptr_set_delete(ptr_set_h ps, locator_t pos);
00178 
00182 extern void **
00183 ptr_set_begin(ptr_set_const_h ps);
00184 
00189 extern void **
00190 ptr_set_end(ptr_set_const_h ps);
00191 
00193 extern void const **
00194 ptr_set_begin_const(ptr_set_const_h ps);
00195 
00197 extern void const **
00198 ptr_set_end_const(ptr_set_const_h ps);
00199 
00200 
00201 #endif /* EOF */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines