Functions | |
int | tds_process_login_tokens (TDSSOCKET *tds) |
tds_process_login_tokens() is called after sending the login packet to the server. | |
int | tds_process_result_tokens (TDSSOCKET *tds, TDS_INT *result_type, int *done_flags) |
process TDS result-type message streams. | |
int | tds_process_row_tokens (TDSSOCKET *tds, TDS_INT *rowtype, TDS_INT *computeid) |
process TDS row-type message streams. | |
int | tds_process_row_tokens_ct (TDSSOCKET *tds, TDS_INT *rowtype, TDS_INT *computeid) |
int | tds_process_trailing_tokens (TDSSOCKET *tds) |
tds_process_trailing_tokens() is called to discard messages that may be left unprocessed at the end of a result "batch". | |
int | tds_process_simple_query (TDSSOCKET *tds) |
Process results for simple query as "SET TEXTSIZE" or "USE dbname" If the statement returns results, beware they are discarded. | |
int | tds_do_until_done (TDSSOCKET *tds) |
simple flush function. | |
void | tds_add_row_column_size (TDSRESULTINFO *info, TDSCOLUMN *curcol) |
Add a column size to result info row size and calc offset into row. | |
int | tds_client_msg (TDSCONTEXT *tds_ctx, TDSSOCKET *tds, int msgnum, int level, int state, int line, const char *msg_text) |
tds_client_msg() sends a message to the client application from the CLI or TDS layer. | |
int | tds_alloc_get_string (TDSSOCKET *tds, char **string, int len) |
Read a string from wire in a new allocated buffer. | |
int | tds_process_cancel (TDSSOCKET *tds) |
tds_process_cancel() processes the incoming token stream until it finds an end token (DONE, DONEPROC, DONEINPROC) with the cancel flag set. | |
void | tds_set_null (unsigned char *current_row, int column) |
set the null bit for the given column in the row buffer | |
void | tds_clr_null (unsigned char *current_row, int column) |
clear the null bit for the given column in the row buffer | |
int | tds_get_null (unsigned char *current_row, int column) |
Return the null bit for the given column in the row buffer. | |
TDSDYNAMIC * | tds_lookup_dynamic (TDSSOCKET *tds, char *id) |
Find a dynamic given string id. | |
int | tds_get_token_size (int marker) |
tds_get_token_size() returns the size of a fixed length token used by tds_process_cancel() to determine how to read past a token | |
void | tds_swap_datatype (int coltype, unsigned char *buf) |
int | tds5_send_optioncmd (TDSSOCKET *tds, TDS_OPTION_CMD tds_command, TDS_OPTION tds_option, TDS_OPTION_ARG *ptds_argument, TDS_INT *ptds_argsize) |
const char * | tds_prtype (int token) |
Many PDU (packets data unit) contain tokens. (like result description, rows, data, errors and many other).
|
Add a column size to result info row size and calc offset into row.
|
|
Read a string from wire in a new allocated buffer.
|
|
tds_client_msg() sends a message to the client application from the CLI or TDS layer. A client message is one that is generated from with the library and not from the server. The message is sent to the CLI (the err_handler) so that it may forward it to the client application or discard it if no msg handler has been by the application. tds->parent contains a void pointer to the parent of the tds socket. This can be cast back into DBPROCESS or CS_CONNECTION by the CLI and used to determine the proper recipient function for this message.
|
|
simple flush function. maybe be superseded soon. |
|
Find a dynamic given string id.
|
|
tds_process_cancel() processes the incoming token stream until it finds an end token (DONE, DONEPROC, DONEINPROC) with the cancel flag set. a that point the connetion should be ready to handle a new query. |
|
tds_process_login_tokens() is called after sending the login packet to the server. It returns the success or failure of the login dependent on the protocol version. 4.2 sends an ACK token only when successful, TDS 5.0 sends it always with a success byte within |
|
process TDS result-type message streams. tds_process_result_tokens() is called after submitting a query with tds_submit_query() and is responsible for calling the routines to populate tds->res_info if appropriate (some query have no result sets)
|
|
process TDS row-type message streams. tds_process_row_tokens() is called once a result set has been obtained with tds_process_result_tokens(). It calls tds_process_row() to copy data into the row buffer.
|
|
Process results for simple query as "SET TEXTSIZE" or "USE dbname" If the statement returns results, beware they are discarded. This function was written to avoid direct calls to tds_process_default_tokens (which caused problems such as ignoring query errors). Results are read until idle state or severe failure (do not stop for statement failure).
|
|
tds_process_trailing_tokens() is called to discard messages that may be left unprocessed at the end of a result "batch". In dblibrary, it is valid to process all the data rows that a command may have returned but to leave end tokens etc. unprocessed (at least explicitly) This function is called to discard such tokens. If it comes across a token that does not fall into the category of valid "trailing" tokens, it will return TDS_FAIL, allowing the calling dblibrary function to return a "results pending" message. The valid "trailing" tokens are : TDS_DONE_TOKEN TDS_DONEPROC_TOKEN TDS_DONEINPROC_TOKEN TDS_RETURNSTATUS_TOKEN TDS_PARAM_TOKEN TDS5_PARAMFMT_TOKEN TDS5_PARAMS_TOKEN |