FreeTDS API: src/tds/data.c File Reference

FreeTDS API

Classes | Macros | Typedefs | Functions
data.c File Reference

Handle different data handling from network. More...

`#include <config.h>`
`#include <stdarg.h>`
`#include <stdio.h>`
`#include <assert.h>`
`#include <freetds/utils.h>`
`#include <freetds/tds.h>`
`#include <freetds/bytes.h>`
`#include <freetds/iconv.h>`
`#include <freetds/checks.h>`
`#include <freetds/stream.h>`
`#include <freetds/data.h>`
`#include <freetds/pushvis.h>`
`#include <freetds/popvis.h>`
`#include "tds_types.h"`
Include dependency graph for data.c:

## Classes
struct | tds_varmax_stream

## Macros
#define | MAX(a, b) (((a) > (b)) ? (a) : (b))
#define | MIN(a, b) (((a) < (b)) ? (a) : (b))
#define | TDS_DECLARE_FUNCS(name) extern const TDSCOLUMNFUNCS tds_ ## name ## _funcs
#define | TDS_DONT_DEFINE_DEFAULT_FUNCTIONS
#define | USE_ICONV (tds->conn->use_iconv)

## Typedefs
typedef struct tds_varmax_stream | TDSVARMAXSTREAM

## Functions
static TDSRET | tds72_get_varmax (TDSSOCKET *tds, TDSCOLUMN *curcol)
TDSRET | tds_clrudt_get_info (TDSSOCKET *tds, TDSCOLUMN *col)
TDSRET | tds_clrudt_put_info (TDSSOCKET *tds, TDSCOLUMN *col)
unsigned | tds_clrudt_put_info_len (TDSSOCKET *tds, TDSCOLUMN *col)
TDS_INT | tds_clrudt_row_len (TDSCOLUMN *col)
| TDS_COMPILE_CHECK (variant_size, sizeof(TDSBLOB) >=sizeof(TDSVARIANT))
| TDS_COMPILE_CHECK (tds_variant_size, sizeof(((TDSVARIANT *) 0) ->data)==sizeof(((TDSBLOB *) 0) ->textvalue))
| TDS_COMPILE_CHECK (tds_variant_offset, TDS_OFFSET(TDSVARIANT, data)==TDS_OFFSET(TDSBLOB, textvalue))
| TDS_DECLARE_FUNCS (generic)
| TDS_DECLARE_FUNCS (numeric)
| TDS_DECLARE_FUNCS (variant)
| TDS_DECLARE_FUNCS (msdatetime)
| TDS_DECLARE_FUNCS (clrudt)
| TDS_DECLARE_FUNCS (sybbigtime)
| TDS_DECLARE_FUNCS (invalid)
TDSRET | tds_generic_get (TDSSOCKET *tds, TDSCOLUMN *curcol)
| Read a data from wire. More...
TDSRET | tds_generic_get_info (TDSSOCKET *tds, TDSCOLUMN *col)
TDSRET | tds_generic_put (TDSSOCKET *tds, TDSCOLUMN *curcol, int bcp7)
| Write data to wire. More...
TDSRET | tds_generic_put_info (TDSSOCKET *tds, TDSCOLUMN *col)
| Put data information to wire. More...
unsigned | tds_generic_put_info_len (TDSSOCKET *tds, TDSCOLUMN *col)
TDS_INT | tds_generic_row_len (TDSCOLUMN *col)
TDS_SERVER_TYPE | tds_get_cardinal_type (TDS_SERVER_TYPE datatype, int usertype)
static TDSRET | tds_get_char_dynamic (TDSSOCKET *tds, TDSCOLUMN *curcol, void **pp, size_t allocated, TDSINSTREAM *r_stream)
static const TDSCOLUMNFUNCS * | tds_get_column_funcs (TDSCONNECTION *conn, int type)
TDSRET | tds_invalid_get (TDSSOCKET *tds, TDSCOLUMN *col)
TDSRET | tds_invalid_get_info (TDSSOCKET *tds, TDSCOLUMN *col)
TDSRET | tds_invalid_put (TDSSOCKET *tds, TDSCOLUMN *col, int bcp7)
TDSRET | tds_invalid_put_info (TDSSOCKET *tds, TDSCOLUMN *col)
unsigned | tds_invalid_put_info_len (TDSSOCKET *tds, TDSCOLUMN *col)
TDS_INT | tds_invalid_row_len (TDSCOLUMN *col)
TDSRET | tds_msdatetime_get (TDSSOCKET *tds, TDSCOLUMN *col)
TDSRET | tds_msdatetime_get_info (TDSSOCKET *tds, TDSCOLUMN *col)
TDSRET | tds_msdatetime_put (TDSSOCKET *tds, TDSCOLUMN *col, int bcp7)
TDSRET | tds_msdatetime_put_info (TDSSOCKET *tds, TDSCOLUMN *col)
TDS_INT | tds_msdatetime_row_len (TDSCOLUMN *col)
TDSRET | tds_numeric_get (TDSSOCKET *tds, TDSCOLUMN *curcol)
TDSRET | tds_numeric_get_info (TDSSOCKET *tds, TDSCOLUMN *col)
TDSRET | tds_numeric_put (TDSSOCKET *tds, TDSCOLUMN *col, int bcp7)
TDSRET | tds_numeric_put_info (TDSSOCKET *tds, TDSCOLUMN *col)
unsigned | tds_numeric_put_info_len (TDSSOCKET *tds, TDSCOLUMN *col)
TDS_INT | tds_numeric_row_len (TDSCOLUMN *col)
void | tds_set_column_type (TDSCONNECTION *conn, TDSCOLUMN *curcol, TDS_SERVER_TYPE type)
| Set type of column initializing all dependency. More...
void | tds_set_param_type (TDSCONNECTION *conn, TDSCOLUMN *curcol, TDS_SERVER_TYPE type)
| Set type of column initializing all dependency. More...
static void | tds_swap_numeric (TDS_NUMERIC *num)
| Converts numeric from Microsoft representation to internal one (Sybase). More...
TDSRET | tds_sybbigtime_get (TDSSOCKET *tds, TDSCOLUMN *col)
TDSRET | tds_sybbigtime_get_info (TDSSOCKET *tds, TDSCOLUMN *col)
TDSRET | tds_sybbigtime_put (TDSSOCKET *tds, TDSCOLUMN *col, int bcp7)
TDSRET | tds_sybbigtime_put_info (TDSSOCKET *tds, TDSCOLUMN *col)
unsigned | tds_sybbigtime_put_info_len (TDSSOCKET *tds, TDSCOLUMN *col)
TDS_INT | tds_sybbigtime_row_len (TDSCOLUMN *col)
TDSRET | tds_variant_get (TDSSOCKET *tds, TDSCOLUMN *curcol)
TDSRET | tds_variant_put (TDSSOCKET *tds, TDSCOLUMN *col, int bcp7)
TDSRET | tds_variant_put_info (TDSSOCKET *tds, TDSCOLUMN *col)
static int | tds_varmax_stream_read (TDSINSTREAM *stream, void *ptr, size_t len)

