struct uci_fixup {
struct list_head list;
- struct uci_sectmap *sm;
+ struct uci_sectionmap *sm;
const char *name;
enum ucimap_type type;
union ucimap_data *data;
};
-struct uci_sectmap_data {
+struct uci_sectionmap_data {
struct list_head list;
struct uci_map *map;
- struct uci_sectmap *sm;
+ struct uci_sectionmap *sm;
const char *section_name;
/* list of allocations done by ucimap */
}
static inline void *
-ucimap_section_ptr(struct uci_sectmap_data *sd)
+ucimap_section_ptr(struct uci_sectionmap_data *sd)
{
void *data = sd + 1;
return data;
}
static inline union ucimap_data *
-ucimap_get_data(struct uci_sectmap_data *sd, struct uci_optmap *om)
+ucimap_get_data(struct uci_sectionmap_data *sd, struct uci_optmap *om)
{
void *data;
}
static void
-ucimap_add_alloc(struct uci_sectmap_data *sd, void *ptr)
+ucimap_add_alloc(struct uci_sectionmap_data *sd, void *ptr)
{
struct uci_alloc *a = &sd->allocmap[sd->allocmap_len++];
a->type = UCIMAP_SIMPLE;
}
static void
-ucimap_free_section(struct uci_map *map, struct uci_sectmap_data *sd)
+ucimap_free_section(struct uci_map *map, struct uci_sectionmap_data *sd)
{
void *section;
int i;
struct list_head *ptr, *tmp;
list_for_each_safe(ptr, tmp, &map->sdata) {
- struct uci_sectmap_data *sd = list_entry(ptr, struct uci_sectmap_data, list);
+ struct uci_sectionmap_data *sd = list_entry(ptr, struct uci_sectionmap_data, list);
ucimap_free_section(map, sd);
}
}
}
static void
-ucimap_add_value(union ucimap_data *data, struct uci_optmap *om, struct uci_sectmap_data *sd, const char *str)
+ucimap_add_value(union ucimap_data *data, struct uci_optmap *om, struct uci_sectionmap_data *sd, const char *str)
{
union ucimap_data tdata = *data;
char *eptr = NULL;
static int
-ucimap_parse_options(struct uci_map *map, struct uci_sectmap *sm, struct uci_sectmap_data *sd, struct uci_section *s)
+ucimap_parse_options(struct uci_map *map, struct uci_sectionmap *sm, struct uci_sectionmap_data *sd, struct uci_section *s)
{
struct uci_element *e, *l;
struct uci_option *o;
static int
-ucimap_parse_section(struct uci_map *map, struct uci_sectmap *sm, struct uci_section *s)
+ucimap_parse_section(struct uci_map *map, struct uci_sectionmap *sm, struct uci_section *s)
{
- struct uci_sectmap_data *sd = NULL;
+ struct uci_sectionmap_data *sd = NULL;
struct uci_optmap *om;
char *section_name;
void *section;
int n_alloc = 2;
int err;
- sd = malloc(sm->alloc_len + sizeof(struct uci_sectmap_data));
+ sd = malloc(sm->alloc_len + sizeof(struct uci_sectionmap_data));
if (!sd)
return UCI_ERR_MEM;
- memset(sd, 0, sm->alloc_len + sizeof(struct uci_sectmap_data));
+ memset(sd, 0, sm->alloc_len + sizeof(struct uci_sectionmap_data));
INIT_LIST_HEAD(&sd->list);
ucimap_foreach_option(sm, om) {
void
ucimap_set_changed(void *section, void *field)
{
- char *sptr = (char *)section - sizeof(struct uci_sectmap_data);
- struct uci_sectmap_data *sd = (struct uci_sectmap_data *) sptr;
- struct uci_sectmap *sm = sd->sm;
+ char *sptr = (char *)section - sizeof(struct uci_sectionmap_data);
+ struct uci_sectionmap_data *sd = (struct uci_sectionmap_data *) sptr;
+ struct uci_sectionmap *sm = sd->sm;
struct uci_optmap *om;
int ofs = (char *)field - (char *)section;
int i = 0;
int
ucimap_store_section(struct uci_map *map, struct uci_package *p, void *section)
{
- char *sptr = (char *)section - sizeof(struct uci_sectmap_data);
- struct uci_sectmap_data *sd = (struct uci_sectmap_data *) sptr;
- struct uci_sectmap *sm = sd->sm;
+ char *sptr = (char *)section - sizeof(struct uci_sectionmap_data);
+ struct uci_sectionmap_data *sd = (struct uci_sectionmap_data *) sptr;
+ struct uci_sectionmap *sm = sd->sm;
struct uci_section *s = NULL;
struct uci_optmap *om;
struct uci_element *e;
void *
ucimap_find_section(struct uci_map *map, struct uci_fixup *f)
{
- struct uci_sectmap_data *sd;
+ struct uci_sectionmap_data *sd;
struct list_head *p;
void *ret;
list_for_each(p, &map->sdata) {
- sd = list_entry(p, struct uci_sectmap_data, list);
+ sd = list_entry(p, struct uci_sectionmap_data, list);
if (sd->sm != f->sm)
continue;
if (strcmp(f->name, sd->section_name) != 0)
continue;
- ret = (char *)sd + sizeof(struct uci_sectmap_data);
+ ret = (char *)sd + sizeof(struct uci_sectionmap_data);
return ret;
}
return NULL;
free(f);
}
list_for_each_safe(p, tmp, &map->sdata) {
- struct uci_sectmap_data *sd = list_entry(p, struct uci_sectmap_data, list);
+ struct uci_sectionmap_data *sd = list_entry(p, struct uci_sectionmap_data, list);
void *section;
if (sd->done)
continue;
- section = (char *) sd + sizeof(struct uci_sectmap_data);
+ section = (char *) sd + sizeof(struct uci_sectionmap_data);
if (sd->sm->add(map, section) != 0)
ucimap_free_section(map, sd);
}