Defines | |
#define | CASE_ALL_BINARY SYBBINARY: case SYBVARBINARY: case SYBIMAGE: case XSYBBINARY: case XSYBVARBINARY |
#define | CASE_ALL_CHAR SYBCHAR: case SYBVARCHAR: case SYBTEXT: case XSYBCHAR: case XSYBVARCHAR |
#define | is_monthname(s) (store_monthname(s, NULL) >= 0) |
Functions | |
TDS_INT | binary_to_result (const void *data, size_t len, CONV_RESULT *cr) |
Copy binary data to to result and return len or TDS_CONVERT_NOMEM. | |
int | is_alphabetic (const char *) |
int | is_ampm (const char *) |
int | is_dd_mon_yyyy (char *t) |
int | is_numeric (const char *) |
int | is_numeric_dateformat (const char *) |
int | is_timeformat (const char *) |
int | store_dd_mon_yyy_date (char *datestr, struct tds_time *t) |
int | store_hour (const char *, const char *, struct tds_time *) |
int | store_mday (const char *, struct tds_time *) |
int | store_monthname (const char *, struct tds_time *) |
Test if a string is a month name and store correct month number. | |
int | store_numeric_date (const char *, struct tds_time *) |
int | store_time (const char *, struct tds_time *) |
int | store_year (int, struct tds_time *) |
int | store_yymmdd_date (const char *, struct tds_time *) |
int | string_to_datetime (const char *datestr, int desttype, CONV_RESULT *cr) |
TDS_INT | string_to_int (const char *buf, const char *pend, TDS_INT *res) |
convert a number in string to TDS_INT | |
TDS_INT | string_to_int8 (const char *buf, const char *pend, TDS_INT8 *res) |
convert a number in string to TDS_INT8 | |
int | string_to_numeric (const char *instr, const char *pend, CONV_RESULT *cr) |
convert a number in string to a TDSNUMERIC | |
TDS_INT | string_to_result (const char *s, CONV_RESULT *cr) |
Copy a terminated string to result and return len or TDS_CONVERT_NOMEM. | |
int | stringz_to_numeric (const char *instr, CONV_RESULT *cr) |
convert a zero terminated string to NUMERIC | |
TDS_INT | tds_convert (const TDSCONTEXT *tds_ctx, int srctype, const TDS_CHAR *src, TDS_UINT srclen, int desttype, CONV_RESULT *cr) |
tds_convert convert a type to another. | |
TDS_INT | tds_convert_binary (int srctype, const TDS_UCHAR *src, TDS_INT srclen, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_convert_bit (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_convert_char (int srctype, const TDS_CHAR *src, TDS_UINT srclen, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_convert_datetime (const TDSCONTEXT *tds_ctx, int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_convert_datetime4 (const TDSCONTEXT *tds_ctx, int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_convert_flt8 (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_convert_int1 (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_convert_int2 (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_convert_int4 (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_convert_int8 (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_convert_money (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_convert_money4 (int srctype, const TDS_CHAR *src, int srclen, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_convert_numeric (int srctype, const TDS_NUMERIC *src, TDS_INT srclen, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_convert_real (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_convert_unique (int srctype, const TDS_CHAR *src, TDS_INT srclen, int desttype, CONV_RESULT *cr) |
TDS_INT | tds_datecrack (TDS_INT datetype, const void *di, TDSDATEREC *dr) |
Convert from db date format to a structured date format. | |
int | tds_get_conversion_type (int srctype, int colsize) |
Return type suitable for conversions (convert all nullable types to fixed type). | |
TDS_INT | tds_get_null_type (int srctype) |
Get same type but nullable. | |
size_t | tds_strftime (char *buf, size_t maxsize, const char *format, const TDSDATEREC *dr) |
format a date string according to an "extended" strftime(3) formatting definition. | |
unsigned char | tds_willconvert (int srctype, int desttype) |
Test if a conversion is possible. | |
Variables | |
const char | tds_hex_digits [16] = "0123456789abcdef" |
Supports, for example, dbconvert().
|
Test if a string is a month name and store correct month number.
|
|
convert a number in string to TDS_INT
|
|
convert a number in string to TDS_INT8
|
|
convert a number in string to a TDSNUMERIC
|
|
convert a zero terminated string to NUMERIC
|
|
tds_convert convert a type to another. If you convert to SYBDECIMAL/SYBNUMERIC you MUST initialize precision and scale of cr. Do not expect strings to be zero terminated. Databases support zero inside string. Using strlen may result on data loss or even a segmentation fault. Instead, use memcpy to copy destination using length returned. This function does not handle NULL, srclen should be >0. Client libraries handle NULLs each in their own way.
|
|
Convert from db date format to a structured date format.
|
|
Return type suitable for conversions (convert all nullable types to fixed type).
|
|
Get same type but nullable.
|
|
format a date string according to an "extended" strftime(3) formatting definition.
|
|
Test if a conversion is possible.
|