1 // $Id: vector.hc,v 1.3 2005/07/03 09:12:31 ensc Exp $ --*- c++ -*--
3 // Copyright (C) 2002,2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; version 2 of the License.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 static inline UNUSED void *
20 Vector_begin(struct Vector *vec)
25 static inline UNUSED void *
26 Vector_end(struct Vector *vec)
28 return (char *)(vec->data) + (vec->count * vec->elem_size);
31 static inline UNUSED void const *
32 Vector_begin_const(struct Vector const *vec)
37 static inline UNUSED void const *
38 Vector_end_const(struct Vector const *vec)
40 return (char *)(vec->data) + (vec->count * vec->elem_size);
43 static inline UNUSED size_t
44 Vector_count(struct Vector const *vec)
49 static inline UNUSED void const *
50 Vector_search_const(struct Vector const *vec, void const *key, int (*compar)(const void *, const void *))
52 return Vector_search((struct Vector *)(vec), key, compar);
55 static inline UNUSED void const *
56 Vector_searchSelfOrg_const(struct Vector const *vec, void const *key,
57 int (*compare)(const void *, const void *),
58 VectorSelfOrgMethod method)
60 return Vector_searchSelfOrg((struct Vector *)(vec), key, compare, method);
63 static inline UNUSED void
64 Vector_foreach_const(struct Vector const *vec, void (*func)(void const *, void *),
67 Vector_foreach((struct Vector *)(vec),
68 (void (*)(void *, void *))(func),