summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin.dahyabhai@pobox.com>2008-10-24 13:59:05 -0400
committerNalin Dahyabhai <nalin.dahyabhai@pobox.com>2008-10-24 13:59:05 -0400
commita668ba841e3fe423053dd506fcc25ff5e1166722 (patch)
tree3ba6b49ebd7a66eabe0a676aada8808d137a61ed /src
parent316ece9f122d3ee63e84734cf4b790c691963e04 (diff)
downloadslapi-nis-a668ba841e3fe423053dd506fcc25ff5e1166722.tar.gz
slapi-nis-a668ba841e3fe423053dd506fcc25ff5e1166722.tar.xz
slapi-nis-a668ba841e3fe423053dd506fcc25ff5e1166722.zip
- rename formatting functions:
derefx -> deref_r referredx -> referred_r - add a simple test for referred_r
Diffstat (limited to 'src')
-rw-r--r--src/back-shr.c4
-rw-r--r--src/format.c80
2 files changed, 42 insertions, 42 deletions
diff --git a/src/back-shr.c b/src/back-shr.c
index 3db9420..de6dab5 100644
--- a/src/back-shr.c
+++ b/src/back-shr.c
@@ -905,7 +905,7 @@ backend_shr_update_references_cb(const char *group, const char *set,
i++) {
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
- "updating derefx[%d] references for \"%s\"\n",
+ "updating deref_r[%d] references for \"%s\"\n",
i, slapi_entry_get_ndn(cbdata->e));
ref_attr = ref_attr_list[i];
these_entries = NULL;
@@ -1073,7 +1073,7 @@ backend_shr_update_references_cb(const char *group, const char *set,
i++) {
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
- "updating referredx[%d] references for "
+ "updating referred_r[%d] references for "
"\"%s\"\n",
i, slapi_entry_get_ndn(cbdata->e));
inref_attr = inref_attr_list[i];
diff --git a/src/format.c b/src/format.c
index 8da0a68..1e2b7f2 100644
--- a/src/format.c
+++ b/src/format.c
@@ -993,14 +993,14 @@ format_deref(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
* at last, pull out the values for the attribute named by the last argument,
* and return a list of those values. */
static int
-format_derefx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
- const char *group, const char *set,
- const char *args, const char *disallowed,
- char *outbuf, int outbuf_len,
- struct format_choice **outbuf_choices,
- char ***ref_attrs, struct format_inref_attr ***inref_attrs,
- struct format_ref_attr_list ***ref_attr_list,
- struct format_ref_attr_list ***inref_attr_list)
+format_deref_r(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
+ const char *group, const char *set,
+ const char *args, const char *disallowed,
+ char *outbuf, int outbuf_len,
+ struct format_choice **outbuf_choices,
+ char ***ref_attrs, struct format_inref_attr ***inref_attrs,
+ struct format_ref_attr_list ***ref_attr_list,
+ struct format_ref_attr_list ***inref_attr_list)
{
int i, j, k, ret, argc;
Slapi_Entry *entry;
@@ -1017,18 +1017,18 @@ format_derefx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
ret = format_parse_args(state, args, &argc, &argv);
if (ret != 0) {
slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
- "derefx: error parsing arguments\n");
+ "deref_r: error parsing arguments\n");
return -EINVAL;
}
if (argc < 2) {
slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
- "derefx requires at least two arguments\n");
+ "deref_r: requires at least two arguments\n");
format_free_parsed_args(argv);
return -EINVAL;
}
if (outbuf_choices == NULL) {
slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
- "derefx: returns a list, but a list "
+ "deref_r: returns a list, but a list "
"would not be appropriate\n");
format_free_parsed_args(argv);
return -EINVAL;
@@ -1062,7 +1062,7 @@ format_derefx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
dn = slapi_sdn_get_ndn(these[j]);
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
- "derefx: noting parent "
+ "deref_r: noting parent "
"\"%s\" for \"%s\"\n",
slapi_dn_parent(dn), attrs[0]);
format_add_sdn_list(&list->links[i].base_sdn_list,
@@ -1074,14 +1074,14 @@ format_derefx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
if (entry == NULL) {
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
- "derefx: error reading entry "
+ "deref_r: error reading entry "
"\"%s\"\n",
slapi_sdn_get_dn(these[j]));
continue;
} else {
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
- "derefx: reading entry "
+ "deref_r: reading entry "
"\"%s\" (%d)\n",
slapi_sdn_get_dn(these[j]), i);
}
@@ -1092,7 +1092,7 @@ format_derefx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
0, &buffer_flags) != 0) {
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
- "derefx: entry \"%s\" has no "
+ "deref_r: entry \"%s\" has no "
"values for \"%s\"\n",
slapi_sdn_get_dn(these[j]),
attrs[0]);
@@ -1127,7 +1127,7 @@ format_derefx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
format_add_bv_list(&choices, bval);
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
- "derefx: found value "
+ "deref_r: found value "
"\"%.*s\" in \"%s\"\n",
bval->bv_len,
bval->bv_val, dn);
@@ -1365,14 +1365,14 @@ format_note_entry_sdn_cb(Slapi_Entry *e, void *cbdata_ptr)
* get to the last argument, at which point we return the value of the
* attribute named by the final argument. */
static int
-format_referredx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
- const char *group, const char *set,
- const char *args, const char *disallowed,
- char *outbuf, int outbuf_len,
- struct format_choice **outbuf_choices,
- char ***ref_attrs, struct format_inref_attr ***inref_attrs,
- struct format_ref_attr_list ***ref_attr_list,
- struct format_ref_attr_list ***inref_attr_list)
+format_referred_r(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
+ const char *group, const char *set,
+ const char *args, const char *disallowed,
+ char *outbuf, int outbuf_len,
+ struct format_choice **outbuf_choices,
+ char ***ref_attrs, struct format_inref_attr ***inref_attrs,
+ struct format_ref_attr_list ***ref_attr_list,
+ struct format_ref_attr_list ***inref_attr_list)
{
int i, j, k, ret, argc, attrs_list_length, disposition, buffer_flags;
Slapi_PBlock *local_pb;
@@ -1392,25 +1392,25 @@ format_referredx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
ret = format_parse_args(state, args, &argc, &argv);
if (ret != 0) {
slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
- "referredx: error parsing arguments\n");
+ "referred_r: error parsing arguments\n");
return -EINVAL;
}
if (argc < 3) {
slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
- "referredx: requires at least 3 arguments\n");
+ "referred_r: requires at least 3 arguments\n");
format_free_parsed_args(argv);
return -EINVAL;
}
if ((argc % 2) != 1) {
slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
- "referredx: requires an odd number of "
+ "referred_r: requires an odd number of "
"arguments\n");
format_free_parsed_args(argv);
return -EINVAL;
}
if (outbuf_choices == NULL) {
slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
- "referredx: returns a list, but a list would "
+ "referred_r: returns a list, but a list would "
"not be appropriate here\n");
format_free_parsed_args(argv);
return -EINVAL;
@@ -1425,7 +1425,7 @@ format_referredx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
attr_links = malloc((attrs_list_length + 1) * sizeof(char *));
if (attr_links == NULL) {
slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
- "referredx: out of memory\n");
+ "referred_r: out of memory\n");
format_free_parsed_args(argv);
return -ENOMEM;
}
@@ -1448,7 +1448,7 @@ format_referredx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
local_pb = slapi_pblock_new();
if (local_pb == NULL) {
slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
- "referredx: out of memory\n");
+ "referred_r: out of memory\n");
format_free_parsed_args(argv);
return -ENOMEM;
}
@@ -1514,8 +1514,8 @@ format_referredx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
/* Search for referrers under this tree. */
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
- "referredx: searching under %s "
- "for \"%s\" (link=%d.1)\n",
+ "referred_r: searching under %s"
+ " for \"%s\" (link=%d.1)\n",
ndn, filter, i);
slapi_search_internal_set_pb(local_pb,
ndn,
@@ -1550,8 +1550,8 @@ format_referredx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
/* Search for referrers under that tree. */
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
- "referredx: searching under %s "
- "for \"%s\" (link=%d.2)\n",
+ "referred_r: searching under %s"
+ " for \"%s\" (link=%d.2)\n",
ndn, filter, i);
slapi_search_internal_set_pb(local_pb,
ndn,
@@ -1596,14 +1596,14 @@ format_referredx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
if (entry == NULL) {
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
- "referredx: error reading entry "
+ "referred_r: error reading entry "
"\"%s\"\n",
slapi_sdn_get_dn(these_entries[i]));
continue;
} else {
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
- "referredx: reading \"%s\" from entry "
+ "referred_r: reading \"%s\" from entry "
"\"%s\"\n", attrs[0],
slapi_sdn_get_dn(these_entries[i]));
}
@@ -1614,7 +1614,7 @@ format_referredx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
0, &buffer_flags) != 0) {
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
- "referredx: entry \"%s\" has no "
+ "referred_r: entry \"%s\" has no "
"values for \"%s\"\n",
slapi_sdn_get_dn(these_entries[i]),
attrs[0]);
@@ -1634,7 +1634,7 @@ format_referredx(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
format_add_bv_list(&choices, bval);
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
- "referredx: found value "
+ "referred_r: found value "
"\"%.*s\" in \"%s\"\n",
bval->bv_len,
bval->bv_val,
@@ -2161,9 +2161,9 @@ format_lookup_fn(const char *fnname)
} fns[] = {
{"first", format_first},
{"deref", format_deref},
- {"derefx", format_derefx},
+ {"deref_r", format_deref_r},
{"referred", format_referred},
- {"referredx", format_referredx},
+ {"referred_r", format_referred_r},
{"merge", format_merge},
{"match", format_match},
{"regmatch", format_regmatch},