NCBI C++ ToolKit
Classes | Macros | Typedefs | Functions | Variables
common.h File Reference
#include <config.h>
#include <stdarg.h>
#include <stdio.h>
#include <sql.h>
#include <sqlext.h>
#include <sqlucode.h>
#include <freetds/sysdep_private.h>
#include <freetds/tds.h>
+ Include dependency graph for common.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  odbc_buf
 

Macros

#define SQLULEN   SQLUINTEGER
 
#define SQLLEN   SQLINTEGER
 
#define FREETDS_SRCDIR   FREETDS_TOPDIR "/src/odbc/unittests"
 
#define ODBC_CHECK_ROWS(n)   odbc_check_rows(n, __LINE__, __FILE__)
 
#define ODBC_CHECK_COLS(n)   odbc_check_cols(n, __LINE__, __FILE__)
 
#define odbc_reset_statement()   odbc_reset_statement_proc(&odbc_stmt, __FILE__, __LINE__)
 
#define ODBC_REPORT_ERROR(msg)   odbc_report_error(msg, __LINE__, __FILE__)
 
#define CHKR(func, params, res)    odbc_check_res(__FILE__, __LINE__, (func params), 0, 0, #func, res)
 
#define CHKR2(func, params, type, handle, res)    odbc_check_res(__FILE__, __LINE__, (func params), type, handle, #func, res)
 
#define CHKAllocConnect(a, res)    CHKR2(SQLAllocConnect, (odbc_env,a), SQL_HANDLE_ENV, odbc_env, res)
 
#define CHKAllocEnv(a, res)    CHKR2(SQLAllocEnv, (a), 0, 0, res)
 
#define CHKAllocStmt(a, res)    CHKR2(SQLAllocStmt, (odbc_conn,a), SQL_HANDLE_DBC, odbc_conn, res)
 
#define CHKAllocHandle(a, b, c, res)    CHKR2(SQLAllocHandle, (a,b,c), odbc_alloc_handle_err_type(a), b, res)
 
#define CHKBindCol(a, b, c, d, e, res)    CHKR2(SQLBindCol, (odbc_stmt,a,b,c,d,e), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKBindParameter(a, b, c, d, e, f, g, h, i, res)    CHKR2(SQLBindParameter, (odbc_stmt,a,b,c,d,e,f,g,h,i), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKCancel(res)    CHKR2(SQLCancel, (odbc_stmt), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKCloseCursor(res)    CHKR2(SQLCloseCursor, (odbc_stmt), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKColAttribute(a, b, c, d, e, f, res)    CHKR2(SQLColAttribute, (odbc_stmt,a,b,c,d,e,f), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKDescribeCol(a, b, c, d, e, f, g, h, res)    CHKR2(SQLDescribeCol, (odbc_stmt,a,b,c,d,e,f,g,h), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKConnect(a, b, c, d, e, f, res)    CHKR2(SQLConnect, (odbc_conn,a,b,c,d,e,f), SQL_HANDLE_DBC, odbc_conn, res)
 
#define CHKDriverConnect(a, b, c, d, e, f, g, res)    CHKR2(SQLDriverConnect, (odbc_conn,a,b,c,d,e,f,g), SQL_HANDLE_DBC, odbc_conn, res)
 
#define CHKEndTran(a, b, c, res)    CHKR2(SQLEndTran, (a,b,c), a, b, res)
 
#define CHKExecDirect(a, b, res)    CHKR2(SQLExecDirect, (odbc_stmt,a,b), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKExecute(res)    CHKR2(SQLExecute, (odbc_stmt), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKExtendedFetch(a, b, c, d, res)    CHKR2(SQLExtendedFetch, (odbc_stmt,a,b,c,d), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKFetch(res)    CHKR2(SQLFetch, (odbc_stmt), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKFetchScroll(a, b, res)    CHKR2(SQLFetchScroll, (odbc_stmt,a,b), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKFreeHandle(a, b, res)    CHKR2(SQLFreeHandle, (a,b), a, b, res)
 
#define CHKFreeStmt(a, res)    CHKR2(SQLFreeStmt, (odbc_stmt,a), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKGetConnectAttr(a, b, c, d, res)    CHKR2(SQLGetConnectAttr, (odbc_conn,a,b,c,d), SQL_HANDLE_DBC, odbc_conn, res)
 
