2000-01-19 00:30:24 +01:00
|
|
|
/*
|
|
|
|
* psql - the PostgreSQL interactive terminal
|
|
|
|
*
|
2003-08-05 01:59:41 +02:00
|
|
|
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
|
2000-01-19 00:30:24 +01:00
|
|
|
*
|
2004-02-19 20:40:09 +01:00
|
|
|
* $PostgreSQL: pgsql/src/bin/psql/command.h,v 1.19 2004/02/19 19:40:09 tgl Exp $
|
2000-01-19 00:30:24 +01:00
|
|
|
*/
|
1999-11-04 22:56:02 +01:00
|
|
|
#ifndef COMMAND_H
|
|
|
|
#define COMMAND_H
|
|
|
|
|
|
|
|
#include "settings.h"
|
|
|
|
#include "print.h"
|
2004-02-19 20:40:09 +01:00
|
|
|
#include "psqlscan.h"
|
1999-11-04 22:56:02 +01:00
|
|
|
|
|
|
|
|
1999-11-05 00:14:30 +01:00
|
|
|
typedef enum _backslashResult
|
|
|
|
{
|
2001-10-28 07:26:15 +01:00
|
|
|
CMD_UNKNOWN = 0, /* not done parsing yet (internal only) */
|
|
|
|
CMD_SEND, /* query complete; send off */
|
|
|
|
CMD_SKIP_LINE, /* keep building query */
|
|
|
|
CMD_TERMINATE, /* quit program */
|
|
|
|
CMD_NEWEDIT, /* query buffer was changed (e.g., via \e) */
|
|
|
|
CMD_ERROR /* the execution of the backslash command
|
1999-11-05 00:14:30 +01:00
|
|
|
* resulted in an error */
|
2000-04-12 19:17:23 +02:00
|
|
|
} backslashResult;
|
1999-11-05 00:14:30 +01:00
|
|
|
|
|
|
|
|
2004-02-19 20:40:09 +01:00
|
|
|
extern backslashResult HandleSlashCmds(PsqlScanState scan_state,
|
|
|
|
PQExpBuffer query_buf);
|
1999-11-05 00:14:30 +01:00
|
|
|
|
2003-06-28 02:12:40 +02:00
|
|
|
extern int process_file(char *filename);
|
1999-11-05 00:14:30 +01:00
|
|
|
|
2003-06-28 02:12:40 +02:00
|
|
|
extern bool do_pset(const char *param,
|
1999-11-05 00:14:30 +01:00
|
|
|
const char *value,
|
2000-04-12 19:17:23 +02:00
|
|
|
printQueryOpt *popt,
|
1999-11-05 00:14:30 +01:00
|
|
|
bool quiet);
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2003-06-28 02:12:40 +02:00
|
|
|
extern void SyncVariables(void);
|
|
|
|
|
|
|
|
extern void UnsyncVariables(void);
|
|
|
|
|
2003-07-28 02:14:43 +02:00
|
|
|
extern void SyncVerbosityVariable(void);
|
2003-06-28 02:12:40 +02:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* COMMAND_H */
|