## Detailed Description

Handle different data handling from network.

## Function Documentation

## § tds_generic_get()

TDSRET tds_generic_get | ( | TDSSOCKET * | tds,
|  | TDSCOLUMN * | curcol
| ) |  |

Read a data from wire.

Parameters

  tds | state information for the socket and the TDS protocol
  curcol | column where store column information

Returns
  TDS_FAIL on error or TDS_SUCCESS

Here is the call graph for this function:

## § tds_generic_put()

TDSRET tds_generic_put | ( | TDSSOCKET * | tds,
|  | TDSCOLUMN * | curcol,
|  | int | bcp7
| ) |  |

Write data to wire.

Parameters

  tds | state information for the socket and the TDS protocol
  curcol | column where store column information

Returns
  TDS_FAIL on error or TDS_SUCCESS

Here is the call graph for this function:

## § tds_generic_put_info()

TDSRET tds_generic_put_info | ( | TDSSOCKET * | tds,
|  | TDSCOLUMN * | col
| ) |  |

Put data information to wire.

Parameters

  tds | state information for the socket and the TDS protocol
  col | column where to store information

Returns
  TDS_SUCCESS or TDS_FAIL

Here is the call graph for this function:

## § tds_set_column_type()

void tds_set_column_type | ( | TDSCONNECTION * | conn,
|  | TDSCOLUMN * | curcol,
|  | TDS_SERVER_TYPE | type
| ) |  |

Set type of column initializing all dependency.

column_usertype should already be set.

Parameters

  curcol | column to set
  type | type to set

## § tds_set_param_type()

void tds_set_param_type | ( | TDSCONNECTION * | conn,
|  | TDSCOLUMN * | curcol,
|  | TDS_SERVER_TYPE | type
| ) |  |

Set type of column initializing all dependency.

Parameters

  tds | state information for the socket and the TDS protocol
  curcol | column to set
  type | type to set

## § tds_swap_numeric()

static void tds_swap_numeric | ( | TDS_NUMERIC * | num | ) |
| static

Converts numeric from Microsoft representation to internal one (Sybase).

Parameters

  num | numeric data to convert