diff options
| author | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2008-05-29 16:33:41 -0400 |
|---|---|---|
| committer | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2008-05-29 16:33:41 -0400 |
| commit | ca4efef04651a0180682b0df42e4140e3e772a60 (patch) | |
| tree | 72dc976da93995bb588094457b3b6dffd6052699 /src | |
| parent | 920cd9bdd08b4e4401121cf1eb0b2d08b9da9e1e (diff) | |
| download | slapi-nis-ca4efef04651a0180682b0df42e4140e3e772a60.tar.gz slapi-nis-ca4efef04651a0180682b0df42e4140e3e772a60.tar.xz slapi-nis-ca4efef04651a0180682b0df42e4140e3e772a60.zip | |
- try to pull out NSPRisms where they're not needed
Diffstat (limited to 'src')
| -rw-r--r-- | src/backend.c | 15 | ||||
| -rw-r--r-- | src/dispatch.c | 4 | ||||
| -rw-r--r-- | src/dummymap.c | 4 | ||||
| -rw-r--r-- | src/format.c | 12 | ||||
| -rw-r--r-- | src/map.c | 36 | ||||
| -rw-r--r-- | src/map.h | 30 | ||||
| -rw-r--r-- | src/nis.c | 12 |
7 files changed, 51 insertions, 62 deletions
diff --git a/src/backend.c b/src/backend.c index 8347497..630f202 100644 --- a/src/backend.c +++ b/src/backend.c @@ -7,9 +7,6 @@ #include <string.h> #include <unistd.h> -#include <nspr.h> -#include <secport.h> -#include <plarenas.h> #include <dirsrv/slapi-plugin.h> #include "backend.h" @@ -416,7 +413,7 @@ backend_startup(struct plugin_state *state) } /* Our postoperation callbacks. */ -static PRBool +static bool_t backend_entry_matches_map(struct backend_map_data *map_data, Slapi_PBlock *pb, Slapi_Entry *e) { @@ -481,7 +478,7 @@ struct backend_add_entry_cbdata { char *dn; }; -static PRBool +static bool_t backend_add_entry_cb(const char *domain, const char *map, void *backend_data, void *cbdata_ptr) { @@ -578,7 +575,7 @@ struct backend_modify_entry_cbdata { char *dn; }; -static PRBool +static bool_t backend_modify_entry_cb(const char *domain, const char *map, void *backend_data, void *cbdata_ptr) { @@ -685,7 +682,7 @@ struct backend_modrdn_entry_cbdata { char *dn_pre, *dn_post; }; -static PRBool +static bool_t backend_modrdn_entry_cb(const char *domain, const char *map, void *backend_data, void *cbdata_ptr) { @@ -694,7 +691,7 @@ backend_modrdn_entry_cb(const char *domain, const char *map, void *backend_data, char **visited_dn_list, *key_pre, *value_pre, *key_post, *value_post; struct backend_map_data *map_data; struct backend_modrdn_entry_cbdata *cbdata; - PRBool matched_pre, matched_post; + bool_t matched_pre, matched_post; map_data = backend_data; cbdata = cbdata_ptr; @@ -843,7 +840,7 @@ struct backend_delete_entry_cbdata { char *dn; }; -static PRBool +static bool_t backend_delete_entry_cb(const char *domain, const char *map, void *backend_data, void *cbdata_ptr) { diff --git a/src/dispatch.c b/src/dispatch.c index a802487..a880d8a 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -15,10 +15,6 @@ #include <rpc/pmap_clnt.h> #include <rpcsvc/yp_prot.h> -#include <nspr.h> -#include <secport.h> -#include <plarenas.h> - #include "dispatch.h" #include "nis.h" #include "plugin.h" diff --git a/src/dummymap.c b/src/dummymap.c index 7ba1728..35c3823 100644 --- a/src/dummymap.c +++ b/src/dummymap.c @@ -10,10 +10,6 @@ #include <rpc/rpc.h> -#include <nspr.h> -#include <secport.h> -#include <plarenas.h> - #include "dispatch.h" #include "map.h" #include "nis.h" diff --git a/src/format.c b/src/format.c index 7f9c89b..305842b 100644 --- a/src/format.c +++ b/src/format.c @@ -11,7 +11,7 @@ static int format_expand(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e, const char *fmt, char *outbuf, int outbuf_len, - char ***visited_ndns, PRBool literal); + char ***visited_ndns, bool_t literal); void format_free_data(char *data) @@ -427,7 +427,7 @@ format_match_generic(struct plugin_state *state, const char *args, char *outbuf, int outbuf_len, char ***visited_ndns, const char *fnname, - PRBool (*match_fn)(const char *pattern, const char *value)) + bool_t (*match_fn)(const char *pattern, const char *value)) { Slapi_ValueSet *values; Slapi_Value *value; @@ -556,7 +556,7 @@ format_match_generic(struct plugin_state *state, } /* Check for glob-style matched values. */ -static PRBool +static bool_t format_match_cb(const char *pattern, const char *value) { return fnmatch(pattern, value, 0) == 0; @@ -573,12 +573,12 @@ format_match(struct plugin_state *state, } /* Check for a regex match. */ -static PRBool +static bool_t format_regmatch_cb(const char *pattern, const char *value) { regex_t reg; regmatch_t matches; - PRBool matched; + bool_t matched; memset(®, 0, sizeof(reg)); if (regcomp(®, pattern, REG_NOSUB) != 0) { return PR_FALSE; @@ -695,7 +695,7 @@ format_expand(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e, const char *fmt, char *outbuf, int outbuf_len, char ***visited_ndns, - PRBool literal) + bool_t literal) { int i, j; int exp_len, level; @@ -175,7 +175,7 @@ map_data_find_map_entry_id(struct plugin_state *state, /* Handlers for the list of related IDs. On this side we actually store them * as one contiguous chunk of memory. */ -static PRBool +static bool_t map_id_in_id_list(const char *id, char **id_list) { while ((*id_list) != NULL) { @@ -238,10 +238,10 @@ map_id_free_id_list(char **id_list) * true, or if "id" is not NULL and matches the entry's ID, or if the * "related_id" is not NULL and in the list of related IDs. If the callback * returns FALSE, then we abort and return FALSE, otherwise we return TRUE. */ -static PRBool +static bool_t map_data_foreach_entry(struct plugin_state *state, - PRBool all, const char *id, const char *related_id, - PRBool (*fn)(const char *domain, const char *map, + bool_t all, const char *id, const char *related_id, + bool_t (*fn)(const char *domain, const char *map, const char *key, unsigned int key_len, const char *value, unsigned int value_len, const char *id, void *cbdata), @@ -280,9 +280,9 @@ map_data_foreach_entry(struct plugin_state *state, } /* Iterate over every entry which matches the corresponding ID. */ -PRBool +bool_t map_data_foreach_entry_id(struct plugin_state *state, const char *id, - PRBool (*fn)(const char *domain, const char *map, + bool_t (*fn)(const char *domain, const char *map, const char *key, unsigned int key_len, const char *value, @@ -294,10 +294,10 @@ map_data_foreach_entry_id(struct plugin_state *state, const char *id, } /* Iterate over every entry which lists the ID as a related ID. */ -PRBool +bool_t map_data_foreach_entry_related_id(struct plugin_state *state, const char *related_id, - PRBool (*fn)(const char *domain, + bool_t (*fn)(const char *domain, const char *map, const char *key, unsigned int key_len, @@ -313,9 +313,9 @@ map_data_foreach_entry_related_id(struct plugin_state *state, /* Iterate over all maps, calling the callback with information about the map * and whatever the caller originally told us to keep track of when the map was * first set up. */ -PRBool +bool_t map_data_foreach_map(struct plugin_state *state, const char *domain_name, - PRBool (*fn)(const char *domain, + bool_t (*fn)(const char *domain, const char *map, void *backend_data, void *cbdata), @@ -345,10 +345,10 @@ map_data_foreach_map(struct plugin_state *state, const char *domain_name, /* Query function: check if we have a record for the domain. Return that * information in "supported", and return TRUE unless we ran into internal * errors. */ -PRBool +bool_t map_supports_domain(struct plugin_state *state, const char *domain_name, - PRBool *supported) + bool_t *supported) { *supported = (map_data_find_domain(state, domain_name) != NULL); return TRUE; @@ -357,10 +357,10 @@ map_supports_domain(struct plugin_state *state, /* Query function: check if we have a record for the map in the domain. Return * that information in "supported", and return TRUE unless we ran into internal * errors. */ -PRBool +bool_t map_supports_map(struct plugin_state *state, const char *domain_name, const char *map_name, - PRBool *supported) + bool_t *supported) { *supported = (map_data_find_map(state, domain_name, map_name) != NULL); return TRUE; @@ -389,7 +389,7 @@ map_master_name(struct plugin_state *state, const char **master) /* Query function: return an indication of the map's age. Should never * decrease. */ -PRBool +bool_t map_order(struct plugin_state *state, const char *domain_name, const char *map_name, unsigned int *order) @@ -406,7 +406,7 @@ map_order(struct plugin_state *state, /* Query function: return the entry value which matches the key. Return TRUE * if we can find a value which corresponds to the key. */ -PRBool +bool_t map_match(struct plugin_state *state, const char *domain_name, const char *map_name, unsigned int key_len, char *key, @@ -424,7 +424,7 @@ map_match(struct plugin_state *state, /* Query function: return the first entry's key and value for a map. Return * FALSE if there's no domain or map. */ -PRBool +bool_t map_first(struct plugin_state *state, const char *domain_name, const char *map_name, unsigned int *first_key_len, char **first_key, @@ -450,7 +450,7 @@ map_first(struct plugin_state *state, /* Query function: return the successor entry's key and value for a map. * Return FALSE if there's no domain or map, or if the predecessor was the last * key in the map. */ -PRBool +bool_t map_next(struct plugin_state *state, const char *domain_name, const char *map_name, unsigned int prev_len, const char *prev, @@ -1,30 +1,32 @@ +#include <rpc/xdr.h> + struct plugin_state; struct slapi_pblock; /* Functions to pull data out of maps. */ int map_startup(struct plugin_state *state); int map_init(struct slapi_pblock *pb, struct plugin_state *state); int map_master_name(struct plugin_state *state, const char **master); -PRBool map_supports_domain(struct plugin_state *state, +bool_t map_supports_domain(struct plugin_state *state, const char *domain, - PRBool *supported); -PRBool map_supports_map(struct plugin_state *state, + bool_t *supported); +bool_t map_supports_map(struct plugin_state *state, const char *domain, const char *map, - PRBool *supported); -PRBool map_match(struct plugin_state *state, + bool_t *supported); +bool_t map_match(struct plugin_state *state, const char *domain, const char *map, unsigned int key_len, char *key, unsigned int *value_len, char **value); -PRBool map_first(struct plugin_state *state, +bool_t map_first(struct plugin_state *state, const char *domain, const char *map, unsigned int *first_key_len, char **first_key, unsigned int *first_value_len, char **first_value); -PRBool map_next(struct plugin_state *state, +bool_t map_next(struct plugin_state *state, const char *domain, const char *map, unsigned int prev_len, const char *prev, unsigned int *next_key_len, char **next_key, unsigned int *next_value_len, char **next_value); -PRBool map_order(struct plugin_state *state, +bool_t map_order(struct plugin_state *state, const char *domain, const char *map, unsigned int *order); /* Functions to push data into maps. */ @@ -46,8 +48,8 @@ void map_data_set_entry(struct plugin_state *state, const char *id, const char **related_ids, unsigned int key_len, char *key, unsigned int value_len, char *value); -PRBool map_data_foreach_entry_id(struct plugin_state *state, const char *id, - PRBool (*fn)(const char *domain, +bool_t map_data_foreach_entry_id(struct plugin_state *state, const char *id, + bool_t (*fn)(const char *domain, const char *map, const char *key, unsigned int key_len, @@ -55,9 +57,9 @@ PRBool map_data_foreach_entry_id(struct plugin_state *state, const char *id, unsigned int value_len, const char *id, void *cbdata), void *cbdata); -PRBool map_data_foreach_entry_related_id(struct plugin_state *state, +bool_t map_data_foreach_entry_related_id(struct plugin_state *state, const char *related_id, - PRBool (*fn)(const char *domain, + bool_t (*fn)(const char *domain, const char *map, const char *key, unsigned int key_len, @@ -66,8 +68,8 @@ PRBool map_data_foreach_entry_related_id(struct plugin_state *state, const char *id, void *cbdata), void *cbdata); -PRBool map_data_foreach_map(struct plugin_state *state, const char *domain_name, - PRBool (*fn)(const char *domain, +bool_t map_data_foreach_map(struct plugin_state *state, const char *domain_name, + bool_t (*fn)(const char *domain, const char *map, void *backend_data, void *cbdata), @@ -15,8 +15,6 @@ #include <rpc/pmap_clnt.h> #include <rpcsvc/yp_prot.h> -#include <nspr.h> - #include "dispatch.h" #include "map.h" #include "nis.h" @@ -28,7 +26,7 @@ nis_domain(struct plugin_state *state, dispatch_reply_fragment *reply_fragment_fn, dispatch_reply *reply_fn, struct dispatch_client_data *cdata, - XDR *request_xdrs, PRBool reply_on_failure, + XDR *request_xdrs, bool_t reply_on_failure, struct rpc_msg *reply, XDR *reply_xdrs, char *reply_buf, bool_t *reply_bool) { @@ -103,7 +101,7 @@ nis_first(struct plugin_state *state, struct ypresp_key_val *reply_key_val) { struct ypreq_nokey req_nokey; - PRBool map_supported; + bool_t map_supported; memset(&req_nokey, 0, sizeof(req_nokey)); memset(reply_key_val, 0, sizeof(*reply_key_val)); @@ -256,7 +254,7 @@ nis_order(struct plugin_state *state, } } -static PRBool +static bool_t nis_maplist_cb(const char *domain, const char *mapname, void *backend_data, void *cbdata) { @@ -338,7 +336,7 @@ nis_all(struct plugin_state *state, struct ypreq_nokey req_nokey; keydat_t *reply_key; valdat_t *reply_val; - PRBool supported; + bool_t supported; memset(&req_nokey, 0, sizeof(req_nokey)); reply_key = &reply_all->ypresp_all_u.val.keydat; @@ -453,7 +451,7 @@ nis_process_request(struct plugin_state *state, struct ypresp_order reply_order; struct ypresp_maplist reply_maplist; struct accepted_reply *accepted; - PRBool reply_bool; + bool_t reply_bool; memset(&request_xdrs, 0, sizeof(request_xdrs)); memset(&reply_xdrs, 0, sizeof(reply_xdrs)); |
