PostgreSQL Source Code  git master
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-2022, 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 
19 extern int varstr_cmp(const char *arg1, int len1, const char *arg2, int len2, Oid collid);
20 extern void varstr_sortsupport(SortSupport ssup, Oid typid, Oid collid);
21 extern 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);
25 extern 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);
29 extern List *textToQualifiedNameList(text *textval);
30 extern bool SplitIdentifierString(char *rawstring, char separator,
31  List **namelist);
32 extern bool SplitDirectoriesString(char *rawstring, char separator,
33  List **namelist);
34 extern bool SplitGUCList(char *rawstring, char separator,
35  List **namelist);
36 extern text *replace_text_regexp(text *src_text, text *pattern_text,
38  int cflags, Oid collation,
39  int search_start, int n);
40 
41 typedef struct ClosestMatchState
42 {
43  const char *source;
44  int min_d;
45  int max_d;
46  const char *match;
48 
49 extern void initClosestMatch(ClosestMatchState *state, const char *source, int max_d);
50 extern void updateClosestMatch(ClosestMatchState *state, const char *candidate);
51 extern const char *getClosestMatch(ClosestMatchState *state);
52 
53 #endif
static rewind_source * source
Definition: pg_rewind.c:81
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:52
Definition: regguts.h:318
Definition: c.h:623
Datum replace_text(PG_FUNCTION_ARGS)
Definition: varlena.c:4251
List * textToQualifiedNameList(text *textval)
Definition: varlena.c:3654
const char * getClosestMatch(ClosestMatchState *state)
Definition: varlena.c:6274
int varstr_cmp(const char *arg1, int len1, const char *arg2, int len2, Oid collid)
Definition: varlena.c:1518
bool SplitDirectoriesString(char *rawstring, char separator, List **namelist)
Definition: varlena.c:3839
bool SplitGUCList(char *rawstring, char separator, List **namelist)
Definition: varlena.c:3960
bool SplitIdentifierString(char *rawstring, char separator, List **namelist)
Definition: varlena.c:3712
void varstr_sortsupport(SortSupport ssup, Oid typid, Oid collid)
Definition: varlena.c:2012
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)
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
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:4461
void initClosestMatch(ClosestMatchState *state, const char *source, int max_d)
Definition: varlena.c:6219
void updateClosestMatch(ClosestMatchState *state, const char *candidate)
Definition: varlena.c:6239