#define CHKGetDiagRec(a, b, c, d, e, f, g, h, res)    CHKR2(SQLGetDiagRec, (a,b,c,d,e,f,g,h), a, b, res)
 
#define CHKGetDiagField(a, b, c, d, e, f, g, res)    CHKR2(SQLGetDiagField, (a,b,c,d,e,f,g), a, b, res)
 
#define CHKGetStmtAttr(a, b, c, d, res)    CHKR2(SQLGetStmtAttr, (odbc_stmt,a,b,c,d), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKGetTypeInfo(a, res)    CHKR2(SQLGetTypeInfo, (odbc_stmt,a), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKGetData(a, b, c, d, e, res)    CHKR2(SQLGetData, (odbc_stmt,a,b,c,d,e), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKMoreResults(res)    CHKR2(SQLMoreResults, (odbc_stmt), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKNumResultCols(a, res)    CHKR2(SQLNumResultCols, (odbc_stmt,a), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKParamData(a, res)    CHKR2(SQLParamData, (odbc_stmt,a), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKParamOptions(a, b, res)    CHKR2(SQLParamOptions, (odbc_stmt,a,b), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKPrepare(a, b, res)    CHKR2(SQLPrepare, (odbc_stmt,a,b), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKPutData(a, b, res)    CHKR2(SQLPutData, (odbc_stmt,a,b), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKRowCount(a, res)    CHKR2(SQLRowCount, (odbc_stmt,a), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKSetConnectAttr(a, b, c, res)    CHKR2(SQLSetConnectAttr, (odbc_conn,a,b,c), SQL_HANDLE_DBC, odbc_conn, res)
 
#define CHKSetCursorName(a, b, res)    CHKR2(SQLSetCursorName, (odbc_stmt,a,b), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKSetPos(a, b, c, res)    CHKR2(SQLSetPos, (odbc_stmt,a,b,c), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKSetStmtAttr(a, b, c, res)    CHKR2(SQLSetStmtAttr, (odbc_stmt,a,b,c), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKSetStmtOption(a, b, res)    CHKR2(SQLSetStmtOption, (odbc_stmt,a,b), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKTables(a, b, c, d, e, f, g, h, res)    CHKR2(SQLTables, (odbc_stmt,a,b,c,d,e,f,g,h), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKProcedureColumns(a, b, c, d, e, f, g, h, res)    CHKR2(SQLProcedureColumns, (odbc_stmt,a,b,c,d,e,f,g,h), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKColumns(a, b, c, d, e, f, g, h, res)    CHKR2(SQLColumns, (odbc_stmt,a,b,c,d,e,f,g,h), SQL_HANDLE_STMT, odbc_stmt, res)
 
#define CHKGetDescRec(a, b, c, d, e, f, g, h, i, j, res)    CHKR2(SQLGetDescRec, (Descriptor,a,b,c,d,e,f,g,h,i,j), SQL_HANDLE_STMT, Descriptor, res)
 
#define odbc_command(cmd)   odbc_command_proc(odbc_stmt, cmd, __FILE__, __LINE__, "SNo")
 
#define odbc_command2(cmd, res)   odbc_command_proc(odbc_stmt, cmd, __FILE__, __LINE__, res)
 
#define ODBC_VECTOR_SIZE(x)   (sizeof(x)/sizeof(x[0]))
 
#define int2ptr(i)   ((void*)(((char*)0)+((tds_sysdep_intptr_type)(i))))
 
#define ptr2int(p)   ((int)(((char*)(p))-((char*)0)))
 
#define setenv   odbc_setenv
 
#define ODBC_GET(s)   odbc_buf_get(&odbc_buf, s)
 
#define ODBC_FREE()   odbc_buf_free(&odbc_buf)
 
#define T(s)   ((SQLCHAR*)(s))
 
#define C(s)   ((char*)(s))
 

Typedefs

typedef struct odbc_buf ODBC_BUF
 

Functions

int odbc_read_login_info (void)
 
void odbc_report_error (const char *msg, int line, const char *file)
 
