src/cx/kv_list.h

changeset 1355
ea359a27b264
parent 1354
b024e573dcb2
child 1356
0ffcccb83b69
equal deleted inserted replaced
1354:b024e573dcb2 1355:ea359a27b264
188 cx_attr_export 188 cx_attr_export
189 int cx_kv_list_insert(CxList *list, size_t index, CxHashKey key, void *value); 189 int cx_kv_list_insert(CxList *list, size_t index, CxHashKey key, void *value);
190 190
191 // Generic Functions 191 // Generic Functions
192 #ifdef __cplusplus 192 #ifdef __cplusplus
193 193 } // extern "C"
194 cx_attr_nonnull 194 cx_attr_nonnull
195 static inline int cxKvListSetKey(CxList *list, size_t index, CxHashKey key) { 195 static inline int cxKvListSetKey(CxList *list, size_t index, CxHashKey key) {
196 return cx_kv_list_set_key(list, index, key); 196 return cx_kv_list_set_key(list, index, key);
197 } 197 }
198 198
233 return cx_kv_list_remove_key(list, index, cx_hash_key_str(key)); 233 return cx_kv_list_remove_key(list, index, cx_hash_key_str(key));
234 } 234 }
235 235
236 cx_attr_nonnull 236 cx_attr_nonnull
237 static inline int cxKvListInsert(CxList *list, size_t index, CxHashKey key, void *value) { 237 static inline int cxKvListInsert(CxList *list, size_t index, CxHashKey key, void *value) {
238 return cx_kv_list_insert(list, index, key, value, value); 238 return cx_kv_list_insert(list, index, key, value);
239 } 239 }
240 240
241 cx_attr_nonnull 241 cx_attr_nonnull
242 static inline int cxKvListInsert(CxList *list, size_t index, cxstring key, void *value) { 242 static inline int cxKvListInsert(CxList *list, size_t index, cxstring key, void *value) {
243 return cx_kv_list_insert(list, index, cx_hash_key_cxstr(key), value); 243 return cx_kv_list_insert(list, index, cx_hash_key_cxstr(key), value);
251 cx_attr_nonnull 251 cx_attr_nonnull
252 cx_attr_cstr_arg(3) 252 cx_attr_cstr_arg(3)
253 static inline int cxKvListInsert(CxList *list, size_t index, const char *key, void *value) { 253 static inline int cxKvListInsert(CxList *list, size_t index, const char *key, void *value) {
254 return cx_kv_list_insert(list, index, cx_hash_key_str(key), value); 254 return cx_kv_list_insert(list, index, cx_hash_key_str(key), value);
255 } 255 }
256 256 extern "C" {
257 #else /* ! __cplusplus */ 257 #else /* ! __cplusplus */
258 /** 258 /**
259 * Sets or updates the key of a list item. 259 * Sets or updates the key of a list item.
260 * 260 *
261 * This is, for example, useful when you have inserted an element using the CxList interface, 261 * This is, for example, useful when you have inserted an element using the CxList interface,

mercurial