#include "dprint.h"
#include "mem/mem.h"
#include "re.h"
#include <string.h>

Go to the source code of this file.
Defines | |
| #define | MAX_REPLACE_WITH 100 |
| #define | REPLACE_BUFFER_SIZE 1024 |
Functions | |
| int | parse_repl (struct replace_with *rw, char **begin, char *end, int *max_token_nb, int with_sep) |
| static int | replace_build (const char *match, int nmatch, regmatch_t *pmatch, struct subst_expr *se, struct sip_msg *msg, str *rpl) |
| Replies will be allocated with the proper size & rpl.len set. | |
| void | replace_lst_free (struct replace_lst *l) |
| frees the entire list, head (l) too | |
| void | subst_expr_free (struct subst_expr *se) |
| struct subst_expr * | subst_parser (str *subst) |
| Parse a /regular expression/replacement/flags into a subst_expr structure. | |
| struct replace_lst * | subst_run (struct subst_expr *se, const char *input, struct sip_msg *msg, int *count) |
| run substitutions | |
| str * | subst_str (const char *input, struct sip_msg *msg, struct subst_expr *se, int *count) |
Definition in file re.c.
| #define MAX_REPLACE_WITH 100 |
| #define REPLACE_BUFFER_SIZE 1024 |
Referenced by replace_build().
| int parse_repl | ( | struct replace_with * | rw, | |
| char ** | begin, | |||
| char * | end, | |||
| int * | max_token_nb, | |||
| int | with_sep | |||
| ) |
Definition at line 70 of file re.c.
References replace_with::c, _str::len, LM_ERR, LM_WARN, MAX_REPLACE_WITH, replace_with::nmatch, NULL, replace_with::offset, PV_MARKER, pv_parse_spec(), REPLACE_CHAR, REPLACE_NMATCH, REPLACE_SPEC, REPLACE_URI, _str::s, s, replace_with::size, replace_with::spec, replace_with::type, and replace_with::u.
Referenced by repl_exp_parse(), and subst_parser().
| static int replace_build | ( | const char * | match, | |
| int | nmatch, | |||
| regmatch_t * | pmatch, | |||
| struct subst_expr * | se, | |||
| struct sip_msg * | msg, | |||
| str * | rpl | |||
| ) | [static] |
Replies will be allocated with the proper size & rpl.len set.
Definition at line 380 of file re.c.
References replace_with::c, sip_msg::first_line, _str::len, LM_CRIT, LM_ERR, subst_expr::n_escapes, sip_msg::new_uri, replace_with::nmatch, replace_with::offset, pkg_malloc, pv_get_spec_value(), subst_expr::replace, REPLACE_BUFFER_SIZE, REPLACE_CHAR, REPLACE_NMATCH, REPLACE_SPEC, REPLACE_URI, subst_expr::replacement, msg_start::request, _pv_value::rs, _str::s, SIP_REQUEST, replace_with::size, replace_with::spec, msg_start::type, replace_with::type, msg_start::u, and replace_with::u.
Referenced by subst_run().
| void replace_lst_free | ( | struct replace_lst * | l | ) |
frees the entire list, head (l) too
Definition at line 57 of file re.c.
References replace_lst::next, pkg_free, replace_lst::rpl, and _str::s.
Referenced by subst_body_f(), subst_f(), subst_run(), and subst_str().
| void subst_expr_free | ( | struct subst_expr * | se | ) |
Definition at line 47 of file re.c.
References pkg_free, subst_expr::re, subst_expr::replacement, and _str::s.
Referenced by subst_parser(), and tr_txt_parse_re().
| struct subst_expr* subst_parser | ( | str * | subst | ) | [read] |
Parse a /regular expression/replacement/flags into a subst_expr structure.
Definition at line 207 of file re.c.
References _str::len, LM_DBG, LM_ERR, subst_expr::max_pmatch, parse_repl(), pkg_free, pkg_malloc, subst_expr::re, _str::s, subst_expr_free(), and WITH_SEP.
Referenced by fixup_subst(), fixup_substre(), ldap_result_check_fixup(), ldap_result_fixup(), and tr_txt_parse_re().
| struct replace_lst* subst_run | ( | struct subst_expr * | se, | |
| const char * | input, | |||
| struct sip_msg * | msg, | |||
| int * | count | |||
| ) | [read] |
run substitutions
Definition at line 500 of file re.c.
References LM_DBG, LM_ERR, subst_expr::max_pmatch, pkg_free, pkg_malloc, subst_expr::re, subst_expr::replace_all, replace_build(), and replace_lst_free().
Referenced by subst_body_f(), subst_f(), and subst_str().
| str* subst_str | ( | const char * | input, | |
| struct sip_msg * | msg, | |||
| struct subst_expr * | se, | |||
| int * | count | |||
| ) |
Definition at line 583 of file re.c.
References _str::len, LM_DBG, LM_ERR, replace_lst::next, replace_lst::offset, pkg_free, pkg_malloc, replace_lst_free(), replace_lst::rpl, _str::s, replace_lst::size, and subst_run().
Referenced by ldap_result_check(), ldap_write_result(), ops_subst(), subst_uri_f(), subst_user_f(), and tr_txt_eval_re().
1.5.6