PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
psqlscan.h File Reference
#include "pqexpbuffer.h"
Include dependency graph for psqlscan.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PsqlScanCallbacks
 

Typedefs

typedef struct PsqlScanStateDataPsqlScanState
 
typedef enum _promptStatus promptStatus_t
 
typedef struct PsqlScanCallbacks PsqlScanCallbacks
 

Enumerations

enum  PsqlScanResult { PSCAN_SEMICOLON, PSCAN_BACKSLASH, PSCAN_INCOMPLETE, PSCAN_EOL }
 
enum  _promptStatus {
  PROMPT_READY, PROMPT_CONTINUE, PROMPT_COMMENT, PROMPT_SINGLEQUOTE,
  PROMPT_DOUBLEQUOTE, PROMPT_DOLLARQUOTE, PROMPT_PAREN, PROMPT_COPY
}
 

Functions

PsqlScanState psql_scan_create (const PsqlScanCallbacks *callbacks)
 
void psql_scan_destroy (PsqlScanState state)
 
void psql_scan_setup (PsqlScanState state, const char *line, int line_len, int encoding, bool std_strings)
 
void psql_scan_finish (PsqlScanState state)
 
PsqlScanResult psql_scan (PsqlScanState state, PQExpBuffer query_buf, promptStatus_t *prompt)
 
void psql_scan_reset (PsqlScanState state)
 
void psql_scan_reselect_sql_lexer (PsqlScanState state)
 
bool psql_scan_in_quote (PsqlScanState state)
 

Typedef Documentation

Definition at line 27 of file psqlscan.h.

Enumeration Type Documentation

Enumerator
PROMPT_READY 
PROMPT_CONTINUE 
PROMPT_COMMENT 
PROMPT_SINGLEQUOTE 
PROMPT_DOUBLEQUOTE 
PROMPT_DOLLARQUOTE 
PROMPT_PAREN 
PROMPT_COPY 

Definition at line 39 of file psqlscan.h.

Enumerator
PSCAN_SEMICOLON 
PSCAN_BACKSLASH 
PSCAN_INCOMPLETE 
PSCAN_EOL 

Definition at line 30 of file psqlscan.h.

31 {
32  PSCAN_SEMICOLON, /* found command-ending semicolon */
33  PSCAN_BACKSLASH, /* found backslash command */
34  PSCAN_INCOMPLETE, /* end of line, SQL statement incomplete */
35  PSCAN_EOL /* end of line, SQL possibly complete */
PsqlScanResult
Definition: psqlscan.h:30

Function Documentation

PsqlScanResult psql_scan ( PsqlScanState  state,
PQExpBuffer  query_buf,
promptStatus_t prompt 
)

Referenced by MainLoop(), and ParseScript().

PsqlScanState psql_scan_create ( const PsqlScanCallbacks callbacks)

Referenced by main(), MainLoop(), and ParseScript().

void psql_scan_destroy ( PsqlScanState  state)

Referenced by main(), MainLoop(), and ParseScript().

void psql_scan_finish ( PsqlScanState  state)

Referenced by MainLoop(), and ParseScript().

bool psql_scan_in_quote ( PsqlScanState  state)

Referenced by MainLoop().

void psql_scan_reselect_sql_lexer ( PsqlScanState  state)
void psql_scan_reset ( PsqlScanState  state)

Referenced by exec_command(), and MainLoop().

void psql_scan_setup ( PsqlScanState  state,
const char *  line,
int  line_len,
int  encoding,
bool  std_strings 
)

Referenced by main(), MainLoop(), and ParseScript().