Header And Logo

PostgreSQL
| The world's most advanced open source database.

Typedefs | Enumerations | Functions

psqlscan.h File Reference

#include "pqexpbuffer.h"
#include "prompt.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.

Typedefs

typedef struct PsqlScanStateData * PsqlScanState

Enumerations

enum  PsqlScanResult { PSCAN_SEMICOLON, PSCAN_BACKSLASH, PSCAN_INCOMPLETE, PSCAN_EOL }
enum  slash_option_type {
  OT_NORMAL, OT_SQLID, OT_SQLIDHACK, OT_FILEPIPE,
  OT_WHOLE_LINE, OT_NO_EVAL
}

Functions

PsqlScanState psql_scan_create (void)
void psql_scan_destroy (PsqlScanState state)
void psql_scan_setup (PsqlScanState state, const char *line, int line_len)
void psql_scan_finish (PsqlScanState state)
PsqlScanResult psql_scan (PsqlScanState state, PQExpBuffer query_buf, promptStatus_t *prompt)
void psql_scan_reset (PsqlScanState state)
bool psql_scan_in_quote (PsqlScanState state)
char * psql_scan_slash_command (PsqlScanState state)
char * psql_scan_slash_option (PsqlScanState state, enum slash_option_type type, char *quote, bool semicolon)
void psql_scan_slash_command_end (PsqlScanState state)

Typedef Documentation

typedef struct PsqlScanStateData* PsqlScanState

Definition at line 17 of file psqlscan.h.


Enumeration Type Documentation

Enumerator:
PSCAN_SEMICOLON 
PSCAN_BACKSLASH 
PSCAN_INCOMPLETE 
PSCAN_EOL 

Definition at line 20 of file psqlscan.h.

{
    PSCAN_SEMICOLON,            /* found command-ending semicolon */
    PSCAN_BACKSLASH,            /* found backslash command */
    PSCAN_INCOMPLETE,           /* end of line, SQL statement incomplete */
    PSCAN_EOL                   /* end of line, SQL possibly complete */
} PsqlScanResult;

Enumerator:
OT_NORMAL 
OT_SQLID 
OT_SQLIDHACK 
OT_FILEPIPE 
OT_WHOLE_LINE 
OT_NO_EVAL 

Definition at line 29 of file psqlscan.h.

{
    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 */
    OT_NO_EVAL                  /* no expansion of backticks or variables */
};


Function Documentation

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

Referenced by MainLoop().

PsqlScanState psql_scan_create ( void   ) 

Referenced by main(), and MainLoop().

void psql_scan_destroy ( PsqlScanState  state  ) 

Referenced by main(), and MainLoop().

void psql_scan_finish ( PsqlScanState  state  ) 

Referenced by MainLoop().

bool psql_scan_in_quote ( PsqlScanState  state  ) 

Referenced by MainLoop().

void psql_scan_reset ( PsqlScanState  state  ) 

Referenced by exec_command(), and MainLoop().

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

Referenced by main(), and MainLoop().

char* psql_scan_slash_command ( PsqlScanState  state  ) 

Referenced by HandleSlashCmds().

void psql_scan_slash_command_end ( PsqlScanState  state  ) 

Referenced by HandleSlashCmds().

char* psql_scan_slash_option ( PsqlScanState  state,
enum slash_option_type  type,
char *  quote,
bool  semicolon 
)