PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <ctype.h>
#include "catalog/pg_collation.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "utils/builtins.h"
#include "utils/pg_locale.h"
#include "varatt.h"
#include "like_match.c"
Go to the source code of this file.
Macros | |
#define | LIKE_TRUE 1 |
#define | LIKE_FALSE 0 |
#define | LIKE_ABORT (-1) |
#define | NextByte(p, plen) ((p)++, (plen)--) |
#define | CHAREQ(p1, p2) wchareq((p1), (p2)) |
#define | NextChar(p, plen) do { int __l = pg_mblen(p); (p) +=__l; (plen) -=__l; } while (0) |
#define | CopyAdvChar(dst, src, srclen) |
#define | MatchText MB_MatchText |
#define | do_like_escape MB_do_like_escape |
#define | CHAREQ(p1, p2) (*(p1) == *(p2)) |
#define | NextChar(p, plen) NextByte((p), (plen)) |
#define | CopyAdvChar(dst, src, srclen) (*(dst)++ = *(src)++, (srclen)--) |
#define | MatchText SB_MatchText |
#define | do_like_escape SB_do_like_escape |
#define | MATCH_LOWER(t) SB_lower_char((unsigned char) (t), locale, locale_is_c) |
#define | NextChar(p, plen) NextByte((p), (plen)) |
#define | MatchText SB_IMatchText |
#define | NextChar(p, plen) do { (p)++; (plen)--; } while ((plen) > 0 && (*(p) & 0xC0) == 0x80 ) |
#define | MatchText UTF8_MatchText |
#define CopyAdvChar | ( | dst, | |
src, | |||
srclen | |||
) |
#define CopyAdvChar | ( | dst, | |
src, | |||
srclen | |||
) | (*(dst)++ = *(src)++, (srclen)--) |
#define do_like_escape MB_do_like_escape |
#define do_like_escape SB_do_like_escape |
#define MATCH_LOWER | ( | t | ) | SB_lower_char((unsigned char) (t), locale, locale_is_c) |
#define MatchText MB_MatchText |
#define MatchText SB_MatchText |
#define MatchText SB_IMatchText |
#define MatchText UTF8_MatchText |
#define NextChar | ( | p, | |
plen | |||
) | do { (p)++; (plen)--; } while ((plen) > 0 && (*(p) & 0xC0) == 0x80 ) |
Datum bytealike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 324 of file like.c.
References LIKE_TRUE, PG_GETARG_BYTEA_PP, PG_RETURN_BOOL, SB_MatchText(), generate_unaccent_rules::str, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum byteanlike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 345 of file like.c.
References LIKE_TRUE, PG_GETARG_BYTEA_PP, PG_RETURN_BOOL, SB_MatchText(), generate_unaccent_rules::str, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Definition at line 171 of file like.c.
References DatumGetTextPP, DirectFunctionCall1Coll(), ereport, errcode(), errhint(), errmsg(), ERROR, GetDatabaseEncoding(), lc_ctype_is_c(), locale, lower(), MB_MatchText(), OidIsValid, pg_database_encoding_max_length(), pg_locale_deterministic(), pg_newlocale_from_collation(), PG_UTF8, PointerGetDatum(), SB_IMatchText(), generate_unaccent_rules::str, UTF8_MatchText(), VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by nameiclike(), nameicnlike(), texticlike(), and texticnlike().
|
inlinestatic |
Definition at line 150 of file like.c.
References ereport, errcode(), errmsg(), ERROR, GetDatabaseEncoding(), lc_ctype_is_c(), locale, MB_MatchText(), pg_database_encoding_max_length(), pg_locale_deterministic(), pg_newlocale_from_collation(), PG_UTF8, SB_MatchText(), and UTF8_MatchText().
Referenced by namelike(), namenlike(), textlike(), and textnlike().
Datum like_escape | ( | PG_FUNCTION_ARGS | ) |
Definition at line 428 of file like.c.
References MB_do_like_escape(), pg_database_encoding_max_length(), PG_GETARG_TEXT_PP, PG_RETURN_TEXT_P, and SB_do_like_escape().
Datum like_escape_bytea | ( | PG_FUNCTION_ARGS | ) |
Definition at line 447 of file like.c.
References PG_GETARG_BYTEA_PP, PG_RETURN_BYTEA_P, and SB_do_like_escape().
Referenced by like_escape().
|
static |
Referenced by Generic_Text_IC_like(), and GenericMatchText().
Datum nameiclike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 370 of file like.c.
References DatumGetTextPP, DirectFunctionCall1, Generic_Text_IC_like(), LIKE_TRUE, name_text(), NameGetDatum(), PG_GET_COLLATION, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and generate_unaccent_rules::str.
Datum nameicnlike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 385 of file like.c.
References DatumGetTextPP, DirectFunctionCall1, Generic_Text_IC_like(), LIKE_TRUE, name_text(), NameGetDatum(), PG_GET_COLLATION, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and generate_unaccent_rules::str.
Datum namelike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 240 of file like.c.
References GenericMatchText(), LIKE_TRUE, NameStr, PG_GET_COLLATION, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, generate_unaccent_rules::str, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum namenlike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 261 of file like.c.
References GenericMatchText(), LIKE_TRUE, NameStr, PG_GET_COLLATION, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, generate_unaccent_rules::str, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by like_escape(), and like_escape_bytea().
|
static |
Referenced by Generic_Text_IC_like().
|
static |
Definition at line 94 of file like.c.
References locale, pg_ascii_tolower(), pg_tolower(), and tolower_l.
|
static |
Referenced by bytealike(), byteanlike(), and GenericMatchText().
Datum texticlike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 400 of file like.c.
References Generic_Text_IC_like(), LIKE_TRUE, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and generate_unaccent_rules::str.
Datum texticnlike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 412 of file like.c.
References Generic_Text_IC_like(), LIKE_TRUE, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and generate_unaccent_rules::str.
Datum textlike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 282 of file like.c.
References GenericMatchText(), LIKE_TRUE, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, generate_unaccent_rules::str, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum textnlike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 303 of file like.c.
References GenericMatchText(), LIKE_TRUE, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, generate_unaccent_rules::str, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
|
static |
Referenced by Generic_Text_IC_like(), and GenericMatchText().
|
inlinestatic |