summaryrefslogtreecommitdiffstats
path: root/src/bin/psql/psqlscanslash.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:15:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:15:05 +0000
commit46651ce6fe013220ed397add242004d764fc0153 (patch)
tree6e5299f990f88e60174a1d3ae6e48eedd2688b2b /src/bin/psql/psqlscanslash.h
parentInitial commit. (diff)
downloadpostgresql-14-46651ce6fe013220ed397add242004d764fc0153.tar.xz
postgresql-14-46651ce6fe013220ed397add242004d764fc0153.zip
Adding upstream version 14.5.upstream/14.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/bin/psql/psqlscanslash.h')
-rw-r--r--src/bin/psql/psqlscanslash.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/bin/psql/psqlscanslash.h b/src/bin/psql/psqlscanslash.h
new file mode 100644
index 0000000..074e961
--- /dev/null
+++ b/src/bin/psql/psqlscanslash.h
@@ -0,0 +1,40 @@
+/*
+ * psql - the PostgreSQL interactive terminal
+ *
+ * Copyright (c) 2000-2021, PostgreSQL Global Development Group
+ *
+ * src/bin/psql/psqlscanslash.h
+ */
+#ifndef PSQLSCANSLASH_H
+#define PSQLSCANSLASH_H
+
+#include "fe_utils/psqlscan.h"
+
+
+/* Different ways for scan_slash_option to handle parameter words */
+enum slash_option_type
+{
+ OT_NORMAL, /* normal case */
+ OT_SQLID, /* treat as SQL identifier */
+ OT_SQLIDHACK, /* SQL identifier, but don't downcase */
+ OT_FILEPIPE, /* it's a filename or pipe */
+ OT_WHOLE_LINE /* just snarf the rest of the line */
+};
+
+
+extern char *psql_scan_slash_command(PsqlScanState state);
+
+extern char *psql_scan_slash_option(PsqlScanState state,
+ enum slash_option_type type,
+ char *quote,
+ bool semicolon);
+
+extern void psql_scan_slash_command_end(PsqlScanState state);
+
+extern int psql_scan_get_paren_depth(PsqlScanState state);
+
+extern void psql_scan_set_paren_depth(PsqlScanState state, int depth);
+
+extern void dequote_downcase_identifier(char *str, bool downcase, int encoding);
+
+#endif /* PSQLSCANSLASH_H */