PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
varlena.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * varlena.h
4 * Functions for the variable-length built-in types.
5 *
6 * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
8 *
9 * src/include/utils/varlena.h
10 *
11 *-------------------------------------------------------------------------
12 */
13#ifndef VARLENA_H
14#define VARLENA_H
15
16#include "nodes/pg_list.h"
17#include "utils/sortsupport.h"
18
19extern int varstr_cmp(const char *arg1, int len1, const char *arg2, int len2, Oid collid);
20extern void varstr_sortsupport(SortSupport ssup, Oid typid, Oid collid);
21extern int varstr_levenshtein(const char *source, int slen,
22 const char *target, int tlen,
23 int ins_c, int del_c, int sub_c,
24 bool trusted);
25extern int varstr_levenshtein_less_equal(const char *source, int slen,
26 const char *target, int tlen,
27 int ins_c, int del_c, int sub_c,
28 int max_d, bool trusted);
29extern List *textToQualifiedNameList(text *textval);
30extern bool SplitIdentifierString(char *rawstring, char separator,
31 List **namelist);
32extern bool SplitDirectoriesString(char *rawstring, char separator,
33 List **namelist);
34extern bool SplitGUCList(char *rawstring, char separator,
35 List **namelist);
36extern text *replace_text_regexp(text *src_text, text *pattern_text,
38 int cflags, Oid collation,
39 int search_start, int n);
40
41typedef struct ClosestMatchState
42{
43 const char *source;
44 int min_d;
45 int max_d;
46 const char *match;
48
49extern void initClosestMatch(ClosestMatchState *state, const char *source, int max_d);
50extern void updateClosestMatch(ClosestMatchState *state, const char *candidate);
51extern const char *getClosestMatch(ClosestMatchState *state);
52
53#endif
Oid collid
static rewind_source * source
Definition: pg_rewind.c:89
unsigned int Oid
Definition: postgres_ext.h:31
const char * match
Definition: varlena.h:46
const char * source
Definition: varlena.h:43
Definition: pg_list.h:54
Definition: regguts.h:323
Definition: c.h:641
Datum replace_text(PG_FUNCTION_ARGS)
Definition: varlena.c:4009
int varstr_cmp(const char *arg1, int len1, const char *arg2, int len2, Oid collid)
Definition: varlena.c:1538
bool SplitDirectoriesString(char *rawstring, char separator, List **namelist)
Definition: varlena.c:3559
const char * getClosestMatch(ClosestMatchState *state)
Definition: varlena.c:6256
bool SplitGUCList(char *rawstring, char separator, List **namelist)
Definition: varlena.c:3680
bool SplitIdentifierString(char *rawstring, char separator, List **namelist)
Definition: varlena.c:3432
void varstr_sortsupport(SortSupport ssup, Oid typid, Oid collid)
Definition: varlena.c:1856
struct ClosestMatchState ClosestMatchState
int varstr_levenshtein_less_equal(const char *source, int slen, const char *target, int tlen, int ins_c, int del_c, int sub_c, int max_d, bool trusted)
text * replace_text_regexp(text *src_text, text *pattern_text, text *replace_text, int cflags, Oid collation, int search_start, int n)
Definition: varlena.c:4219
int varstr_levenshtein(const char *source, int slen, const char *target, int tlen, int ins_c, int del_c, int sub_c, bool trusted)
Definition: levenshtein.c:73
void initClosestMatch(ClosestMatchState *state, const char *source, int max_d)
Definition: varlena.c:6201
void updateClosestMatch(ClosestMatchState *state, const char *candidate)
Definition: varlena.c:6221
List * textToQualifiedNameList(text *textval)
Definition: varlena.c:3374