From 7bb3a0587634bee49f0dc10616e9a48b067d0a3c Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Tue, 13 May 2008 13:47:45 -0400 Subject: - namespace cleanup: struct entry becomes struct map_entry --- src/map.c | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'src/map.c') diff --git a/src/map.c b/src/map.c index 13155aa..1d193c0 100644 --- a/src/map.c +++ b/src/map.c @@ -3,9 +3,10 @@ #endif #include +#include #include -#include #include +#include #include #include @@ -26,8 +27,8 @@ struct { struct map { char *name; time_t last_changed; - struct entry { - struct entry *prev, *next; + struct map_entry { + struct map_entry *prev, *next; char *id, **related_ids; char *key; unsigned int key_len; @@ -76,11 +77,11 @@ map_data_find_map(struct plugin_state *state, /* Utility functions - find a specific entry in the named map in the named * domain. */ -static struct entry * +static struct map_entry * map_data_find_map_entry(struct plugin_state *state, struct map *map, unsigned int key_len, const char *key) { - struct entry *entry; + struct map_entry *entry; if (map == NULL) { return NULL; } @@ -93,7 +94,7 @@ map_data_find_map_entry(struct plugin_state *state, return NULL; } -static struct entry * +static struct map_entry * map_data_find_entry(struct plugin_state *state, const char *domain_name, const char *map_name, unsigned int key_len, const char *key) @@ -106,11 +107,11 @@ map_data_find_entry(struct plugin_state *state, key); } -static struct entry * +static struct map_entry * map_data_find_map_entry_id(struct plugin_state *state, struct map *map, const char *id) { - struct entry *entry; + struct map_entry *entry; if (map == NULL) { return NULL; } @@ -199,7 +200,7 @@ map_data_foreach_entry(struct plugin_state *state, int i, j; struct domain *domain; struct map *map; - struct entry *entry; + struct map_entry *entry; for (i = 0; i < map_data.n_domains; i++) { domain = &map_data.domains[i]; for (j = 0; j < domain->n_maps; j++) { @@ -273,7 +274,7 @@ map_data_foreach_map(struct plugin_state *state, const char *domain_name, int i, j; struct domain *domain; struct map *map; - struct entry *entry; + struct map_entry *entry; for (i = 0; i < map_data.n_domains; i++) { domain = &map_data.domains[i]; if ((domain_name != NULL) && @@ -340,7 +341,7 @@ map_match(struct plugin_state *state, unsigned int key_len, char *key, unsigned int *value_len, char **value) { - struct entry *entry; + struct map_entry *entry; entry = map_data_find_entry(state, domain_name, map_name, key_len, key); if (entry == NULL) { return FALSE; @@ -359,7 +360,7 @@ map_first(struct plugin_state *state, unsigned int *first_value_len, char **first_value) { struct map *map; - struct entry *entry; + struct map_entry *entry; map = map_data_find_map(state, domain_name, map_name); if (map == NULL) { return FALSE; @@ -385,7 +386,7 @@ map_next(struct plugin_state *state, unsigned int *next_key_len, char **next_key, unsigned int *next_value_len, char **next_value) { - struct entry *entry; + struct map_entry *entry; entry = map_data_find_entry(state, domain_name, map_name, prev_len, prev); if ((entry == NULL) || (entry->next == NULL)) { @@ -402,7 +403,7 @@ map_next(struct plugin_state *state, static void map_data_clear_map_map(struct plugin_state *state, struct map *map) { - struct entry *entry, *next; + struct map_entry *entry, *next; /* Clear the entries list. */ if (map != NULL) { for (entry = map->entries; entry != NULL; entry = next) { @@ -576,9 +577,9 @@ map_data_set_map(struct plugin_state *state, static void map_data_unset_map_entry(struct plugin_state *state, struct map *map, - struct entry *entry) + struct map_entry *entry) { - struct entry *prev, *next; + struct map_entry *prev, *next; if ((map != NULL) && (entry != NULL)) { prev = entry->prev; next = entry->next; @@ -608,7 +609,7 @@ map_data_unset_entry_key(struct plugin_state *state, const char *key) { struct map *map; - struct entry *entry; + struct map_entry *entry; map = map_data_find_map(state, domain_name, map_name); entry = map_data_find_map_entry(state, map, key_len, key); map_data_unset_map_entry(state, map, entry); @@ -623,7 +624,7 @@ map_data_unset_entry_id(struct plugin_state *state, const char *id) { struct map *map; - struct entry *entry; + struct map_entry *entry; map = map_data_find_map(state, domain_name, map_name); entry = map_data_find_map_entry_id(state, map, id); map_data_unset_map_entry(state, map, entry); @@ -643,7 +644,7 @@ map_data_set_entry(struct plugin_state *state, char *value) { struct map *map; - struct entry *entry; + struct map_entry *entry; map = map_data_find_map(state, domain_name, map_name); if (key_len == (unsigned int) -1) { key_len = strlen(key); -- cgit