void odbc_read_error (void)
 
void odbc_check_cols (int n, int line, const char *file)
 
void odbc_check_rows (int n, int line, const char *file)
 
void odbc_reset_statement_proc (SQLHSTMT *stmt, const char *file, int line)
 
void odbc_check_cursor (void)
 
void odbc_check_no_row (const char *query)
 
void odbc_test_skipped (void)
 
SQLRETURN odbc_check_res (const char *file, int line, SQLRETURN rc, SQLSMALLINT handle_type, SQLHANDLE handle, const char *func, const char *res)
 
SQLSMALLINT odbc_alloc_handle_err_type (SQLSMALLINT type)
 
int odbc_connect (void)
 
int odbc_disconnect (void)
 
SQLRETURN odbc_command_proc (HSTMT stmt, const char *command, const char *file, int line, const char *res)
 
SQLRETURN odbc_command_with_result (HSTMT stmt, const char *command)
 
int odbc_db_is_microsoft (void)
 
const char * odbc_db_version (void)
 
unsigned int odbc_db_version_int (void)
 
int odbc_driver_is_freetds (void)
 
int odbc_tds_version (void)
 
void odbc_setenv (const char *name, const char *value, int overwrite)
 
void odbc_mark_sockets_opened (void)
 
TDS_SYS_SOCKET odbc_find_last_socket (void)
 
void odbc_c2string (char *out, SQLSMALLINT out_c_type, const void *in, size_t in_len)
 Converts an ODBC result into a string. More...
 
SQLINTEGER odbc_to_sqlwchar (SQLWCHAR *dst, const char *src, SQLINTEGER n)
 
SQLINTEGER odbc_from_sqlwchar (char *dst, const SQLWCHAR *src, SQLINTEGER n)
 
void * odbc_buf_get (ODBC_BUF **buf, size_t s)
 
void odbc_buf_free (ODBC_BUF **buf)
 
SQLWCHARodbc_get_sqlwchar (ODBC_BUF **buf, const char *s)
 
char * odbc_get_sqlchar (ODBC_BUF **buf, SQLWCHAR *s)
 

Variables

HENV odbc_env
 
HDBC odbc_conn
 
HSTMT odbc_stmt
 
int odbc_use_version3
 
void(* odbc_set_conn_attr )(void)
 
char odbc_err [512]
 
char odbc_sqlstate [6]
 
char odbc_user [512]
 
char odbc_server [512]
 
char odbc_password [512]
 
char odbc_database [512]
 
char odbc_driver [1024]
 
ODBC_BUFodbc_buf
 

Macro Definition Documentation

◆ C

#define C (   s)    ((char*)(s))

Definition at line 231 of file common.h.

◆ CHKAllocConnect

#define CHKAllocConnect (   a,
  res 
)     CHKR2(SQLAllocConnect, (odbc_env,a), SQL_HANDLE_ENV, odbc_env, res)

Definition at line 86 of file common.h.

◆ CHKAllocEnv

#define CHKAllocEnv (   a,
  res 
)     CHKR2(SQLAllocEnv, (a), 0, 0, res)

Definition at line 88 of file common.h.

◆ CHKAllocHandle

#define CHKAllocHandle (   a,
  b,
  c,
  res 
)     CHKR2(SQLAllocHandle, (a,b,c), odbc_alloc_handle_err_type(a), b, res)

Definition at line 92 of file common.h.

◆ CHKAllocStmt

#define CHKAllocStmt (   a,
  res 
)     CHKR2(SQLAllocStmt, (odbc_conn,a), SQL_HANDLE_DBC, odbc_conn, res)

Definition at line 90 of file common.h.

◆ CHKBindCol

