/* Code generated by cmd/cgo; DO NOT EDIT. */

/* package github.com/SimonWaldherr/tinySQL/odbc */


#line 1 "cgo-builtin-export-prolog"

#include <stddef.h>

#ifndef GO_CGO_EXPORT_PROLOGUE_H
#define GO_CGO_EXPORT_PROLOGUE_H

#ifndef GO_CGO_GOSTRING_TYPEDEF
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
extern size_t _GoStringLen(_GoString_ s);
extern const char *_GoStringPtr(_GoString_ s);
#endif

#endif

/* Start of preamble from import "C" comments.  */


#line 19 "odbc.go"

#include <stdlib.h>
#include <string.h>

// ODBC types and constants
typedef void* SQLHENV;
typedef void* SQLHDBC;
typedef void* SQLHSTMT;
typedef short SQLSMALLINT;
typedef unsigned short SQLUSMALLINT;
typedef int SQLINTEGER;
typedef unsigned char SQLUCHAR;
typedef long SQLLEN;
typedef unsigned long SQLULEN;
typedef void* SQLPOINTER;
typedef SQLSMALLINT SQLRETURN;

#define SQL_SUCCESS 0
#define SQL_SUCCESS_WITH_INFO 1
#define SQL_ERROR -1
#define SQL_INVALID_HANDLE -2
#define SQL_NO_DATA 100

#define SQL_HANDLE_ENV 1
#define SQL_HANDLE_DBC 2
#define SQL_HANDLE_STMT 3

#define SQL_ATTR_ODBC_VERSION 200
#define SQL_OV_ODBC3 3

#define SQL_NULL_DATA -1
#define SQL_NTS -3

#define SQL_COMMIT 0
#define SQL_ROLLBACK 1

#define SQL_DRIVER_NOPROMPT 0
#define SQL_DRIVER_COMPLETE 1
#define SQL_DRIVER_PROMPT 2
#define SQL_DRIVER_COMPLETE_REQUIRED 3

// SQL data types
#define SQL_CHAR 1
#define SQL_VARCHAR 12
#define SQL_LONGVARCHAR -1
#define SQL_WCHAR -8
#define SQL_WVARCHAR -9
#define SQL_WLONGVARCHAR -10
#define SQL_C_CHAR 1
#define SQL_C_WCHAR -8

// Statement attributes
#define SQL_ATTR_ROW_ARRAY_SIZE 27
#define SQL_ATTR_ROWS_FETCHED_PTR 26

// Connection attributes
#define SQL_ATTR_AUTOCOMMIT 102
#define SQL_AUTOCOMMIT_ON 1
#define SQL_AUTOCOMMIT_OFF 0

// Info types for SQLGetInfo
#define SQL_DRIVER_NAME 6
#define SQL_DRIVER_VER 7
#define SQL_DBMS_NAME 17
#define SQL_DBMS_VER 18
#define SQL_MAX_COLUMN_NAME_LEN 30
#define SQL_MAX_TABLE_NAME_LEN 35
#define SQL_MAX_COLUMNS_IN_SELECT 100
#define SQL_MAX_IDENTIFIER_LEN 10014
#define SQL_DATABASE_NAME 16
#define SQL_DATA_SOURCE_NAME 2
#define SQL_CATALOG_NAME_SEPARATOR 41
#define SQL_CATALOG_TERM 42
#define SQL_SCHEMA_TERM 39
#define SQL_TABLE_TERM 45
#define SQL_ACCESSIBLE_TABLES 19
#define SQL_GETDATA_EXTENSIONS 81

// Nullable info
#define SQL_NO_NULLS 0
#define SQL_NULLABLE 1
#define SQL_NULLABLE_UNKNOWN 2

#line 1 "cgo-generated-wrapper"


/* End of preamble from import "C" comments.  */


/* Start of boilerplate cgo prologue.  */
#line 1 "cgo-gcc-export-header-prolog"

#ifndef GO_CGO_PROLOGUE_H
#define GO_CGO_PROLOGUE_H

typedef signed char GoInt8;
typedef unsigned char GoUint8;
typedef short GoInt16;
typedef unsigned short GoUint16;
typedef int GoInt32;
typedef unsigned int GoUint32;
typedef long long GoInt64;
typedef unsigned long long GoUint64;
typedef GoInt64 GoInt;
typedef GoUint64 GoUint;
typedef size_t GoUintptr;
typedef float GoFloat32;
typedef double GoFloat64;
#ifdef _MSC_VER
#if !defined(__cplusplus) || _MSVC_LANG <= 201402L
#include <complex.h>
typedef _Fcomplex GoComplex64;
typedef _Dcomplex GoComplex128;
#else
#include <complex>
typedef std::complex<float> GoComplex64;
typedef std::complex<double> GoComplex128;
#endif
#else
typedef float _Complex GoComplex64;
typedef double _Complex GoComplex128;
#endif

/*
  static assertion to make sure the file is being used on architecture
  at least with matching size of GoInt.
*/
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];

