From: Felix Fietkau Date: Sat, 29 Aug 2009 17:41:57 +0000 (+0200) Subject: shorten callback names X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=75c9a5d0faf426863f52094fcc77d11e39786581;p=uci.git shorten callback names --- diff --git a/ucimap-example.c b/ucimap-example.c index 0e3f7a4..ca55931 100644 --- a/ucimap-example.c +++ b/ucimap-example.c @@ -139,8 +139,8 @@ static struct my_optmap network_interface_options[] = { static struct uci_sectmap network_interface = { .type = "interface", .alloc_len = sizeof(struct uci_network), - .init_section = network_init_interface, - .add_section = network_add_interface, + .init = network_init_interface, + .add = network_add_interface, .options = &network_interface_options[0].map, .n_options = ARRAY_SIZE(network_interface_options), .options_size = sizeof(struct my_optmap) @@ -158,8 +158,8 @@ static struct uci_sectmap network_alias = { .type = "alias", .options = network_alias_options, .alloc_len = sizeof(struct uci_network), - .init_section = network_init_alias, - .add_section = network_add_alias, + .init = network_init_alias, + .add = network_add_alias, .n_options = ARRAY_SIZE(network_alias_options), }; diff --git a/ucimap.c b/ucimap.c index e942333..191c97c 100644 --- a/ucimap.c +++ b/ucimap.c @@ -139,8 +139,8 @@ ucimap_free_section(struct uci_map *map, struct uci_sectmap_data *sd) if (!list_empty(&sd->list)) list_del(&sd->list); - if (sd->sm->free_section) - sd->sm->free_section(map, section); + if (sd->sm->free) + sd->sm->free(map, section); for (i = 0; i < sd->allocmap_len; i++) { ucimap_free_item(&sd->allocmap[i]); @@ -341,7 +341,7 @@ ucimap_parse_section(struct uci_map *map, struct uci_sectmap *sm, struct uci_sec section = (char *)sd + sizeof(struct uci_sectmap_data); - err = sm->init_section(map, section, s); + err = sm->init(map, section, s); if (err) goto error; @@ -525,7 +525,7 @@ ucimap_parse(struct uci_map *map, struct uci_package *pkg) continue; section = (char *) sd + sizeof(struct uci_sectmap_data); - if (sd->sm->add_section(map, section) != 0) + if (sd->sm->add(map, section) != 0) ucimap_free_section(map, sd); } } diff --git a/ucimap.h b/ucimap.h index adb7004..865c45a 100644 --- a/ucimap.h +++ b/ucimap.h @@ -84,13 +84,13 @@ struct uci_sectmap { unsigned int alloc_len; /* give the caller time to initialize the preallocated struct */ - int (*init_section)(struct uci_map *map, void *section, struct uci_section *s); + int (*init)(struct uci_map *map, void *section, struct uci_section *s); /* pass the fully processed struct to the callback after the section end */ - int (*add_section)(struct uci_map *map, void *section); + int (*add)(struct uci_map *map, void *section); /* let the callback clean up its own stuff in the section */ - int (*free_section)(struct uci_map *map, void *section); + int (*free)(struct uci_map *map, void *section); /* list of option mappings for this section */ struct uci_optmap *options;