NCBI C++ ToolKit
Classes | Typedefs | Functions
stream.h File Reference
#include <freetds/pushvis.h>
#include <freetds/popvis.h>
+ Include dependency graph for stream.h:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  tds_input_stream
 define a stream of data used for input More...
 
struct  tds_output_stream
 define a stream of data used for output More...
 
struct  tds_datain_stream
 input stream to read data from tds protocol More...
 
struct  tds_dataout_stream
 output stream to write data to tds protocol More...
 
struct  tds_staticin_stream
 input stream to read data from a static buffer More...
 
struct  tds_staticout_stream
 output stream to write data to a static buffer. More...
 
struct  tds_dynamic_stream
 output stream to write data to a dynamic buffer More...
 

Typedefs

typedef struct tds_input_stream TDSINSTREAM
 define a stream of data used for input More...
 
typedef struct tds_output_stream TDSOUTSTREAM
 define a stream of data used for output More...
 
typedef struct tds_datain_stream TDSDATAINSTREAM
 input stream to read data from tds protocol More...
 
typedef struct tds_dataout_stream TDSDATAOUTSTREAM
 output stream to write data to tds protocol More...
 
typedef struct tds_staticin_stream TDSSTATICINSTREAM
 input stream to read data from a static buffer More...
 
typedef struct tds_staticout_stream TDSSTATICOUTSTREAM
 output stream to write data to a static buffer. More...
 
typedef struct tds_dynamic_stream TDSDYNAMICSTREAM
 output stream to write data to a dynamic buffer More...
 

Functions

TDSRET tds_convert_stream (TDSSOCKET *tds, TDSICONV *char_conv, TDS_ICONV_DIRECTION direction, TDSINSTREAM *istream, TDSOUTSTREAM *ostream)
 Convert a stream from istream to ostream using a specific conversion. More...
 
TDSRET tds_copy_stream (TDSSOCKET *tds, TDSINSTREAM *istream, TDSOUTSTREAM *ostream)
 Copy data from a stream to another. More...
 
void tds_datain_stream_init (TDSDATAINSTREAM *stream, TDSSOCKET *tds, size_t wire_size)
 Initialize a data input stream. More...
 
void tds_dataout_stream_init (TDSDATAOUTSTREAM *stream, TDSSOCKET *tds)
 Initialize a data output stream. More...
 
void tds_staticin_stream_init (TDSSTATICINSTREAM *stream, const void *ptr, size_t len)
 Initialize an input stream for read from a static allocated buffer. More...
 
void tds_staticout_stream_init (TDSSTATICOUTSTREAM *stream, void *ptr, size_t len)
 Initialize an output stream for write into a static allocated buffer. More...
 
TDSRET tds_dynamic_stream_init (TDSDYNAMICSTREAM *stream, void **ptr, size_t allocated)
 Initialize a dynamic output stream. More...
 

Typedef Documentation

◆ TDSDATAINSTREAM

input stream to read data from tds protocol

◆ TDSDATAOUTSTREAM

output stream to write data to tds protocol

◆ TDSDYNAMICSTREAM

output stream to write data to a dynamic buffer

◆ TDSINSTREAM

typedef struct tds_input_stream TDSINSTREAM

define a stream of data used for input

◆ TDSOUTSTREAM

define a stream of data used for output

◆ TDSSTATICINSTREAM

input stream to read data from a static buffer

◆ TDSSTATICOUTSTREAM

output stream to write data to a static buffer.

stream.buffer contains the pointer where stream will write to.

Function Documentation

◆ tds_convert_stream()

TDSRET tds_convert_stream ( TDSSOCKET tds,
TDSICONV char_conv,
TDS_ICONV_DIRECTION  direction,
TDSINSTREAM istream,
TDSOUTSTREAM ostream 
)

Convert a stream from istream to ostream using a specific conversion.

Convert a stream from istream to ostream using a specific conversion.

Parameters
char_convconversion structure
directionspecify conversion to server or from server
istreaminput stream
ostreamoutput stream
Returns
TDS_SUCCESS of TDS_FAIL

Definition at line 71 of file stream.c.

◆ tds_copy_stream()

TDSRET tds_copy_stream ( TDSSOCKET tds,
TDSINSTREAM istream,
TDSOUTSTREAM ostream 
)

Copy data from a stream to another.

Copy data from a stream to another.

Parameters
istreaminput stream
ostreamoutput stream
Returns
TDS_SUCCESS or TDS_FAIL

Definition at line 163 of file stream.c.

References tds_output_stream::buf_len, tds_output_stream::buffer, len, tds_input_stream::read, TDS_FAIL, TDS_SUCCESS, TDS_UNLIKELY, and tds_output_stream::write.

◆ tds_datain_stream_init()

void tds_datain_stream_init ( TDSDATAINSTREAM stream,
TDSSOCKET tds,
size_t  wire_size 
)

Initialize a data input stream.

This stream read data from network.

Parameters
streaminput stream to initialize \tds
wire_sizebyte to read

Definition at line 205 of file stream.c.

◆ tds_dataout_stream_init()

void tds_dataout_stream_init ( TDSDATAOUTSTREAM stream,
TDSSOCKET tds 
)

Initialize a data output stream.

This stream writes data to network.

Parameters
streamoutput stream to initialize \tds

Definition at line 245 of file stream.c.

◆ tds_dynamic_stream_init()

TDSRET tds_dynamic_stream_init ( TDSDYNAMICSTREAM stream,
void **  ptr,
size_t  allocated 
)

Initialize a dynamic output stream.

This stream write data into a dynamic allocated buffer.

Parameters
streamstream to initialize
ptrpointer to pointer to buffer to fill. Buffer will be extended as needed
allocatedbytes initialially allocated for the buffer. Useful to reuse buffers
Returns
TDS_SUCCESS on success, TDS_FAIL otherwise

Definition at line 355 of file stream.c.

◆ tds_staticin_stream_init()

void tds_staticin_stream_init ( TDSSTATICINSTREAM stream,
const void *  ptr,
size_t  len 
)

Initialize an input stream for read from a static allocated buffer.

Parameters
streamstream to initialize
ptrbuffer to read from
lenbuffer size in bytes

Definition at line 287 of file stream.c.

◆ tds_staticout_stream_init()

void tds_staticout_stream_init ( TDSSTATICOUTSTREAM stream,
void *  ptr,
size_t  len 
)

Initialize an output stream for write into a static allocated buffer.

Parameters
streamstream to initialize
ptrbuffer to write to
lenbuffer size in bytes

Definition at line 314 of file stream.c.

Modified on Tue May 21 10:58:53 2024 by modify_doxy.py rev. 669887