#define CHKBindCol (   a,
  b,
  c,
  d,
  e,
  res 
)     CHKR2(SQLBindCol, (odbc_stmt,a,b,c,d,e), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 94 of file common.h.

◆ CHKBindParameter

#define CHKBindParameter (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  res 
)     CHKR2(SQLBindParameter, (odbc_stmt,a,b,c,d,e,f,g,h,i), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 96 of file common.h.

◆ CHKCancel

#define CHKCancel (   res)     CHKR2(SQLCancel, (odbc_stmt), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 98 of file common.h.

◆ CHKCloseCursor

#define CHKCloseCursor (   res)     CHKR2(SQLCloseCursor, (odbc_stmt), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 100 of file common.h.

◆ CHKColAttribute

#define CHKColAttribute (   a,
  b,
  c,
  d,
  e,
  f,
  res 
)     CHKR2(SQLColAttribute, (odbc_stmt,a,b,c,d,e,f), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 102 of file common.h.

◆ CHKColumns

#define CHKColumns (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  res 
)     CHKR2(SQLColumns, (odbc_stmt,a,b,c,d,e,f,g,h), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 171 of file common.h.

◆ CHKConnect

#define CHKConnect (   a,
  b,
  c,
  d,
  e,
  f,
  res 
)     CHKR2(SQLConnect, (odbc_conn,a,b,c,d,e,f), SQL_HANDLE_DBC, odbc_conn, res)

Definition at line 106 of file common.h.

◆ CHKDescribeCol

#define CHKDescribeCol (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  res 
)     CHKR2(SQLDescribeCol, (odbc_stmt,a,b,c,d,e,f,g,h), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 104 of file common.h.

◆ CHKDriverConnect

#define CHKDriverConnect (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  res 
)     CHKR2(SQLDriverConnect, (odbc_conn,a,b,c,d,e,f,g), SQL_HANDLE_DBC, odbc_conn, res)

Definition at line 108 of file common.h.

◆ CHKEndTran

#define CHKEndTran (   a,
  b,
  c,
  res 
)     CHKR2(SQLEndTran, (a,b,c), a, b, res)

Definition at line 110 of file common.h.

◆ CHKExecDirect

#define CHKExecDirect (   a,
  b,
  res 
)     CHKR2(SQLExecDirect, (odbc_stmt,a,b), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 112 of file common.h.

◆ CHKExecute

#define CHKExecute (   res)     CHKR2(SQLExecute, (odbc_stmt), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 114 of file common.h.

◆ CHKExtendedFetch

#define CHKExtendedFetch (   a,
  b,
  c,
  d,
  res 
)     CHKR2(SQLExtendedFetch, (odbc_stmt,a,b,c,d), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 116 of file common.h.

◆ CHKFetch

#define CHKFetch (   res)     CHKR2(SQLFetch, (odbc_stmt), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 118 of file common.h.

◆ CHKFetchScroll

#define CHKFetchScroll (   a,
  b,
  res 
)     CHKR2(SQLFetchScroll, (odbc_stmt,a,b), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 120 of file common.h.

◆ CHKFreeHandle

#define CHKFreeHandle (   a,
  b,
  res 
)     CHKR2(SQLFreeHandle, (a,b), a, b, res)

Definition at line 122 of file common.h.

◆ CHKFreeStmt

#define CHKFreeStmt (   a,
  res 
)     CHKR2(SQLFreeStmt, (odbc_stmt,a), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 124 of file common.h.

◆ CHKGetConnectAttr

#define CHKGetConnectAttr (   a,
  b,
  c,
  d,
  res 
)     CHKR2(SQLGetConnectAttr, (odbc_conn,a,b,c,d), SQL_HANDLE_DBC, odbc_conn, res)

Definition at line 126 of file common.h.

◆ CHKGetData

#define CHKGetData (   a,
  b,
  c,
  d,
  e,
  res 
)     CHKR2(SQLGetData, (odbc_stmt,a,b,c,d,e), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 136 of file common.h.

◆ CHKGetDescRec

#define CHKGetDescRec (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  res 
)     CHKR2(SQLGetDescRec, (Descriptor,a,b,c,d,e,f,g,h,i,j), SQL_HANDLE_STMT, Descriptor, res)

Definition at line 173 of file common.h.

◆ CHKGetDiagField

#define CHKGetDiagField (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  res 
)     CHKR2(SQLGetDiagField, (a,b,c,d,e,f,g), a, b, res)

Definition at line 130 of file common.h.

◆ CHKGetDiagRec

#define CHKGetDiagRec (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  res 
)     CHKR2(SQLGetDiagRec, (a,b,c,d,e,f,g,h), a, b, res)

Definition at line 128 of file common.h.

