summaryrefslogtreecommitdiffstats
path: root/src/map.c
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@localhost.localdomain>2008-05-13 13:47:45 -0400
committerNalin Dahyabhai <nalin@localhost.localdomain>2008-05-13 13:47:45 -0400
commit7bb3a0587634bee49f0dc10616e9a48b067d0a3c (patch)
tree65241c139999d5039190cd8d279da9b679e7c77a /src/map.c
parentb6e5e6eccd20dd7f46b45a00226dc0016baf1736 (diff)
downloadslapi-nis-7bb3a0587634bee49f0dc10616e9a48b067d0a3c.tar.gz
slapi-nis-7bb3a0587634bee49f0dc10616e9a48b067d0a3c.tar.xz
slapi-nis-7bb3a0587634bee49f0dc10616e9a48b067d0a3c.zip
- namespace cleanup: struct entry becomes struct map_entry
Diffstat (limited to 'src/map.c')
-rw-r--r--src/map.c39
1 files changed, 20 insertions, 19 deletions
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 <sys/types.h>
+#include <search.h>
#include <stdlib.h>
-#include <time.h>
#include <string.h>
+#include <time.h>
#include <unistd.h>
#include <rpc/rpc.h>
@@ -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);