]>
git.ipfire.org Git - thirdparty/kmod.git/blob - libabc/libabc.h
2 libabc - something with abc
4 Copyright (C) 2011 Someone <someone@example.com>
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.ΒΆ
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33 * library user context - reads the config and system
34 * environment, user variables, allows custom logging
37 struct abc_ctx
*abc_ref(struct abc_ctx
*ctx
);
38 struct abc_ctx
*abc_unref(struct abc_ctx
*ctx
);
39 int abc_new(struct abc_ctx
**ctx
);
40 void abc_set_log_fn(struct abc_ctx
*ctx
,
41 void (*log_fn
)(struct abc_ctx
*ctx
,
42 int priority
, const char *file
, int line
, const char *fn
,
43 const char *format
, va_list args
));
44 int abc_get_log_priority(struct abc_ctx
*ctx
);
45 void abc_set_log_priority(struct abc_ctx
*ctx
, int priority
);
46 void *abc_get_userdata(struct abc_ctx
*ctx
);
47 void abc_set_userdata(struct abc_ctx
*ctx
, void *userdata
);
52 * access to abc generated lists
54 struct abc_list_entry
;
55 struct abc_list_entry
*abc_list_entry_get_next(struct abc_list_entry
*list_entry
);
56 const char *abc_list_entry_get_name(struct abc_list_entry
*list_entry
);
57 const char *abc_list_entry_get_value(struct abc_list_entry
*list_entry
);
58 #define abc_list_entry_foreach(list_entry, first_entry) \
59 for (list_entry = first_entry; \
61 list_entry = abc_list_entry_get_next(list_entry))
66 * access to things of abc
69 struct abc_thing
*abc_thing_ref(struct abc_thing
*thing
);
70 struct abc_thing
*abc_thing_unref(struct abc_thing
*thing
);
71 struct abc_ctx
*abc_thing_get_ctx(struct abc_thing
*thing
);
72 int abc_thing_new_from_string(struct abc_ctx
*ctx
, const char *string
, struct abc_thing
**thing
);
73 struct abc_list_entry
*abc_thing_get_some_list_entry(struct abc_thing
*thing
);