libcomps ..

Loading...
Searching...
No Matches
comps_objdict.h
Go to the documentation of this file.
1/* libcomps - C alternative to yum.comps library
2 * Copyright (C) 2013 Jindrich Luza
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * 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.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17 * USA
18 */
19
29#ifndef COMPS_OBJDICT_H
30#define COMPS_OBJDICT_H
31
32#include "comps_objradix.h"
33#include "comps_objmradix.h"
34
35 typedef COMPS_ObjRTree COMPS_ObjDict;
36 COMPS_Object_TAIL(COMPS_ObjDict);
37
38 typedef COMPS_ObjMRTree COMPS_ObjMDict;
39 COMPS_Object_TAIL(COMPS_ObjMDict);
40
41COMPS_ObjDict* comps_objdict_create();
42COMPS_ObjMDict* comps_objmdict_create();
43
44
45 void comps_objdict_destroy(COMPS_ObjDict *rt);
46 void comps_objdict_destroy_v(void *rt);
47 void comps_objmdict_destroy(COMPS_ObjMDict *rt);
48 void comps_objmdict_destroy_v(void *rt);
66 void comps_objdict_set(COMPS_ObjDict *rt, char *key, COMPS_Object *data);
67
78 void comps_objdict_set_x(COMPS_ObjDict *rt, char *key, COMPS_Object *data);
79
87 void comps_objdict_set_n(COMPS_ObjDict *rt, char *key, unsigned int len,
88 COMPS_Object *data);
102 void comps_objmdict_set(COMPS_ObjMDict *rt, char *key, COMPS_Object *data);
103
113 void comps_objmdict_set_x(COMPS_ObjMDict *rt, char *key, COMPS_Object *data);
114
122 void comps_objmdict_set_n(COMPS_ObjMDict *rt, char *key, unsigned int len,
123 COMPS_Object *data);
138 COMPS_Object* comps_objdict_get(COMPS_ObjDict *rt, const char *key);
139
149 COMPS_Object* comps_objdict_get_x(COMPS_ObjRTree * rt, const char * key);
163 COMPS_ObjList * comps_objmdict_get(COMPS_ObjMDict *rt, const char *key);
175 void comps_objdict_unset(COMPS_ObjDict * rt, const char * key);
187 void comps_objmdict_unset(COMPS_ObjMDict * rt, const char * key);
195 void comps_objdict_clear(COMPS_ObjDict * rt);
203 void comps_objmdict_clear(COMPS_ObjMDict * rt);
212COMPS_HSList * comps_objdict_values(COMPS_ObjDict * rt);
221COMPS_HSList * comps_objmdict_values(COMPS_ObjMDict * rt);
235 void comps_objdict_values_walk(COMPS_ObjRTree * rt, void* udata,
236 void (*walk_f)(void*, COMPS_Object*));
250 void comps_objmdict_values_walk(COMPS_ObjMDict *rt, void *udata,
251 void (*walk_f)(void*, void*));
264COMPS_ObjDict* comps_objdict_clone(COMPS_ObjDict *rt);
266 void * comps_objdict_clone_v(void * rt);
267
278COMPS_ObjMDict* comps_objmdict_clone(COMPS_ObjMDict *rt);
280 void* comps_objmdict_clone_v(void *rt);
281
289COMPS_HSList* comps_objmdict_keys(COMPS_ObjMDict *rt);
299COMPS_HSList* comps_objdict_keys(COMPS_ObjDict *rt);
300
306COMPS_HSList* comps_objdict_pairs(COMPS_ObjDict *rt);
316COMPS_HSList* comps_objmdict_pairs(COMPS_ObjMDict *rt);
321//void comps_mdict_unite(COMPS_MDict *d1, COMPS_MDict *d2);
322
333COMPS_ObjDict* comps_objdict_union(COMPS_ObjDict *d1, COMPS_ObjDict *d2);
335#endif
COMPS_Object_TAIL
#define COMPS_Object_TAIL(obj)
insert "extern COMPS_ObjectInfo <obj>_ObjInfo" statement. Use this macro in combination with COMPS_OB...
Definition comps_obj.h:89
comps_objdict_get_x
COMPS_Object * comps_objdict_get_x(COMPS_ObjRTree *rt, const char *key)
comps_objdict_values
COMPS_HSList * comps_objdict_values(COMPS_ObjDict *rt)
comps_objdict_set_n
void comps_objdict_set_n(COMPS_ObjDict *rt, char *key, unsigned int len, COMPS_Object *data)
comps_objdict_unset
void comps_objdict_unset(COMPS_ObjDict *rt, const char *key)
comps_objdict_set
void comps_objdict_set(COMPS_ObjDict *rt, char *key, COMPS_Object *data)
comps_objdict_keys
COMPS_HSList * comps_objdict_keys(COMPS_ObjDict *rt)
comps_objdict_pairs
COMPS_HSList * comps_objdict_pairs(COMPS_ObjDict *rt)
comps_objdict_clone
COMPS_ObjDict * comps_objdict_clone(COMPS_ObjDict *rt)
comps_objdict_set_x
void comps_objdict_set_x(COMPS_ObjDict *rt, char *key, COMPS_Object *data)
comps_objdict_get
COMPS_Object * comps_objdict_get(COMPS_ObjDict *rt, const char *key)
comps_objdict_union
COMPS_ObjDict * comps_objdict_union(COMPS_ObjDict *d1, COMPS_ObjDict *d2)
comps_objdict_clear
void comps_objdict_clear(COMPS_ObjDict *rt)
comps_objdict_values_walk
void comps_objdict_values_walk(COMPS_ObjRTree *rt, void *udata, void(*walk_f)(void *, COMPS_Object *))
comps_objmdict_pairs
COMPS_HSList * comps_objmdict_pairs(COMPS_ObjMDict *rt)
comps_objmdict_get
COMPS_ObjList * comps_objmdict_get(COMPS_ObjMDict *rt, const char *key)
comps_objmdict_set_x
void comps_objmdict_set_x(COMPS_ObjMDict *rt, char *key, COMPS_Object *data)
comps_objmdict_values
COMPS_HSList * comps_objmdict_values(COMPS_ObjMDict *rt)
comps_objmdict_clear
void comps_objmdict_clear(COMPS_ObjMDict *rt)
comps_objmdict_keys
COMPS_HSList * comps_objmdict_keys(COMPS_ObjMDict *rt)
comps_objmdict_values_walk
void comps_objmdict_values_walk(COMPS_ObjMDict *rt, void *udata, void(*walk_f)(void *, void *))
comps_objmdict_set_n
void comps_objmdict_set_n(COMPS_ObjMDict *rt, char *key, unsigned int len, COMPS_Object *data)
comps_objmdict_set
void comps_objmdict_set(COMPS_ObjMDict *rt, char *key, COMPS_Object *data)
comps_objmdict_unset
void comps_objmdict_unset(COMPS_ObjMDict *rt, const char *key)
comps_objmdict_clone
COMPS_ObjMDict * comps_objmdict_clone(COMPS_ObjMDict *rt)
COMPS_ObjList
Definition comps_objlist.h:41
COMPS_Object
Definition comps_obj.h:124