|
Compounds |
struct | _tds_compiletime_settings |
| A structure to hold all the compile-time settings. More...
|
struct | TDS8_COLLATION |
| hold information for collate in TDS8 More...
|
union | tds_align_struct |
struct | tds_answer |
struct | tds_blob_info |
| structure that hold information about blobs (like text or image). More...
|
struct | tds_column_info |
| structure for storing data about regular and compute rows More...
|
struct | tds_connect_info |
struct | tds_context |
struct | tds_dynamic |
struct | tds_env_info |
struct | tds_locale |
struct | tds_login |
struct | tds_msg_info |
union | tds_option_arg |
struct | tds_result_info |
| Hold information for any results. More...
|
struct | tds_socket |
struct | tdsdaterec |
| information on data, used by tds_datecrack More...
|
struct | tdsdatetime |
struct | tdsdatetime4 |
union | tdsmoney |
struct | tdsmoney4 |
struct | tdsnumeric |
struct | tdsoldmoney |
struct | tdsunique |
struct | tdsvarbinary |
struct | tdsvarchar |
Defines |
#define | TDS_IS_SYBASE(x) (!(x->product_version & 0x80000000u)) |
| Check if product is Sybase (such as Adaptive Server Enterrprice).
|
#define | TDS_IS_MSSQL(x) ((x->product_version & 0x80000000u)!=0) |
| Check if product is Microsft SQL Server.
|
#define | TDS_MS_VER(maj, min, x) (0x80000000u|((maj)<<24)|((min)<<16)|(x)) |
| Calc a version number for mssql.
|
#define | TDS_SYB_VER(maj, min, x) (((maj)<<24)|((min)<<16)|(x)<<8) |
| Calc a version number for Sybase.
|
Typedefs |
typedef _tds_compiletime_settings | TDS_COMPILETIME_SETTINGS |
| A structure to hold all the compile-time settings.
|
typedef tdsdaterec | TDSDATEREC |
| information on data, used by tds_datecrack
|
typedef tds_blob_info | TDSBLOBINFO |
| structure that hold information about blobs (like text or image).
|
typedef tds_column_info | TDSCOLINFO |
| structure for storing data about regular and compute rows
|
typedef tds_result_info | TDSRESULTINFO |
| Hold information for any results.
|
Enumerations |
enum | TDS_OPTION_CMD |
| options that can be sent with a TDS_OPTIONCMD token
|
Functions |
int | tds_put_string (TDSSOCKET *tds, const char *buf, int len) |
| Output a string to wire automatic translate string to unicode if needed.
|
const TDS_COMPILETIME_SETTINGS * | tds_get_compiletime_settings (void) |
| Return a structure capturing the compile-time settings provided to the configure script.
|
int | tds_read_conf_section (FILE *in, const char *section, TDSCONFPARSE tds_conf_parse, void *parse_param) |
| Read a section of configuration file (INI style file).
|
int | tds_read_conf_file (TDSCONNECTINFO *connect_info, const char *server) |
| Read configuration info for given server return 0 on error.
|
TDSCONNECTINFO * | tds_read_config_info (TDSSOCKET *tds, TDSLOGIN *login, TDSLOCALE *locale) |
| tds_read_config_info() will fill the tds connect_info structure based on configuration information gathered in the following order: 1) Program specified in TDSLOGIN structure 2) The environment variables TDSVER, TDSDUMP, TDSPORT, TDSQUERY, TDSHOST 3) A config file with the following search order: a) a readable file specified by environment variable FREETDSCONF b) a readable file in ~/.freetds.conf c) a readable file in $prefix/etc/freetds.conf 3) ~/.interfaces if exists 4) $SYBASE/interfaces if exists 5) TDS_DEF_* default values
|
void | tds_fix_connect (TDSCONNECTINFO *connect_info) |
| Fix configuration after reading it.
|
void | tds_config_verstr (const char *tdsver, TDSCONNECTINFO *connect_info) |
| Set TDS version from given string.
|
void | tds_lookup_host (const char *servername, const char *portname, char *ip, char *port) |
| Given a servername and port name or number, lookup the hostname and service.
|
int | tds_set_interfaces_file_loc (char *interfloc) |
| Set the full name of interface file.
|
TDSLOCALE * | tds_get_locale (void) |
| Get locale information.
|
unsigned char * | tds_alloc_row (TDSRESULTINFO *res_info) |
| Allocate space for row store return NULL on out of memory.
|
char * | tds_alloc_get_string (TDSSOCKET *tds, int len) |
| Read a string from wire in a new allocated buffer.
|
TDSCONNECTINFO * | tds_alloc_connect (TDSLOCALE *locale) |
| Allocate space for configure structure and initialize with default values.
|
int | tds_connect (TDSSOCKET *tds, TDSCONNECTINFO *connect_info) |
| Do a connection to socket.
|
int | tds_submit_query (TDSSOCKET *tds, const char *query, TDSPARAMINFO *params) |
| tds_submit_query() sends a language string to the database server for processing.
|
int | tds_process_result_tokens (TDSSOCKET *tds, TDS_INT *result_type) |
| 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_default_tokens (TDSSOCKET *tds, int marker) |
| tds_process_default_tokens() is a catch all function that is called to process tokens not known to other tds_process_* routines
|
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".
|
TDS_INT | tds_process_end (TDSSOCKET *tds, int marker, int *flags) |
| tds_process_end() processes any of the DONE, DONEPROC, or DONEINPROC tokens.
|
int | tds_client_msg (TDSCONTEXT *tds_ctx, TDSSOCKET *tds, int msgnum, int level, int state, int line, const char *message) |
| tds_client_msg() sends a message to the client application from the CLI or TDS layer.
|
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.
|
unsigned char * | tds7_crypt_pass (const unsigned char *clear_pass, int len, unsigned char *crypt_pass) |
| tds7_crypt_pass() -- 'encrypt' TDS 7.0 style passwords.
|
char * | tds7_ascii2unicode (TDSSOCKET *tds, const char *in_string, char *out_string, int maxlen) |
| convert a ascii string to ucs2.
|
int | tds7_unicode2ascii (TDSSOCKET *tds, const char *in_string, int in_len, char *out_string, int out_len) |
| convert from ucs2 string to ascii.
|
char * | tds_get_homedir (void) |
| Get user home directory.
|
unsigned char * | tds_alloc_param_row (TDSPARAMINFO *info, TDSCOLINFO *curparam) |
| Add another field to row.
|
int | tds_submit_prepare (TDSSOCKET *tds, const char *query, const char *id, TDSDYNAMIC **dyn_out) |
| tds_submit_prepare() creates a temporary stored procedure in the server.
|
int | tds_submit_execute (TDSSOCKET *tds, TDSDYNAMIC *dyn) |
| tds_submit_execute() sends a previously prepared dynamic statement to the server.
|
int | tds_send_cancel (TDSSOCKET *tds) |
| tds_send_cancel() sends an empty packet (8 byte header only) tds_process_cancel should be called directly after this.
|
const char * | tds_next_placeholders (const char *start) |
| Get position of next placeholders.
|
int | tds_count_placeholders (const char *query) |
| Count the number of placeholders in query.
|
int | tds_get_dynid (TDSSOCKET *tds, char **id) |
| Get an id for dynamic query based on TDS information.
|
int | tds_submit_unprepare (TDSSOCKET *tds, TDSDYNAMIC *dyn) |
| Send a unprepare request for a prepared query.
|
int | tds_submit_rpc (TDSSOCKET *tds, const char *rpc_name, TDSPARAMINFO *params) |
| tds_submit_rpc() call a RPC from server.
|
int | tds_quote_id (TDSSOCKET *tds, char *buffer, const char *id) |
| Quote an id.
|
int | tds_quote_string (TDSSOCKET *tds, char *buffer, const char *str, int len) |
| Quote a string.
|
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.
|
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
|
int | tds_process_login_tokens (TDSSOCKET *tds) |
| tds_process_login_tokens() is called after sending the login packet to the server.
|
void | tds_set_column_type (TDSCOLINFO *curcol, int type) |
| Set type of column initializing all dependency.
|
void | tds_add_row_column_size (TDSRESULTINFO *info, TDSCOLINFO *curcol) |
| Add a column size to result info row size and calc offset into row.
|
int | tds_process_simple_query (TDSSOCKET *tds, TDS_INT *result_type) |
| Process results for simple query as "SET TEXTSIZE" or "USE dbname" If the statement returns results, beware they are discarded.
|
TDS_INT | tds_datecrack (TDS_INT datetype, const void *di, TDSDATEREC *dr) |
| Convert from db date format to a structured date format.
|
int | tds_flush_packet (TDSSOCKET *tds) |
| Flush packet to server.
|
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 n) |
| 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_version (TDSSOCKET *tds_socket, char *pversion_string) |
| Returns the version of the TDS protocol in effect for the link as a decimal integer.
|
void | tds_answer_challenge (const char *passwd, const unsigned char *challenge, TDSANSWER *answer) |
| Crypt a given password using schema required for NTLMv1 authentication.
|
Variables |
const int | tds_numeric_bytes_per_prec [] |
| The following little table is indexed by precision and will tell us the number of bytes required to store the specified precision.
|