From: Arran Cudbard-Bell Date: Thu, 11 Sep 2014 17:30:58 +0000 (-0400) Subject: Rename map_from_str to map_from_fields X-Git-Tag: release_3_0_5~556 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1314687b093ebfb92ebcd057e8b5ae53aa705ba3;p=thirdparty%2Ffreeradius-server.git Rename map_from_str to map_from_fields --- diff --git a/src/include/map.h b/src/include/map.h index 604482db1c4..ba225b8e34e 100644 --- a/src/include/map.h +++ b/src/include/map.h @@ -61,10 +61,10 @@ value_pair_map_t *map_from_cp(TALLOC_CTX *ctx, CONF_PAIR *cp, request_refs_t dst_request_def, pair_lists_t dst_list_def, request_refs_t src_request_def, pair_lists_t src_list_def); -value_pair_map_t *map_from_str(TALLOC_CTX *ctx, char const *lhs, FR_TOKEN lhs_type, - FR_TOKEN op, char const *rhs, FR_TOKEN rhs_type, - request_refs_t dst_request_def, pair_lists_t dst_list_def, - request_refs_t src_request_def, pair_lists_t src_list_def); +value_pair_map_t *map_from_fields(TALLOC_CTX *ctx, char const *lhs, FR_TOKEN lhs_type, + FR_TOKEN op, char const *rhs, FR_TOKEN rhs_type, + request_refs_t dst_request_def, pair_lists_t dst_list_def, + request_refs_t src_request_def, pair_lists_t src_list_def); int map_from_cs(CONF_SECTION *cs, value_pair_map_t **head, pair_lists_t dst_list_def, pair_lists_t src_list_def, diff --git a/src/main/map.c b/src/main/map.c index d7e7e191b73..bc62d46efda 100644 --- a/src/main/map.c +++ b/src/main/map.c @@ -343,12 +343,12 @@ error: * in. * @return value_pair_map_t if successful or NULL on error. */ -value_pair_map_t *map_from_str(TALLOC_CTX *ctx, char const *lhs, FR_TOKEN lhs_type, - FR_TOKEN op, char const *rhs, FR_TOKEN rhs_type, - request_refs_t dst_request_def, - pair_lists_t dst_list_def, - request_refs_t src_request_def, - pair_lists_t src_list_def) +value_pair_map_t *map_from_fields(TALLOC_CTX *ctx, char const *lhs, FR_TOKEN lhs_type, + FR_TOKEN op, char const *rhs, FR_TOKEN rhs_type, + request_refs_t dst_request_def, + pair_lists_t dst_list_def, + request_refs_t src_request_def, + pair_lists_t src_list_def) { value_pair_map_t *map; @@ -399,8 +399,8 @@ int map_from_vp_str(value_pair_map_t **out, REQUEST *request, char const *raw, return -1; } - map = map_from_str(request, tokens.l_opand, T_BARE_WORD, tokens.op, tokens.r_opand, tokens.quote, - dst_request_def, dst_list_def, src_request_def, src_list_def); + map = map_from_fields(request, raw.l_opand, T_BARE_WORD, raw.op, raw.r_opand, raw.quote, + dst_request_def, dst_list_def, src_request_def, src_list_def); if (!map) { REDEBUG("Failed parsing attribute string: %s", fr_strerror()); return -1; diff --git a/src/main/modcall.c b/src/main/modcall.c index 8cbd52d48ce..469bc0164ae 100644 --- a/src/main/modcall.c +++ b/src/main/modcall.c @@ -3004,10 +3004,10 @@ static bool pass2_callback(UNUSED void *ctx, fr_cond_t *c) /* * Re-parse the LHS as an attribute. */ - map = map_from_str(c, old->dst->name, T_BARE_WORD, old->op, - old->src->name, T_BARE_WORD, - REQUEST_CURRENT, PAIR_LIST_REQUEST, - REQUEST_CURRENT, PAIR_LIST_REQUEST); + map = map_from_fields(c, old->dst->name, T_BARE_WORD, old->op, + old->src->name, T_BARE_WORD, + REQUEST_CURRENT, PAIR_LIST_REQUEST, + REQUEST_CURRENT, PAIR_LIST_REQUEST); if (!map) { cf_log_err(old->ci, "Failed parsing condition"); return false; diff --git a/src/main/parser.c b/src/main/parser.c index 4fcd1f00ddd..f2d91754127 100644 --- a/src/main/parser.c +++ b/src/main/parser.c @@ -640,9 +640,9 @@ static ssize_t condition_tokenize(TALLOC_CTX *ctx, CONF_ITEM *ci, char const *st return_P("Unexpected regular expression"); } - c->data.map = map_from_str(c, lhs, lhs_type, op, rhs, rhs_type, - REQUEST_CURRENT, PAIR_LIST_REQUEST, - REQUEST_CURRENT, PAIR_LIST_REQUEST); + c->data.map = map_from_fields(c, lhs, lhs_type, op, rhs, rhs_type, + REQUEST_CURRENT, PAIR_LIST_REQUEST, + REQUEST_CURRENT, PAIR_LIST_REQUEST); if (!c->data.map) { /* * If strings are T_BARE_WORD and they start with '&', @@ -654,9 +654,9 @@ static ssize_t condition_tokenize(TALLOC_CTX *ctx, CONF_ITEM *ci, char const *st (lhs_type != T_BARE_WORD)) { return_0("Syntax error"); } - c->data.map = map_from_str(c, lhs, lhs_type + 1, op, rhs, rhs_type, - REQUEST_CURRENT, PAIR_LIST_REQUEST, - REQUEST_CURRENT, PAIR_LIST_REQUEST); + c->data.map = map_from_fields(c, lhs, lhs_type + 1, op, rhs, rhs_type, + REQUEST_CURRENT, PAIR_LIST_REQUEST, + REQUEST_CURRENT, PAIR_LIST_REQUEST); if (!c->data.map) { return_0("Unknown attribute"); }