postgresql/contrib/pgbench/pgbench.h
Tom Lane e9dd03c03a Minor code cleanups in pgbench expression support.
Get rid of unnecessary expr_yylex declaration (we haven't supported
flex 2.5.4 in a long time, and even if we still did, the declaration in
pgbench.h makes this one unnecessary and inappropriate).  Fix copyright
dates, improve some layout choices, etc.
2015-03-29 13:06:59 -04:00

56 lines
1.0 KiB
C

/*-------------------------------------------------------------------------
*
* pgbench.h
*
* Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*-------------------------------------------------------------------------
*/
#ifndef PGBENCH_H
#define PGBENCH_H
typedef enum PgBenchExprType
{
ENODE_INTEGER_CONSTANT,
ENODE_VARIABLE,
ENODE_OPERATOR
} PgBenchExprType;
typedef struct PgBenchExpr PgBenchExpr;
struct PgBenchExpr
{
PgBenchExprType etype;
union
{
struct
{
int64 ival;
} integer_constant;
struct
{
char *varname;
} variable;
struct
{
char operator;
PgBenchExpr *lexpr;
PgBenchExpr *rexpr;
} operator;
} u;
};
extern PgBenchExpr *expr_parse_result;
extern int expr_yyparse(void);
extern int expr_yylex(void);
extern void expr_yyerror(const char *str);
extern void expr_scanner_init(const char *str);
extern void expr_scanner_finish(void);
extern int64 strtoint64(const char *str);
#endif /* PGBENCH_H */