◆ CHKGetStmtAttr

#define CHKGetStmtAttr (   a,
  b,
  c,
  d,
  res 
)     CHKR2(SQLGetStmtAttr, (odbc_stmt,a,b,c,d), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 132 of file common.h.

◆ CHKGetTypeInfo

#define CHKGetTypeInfo (   a,
  res 
)     CHKR2(SQLGetTypeInfo, (odbc_stmt,a), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 134 of file common.h.

◆ CHKMoreResults

#define CHKMoreResults (   res)     CHKR2(SQLMoreResults, (odbc_stmt), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 138 of file common.h.

◆ CHKNumResultCols

#define CHKNumResultCols (   a,
  res 
)     CHKR2(SQLNumResultCols, (odbc_stmt,a), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 140 of file common.h.

◆ CHKParamData

#define CHKParamData (   a,
  res 
)     CHKR2(SQLParamData, (odbc_stmt,a), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 142 of file common.h.

◆ CHKParamOptions

#define CHKParamOptions (   a,
  b,
  res 
)     CHKR2(SQLParamOptions, (odbc_stmt,a,b), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 144 of file common.h.

◆ CHKPrepare

#define CHKPrepare (   a,
  b,
  res 
)     CHKR2(SQLPrepare, (odbc_stmt,a,b), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 146 of file common.h.

◆ CHKProcedureColumns

#define CHKProcedureColumns (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  res 
)     CHKR2(SQLProcedureColumns, (odbc_stmt,a,b,c,d,e,f,g,h), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 169 of file common.h.

◆ CHKPutData

#define CHKPutData (   a,
  b,
  res 
)     CHKR2(SQLPutData, (odbc_stmt,a,b), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 148 of file common.h.

◆ CHKR

#define CHKR (   func,
  params,
  res 
)     odbc_check_res(__FILE__, __LINE__, (func params), 0, 0, #func, res)

Definition at line 79 of file common.h.

◆ CHKR2

#define CHKR2 (   func,
  params,
  type,
  handle,
  res 
)     odbc_check_res(__FILE__, __LINE__, (func params), type, handle, #func, res)

Definition at line 81 of file common.h.

◆ CHKRowCount

#define CHKRowCount (   a,
  res 
)     CHKR2(SQLRowCount, (odbc_stmt,a), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 150 of file common.h.

◆ CHKSetConnectAttr

#define CHKSetConnectAttr (   a,
  b,
  c,
  res 
)     CHKR2(SQLSetConnectAttr, (odbc_conn,a,b,c), SQL_HANDLE_DBC, odbc_conn, res)

Definition at line 152 of file common.h.

◆ CHKSetCursorName

#define CHKSetCursorName (   a,
  b,
  res 
)     CHKR2(SQLSetCursorName, (odbc_stmt,a,b), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 154 of file common.h.

◆ CHKSetPos

#define CHKSetPos (   a,
  b,
  c,
  res 
)     CHKR2(SQLSetPos, (odbc_stmt,a,b,c), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 156 of file common.h.

◆ CHKSetStmtAttr

#define CHKSetStmtAttr (   a,
  b,
  c,
  res 
)     CHKR2(SQLSetStmtAttr, (odbc_stmt,a,b,c), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 158 of file common.h.

◆ CHKSetStmtOption

#define CHKSetStmtOption (   a,
  b,
  res 
)     CHKR2(SQLSetStmtOption, (odbc_stmt,a,b), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 164 of file common.h.

◆ CHKTables

#define CHKTables (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  res 
)     CHKR2(SQLTables, (odbc_stmt,a,b,c,d,e,f,g,h), SQL_HANDLE_STMT, odbc_stmt, res)

Definition at line 167 of file common.h.

◆ FREETDS_SRCDIR

#define FREETDS_SRCDIR   FREETDS_TOPDIR "/src/odbc/unittests"

Definition at line 43 of file common.h.

◆ int2ptr

#define int2ptr (   i)    ((void*)(((char*)0)+((tds_sysdep_intptr_type)(i))))

Definition at line 189 of file common.h.

◆ ODBC_CHECK_COLS

#define ODBC_CHECK_COLS (   n)    odbc_check_cols(n, __LINE__, __FILE__)

