NCBI C++ ToolKit
Classes | Macros | Typedefs | Enumerations | Functions
ctlib.h File Reference
#include <freetds/tds.h>
#include <freetds/convert.h>
#include <freetds/utils/string.h>
#include <freetds/bool.h>
#include <freetds/pushvis.h>
#include <freetds/popvis.h>
+ Include dependency graph for ctlib.h:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  _cs_config
 
struct  cs_diag_msg_client
 
struct  cs_servermsg_small
 
struct  cs_servermsg_large
 
struct  cs_servermsg_common1
 
struct  CS_SERVERMSG_COMMON2
 
union  cs_servermsg_internal
 
struct  cs_diag_msg_svr
 
struct  cs_diag_msg
 
struct  _cs_context
 
struct  _ct_colinfo
 
struct  _cs_connection
 
struct  _cs_param
 
struct  _csremote_proc
 
struct  _cs_dynamic
 
struct  _cs_command
 
struct  _cs_blkdesc
 
struct  _cs_locale
 
struct  CS_DATAFMT_SMALL
 
struct  CS_DATAFMT_LARGE
 
struct  CS_DATAFMT_COMMON
 
union  CS_DATAFMT_INTERNAL
 

Macros

#define CS_DYNAMIC_CMD   160
 
#define CS_CUR_CMD   161
 
#define _CS_RES_NONE   -1
 
#define _CS_RES_INIT   0
 
#define _CS_RES_RESULTSET_EMPTY   1
 
#define _CS_RES_RESULTSET_ROWS   2
 
#define _CS_RES_STATUS   3
 
#define _CS_RES_CMD_DONE   4
 
#define _CS_RES_CMD_SUCCEED   5
 
#define _CS_RES_END_RESULTS   6
 
#define _CS_RES_DESCRIBE_RESULT   7
 
#define _CS_COMMAND_IDLE   0
 
#define _CS_COMMAND_BUILDING   1
 
#define _CS_COMMAND_READY   2
 
#define _CS_COMMAND_SENT   3
 
#define _CS_CANCEL_NOCANCEL   0
 
#define _CS_CANCEL_PENDING   1
 
#define _CS_ERRHAND_INLINE   1
 
#define _CS_ERRHAND_CB   2
 
#define _CS_CURS_TYPE_UNACTIONED   TDS_CURSOR_STATE_UNACTIONED
 
#define _CS_CURS_TYPE_REQUESTED   TDS_CURSOR_STATE_REQUESTED
 
#define _CS_CURS_TYPE_SENT   TDS_CURSOR_STATE_SENT
 

Typedefs

typedef struct cs_servermsg_small CS_SERVERMSG_SMALL
 
typedef struct cs_servermsg_large CS_SERVERMSG_LARGE
 
typedef struct cs_servermsg_common1 CS_SERVERMSG_COMMON1
 
typedef union cs_servermsg_internal CS_SERVERMSG_INTERNAL
 
typedef struct _ct_colinfo CT_COLINFO
 
typedef struct _cs_dynamic CS_DYNAMIC
 
typedef struct _cs_param CS_PARAM
 
typedef CS_PARAM CSREMOTE_PROC_PARAM
 
typedef struct _csremote_proc CSREMOTE_PROC
 
typedef CS_PARAM CS_DYNAMIC_PARAM
 

Enumerations

enum  BLK_CONV_STATUS { BLK_CONV_OK = 0 , BLK_CONV_OVERFLOW = 25 , BLK_CONV_SYNTAX_ERROR = 26 , BLK_CONV_TRUNCATION = 42 }
 

Functions

static size_t cs_servermsg_len (CS_CONTEXT *ctx)
 
TDSRET _ct_handle_server_message (const TDSCONTEXT *ctxptr, TDSSOCKET *tdsptr, TDSMESSAGE *msgptr)
 
int _ct_handle_client_message (const TDSCONTEXT *ctxptr, TDSSOCKET *tdsptr, TDSMESSAGE *msgptr)
 
TDS_SERVER_TYPE _ct_get_server_type (TDSSOCKET *tds, int datatype)
 
int _ct_bind_data (CS_CONTEXT *ctx, TDSRESULTINFO *resinfo, TDSRESULTINFO *bindinfo, CS_INT offset)
 
