#ifndef PG_QUERY_H
#define PG_QUERY_H
#include <stdint.h>
typedef struct {
char* message; char* funcname; char* filename; int lineno; int cursorpos; char* context; } PgQueryError;
typedef struct {
unsigned int len;
char* data;
} PgQueryProtobuf;
typedef struct {
PgQueryProtobuf pbuf;
char* stderr_buffer;
PgQueryError* error;
} PgQueryScanResult;
typedef struct {
char* parse_tree;
char* stderr_buffer;
PgQueryError* error;
} PgQueryParseResult;
typedef struct {
PgQueryProtobuf parse_tree;
char* stderr_buffer;
PgQueryError* error;
} PgQueryProtobufParseResult;
typedef struct {
int stmt_location;
int stmt_len;
} PgQuerySplitStmt;
typedef struct {
PgQuerySplitStmt **stmts;
int n_stmts;
char* stderr_buffer;
PgQueryError* error;
} PgQuerySplitResult;
typedef struct {
char* query;
PgQueryError* error;
} PgQueryDeparseResult;
typedef struct {
char* plpgsql_funcs;
PgQueryError* error;
} PgQueryPlpgsqlParseResult;
typedef struct {
uint64_t fingerprint;
char* fingerprint_str;
char* stderr_buffer;
PgQueryError* error;
} PgQueryFingerprintResult;
typedef struct {
char* normalized_query;
PgQueryError* error;
} PgQueryNormalizeResult;
#ifdef __cplusplus
extern "C" {
#endif
PgQueryNormalizeResult pg_query_normalize(const char* input);
PgQueryScanResult pg_query_scan(const char* input);
PgQueryParseResult pg_query_parse(const char* input);
PgQueryProtobufParseResult pg_query_parse_protobuf(const char* input);
PgQueryPlpgsqlParseResult pg_query_parse_plpgsql(const char* input);
PgQueryFingerprintResult pg_query_fingerprint(const char* input);
PgQuerySplitResult pg_query_split_with_scanner(const char *input);
PgQuerySplitResult pg_query_split_with_parser(const char *input);
PgQueryDeparseResult pg_query_deparse_protobuf(PgQueryProtobuf parse_tree);
void pg_query_free_normalize_result(PgQueryNormalizeResult result);
void pg_query_free_scan_result(PgQueryScanResult result);
void pg_query_free_parse_result(PgQueryParseResult result);
void pg_query_free_split_result(PgQuerySplitResult result);
void pg_query_free_deparse_result(PgQueryDeparseResult result);
void pg_query_free_protobuf_parse_result(PgQueryProtobufParseResult result);
void pg_query_free_plpgsql_parse_result(PgQueryPlpgsqlParseResult result);
void pg_query_free_fingerprint_result(PgQueryFingerprintResult result);
void pg_query_exit(void);
#define PG_VERSION "13.3"
#define PG_MAJORVERSION "13"
#define PG_VERSION_NUM 130003
void pg_query_init(void);
#ifdef __cplusplus
}
#endif
#endif