/* Abstract type for lexer's internal state */ typedefstruct PsqlScanStateData *PsqlScanState;
/* Termination states for psql_scan() */ typedefenum
{
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;
/* Prompt type returned by psql_scan() */ typedefenum _promptStatus
{
PROMPT_READY,
PROMPT_CONTINUE,
PROMPT_COMMENT,
PROMPT_SINGLEQUOTE,
PROMPT_DOUBLEQUOTE,
PROMPT_DOLLARQUOTE,
PROMPT_PAREN,
PROMPT_COPY,
} promptStatus_t;
/* Quoting request types for get_variable() callback */ typedefenum
{
PQUOTE_PLAIN, /* just return the actual value */
PQUOTE_SQL_LITERAL, /* add quotes to make a valid SQL literal */
PQUOTE_SQL_IDENT, /* quote if needed to make a SQL identifier */
PQUOTE_SHELL_ARG, /* quote if needed to be safe in a shell cmd */
} PsqlScanQuoteType;
/* Callback functions to be used by the lexer */ typedefstruct PsqlScanCallbacks
{ /* Fetch value of a variable, as a free'able string; NULL if unknown */ /* This pointer can be NULL if no variable substitution is wanted */ char *(*get_variable) (constchar *varname, PsqlScanQuoteType quote, void *passthrough);
} PsqlScanCallbacks;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.