summaryrefslogtreecommitdiffstats
path: root/src/bin/psql/command.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:19:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:19:15 +0000
commit6eb9c5a5657d1fe77b55cc261450f3538d35a94d (patch)
tree657d8194422a5daccecfd42d654b8a245ef7b4c8 /src/bin/psql/command.h
parentInitial commit. (diff)
downloadpostgresql-13-6eb9c5a5657d1fe77b55cc261450f3538d35a94d.tar.xz
postgresql-13-6eb9c5a5657d1fe77b55cc261450f3538d35a94d.zip
Adding upstream version 13.4.upstream/13.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/bin/psql/command.h')
-rw-r--r--src/bin/psql/command.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/bin/psql/command.h b/src/bin/psql/command.h
new file mode 100644
index 0000000..006832f
--- /dev/null
+++ b/src/bin/psql/command.h
@@ -0,0 +1,49 @@
+/*
+ * psql - the PostgreSQL interactive terminal
+ *
+ * Copyright (c) 2000-2020, PostgreSQL Global Development Group
+ *
+ * src/bin/psql/command.h
+ */
+#ifndef COMMAND_H
+#define COMMAND_H
+
+#include "fe_utils/conditional.h"
+#include "fe_utils/print.h"
+#include "fe_utils/psqlscan.h"
+
+typedef enum _backslashResult
+{
+ PSQL_CMD_UNKNOWN = 0, /* not done parsing yet (internal only) */
+ PSQL_CMD_SEND, /* query complete; send off */
+ PSQL_CMD_SKIP_LINE, /* keep building query */
+ PSQL_CMD_TERMINATE, /* quit program */
+ PSQL_CMD_NEWEDIT, /* query buffer was changed (e.g., via \e) */
+ PSQL_CMD_ERROR /* the execution of the backslash command
+ * resulted in an error */
+} backslashResult;
+
+
+extern backslashResult HandleSlashCmds(PsqlScanState scan_state,
+ ConditionalStack cstack,
+ PQExpBuffer query_buf,
+ PQExpBuffer previous_buf);
+
+extern int process_file(char *filename, bool use_relative_path);
+
+extern bool do_pset(const char *param,
+ const char *value,
+ printQueryOpt *popt,
+ bool quiet);
+
+extern printQueryOpt *savePsetInfo(const printQueryOpt *popt);
+
+extern void restorePsetInfo(printQueryOpt *popt, printQueryOpt *save);
+
+extern void connection_warnings(bool in_startup);
+
+extern void SyncVariables(void);
+
+extern void UnsyncVariables(void);
+
+#endif /* COMMAND_H */