projects
/
project
/
uci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d90507c
)
ucimap: allow sectmaps to specify the option map data structure size (useful for...
author
Felix Fietkau
<nbd@openwrt.org>
Sat, 29 Aug 2009 14:30:28 +0000
(16:30 +0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Sat, 29 Aug 2009 14:31:36 +0000
(16:31 +0200)
ucimap.c
patch
|
blob
|
history
ucimap.h
patch
|
blob
|
history
diff --git
a/ucimap.c
b/ucimap.c
index
dddbafc
..
e51cd2b
100644
(file)
--- a/
ucimap.c
+++ b/
ucimap.c
@@
-216,12
+216,20
@@
ucimap_parse_options(struct uci_map *map, struct uci_sectmap *sm, struct uci_sec
section = (unsigned long) sd + sizeof(struct uci_sectmap_data);
uci_foreach_element(&s->options, e) {
struct uci_optmap *om = NULL;
section = (unsigned long) sd + sizeof(struct uci_sectmap_data);
uci_foreach_element(&s->options, e) {
struct uci_optmap *om = NULL;
+ void *ptr = sm->options;
+ int size = sm->options_size;
+
+ if (!size)
+ size = sizeof(struct uci_optmap);
for (i = 0; i < sm->n_options; i++) {
for (i = 0; i < sm->n_options; i++) {
- if (strcmp(e->name, sm->options[i].name) == 0) {
- om = &sm->options[i];
+ struct uci_optmap *tmp = ptr;
+
+ if (strcmp(e->name, tmp->name) == 0) {
+ om = ptr;
break;
}
break;
}
+ ptr = (unsigned char *)ptr + size;
}
if (!om)
continue;
}
if (!om)
continue;
diff --git
a/ucimap.h
b/ucimap.h
index
43f54e0
..
001ae1b
100644
(file)
--- a/
ucimap.h
+++ b/
ucimap.h
@@
-98,6
+98,7
@@
struct uci_sectmap {
/* list of option mappings for this section */
struct uci_optmap *options;
unsigned int n_options;
/* list of option mappings for this section */
struct uci_optmap *options;
unsigned int n_options;
+ unsigned int options_size;
};
struct uci_optmap {
};
struct uci_optmap {