- struct uci_context *ctx = package->ctx;
- struct uci_section *s;
- struct uci_option *o;
-
- fprintf(stream, "package '%s'\n", uci_escape(ctx, package->name));
- uci_foreach_entry(section, &package->sections, s) {
- fprintf(stream, "\nconfig '%s'", uci_escape(ctx, s->type));
- fprintf(stream, " '%s'\n", uci_escape(ctx, s->name));
- uci_foreach_entry(option, &s->options, o) {
- fprintf(stream, "\toption '%s'", uci_escape(ctx, o->name));
- fprintf(stream, " '%s'\n", uci_escape(ctx, o->value));
+ struct uci_context *ctx = p->ctx;
+ struct uci_element *s, *o;
+
+ fprintf(stream, "package '%s'\n", uci_escape(ctx, p->e.name));
+ uci_foreach_element(&p->sections, s) {
+ struct uci_section *sec = uci_to_section(s);
+ fprintf(stream, "\nconfig '%s'", uci_escape(ctx, sec->type));
+ fprintf(stream, " '%s'\n", uci_escape(ctx, sec->e.name));
+ uci_foreach_element(&sec->options, o) {
+ struct uci_option *opt = uci_to_option(o);
+ fprintf(stream, "\toption '%s'", uci_escape(ctx, opt->e.name));
+ fprintf(stream, " '%s'\n", uci_escape(ctx, opt->value));