Definition at line 69 of file common.h.

◆ ODBC_CHECK_ROWS

#define ODBC_CHECK_ROWS (   n)    odbc_check_rows(n, __LINE__, __FILE__)

Definition at line 68 of file common.h.

◆ odbc_command

#define odbc_command (   cmd)    odbc_command_proc(odbc_stmt, cmd, __FILE__, __LINE__, "SNo")

Definition at line 179 of file common.h.

◆ odbc_command2

#define odbc_command2 (   cmd,
  res 
)    odbc_command_proc(odbc_stmt, cmd, __FILE__, __LINE__, res)

Definition at line 180 of file common.h.

◆ ODBC_FREE

#define ODBC_FREE ( )    odbc_buf_free(&odbc_buf)

Definition at line 218 of file common.h.

◆ ODBC_GET

#define ODBC_GET (   s)    odbc_buf_get(&odbc_buf, s)

Definition at line 217 of file common.h.

◆ ODBC_REPORT_ERROR

#define ODBC_REPORT_ERROR (   msg)    odbc_report_error(msg, __LINE__, __FILE__)

Definition at line 76 of file common.h.

◆ odbc_reset_statement

#define odbc_reset_statement ( )    odbc_reset_statement_proc(&odbc_stmt, __FILE__, __LINE__)

Definition at line 71 of file common.h.

◆ ODBC_VECTOR_SIZE

#define ODBC_VECTOR_SIZE (   x)    (sizeof(x)/sizeof(x[0]))

Definition at line 188 of file common.h.

◆ ptr2int

#define ptr2int (   p)    ((int)(((char*)(p))-((char*)0)))

Definition at line 190 of file common.h.

◆ setenv

#define setenv   odbc_setenv

Definition at line 195 of file common.h.

◆ SQLLEN

#define SQLLEN   SQLINTEGER

Definition at line 38 of file common.h.

◆ SQLULEN

#define SQLULEN   SQLUINTEGER

Definition at line 35 of file common.h.

◆ T

#define T (   s)    ((SQLCHAR*)(s))

Typedef Documentation

◆ ODBC_BUF

typedef struct odbc_buf ODBC_BUF

Function Documentation

◆ odbc_alloc_handle_err_type()

SQLSMALLINT odbc_alloc_handle_err_type ( SQLSMALLINT  type)

Definition at line 609 of file common.c.

◆ odbc_buf_free()

void odbc_buf_free ( ODBC_BUF **  buf)

Definition at line 693 of file common.c.

◆ odbc_buf_get()

void* odbc_buf_get ( ODBC_BUF **  buf,
size_t  s 
)

Definition at line 681 of file common.c.

◆ odbc_c2string()

void odbc_c2string ( char *  out,
SQLSMALLINT  out_c_type,
const void *  in,
size_t  in_len 
)

Converts an ODBC result into a string.

There is no check on destination length, use a buffer big enough.

Definition at line 26 of file c2string.c.

◆ odbc_check_cols()

void odbc_check_cols ( int  n,
int  line,
const char *  file 
)

Definition at line 496 of file common.c.

◆ odbc_check_cursor()

void odbc_check_cursor ( void  )

Definition at line 548 of file common.c.

◆ odbc_check_no_row()

void odbc_check_no_row ( const char *  query)

Definition at line 883 of file common.c.

◆ odbc_check_res()

SQLRETURN odbc_check_res ( const char *  file,
int  line,
SQLRETURN  rc,
SQLSMALLINT  handle_type,
SQLHANDLE  handle,
const char *  func,
const char *  res 
)

Definition at line 573 of file common.c.

◆ odbc_check_rows()

void odbc_check_rows ( int  n,
int  line,
const char *  file 
)

Definition at line 513 of file common.c.

◆ odbc_command_proc()

SQLRETURN odbc_command_proc ( HSTMT  stmt,
const char *  command,
const char *  file,
int  line,
const char *  res 
)

Definition at line 623 of file common.c.

◆ odbc_command_with_result()

SQLRETURN odbc_command_with_result ( HSTMT  stmt,
const char *  command 
)

Definition at line 312 of file common.c.

◆ odbc_connect()