int _ct_get_client_type (const TDSCOLUMN *col, bool describe)
 
void _ctclient_msg (CS_CONNECTION *con, const char *funcname, int layer, int origin, int severity, int number, const char *fmt,...)
 
CS_INT _ct_diag_clearmsg (CS_CONTEXT *context, CS_INT type)
 
void _cs_locale_free (CS_LOCALE *locale)
 
CS_LOCALE_cs_locale_copy (CS_LOCALE *orig)
 
int _cs_locale_copy_inplace (CS_LOCALE *new_locale, CS_LOCALE *orig)
 
int _cs_convert_not_client (CS_CONTEXT *ctx, const TDSCOLUMN *curcol, CONV_RESULT *convert_buffer, unsigned char **p_src)
 Try to convert to a type we can handle. More...
 
CS_RETCODE _cs_convert (CS_CONTEXT *ctx, const CS_DATAFMT_COMMON *srcfmt, CS_VOID *srcdata, const CS_DATAFMT_COMMON *destfmt, CS_VOID *destdata, CS_INT *resultlen, TDS_SERVER_TYPE desttype, CS_VOID **handle, BLK_CONV_STATUS *blk_status)
 
void _csclient_msg (CS_CONTEXT *ctx, const char *funcname, int layer, int origin, int severity, int number, const char *fmt,...)
 
bool _ct_is_large_identifiers_version (CS_INT version)
 Check if a give version supports large identifiers. More...
 
const CS_DATAFMT_COMMON_ct_datafmt_common (CS_CONTEXT *ctx, const CS_DATAFMT *datafmt)
 
const CS_DATAFMT_LARGE_ct_datafmt_conv_in (CS_CONTEXT *ctx, const CS_DATAFMT *datafmt, CS_DATAFMT_LARGE *fmtbuf)
 Converts CS_DATAFMT input parameter to CS_DATAFMT_LARGE. More...
 
CS_DATAFMT_LARGE_ct_datafmt_conv_prepare (CS_CONTEXT *ctx, CS_DATAFMT *datafmt, CS_DATAFMT_LARGE *fmtbuf)
 Prepares to Convert CS_DATAFMT output parameter to CS_DATAFMT_LARGE. More...
 
void _ct_datafmt_conv_back (CS_DATAFMT *datafmt, CS_DATAFMT_LARGE *fmtbuf)
 Converts CS_DATAFMT output parameter to CS_DATAFMT_LARGE after setting it. More...
 

Macro Definition Documentation

◆ _CS_CANCEL_NOCANCEL

#define _CS_CANCEL_NOCANCEL   0

Definition at line 289 of file ctlib.h.

◆ _CS_CANCEL_PENDING

#define _CS_CANCEL_PENDING   1

Definition at line 290 of file ctlib.h.

◆ _CS_COMMAND_BUILDING

#define _CS_COMMAND_BUILDING   1

Definition at line 284 of file ctlib.h.

◆ _CS_COMMAND_IDLE

#define _CS_COMMAND_IDLE   0

Definition at line 283 of file ctlib.h.

◆ _CS_COMMAND_READY

#define _CS_COMMAND_READY   2

Definition at line 285 of file ctlib.h.

◆ _CS_COMMAND_SENT

#define _CS_COMMAND_SENT   3

Definition at line 286 of file ctlib.h.

◆ _CS_CURS_TYPE_REQUESTED

#define _CS_CURS_TYPE_REQUESTED   TDS_CURSOR_STATE_REQUESTED

Definition at line 339 of file ctlib.h.

◆ _CS_CURS_TYPE_SENT

#define _CS_CURS_TYPE_SENT   TDS_CURSOR_STATE_SENT

Definition at line 340 of file ctlib.h.

◆ _CS_CURS_TYPE_UNACTIONED

#define _CS_CURS_TYPE_UNACTIONED   TDS_CURSOR_STATE_UNACTIONED

Definition at line 338 of file ctlib.h.

◆ _CS_ERRHAND_CB

#define _CS_ERRHAND_CB   2

Definition at line 326 of file ctlib.h.

◆ _CS_ERRHAND_INLINE

#define _CS_ERRHAND_INLINE   1

Definition at line 325 of file ctlib.h.

◆ _CS_RES_CMD_DONE

#define _CS_RES_CMD_DONE   4

