summaryrefslogtreecommitdiff
path: root/src/include/utils/builtins.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2014-11-13 12:25:10 -0500
committerRobert Haas <rhaas@postgresql.org>2014-11-13 12:33:26 -0500
commitc0828b78e930a4e085ec52f19fdc850104cb0659 (patch)
tree23e68c0c19b7016e95b8acf177124dd5b6cf7111 /src/include/utils/builtins.h
parent1d69ae419d04fa7919fa282224a566499f3a0fd0 (diff)
Move the guts of our Levenshtein implementation into core.
The hope is that we can use this to produce better diagnostics in some cases. Peter Geoghegan, reviewed by Michael Paquier, with some further changes by me.
Diffstat (limited to 'src/include/utils/builtins.h')
-rw-r--r--src/include/utils/builtins.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index 3ba34f88eec..417fd1771a8 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -786,6 +786,11 @@ extern Datum textoverlay_no_len(PG_FUNCTION_ARGS);
extern Datum name_text(PG_FUNCTION_ARGS);
extern Datum text_name(PG_FUNCTION_ARGS);
extern int varstr_cmp(char *arg1, int len1, char *arg2, int len2, Oid collid);
+extern int varstr_levenshtein(const char *source, int slen, const char *target,
+ int tlen, int ins_c, int del_c, int sub_c);
+extern 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);
extern List *textToQualifiedNameList(text *textval);
extern bool SplitIdentifierString(char *rawstring, char separator,
List **namelist);