Defines | |
#define | binary_to_result(data, len, cr) binary_to_result(desttype, data, len, cr) |
#define | CASE_ALL_BINARY SYBBINARY: case SYBVARBINARY: case SYBIMAGE: case XSYBBINARY: case XSYBVARBINARY: case TDS_CONVERT_BINARY |
#define | CASE_ALL_CHAR SYBCHAR: case SYBVARCHAR: case SYBTEXT: case XSYBCHAR: case XSYBVARCHAR |
#define | is_monthname(s) (store_monthname(s, NULL) >= 0) |
#define | string_to_result(s, cr) string_to_result(desttype, s, cr) |
Functions | |
static TDS_INT | binary_to_result (int desttype, const void *data, size_t len, CONV_RESULT *cr) |
Copy binary data to to result and return len or TDS_CONVERT_NOMEM. | |
static int | is_alphabetic (const char *) |
static int | is_ampm (const char *) |
static int | is_dd_mon_yyyy (char *t) |
static int | is_numeric (const char *) |
static int | is_numeric_dateformat (const char *) |
static int | is_timeformat (const char *) |
static int | store_dd_mon_yyy_date (char *datestr, struct tds_time *t) |
static int | store_hour (const char *, const char *, struct tds_time *) |
static int | store_mday (const char *, struct tds_time *) |
static int | store_monthname (const char *, struct tds_time *) |
Test if a string is a month name and store correct month number. | |
static int | store_numeric_date (const char *, struct tds_time *) |
static int | store_time (const char *, struct tds_time *) |
static int | store_year (int, struct tds_time *) |
static int | store_yymmdd_date (const char *, struct tds_time *) |
static int | string_to_datetime (const char *datestr, int desttype, CONV_RESULT *cr) |
static TDS_INT | string_to_int (const char *buf, const char *pend, TDS_INT *res) |
convert a number in string to TDS_INT | |
static TDS_INT | string_to_int8 (const char *buf, const char *pend, TDS_INT8 *res) |
convert a number in string to TDS_INT8 | |
static int | string_to_numeric (const char *instr, const char *pend, CONV_RESULT *cr) |
convert a number in string to a TDSNUMERIC | |
static TDS_INT | string_to_result (int desttype, const char *s, CONV_RESULT *cr) |
Copy a terminated string to result and return len or TDS_CONVERT_NOMEM. | |
static 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. | |
static TDS_INT | tds_convert_binary (int srctype, const TDS_UCHAR *src, TDS_INT srclen, int desttype, CONV_RESULT *cr) |
static TDS_INT | tds_convert_bit (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
static TDS_INT | tds_convert_char (int srctype, const TDS_CHAR *src, TDS_UINT srclen, int desttype, CONV_RESULT *cr) |
static TDS_INT | tds_convert_datetime (const TDSCONTEXT *tds_ctx, int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
static TDS_INT | tds_convert_datetime4 (const TDSCONTEXT *tds_ctx, int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
static TDS_INT | tds_convert_flt8 (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
static TDS_INT | tds_convert_int1 (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
static TDS_INT | tds_convert_int2 (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
static TDS_INT | tds_convert_int4 (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
static TDS_INT | tds_convert_int8 (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
static TDS_INT | tds_convert_money (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
static TDS_INT | tds_convert_money4 (int srctype, const TDS_CHAR *src, int srclen, int desttype, CONV_RESULT *cr) |
static TDS_INT | tds_convert_numeric (int srctype, const TDS_NUMERIC *src, TDS_INT srclen, int desttype, CONV_RESULT *cr) |
static TDS_INT | tds_convert_real (int srctype, const TDS_CHAR *src, int desttype, CONV_RESULT *cr) |
static 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.
|