#include "str.h"
#include "pvar.h"
#include "parser/msg_parser.h"
#include <sys/types.h>
#include <regex.h>


Go to the source code of this file.
Data Structures | |
| struct | replace_lst |
| struct | replace_with |
| struct | subst_expr |
Defines | |
| #define | WITH_SEP 1 |
| #define | WITHOUT_SEP 0 |
Enumerations | |
| enum | replace_special { REPLACE_NMATCH, REPLACE_CHAR, REPLACE_URI, REPLACE_SPEC } |
Functions | |
| int | parse_repl (struct replace_with *rw, char **begin, char *end, int *max_token_nb, int flag) |
| 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.h.
| #define WITH_SEP 1 |
| #define WITHOUT_SEP 0 |
| enum replace_special |
| int parse_repl | ( | struct replace_with * | rw, | |
| char ** | begin, | |||
| char * | end, | |||
| int * | max_token_nb, | |||
| int | flag | |||
| ) |
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().
| 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