#ifndef GO_CGO_GOSTRING_TYPEDEF
typedef _GoString_ GoString;
#endif
typedef void *GoMap;
typedef void *GoChan;
typedef struct { void *t; void *v; } GoInterface;
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;

#endif

/* End of boilerplate cgo prologue.  */

#ifdef __cplusplus
extern "C" {
#endif

extern SQLRETURN SQLAllocHandle(SQLSMALLINT handleType, SQLPOINTER inputHandle, SQLPOINTER* outputHandlePtr);
extern SQLRETURN SQLFreeHandle(SQLSMALLINT handleType, SQLPOINTER handle);
extern SQLRETURN SQLSetEnvAttr(SQLHENV environmentHandle, SQLINTEGER attribute, SQLPOINTER valuePtr, SQLINTEGER stringLength);
extern SQLRETURN SQLConnect(SQLHDBC connectionHandle, SQLUCHAR* serverName, SQLSMALLINT nameLength1, SQLUCHAR* userName, SQLSMALLINT nameLength2, SQLUCHAR* authentication, SQLSMALLINT nameLength3);
extern SQLRETURN SQLDriverConnect(SQLHDBC connectionHandle, SQLPOINTER windowHandle, SQLUCHAR* inConnectionString, SQLSMALLINT stringLength1, SQLUCHAR* outConnectionString, SQLSMALLINT bufferLength, SQLSMALLINT* stringLength2Ptr, SQLUSMALLINT driverCompletion);
extern SQLRETURN SQLDisconnect(SQLHDBC connectionHandle);
extern SQLRETURN SQLExecDirect(SQLHSTMT statementHandle, SQLUCHAR* statementText, SQLINTEGER textLength);
extern SQLRETURN SQLFetch(SQLHSTMT statementHandle);
extern SQLRETURN SQLGetData(SQLHSTMT statementHandle, SQLUSMALLINT columnNumber, SQLSMALLINT targetType, SQLPOINTER targetValuePtr, SQLLEN bufferLength, SQLLEN* strLenOrIndPtr);
extern SQLRETURN SQLNumResultCols(SQLHSTMT statementHandle, SQLSMALLINT* columnCountPtr);
extern SQLRETURN SQLRowCount(SQLHSTMT statementHandle, SQLLEN* rowCountPtr);
extern SQLRETURN SQLDescribeCol(SQLHSTMT statementHandle, SQLUSMALLINT columnNumber, SQLUCHAR* columnName, SQLSMALLINT bufferLength, SQLSMALLINT* nameLengthPtr, SQLSMALLINT* dataTypePtr, SQLULEN* columnSizePtr, SQLSMALLINT* decimalDigitsPtr, SQLSMALLINT* nullablePtr);
extern SQLRETURN SQLEndTran(SQLSMALLINT handleType, SQLPOINTER handle, SQLSMALLINT completionType);
extern SQLRETURN SQLPrepare(SQLHSTMT statementHandle, SQLUCHAR* statementText, SQLINTEGER textLength);
extern SQLRETURN SQLExecute(SQLHSTMT statementHandle);
extern SQLRETURN SQLGetInfo(SQLHDBC connectionHandle, SQLUSMALLINT infoType, SQLPOINTER infoValuePtr, SQLSMALLINT bufferLength, SQLSMALLINT* stringLengthPtr);
extern SQLRETURN SQLTables(SQLHSTMT statementHandle, SQLUCHAR* catalogName, SQLSMALLINT nameLength1, SQLUCHAR* schemaName, SQLSMALLINT nameLength2, SQLUCHAR* tableName, SQLSMALLINT nameLength3, SQLUCHAR* tableType, SQLSMALLINT nameLength4);
extern SQLRETURN SQLColumns(SQLHSTMT statementHandle, SQLUCHAR* catalogName, SQLSMALLINT nameLength1, SQLUCHAR* schemaName, SQLSMALLINT nameLength2, SQLUCHAR* tableName, SQLSMALLINT nameLength3, SQLUCHAR* columnName, SQLSMALLINT nameLength4);
extern SQLRETURN SQLSetConnectAttr(SQLHDBC connectionHandle, SQLINTEGER attribute, SQLPOINTER valuePtr, SQLINTEGER stringLength);
extern SQLRETURN SQLSetStmtAttr(SQLHSTMT statementHandle, SQLINTEGER attribute, SQLPOINTER valuePtr, SQLINTEGER stringLength);
extern SQLRETURN SQLMoreResults(SQLHSTMT statementHandle);
extern SQLRETURN SQLGetDiagRec(SQLSMALLINT handleType, SQLPOINTER handle, SQLSMALLINT recNumber, SQLUCHAR* sqlState, SQLINTEGER* nativeErrorPtr, SQLUCHAR* messageText, SQLSMALLINT bufferLength, SQLSMALLINT* textLengthPtr);

#ifdef __cplusplus
}
#endif