int odbc_connect ( void  )

Definition at line 244 of file common.c.

◆ odbc_db_is_microsoft()

int odbc_db_is_microsoft ( void  )

Definition at line 325 of file common.c.

◆ odbc_db_version()

const char* odbc_db_version ( void  )

Definition at line 468 of file common.c.

◆ odbc_db_version_int()

unsigned int odbc_db_version_int ( void  )

Definition at line 483 of file common.c.

◆ odbc_disconnect()

int odbc_disconnect ( void  )

Definition at line 290 of file common.c.

◆ odbc_driver_is_freetds()

int odbc_driver_is_freetds ( void  )

Definition at line 345 of file common.c.

◆ odbc_find_last_socket()

TDS_SYS_SOCKET odbc_find_last_socket ( void  )

Definition at line 802 of file common.c.

◆ odbc_from_sqlwchar()

SQLINTEGER odbc_from_sqlwchar ( char *  dst,
const SQLWCHAR src,
SQLINTEGER  n 
)

Definition at line 663 of file common.c.

◆ odbc_get_sqlchar()

char* odbc_get_sqlchar ( ODBC_BUF **  buf,
SQLWCHAR s 
)

Definition at line 719 of file common.c.

◆ odbc_get_sqlwchar()

SQLWCHAR* odbc_get_sqlwchar ( ODBC_BUF **  buf,
const char *  s 
)

Definition at line 706 of file common.c.

◆ odbc_mark_sockets_opened()

void odbc_mark_sockets_opened ( void  )

Definition at line 790 of file common.c.

◆ odbc_read_error()

void odbc_read_error ( void  )

Definition at line 638 of file common.c.

◆ odbc_read_login_info()

int odbc_read_login_info ( void  )

Definition at line 88 of file common.c.

◆ odbc_report_error()

void odbc_report_error ( const char *  msg,
int  line,
const char *  file 
)

Definition at line 188 of file common.c.

◆ odbc_reset_statement_proc()

void odbc_reset_statement_proc ( SQLHSTMT stmt,
const char *  file,
int  line 
)

Definition at line 531 of file common.c.

◆ odbc_setenv()

void odbc_setenv ( const char *  name,
const char *  value,
int  overwrite 
)

Definition at line 62 of file common.c.

References buf, putenv, and rapidjson::value.

◆ odbc_tds_version()

int odbc_tds_version ( void  )

Definition at line 444 of file common.c.

◆ odbc_test_skipped()

void odbc_test_skipped ( void  )

Definition at line 539 of file common.c.

◆ odbc_to_sqlwchar()

SQLINTEGER odbc_to_sqlwchar ( SQLWCHAR dst,
const char *  src,
SQLINTEGER  n 
)

Definition at line 654 of file common.c.

Variable Documentation

◆ odbc_buf

ODBC_BUF* odbc_buf
extern

Definition at line 678 of file common.c.

◆ odbc_conn

HDBC odbc_conn
extern

Definition at line 32 of file common.c.

◆ odbc_database

char odbc_database[512]
extern

Definition at line 40 of file common.c.

◆ odbc_driver

char odbc_driver[1024]
extern

Definition at line 41 of file common.c.

◆ odbc_env

HENV odbc_env
extern

Definition at line 31 of file common.c.

◆ odbc_err

char odbc_err[512]
extern

Definition at line 634 of file common.c.

◆ odbc_password

char odbc_password[512]
extern

Definition at line 39 of file common.c.

◆ odbc_server

char odbc_server[512]
extern

Definition at line 38 of file common.c.

◆ odbc_set_conn_attr

void(* odbc_set_conn_attr) (void) ( void  )
extern

Definition at line 35 of file common.c.

◆ odbc_sqlstate

char odbc_sqlstate[6]
extern

Definition at line 635 of file common.c.

◆ odbc_stmt

HSTMT odbc_stmt
extern

Definition at line 33 of file common.c.

◆ odbc_use_version3

int odbc_use_version3
extern

Definition at line 34 of file common.c.

◆ odbc_user

char odbc_user[512]
extern

Definition at line 37 of file common.c.

Modified on Wed Apr 24 14:17:34 2024 by modify_doxy.py rev. 669887