Definition at line 276 of file ctlib.h.

◆ _CS_RES_CMD_SUCCEED

#define _CS_RES_CMD_SUCCEED   5

Definition at line 277 of file ctlib.h.

◆ _CS_RES_DESCRIBE_RESULT

#define _CS_RES_DESCRIBE_RESULT   7

Definition at line 279 of file ctlib.h.

◆ _CS_RES_END_RESULTS

#define _CS_RES_END_RESULTS   6

Definition at line 278 of file ctlib.h.

◆ _CS_RES_INIT

#define _CS_RES_INIT   0

Definition at line 272 of file ctlib.h.

◆ _CS_RES_NONE

#define _CS_RES_NONE   -1

Definition at line 271 of file ctlib.h.

◆ _CS_RES_RESULTSET_EMPTY

#define _CS_RES_RESULTSET_EMPTY   1

Definition at line 273 of file ctlib.h.

◆ _CS_RES_RESULTSET_ROWS

#define _CS_RES_RESULTSET_ROWS   2

Definition at line 274 of file ctlib.h.

◆ _CS_RES_STATUS

#define _CS_RES_STATUS   3

Definition at line 275 of file ctlib.h.

◆ CS_CUR_CMD

#define CS_CUR_CMD   161

Definition at line 267 of file ctlib.h.

◆ CS_DYNAMIC_CMD

#define CS_DYNAMIC_CMD   160

Definition at line 266 of file ctlib.h.

Typedef Documentation

◆ CS_DYNAMIC

typedef struct _cs_dynamic CS_DYNAMIC

Definition at line 179 of file ctlib.h.

◆ CS_DYNAMIC_PARAM

Definition at line 254 of file ctlib.h.

◆ CS_PARAM

typedef struct _cs_param CS_PARAM

◆ CS_SERVERMSG_COMMON1

◆ CS_SERVERMSG_INTERNAL

◆ CS_SERVERMSG_LARGE

◆ CS_SERVERMSG_SMALL

◆ CSREMOTE_PROC

typedef struct _csremote_proc CSREMOTE_PROC

◆ CSREMOTE_PROC_PARAM

Definition at line 240 of file ctlib.h.

◆ CT_COLINFO

typedef struct _ct_colinfo CT_COLINFO

Enumeration Type Documentation

◆ BLK_CONV_STATUS

Enumerator
BLK_CONV_OK 
BLK_CONV_OVERFLOW 
BLK_CONV_SYNTAX_ERROR 
BLK_CONV_TRUNCATION 

Definition at line 389 of file ctlib.h.

Function Documentation

◆ _cs_convert()

CS_RETCODE _cs_convert ( CS_CONTEXT ctx,
const CS_DATAFMT_COMMON srcfmt,
CS_VOID srcdata,
const CS_DATAFMT_COMMON destfmt,
CS_VOID destdata,
CS_INT resultlen,
TDS_SERVER_TYPE  desttype,
CS_VOID **  handle,
BLK_CONV_STATUS blk_status 
)

◆ _cs_convert_not_client()

int _cs_convert_not_client ( CS_CONTEXT ctx,
const TDSCOLUMN curcol,
CONV_RESULT convert_buffer,
unsigned char **  p_src 
)

◆ _cs_locale_copy()

CS_LOCALE* _cs_locale_copy ( CS_LOCALE orig)

◆ _cs_locale_copy_inplace()

int _cs_locale_copy_inplace ( CS_LOCALE new_locale,
CS_LOCALE orig 
)

◆ _cs_locale_free()

void _cs_locale_free ( CS_LOCALE locale)

Definition at line 249 of file cs.c.

References _cs_locale_free_contents(), free(), locale, TDS_DBG_FUNC, and tdsdump_log.

Referenced by _cs_locale_copy(), and cs_loc_drop().

◆ _csclient_msg()

void _csclient_msg ( CS_CONTEXT ctx,
const char *  funcname,
int  layer,
int  origin,
int  severity,
int  number,
const char *  fmt,
  ... 
)

◆ _ct_bind_data()

int _ct_bind_data ( CS_CONTEXT ctx,
TDSRESULTINFO resinfo,
TDSRESULTINFO bindinfo,
CS_INT  offset 
)

◆ _ct_datafmt_common()

