Main Page   Modules   Compound List   File List   Compound Members   File Members   Related Pages  

Network functions
[LibTDS API]

Functions for reading or writing from network. More...

Functions

TDS_SMALLINT tds_get_smallint (TDSSOCKET *tds)
 Get an int16 from the server.

TDS_INT tds_get_int (TDSSOCKET *tds)
 Get an int32 from the server.

int tds_get_string (TDSSOCKET *tds, int string_len, char *dest, int need)
 Fetch a string from the wire.

void * tds_get_n (TDSSOCKET *tds, void *dest, int need)
 Get N bytes from the buffer and return them in the already allocated space given to us.

int tds_get_size_by_type (int servertype)
 Return the number of bytes needed by specified type.

int tds_read_packet (TDSSOCKET *tds)
 Read in one 'packet' from the server.

int tds_put_string (TDSSOCKET *tds, const char *s, int len)
 Output a string to wire automatic translate string to unicode if needed.

int tds_flush_packet (TDSSOCKET *tds)
 Flush packet to server.


Detailed Description

Functions for reading or writing from network.


Function Documentation

int tds_flush_packet TDSSOCKET *    tds
 

Flush packet to server.

Returns:
TDS_FAIL or TDS_SUCCEED

void* tds_get_n TDSSOCKET *    tds,
void *    dest,
int    need
 

Get N bytes from the buffer and return them in the already allocated space given to us.

We ASSUME that the person calling this function has done the bounds checking for us since they know how many bytes they want here. dest of NULL means we just want to eat the bytes. (tetherow@nol.org)

int tds_get_string TDSSOCKET *    tds,
int    string_len,
char *    dest,
int    need
 

Fetch a string from the wire.

Output string is NOT null terminated. If TDS version is 7 or 8 read unicode string and convert it.

Returns:
bytes written
Parameters:
tds  connection information
string_len  length of string to read from wire (in characters)
dest  destination buffer, if NULL string is readed and discarded
need  length to read (in characters)

int tds_put_string TDSSOCKET *    tds,
const char *    s,
int    len
 

Output a string to wire automatic translate string to unicode if needed.

Parameters:
s  string to write
len  lenth of string or -1 for null terminated

int tds_read_packet TDSSOCKET *    tds
 

Read in one 'packet' from the server.

This is a wrapped outer packet of the protocol (they bundle resulte packets into chunks and wrap them at what appears to be 512 bytes regardless of how that breaks internal packet up. (tetherow@nol.org)

Returns:
bytes readed or -1 on failure


Generated on Sat Apr 5 23:17:42 2003 for FreeTDS API by doxygen1.2.18