Sat, 11 Oct 2025 11:55:46 +0200
changes the compare function wrapper for pointer lists so that it no longer invokes the actual compare function for NULL pointers
398
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
1 | /* |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
3 | * |
1348
a1da355ed3b8
roll out the function stubs for the kv-list
Mike Becker <universe@uap-core.de>
parents:
1347
diff
changeset
|
4 | * Copyright 2025 Mike Becker, Olaf Wintermann All rights reserved. |
398
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
5 | * |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
6 | * Redistribution and use in source and binary forms, with or without |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
7 | * modification, are permitted provided that the following conditions are met: |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
8 | * |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
9 | * 1. Redistributions of source code must retain the above copyright |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
10 | * notice, this list of conditions and the following disclaimer. |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
11 | * |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
12 | * 2. Redistributions in binary form must reproduce the above copyright |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
13 | * notice, this list of conditions and the following disclaimer in the |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
14 | * documentation and/or other materials provided with the distribution. |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
15 | * |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
26 | * POSSIBILITY OF SUCH DAMAGE. |
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
27 | */ |
453
bb144d08cd44
add some documentation and changes some signatures
Mike Becker <universe@uap-core.de>
parents:
438
diff
changeset
|
28 | /** |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
29 | * @file kv_list.h |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
30 | * @brief Linked list implementation with key/value-lookup. |
1100
2ca6fa71e55e
refine docs for linked_list.h - issue #548
Mike Becker <universe@uap-core.de>
parents:
993
diff
changeset
|
31 | * @author Mike Becker |
2ca6fa71e55e
refine docs for linked_list.h - issue #548
Mike Becker <universe@uap-core.de>
parents:
993
diff
changeset
|
32 | * @author Olaf Wintermann |
2ca6fa71e55e
refine docs for linked_list.h - issue #548
Mike Becker <universe@uap-core.de>
parents:
993
diff
changeset
|
33 | * @copyright 2-Clause BSD License |
453
bb144d08cd44
add some documentation and changes some signatures
Mike Becker <universe@uap-core.de>
parents:
438
diff
changeset
|
34 | */ |
398
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
35 | |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
36 | #ifndef UCX_KV_LIST_H |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
37 | #define UCX_KV_LIST_H |
398
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
38 | |
484
9e6900b1cf9d
add common.h include to all other header files
Mike Becker <universe@uap-core.de>
parents:
481
diff
changeset
|
39 | #include "common.h" |
398
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
40 | #include "list.h" |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
41 | #include "map.h" |
398
8d506ed6c1c0
adds first draft for linked list implementation
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
42 | |
415 | 43 | #ifdef __cplusplus |
44 | extern "C" { | |
45 | #endif | |
46 | ||
466
28bc3e10ac28
add special linked list implementation for storing pointers
Mike Becker <universe@uap-core.de>
parents:
456
diff
changeset
|
47 | /** |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
48 | * Allocates a linked list with a lookup-map for storing elements with @p elem_size bytes each. |
466
28bc3e10ac28
add special linked list implementation for storing pointers
Mike Becker <universe@uap-core.de>
parents:
456
diff
changeset
|
49 | * |
1111
78eeeb950883
remove API for changing the store_pointer property after list creation
Mike Becker <universe@uap-core.de>
parents:
1100
diff
changeset
|
50 | * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
51 | * copies of the added elements, and the compare function will be automatically set |
1111
78eeeb950883
remove API for changing the store_pointer property after list creation
Mike Becker <universe@uap-core.de>
parents:
1100
diff
changeset
|
52 | * to cx_cmp_ptr(), if none is given. |
669
dce9b8450656
add docs for CX_STORE_POINTERS and remove cxHashMapCreateForPointers()
Mike Becker <universe@uap-core.de>
parents:
662
diff
changeset
|
53 | * |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
54 | * After creating the list, it can also be used as a map after converting the pointer |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
55 | * to a CxMap pointer with cxKvListAsMap(). |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
56 | * When you want to use the list interface again, you can also convert the map pointer back |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
57 | * with cxKvListAsList(). |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
58 | * |
466
28bc3e10ac28
add special linked list implementation for storing pointers
Mike Becker <universe@uap-core.de>
parents:
456
diff
changeset
|
59 | * @param allocator the allocator for allocating the list nodes |
1318
12fa1d37fe48
allow changing the cxDefaultAllocator - resolves #669
Mike Becker <universe@uap-core.de>
parents:
1241
diff
changeset
|
60 | * (if @c NULL, the cxDefaultAllocator will be used) |
466
28bc3e10ac28
add special linked list implementation for storing pointers
Mike Becker <universe@uap-core.de>
parents:
456
diff
changeset
|
61 | * @param comparator the comparator for the elements |
1100
2ca6fa71e55e
refine docs for linked_list.h - issue #548
Mike Becker <universe@uap-core.de>
parents:
993
diff
changeset
|
62 | * (if @c NULL, and the list is not storing pointers, sort and find |
763
741a2040fa33
make cx_cmp_ptr default comparator for pointer lists - relates to #340
Mike Becker <universe@uap-core.de>
parents:
759
diff
changeset
|
63 | * functions will not work) |
855
35bcb3216c0d
fix inconsistent use of item_size and elem_size
Mike Becker <universe@uap-core.de>
parents:
807
diff
changeset
|
64 | * @param elem_size the size of each element in bytes |
466
28bc3e10ac28
add special linked list implementation for storing pointers
Mike Becker <universe@uap-core.de>
parents:
456
diff
changeset
|
65 | * @return the created list |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
66 | * @see cxKvListAsMap() |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
67 | * @see cxKvListAsList() |
466
28bc3e10ac28
add special linked list implementation for storing pointers
Mike Becker <universe@uap-core.de>
parents:
456
diff
changeset
|
68 | */ |
985
68754c7de906
major refactoring of attributes
Mike Becker <universe@uap-core.de>
parents:
926
diff
changeset
|
69 | cx_attr_nodiscard |
68754c7de906
major refactoring of attributes
Mike Becker <universe@uap-core.de>
parents:
926
diff
changeset
|
70 | cx_attr_malloc |
993
b642eca4b956
make names of destroy and free functions consistent - fixes #484
Mike Becker <universe@uap-core.de>
parents:
989
diff
changeset
|
71 | cx_attr_dealloc(cxListFree, 1) |
1180
4c3a69b9723a
add support for building windows DLLs - resolves #582
Mike Becker <universe@uap-core.de>
parents:
1162
diff
changeset
|
72 | cx_attr_export |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
73 | CxList *cxKvListCreate( |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
74 | const CxAllocator *allocator, |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
75 | cx_compare_func comparator, |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
76 | size_t elem_size |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
77 | ); |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
78 | |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
79 | /** |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
80 | * Allocates a linked list with a lookup-map for storing elements with @p elem_size bytes each. |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
81 | * |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
82 | * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
83 | * copies of the added elements, and the compare function will be automatically set |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
84 | * to cx_cmp_ptr(), if none is given. |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
85 | * |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
86 | * This function creates the list with cxKvListCreate() and immediately applies |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
87 | * cxKvListAsMap(). If you want to use the returned object as a list, you can call |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
88 | * cxKvListAsList() later. |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
89 | * |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
90 | * @param allocator the allocator for allocating the list nodes |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
91 | * (if @c NULL, the cxDefaultAllocator will be used) |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
92 | * @param comparator the comparator for the elements |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
93 | * (if @c NULL, and the list is not storing pointers, sort and find |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
94 | * functions will not work) |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
95 | * @param elem_size the size of each element in bytes |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
96 | * @return the created list wrapped into the CxMap interface |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
97 | * @see cxKvListAsMap() |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
98 | * @see cxKvListAsList() |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
99 | */ |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
100 | cx_attr_nodiscard |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
101 | cx_attr_malloc |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
102 | cx_attr_dealloc(cxMapFree, 1) |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
103 | cx_attr_export |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
104 | CxMap *cxKvListCreateAsMap( |
890
54565fd74e74
move all const keywords to the west - fixes #426
Mike Becker <universe@uap-core.de>
parents:
879
diff
changeset
|
105 | const CxAllocator *allocator, |
677
b09aae58bba4
refactoring of collections to make use of destructors in map implementations
Mike Becker <universe@uap-core.de>
parents:
670
diff
changeset
|
106 | cx_compare_func comparator, |
855
35bcb3216c0d
fix inconsistent use of item_size and elem_size
Mike Becker <universe@uap-core.de>
parents:
807
diff
changeset
|
107 | size_t elem_size |
670
4ad8ea3aee49
allow NULL for allocator and comparator
Mike Becker <universe@uap-core.de>
parents:
669
diff
changeset
|
108 | ); |
453
bb144d08cd44
add some documentation and changes some signatures
Mike Becker <universe@uap-core.de>
parents:
438
diff
changeset
|
109 | |
466
28bc3e10ac28
add special linked list implementation for storing pointers
Mike Becker <universe@uap-core.de>
parents:
456
diff
changeset
|
110 | /** |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
111 | * Allocates a linked list with a lookup-map for storing elements with @p elem_size bytes each. |
662
d0d95740071b
add simple functions for creating lists
Mike Becker <universe@uap-core.de>
parents:
647
diff
changeset
|
112 | * |
d0d95740071b
add simple functions for creating lists
Mike Becker <universe@uap-core.de>
parents:
647
diff
changeset
|
113 | * The list will use cxDefaultAllocator and no comparator function. If you want |
d0d95740071b
add simple functions for creating lists
Mike Becker <universe@uap-core.de>
parents:
647
diff
changeset
|
114 | * to call functions that need a comparator, you must either set one immediately |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
115 | * after list creation or use cxKvListCreate(). |
662
d0d95740071b
add simple functions for creating lists
Mike Becker <universe@uap-core.de>
parents:
647
diff
changeset
|
116 | * |
1111
78eeeb950883
remove API for changing the store_pointer property after list creation
Mike Becker <universe@uap-core.de>
parents:
1100
diff
changeset
|
117 | * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
118 | * copies of the added elements, and the compare function will be automatically set |
1239
b4b1f15d1866
complete more than 80% of the list.h documentation
Mike Becker <universe@uap-core.de>
parents:
1180
diff
changeset
|
119 | * to cx_cmp_ptr(). |
669
dce9b8450656
add docs for CX_STORE_POINTERS and remove cxHashMapCreateForPointers()
Mike Becker <universe@uap-core.de>
parents:
662
diff
changeset
|
120 | * |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
121 | * After creating the list, it can also be used as a map after converting the pointer |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
122 | * to a CxMap pointer with cxKvListAsMap(). |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
123 | * When you want to use the list interface again, you can also convert the map pointer back |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
124 | * with cxKvListAsList(). |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
125 | * |
1100
2ca6fa71e55e
refine docs for linked_list.h - issue #548
Mike Becker <universe@uap-core.de>
parents:
993
diff
changeset
|
126 | * @param elem_size (@c size_t) the size of each element in bytes |
2ca6fa71e55e
refine docs for linked_list.h - issue #548
Mike Becker <universe@uap-core.de>
parents:
993
diff
changeset
|
127 | * @return (@c CxList*) the created list |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
128 | * @see cxKvListAsMap() |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
129 | * @see cxKvListAsList() |
662
d0d95740071b
add simple functions for creating lists
Mike Becker <universe@uap-core.de>
parents:
647
diff
changeset
|
130 | */ |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
131 | #define cxKvListCreateSimple(elem_size) cxKvListCreate(NULL, NULL, elem_size) |
438
cd3069757010
add function cx_linked_list_at()
Mike Becker <universe@uap-core.de>
parents:
415
diff
changeset
|
132 | |
453
bb144d08cd44
add some documentation and changes some signatures
Mike Becker <universe@uap-core.de>
parents:
438
diff
changeset
|
133 | /** |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
134 | * Allocates a linked list with a lookup-map for storing elements with @p elem_size bytes each. |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
135 | * |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
136 | * The list will use cxDefaultAllocator and no comparator function. If you want |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
137 | * to call functions that need a comparator, you must either set one immediately |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
138 | * after list creation or use cxKvListCreate(). |
480
e3be53a3354f
add cx_linked_list_find()
Mike Becker <universe@uap-core.de>
parents:
478
diff
changeset
|
139 | * |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
140 | * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
141 | * copies of the added elements, and the compare function will be automatically set |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
142 | * to cx_cmp_ptr(). |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
143 | * |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
144 | * This macro behaves as if the list was created with cxKvListCreateSimple() and |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
145 | * immediately followed up by cxKvListAsMap(). |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
146 | * If you want to use the returned object as a list, you can call cxKvListAsList() later. |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
147 | * |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
148 | * @param elem_size (@c size_t) the size of each element in bytes |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
149 | * @return (@c CxMap*) the created list wrapped into the CxMap interface |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
150 | * @see cxKvListAsMap() |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
151 | * @see cxKvListAsList() |
480
e3be53a3354f
add cx_linked_list_find()
Mike Becker <universe@uap-core.de>
parents:
478
diff
changeset
|
152 | */ |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
153 | #define cxKvListCreateAsMapSimple(elem_size) cxKvListCreateAsMap(NULL, NULL, elem_size) |
764
ccbdbd088455
add cxListFindRemove and cx_linked_list_find_node
Mike Becker <universe@uap-core.de>
parents:
763
diff
changeset
|
154 | |
ccbdbd088455
add cxListFindRemove and cx_linked_list_find_node
Mike Becker <universe@uap-core.de>
parents:
763
diff
changeset
|
155 | /** |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
156 | * Converts a map pointer belonging to a key-value-List back to the original list pointer. |
475
31bf97fdbf71
add cx_linked_list_first() + cx_linked_list_prepend()
Mike Becker <universe@uap-core.de>
parents:
473
diff
changeset
|
157 | * |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
158 | * @param map a map pointer that was returned by a call to cxKvListAsMap() |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
159 | * @return the original list pointer |
475
31bf97fdbf71
add cx_linked_list_first() + cx_linked_list_prepend()
Mike Becker <universe@uap-core.de>
parents:
473
diff
changeset
|
160 | */ |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
161 | cx_attr_nodiscard |
985
68754c7de906
major refactoring of attributes
Mike Becker <universe@uap-core.de>
parents:
926
diff
changeset
|
162 | cx_attr_nonnull |
68754c7de906
major refactoring of attributes
Mike Becker <universe@uap-core.de>
parents:
926
diff
changeset
|
163 | cx_attr_returns_nonnull |
1180
4c3a69b9723a
add support for building windows DLLs - resolves #582
Mike Becker <universe@uap-core.de>
parents:
1162
diff
changeset
|
164 | cx_attr_export |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
165 | CxList *cxKvListAsList(CxMap *map); |
481
eef025d82a34
add several new linked list functions
Mike Becker <universe@uap-core.de>
parents:
480
diff
changeset
|
166 | |
eef025d82a34
add several new linked list functions
Mike Becker <universe@uap-core.de>
parents:
480
diff
changeset
|
167 | /** |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
168 | * Converts a map pointer belonging to a key-value-List back to the original list pointer. |
481
eef025d82a34
add several new linked list functions
Mike Becker <universe@uap-core.de>
parents:
480
diff
changeset
|
169 | * |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
170 | * @param list a list created by cxKvListCreate() or cxKvListCreateSimple() |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
171 | * @return a map pointer that lets you use the list as if it was a map |
481
eef025d82a34
add several new linked list functions
Mike Becker <universe@uap-core.de>
parents:
480
diff
changeset
|
172 | */ |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
173 | cx_attr_nodiscard |
985
68754c7de906
major refactoring of attributes
Mike Becker <universe@uap-core.de>
parents:
926
diff
changeset
|
174 | cx_attr_nonnull |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
175 | cx_attr_returns_nonnull |
1180
4c3a69b9723a
add support for building windows DLLs - resolves #582
Mike Becker <universe@uap-core.de>
parents:
1162
diff
changeset
|
176 | cx_attr_export |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
177 | CxMap *cxKvListAsMap(CxList *list); |
481
eef025d82a34
add several new linked list functions
Mike Becker <universe@uap-core.de>
parents:
480
diff
changeset
|
178 | |
1407 | 179 | /** |
180 | * Sets or updates the key of a list item. | |
181 | * | |
182 | * This is, for example, useful when you have inserted an element using the CxList interface, | |
183 | * and now you want to associate this element with a key. | |
184 | * | |
185 | * @param list the list | |
186 | * @param index the index of the element in the list | |
187 | * @param key the key | |
188 | * @retval zero success | |
189 | * @retval non-zero memory allocation failure or the index is out of bounds | |
190 | * @see cxKvListSetKey() | |
191 | */ | |
1348
a1da355ed3b8
roll out the function stubs for the kv-list
Mike Becker <universe@uap-core.de>
parents:
1347
diff
changeset
|
192 | cx_attr_nonnull |
a1da355ed3b8
roll out the function stubs for the kv-list
Mike Becker <universe@uap-core.de>
parents:
1347
diff
changeset
|
193 | cx_attr_export |
a1da355ed3b8
roll out the function stubs for the kv-list
Mike Becker <universe@uap-core.de>
parents:
1347
diff
changeset
|
194 | int cx_kv_list_set_key(CxList *list, size_t index, CxHashKey key); |
a1da355ed3b8
roll out the function stubs for the kv-list
Mike Becker <universe@uap-core.de>
parents:
1347
diff
changeset
|
195 | |
1407 | 196 | /** |
197 | * Inserts an item into the list at the specified index and associates it with the specified key. | |
198 | * | |
199 | * @param list the list | |
200 | * @param index the index the inserted element shall have | |
201 | * @param key the key | |
202 | * @param value the value | |
203 | * @retval zero success | |
204 | * @retval non-zero memory allocation failure or the index is out of bounds | |
205 | * @see cxKvListInsert() | |
206 | */ | |
1348
a1da355ed3b8
roll out the function stubs for the kv-list
Mike Becker <universe@uap-core.de>
parents:
1347
diff
changeset
|
207 | cx_attr_nonnull |
a1da355ed3b8
roll out the function stubs for the kv-list
Mike Becker <universe@uap-core.de>
parents:
1347
diff
changeset
|
208 | cx_attr_export |
a1da355ed3b8
roll out the function stubs for the kv-list
Mike Becker <universe@uap-core.de>
parents:
1347
diff
changeset
|
209 | int cx_kv_list_insert(CxList *list, size_t index, CxHashKey key, void *value); |
a1da355ed3b8
roll out the function stubs for the kv-list
Mike Becker <universe@uap-core.de>
parents:
1347
diff
changeset
|
210 | |
481
eef025d82a34
add several new linked list functions
Mike Becker <universe@uap-core.de>
parents:
480
diff
changeset
|
211 | /** |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
212 | * Sets or updates the key of a list item. |
481
eef025d82a34
add several new linked list functions
Mike Becker <universe@uap-core.de>
parents:
480
diff
changeset
|
213 | * |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
214 | * This is, for example, useful when you have inserted an element using the CxList interface, |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
215 | * and now you want to associate this element with a key. |
481
eef025d82a34
add several new linked list functions
Mike Becker <universe@uap-core.de>
parents:
480
diff
changeset
|
216 | * |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
217 | * @param list (@c CxList*) the list |
1348
a1da355ed3b8
roll out the function stubs for the kv-list
Mike Becker <universe@uap-core.de>
parents:
1347
diff
changeset
|
218 | * @param index (@c size_t) the index of the element in the list |
1406
85dc816f3442
change kv-list to use new CX_HASH_KEY macro
Mike Becker <universe@uap-core.de>
parents:
1404
diff
changeset
|
219 | * @param key (any supported key type) the key |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
220 | * @retval zero success |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
221 | * @retval non-zero memory allocation failure or the index is out of bounds |
1406
85dc816f3442
change kv-list to use new CX_HASH_KEY macro
Mike Becker <universe@uap-core.de>
parents:
1404
diff
changeset
|
222 | * @see CX_HASH_KEY() |
481
eef025d82a34
add several new linked list functions
Mike Becker <universe@uap-core.de>
parents:
480
diff
changeset
|
223 | */ |
1406
85dc816f3442
change kv-list to use new CX_HASH_KEY macro
Mike Becker <universe@uap-core.de>
parents:
1404
diff
changeset
|
224 | #define cxKvListSetKey(list, index, key) cx_kv_list_set_key(list, index, CX_HASH_KEY(key)) |
475
31bf97fdbf71
add cx_linked_list_first() + cx_linked_list_prepend()
Mike Becker <universe@uap-core.de>
parents:
473
diff
changeset
|
225 | |
31bf97fdbf71
add cx_linked_list_first() + cx_linked_list_prepend()
Mike Becker <universe@uap-core.de>
parents:
473
diff
changeset
|
226 | /** |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
227 | * Inserts an item into the list at the specified index and associates it with the specified key. |
473
1bd4b8c28722
add cx_linked_list_{prev, remove, reverse}
Mike Becker <universe@uap-core.de>
parents:
468
diff
changeset
|
228 | * |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
229 | * @param list (@c CxList*) the list |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
230 | * @param index (@c size_t) the index the inserted element shall have |
1406
85dc816f3442
change kv-list to use new CX_HASH_KEY macro
Mike Becker <universe@uap-core.de>
parents:
1404
diff
changeset
|
231 | * @param key (any supported key type) the key |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
232 | * @param value (@c void*) the value |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
233 | * @retval zero success |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
234 | * @retval non-zero memory allocation failure or the index is out of bounds |
1406
85dc816f3442
change kv-list to use new CX_HASH_KEY macro
Mike Becker <universe@uap-core.de>
parents:
1404
diff
changeset
|
235 | * @see CX_HASH_KEY() |
473
1bd4b8c28722
add cx_linked_list_{prev, remove, reverse}
Mike Becker <universe@uap-core.de>
parents:
468
diff
changeset
|
236 | */ |
1406
85dc816f3442
change kv-list to use new CX_HASH_KEY macro
Mike Becker <universe@uap-core.de>
parents:
1404
diff
changeset
|
237 | #define cxKvListInsert(list, index, key, value) cx_kv_list_insert(list, index, CX_HASH_KEY(key), value) |
1348
a1da355ed3b8
roll out the function stubs for the kv-list
Mike Becker <universe@uap-core.de>
parents:
1347
diff
changeset
|
238 | |
468
75ae1dccd101
add cx_linked_list_sort()
Mike Becker <universe@uap-core.de>
parents:
467
diff
changeset
|
239 | |
75ae1dccd101
add cx_linked_list_sort()
Mike Becker <universe@uap-core.de>
parents:
467
diff
changeset
|
240 | /** |
1404
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
241 | * Removes the key of a list item. |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
242 | * |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
243 | * This can be useful if you want to explicitly remove an item from the lookup map. |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
244 | * |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
245 | * If no key is associated with the item, nothing happens, and this function returns zero. |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
246 | * |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
247 | * @param list the list |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
248 | * @param index the index of the element in the list |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
249 | * @retval zero success |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
250 | * @retval non-zero the index is out of bounds |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
251 | */ |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
252 | cx_attr_nonnull |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
253 | cx_attr_export |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
254 | int cxKvListRemoveKey(CxList *list, size_t index); |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
255 | |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
256 | /** |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
257 | * Returns the key of a list item. |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
258 | * |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
259 | * @param list the list |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
260 | * @param index the index of the element in the list |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
261 | * @return a pointer to the key or @c NULL when the index is out of bounds or the item does not have a key |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
262 | */ |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
263 | cx_attr_nonnull |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
264 | cx_attr_export |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
265 | const CxHashKey *cxKvListGetKey(CxList *list, size_t index); |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
266 | |
ae80e36c05c7
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
Mike Becker <universe@uap-core.de>
parents:
1394
diff
changeset
|
267 | /** |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
268 | * Adds an item into the list and associates it with the specified key. |
486
d7ca126eab7f
add cx_linked_list_compare() and simplifies some tests
Mike Becker <universe@uap-core.de>
parents:
485
diff
changeset
|
269 | * |
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
270 | * @param list (@c CxList*) the list |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
271 | * @param key (@c CxHashKey, @c char*, @c cxstring, or @c cxmutstr) the key |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
272 | * @param value (@c void*) the value |
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
273 | * @retval zero success |
1378
1b4fa55f7caa
implement cx_kv_list_insert()
Mike Becker <universe@uap-core.de>
parents:
1377
diff
changeset
|
274 | * @retval non-zero memory allocation failure |
486
d7ca126eab7f
add cx_linked_list_compare() and simplifies some tests
Mike Becker <universe@uap-core.de>
parents:
485
diff
changeset
|
275 | */ |
1378
1b4fa55f7caa
implement cx_kv_list_insert()
Mike Becker <universe@uap-core.de>
parents:
1377
diff
changeset
|
276 | #define cxKvListAdd(list, key, value) cxKvListInsert(list, (list)->collection.size, key, value) |
473
1bd4b8c28722
add cx_linked_list_{prev, remove, reverse}
Mike Becker <universe@uap-core.de>
parents:
468
diff
changeset
|
277 | |
415 | 278 | #ifdef __cplusplus |
628
1e2be40f0cb5
use //-style single line comments everywhere
Mike Becker <universe@uap-core.de>
parents:
552
diff
changeset
|
279 | } // extern "C" |
415 | 280 | #endif |
281 | ||
1347
d02b1fde73ee
create a header file for the new key-value-lists
Mike Becker <universe@uap-core.de>
parents:
1318
diff
changeset
|
282 | #endif // UCX_KV_LIST_H |