const CS_DATAFMT_COMMON* _ct_datafmt_common ( CS_CONTEXT ctx,
const CS_DATAFMT datafmt 
)

Definition at line 244 of file ctutil.c.

References ctx, NULL, and _cs_context::use_large_identifiers.

Referenced by blk_bind(), cs_convert(), and ct_bind().

◆ _ct_datafmt_conv_back()

void _ct_datafmt_conv_back ( CS_DATAFMT datafmt,
CS_DATAFMT_LARGE fmtbuf 
)

Converts CS_DATAFMT output parameter to CS_DATAFMT_LARGE after setting it.

Parameters
datafmtInput parameter
fmtbufBuffer to use in case conversion is required. You should pass value returned by _ct_datafmt_conv_prepare().

Definition at line 308 of file ctutil.c.

References CS_DATAFMT_SMALL::datatype, CS_DATAFMT_LARGE::datatype, CS_DATAFMT_SMALL::name, CS_DATAFMT_LARGE::name, CS_DATAFMT_SMALL::namelen, and strlcpy.

Referenced by blk_describe(), and ct_describe().

◆ _ct_datafmt_conv_in()

const CS_DATAFMT_LARGE* _ct_datafmt_conv_in ( CS_CONTEXT ctx,
const CS_DATAFMT datafmt,
CS_DATAFMT_LARGE fmtbuf 
)

Converts CS_DATAFMT input parameter to CS_DATAFMT_LARGE.

Parameters
ctxCTLib context
datafmtInput parameter
fmtbufBuffer to use in case conversion is required
Returns
parameter converted to large

Definition at line 261 of file ctutil.c.

References ctx, CS_DATAFMT_SMALL::datatype, CS_DATAFMT_LARGE::datatype, CS_DATAFMT_SMALL::name, CS_DATAFMT_LARGE::name, CS_DATAFMT_LARGE::namelen, NULL, strlcpy, and _cs_context::use_large_identifiers.

Referenced by ct_param(), and ct_setparam().

◆ _ct_datafmt_conv_prepare()

CS_DATAFMT_LARGE* _ct_datafmt_conv_prepare ( CS_CONTEXT ctx,
CS_DATAFMT datafmt,
CS_DATAFMT_LARGE fmtbuf 
)

Prepares to Convert CS_DATAFMT output parameter to CS_DATAFMT_LARGE.

Parameters
ctxCTLib context
datafmtInput parameter
fmtbufBuffer to use in case conversion is required
Returns
parameter converted to large

Definition at line 289 of file ctutil.c.

References ctx, NULL, and _cs_context::use_large_identifiers.

Referenced by blk_describe(), and ct_describe().

◆ _ct_diag_clearmsg()

CS_INT _ct_diag_clearmsg ( CS_CONTEXT context,
CS_INT  type 
)

◆ _ct_get_client_type()

int _ct_get_client_type ( const TDSCOLUMN col,
bool  describe 
)

◆ _ct_get_server_type()

TDS_SERVER_TYPE _ct_get_server_type ( TDSSOCKET tds,
int  datatype 
)

◆ _ct_handle_client_message()

int _ct_handle_client_message ( const TDSCONTEXT ctxptr,
TDSSOCKET tdsptr,
TDSMESSAGE msgptr 
)

◆ _ct_handle_server_message()

TDSRET _ct_handle_server_message ( const TDSCONTEXT ctxptr,
TDSSOCKET tdsptr,
TDSMESSAGE msgptr 
)

◆ _ct_is_large_identifiers_version()

bool _ct_is_large_identifiers_version ( CS_INT  version)

Check if a give version supports large identifiers.

Definition at line 231 of file ctutil.c.

References version.

Referenced by cs_ctx_alloc(), and ct_init().

◆ _ctclient_msg()

void _ctclient_msg ( CS_CONNECTION con,
const char *  funcname,
int  layer,
int  origin,
int  severity,
int  number,
const char *  fmt,
  ... 
)

◆ cs_servermsg_len()

static size_t cs_servermsg_len ( CS_CONTEXT ctx)
inlinestatic

Definition at line 179 of file ctlib.h.

Referenced by ct_diag_getservermsg(), and ct_diag_storeservermsg().

Modified on Sun Jul 21 04:16:32 2024 by modify_doxy.py rev. 669887