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/fmgrprotos.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, locale) SB_lower_char((unsigned char) (t), locale) |
#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, | |
locale | |||
) | SB_lower_char((unsigned char) (t), locale) |
#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 326 of file like.c.
References LIKE_TRUE, PG_GETARG_BYTEA_PP, PG_RETURN_BOOL, SB_MatchText(), str, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum byteanlike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 347 of file like.c.
References LIKE_TRUE, PG_GETARG_BYTEA_PP, PG_RETURN_BOOL, SB_MatchText(), str, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Definition at line 177 of file like.c.
References DatumGetTextPP, DirectFunctionCall1Coll(), ereport, errcode(), errhint(), errmsg(), ERROR, GetDatabaseEncoding(), locale, lower(), MB_MatchText(), OidIsValid, pg_database_encoding_max_length(), pg_newlocale_from_collation(), PG_UTF8, PointerGetDatum(), SB_IMatchText(), 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(), errhint(), errmsg(), ERROR, GetDatabaseEncoding(), locale, MB_MatchText(), OidIsValid, pg_database_encoding_max_length(), 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 430 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 449 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 372 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 str.
Datum nameicnlike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 387 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 str.
Datum namelike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 242 of file like.c.
References GenericMatchText(), LIKE_TRUE, NameStr, PG_GET_COLLATION, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, str, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum namenlike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 263 of file like.c.
References GenericMatchText(), LIKE_TRUE, NameStr, PG_GET_COLLATION, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, 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 402 of file like.c.
References Generic_Text_IC_like(), LIKE_TRUE, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and str.
Datum texticnlike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 414 of file like.c.
References Generic_Text_IC_like(), LIKE_TRUE, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and str.
Datum textlike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 284 of file like.c.
References GenericMatchText(), LIKE_TRUE, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, str, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum textnlike | ( | PG_FUNCTION_ARGS | ) |
Definition at line 305 of file like.c.
References GenericMatchText(), LIKE_TRUE, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, str, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
|
static |
Referenced by Generic_Text_IC_like(), and GenericMatchText().
|
inlinestatic |
Definition at line 58 of file like.c.
References pg_mblen().