PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "funcapi.h"
#include "regex/regex.h"
#include "utils/array.h"
#include "utils/builtins.h"
Go to the source code of this file.
Data Structures | |
struct | test_re_flags |
struct | test_regex_ctx |
Typedefs | |
typedef struct test_re_flags | test_re_flags |
typedef struct test_regex_ctx | test_regex_ctx |
Functions | |
static void | test_re_compile (text *text_re, int cflags, Oid collation, regex_t *result_re) |
static void | parse_test_flags (test_re_flags *flags, text *opts) |
static test_regex_ctx * | setup_test_matches (text *orig_str, regex_t *cpattern, test_re_flags *re_flags, Oid collation, bool use_subpatterns) |
static ArrayType * | build_test_info_result (regex_t *cpattern, test_re_flags *flags) |
static ArrayType * | build_test_match_result (test_regex_ctx *matchctx) |
PG_FUNCTION_INFO_V1 (test_regex) | |
Datum | test_regex (PG_FUNCTION_ARGS) |
static bool | test_re_execute (regex_t *re, pg_wchar *data, int data_len, int start_search, rm_detail_t *details, int nmatch, regmatch_t *pmatch, int eflags) |
Variables | |
PG_MODULE_MAGIC | |
typedef struct test_re_flags test_re_flags |
typedef struct test_regex_ctx test_regex_ctx |
|
static |
Definition at line 617 of file test_regex.c.
References bit(), buf, construct_md_array(), cstring_to_text(), test_re_flags::info, lengthof, PointerGetDatum(), REG_UBACKREF, REG_UBBS, REG_UBOUNDS, REG_UBRACES, REG_UBSALNUM, REG_UEMPTYMATCH, REG_UIMPOSSIBLE, REG_ULOCALE, REG_ULOOKAROUND, REG_UNONPOSIX, REG_UPBOTCH, REG_USHORTEST, REG_UUNPORT, REG_UUNSPEC, and snprintf.
Referenced by test_regex().
|
static |
Definition at line 691 of file test_regex.c.
References Assert, buf, test_re_flags::cflags, construct_md_array(), test_regex_ctx::conv_buf, cstring_to_text(), cstring_to_text_with_len(), test_regex_ctx::details, DirectFunctionCall3, test_regex_ctx::elems, i, test_re_flags::indices, Int32GetDatum(), len, test_regex_ctx::match_locs, test_regex_ctx::next_match, test_regex_ctx::npatterns, test_regex_ctx::nulls, test_regex_ctx::orig_str, pg_wchar2mb_with_len(), PointerGetDatum(), test_regex_ctx::re_flags, REG_EXPECT, pg_regmatch_t::rm_eo, rm_detail_t::rm_extend, pg_regmatch_t::rm_so, snprintf, text_substr(), and test_regex_ctx::wide_str.
Referenced by test_regex().
|
static |
Definition at line 249 of file test_regex.c.
References test_re_flags::cflags, test_re_flags::eflags, ereport, errcode(), errmsg(), ERROR, test_re_flags::glob, i, test_re_flags::indices, test_re_flags::info, opts, test_re_flags::partial, pg_mblen(), REG_ADVANCED, REG_ADVF, REG_BOSONLY, REG_DUMP, REG_EXPANDED, REG_EXPECT, REG_EXTENDED, REG_FAKE, REG_FTRACE, REG_ICASE, REG_MTRACE, REG_NEWLINE, REG_NLANCH, REG_NLSTOP, REG_NOSUB, REG_NOTBOL, REG_NOTEOL, REG_PROGRESS, REG_QUOTE, REG_SMALL, REG_UBACKREF, REG_UBBS, REG_UBOUNDS, REG_UBRACES, REG_UBSALNUM, REG_UEMPTYMATCH, REG_UIMPOSSIBLE, REG_ULOCALE, REG_ULOOKAROUND, REG_UNONPOSIX, REG_UPBOTCH, REG_USHORTEST, REG_UUNPORT, REG_UUNSPEC, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by test_regex().
PG_FUNCTION_INFO_V1 | ( | test_regex | ) |
|
static |
Definition at line 434 of file test_regex.c.
References Assert, test_regex_ctx::conv_buf, test_regex_ctx::conv_bufsiz, test_regex_ctx::details, test_re_flags::eflags, ereport, errcode(), errmsg(), ERROR, test_re_flags::glob, i, test_re_flags::indices, test_regex_ctx::match_locs, MaxAllocSize, test_regex_ctx::nmatches, test_regex_ctx::npatterns, test_regex_ctx::orig_str, palloc(), palloc0(), test_re_flags::partial, pfree(), pg_database_encoding_max_length(), pg_mb2wchar_with_len(), test_regex_ctx::re_flags, regmatch_t, repalloc(), pg_regmatch_t::rm_eo, rm_detail_t::rm_extend, pg_regmatch_t::rm_so, test_re_execute(), VARDATA_ANY, VARSIZE_ANY_EXHDR, and test_regex_ctx::wide_str.
Referenced by test_regex().
|
static |
Definition at line 160 of file test_regex.c.
References ereport, errcode(), errmsg(), ERROR, palloc(), pfree(), pg_mb2wchar_with_len(), pg_regcomp(), pg_regerror(), REG_OKAY, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by test_regex().
|
static |
Definition at line 201 of file test_regex.c.
References data, ereport, errcode(), errmsg(), ERROR, i, pg_regerror(), pg_regexec(), REG_NOMATCH, REG_OKAY, pg_regmatch_t::rm_eo, rm_detail_t::rm_extend, and pg_regmatch_t::rm_so.
Referenced by setup_test_matches().
Datum test_regex | ( | PG_FUNCTION_ARGS | ) |
Definition at line 79 of file test_regex.c.
References build_test_info_result(), build_test_match_result(), test_re_flags::cflags, test_regex_ctx::elems, if(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, test_regex_ctx::next_match, test_regex_ctx::nmatches, test_regex_ctx::npatterns, test_regex_ctx::nulls, palloc(), parse_test_flags(), PG_GET_COLLATION, PG_GETARG_TEXT_P_COPY, PG_GETARG_TEXT_PP, pg_regfree(), PointerGetDatum(), regex_t, setup_test_matches(), SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, test_re_compile(), and FuncCallContext::user_fctx.
PG_MODULE_MAGIC |
Definition at line 22 of file test_regex.c.