iconv_charsets.h
/*
* Autogenerated file.
* Generated by iconv_charsets.pl
*/
#define CP1252_ALL \
CP1252(0x80, 8364) \
CP1252(0x82, 8218) \
CP1252(0x83, 402) \
CP1252(0x84, 8222) \
CP1252(0x85, 8230) \
CP1252(0x86, 8224) \
CP1252(0x87, 8225) \
CP1252(0x88, 710) \
CP1252(0x89, 8240) \
CP1252(0x8a, 352) \
CP1252(0x8b, 8249) \
CP1252(0x8c, 338) \
CP1252(0x8e, 381) \
CP1252(0x91, 8216) \
CP1252(0x92, 8217) \
CP1252(0x93, 8220) \
CP1252(0x94, 8221) \
CP1252(0x95, 8226) \
CP1252(0x96, 8211) \
CP1252(0x97, 8212) \
CP1252(0x98, 732) \
CP1252(0x99, 8482) \
CP1252(0x9a, 353) \
CP1252(0x9b, 8250) \
CP1252(0x9c, 339) \
CP1252(0x9e, 382) \
CP1252(0x9f, 376)
static const uint16_t cp1252_0080_00a0[] = {
0x20ac,
0x81,
0x201a,
0x192,
0x201e,
0x2026,
0x2020,
0x2021,
0x2c6,
0x2030,
0x160,
0x2039,
0x152,
0x8d,
0x17d,
0x8f,
0x90,
0x2018,
0x2019,
0x201c,
0x201d,
0x2022,
0x2013,
0x2014,
0x2dc,
0x2122,
0x161,
0x203a,
0x153,
0x9d,
0x17e,
0x178,
};
TDS_COMPILE_CHECK(cp1252size, sizeof(cp1252_0080_00a0) == 0x20*sizeof(uint16_t));
tds_staticout_stream
output stream to write data to a static buffer.
Definition: stream.h:92
tmp_col_struct
Definition: stream.c:44
tds_freeze::pkt
TDSPACKET * pkt
first packet frozen
Definition: tds.h:1579
tds_datain_stream_read
static int tds_datain_stream_read(TDSINSTREAM *stream, void *ptr, size_t len)
Reads data from network for input stream.
Definition: stream.c:185
tds_socket::frozen_packets
TDSPACKET * frozen_packets
list of packets frozen, points to first one.
Definition: tds.h:1207
tds_env::charset
char * charset
character set encoding
Definition: tds.h:972
tds_packet
Definition: tds.h:1061
tds_dynamic_stream_write
static int tds_dynamic_stream_write(TDSOUTSTREAM *stream, size_t len)
Writes data to a dynamic allocated buffer.
Definition: stream.c:324
tds_pool
Definition: pool.h:105
tds_set_state
TDS_STATE tds_set_state(TDSSOCKET *tds, TDS_STATE state)
Set state of TDS connection, with logging and checking.
Definition: util.c:58
TDS_READING
@ TDS_READING
client is reading data
Definition: tds.h:798
tds_iconv_alloc
int tds_iconv_alloc(TDSCONNECTION *conn)
Allocate iconv stuff.
Definition: iconv.c:316
tds_output_stream::buffer
char * buffer
write buffer.
Definition: stream.h:50
tds_dstr_cstr
static const char * tds_dstr_cstr(const DSTR *s)
Returns a C version (NUL terminated string) of dstr.
Definition: string.h:78
tds_login::password
DSTR password
password of account login
Definition: tds.h:537
tds_socket::in_pos
unsigned in_pos
current position in in_buf
Definition: tds.h:1196
tds_iconv_from_collate
TDSICONV * tds_iconv_from_collate(TDSCONNECTION *conn, TDS_UCHAR collate[5])
Get iconv information from a LCID (to support different column encoding under MSSQL2K)
Definition: iconv.c:1251
tds.h
Main include file for libtds.
tds_connection::env
TDSENV env
environment is shared between all sessions
Definition: tds.h:1105
tds_input_stream::read
int(* read)(struct tds_input_stream *stream, void *ptr, size_t len)
read some data Return 0 if end of stream Return <0 if error (actually not defined)
Definition: stream.h:35
tds_dstr_isempty
static int tds_dstr_isempty(const DSTR *s)
test if string is empty
Definition: string.h:60
tds_staticout_stream_write
static int tds_staticout_stream_write(TDSOUTSTREAM *stream, size_t len)
Writes data to a static allocated buffer.
Definition: stream.c:298
tds_staticin_stream
input stream to read data from a static buffer
Definition: stream.h:81
tdsiconvdir
Definition: iconv.h:85
tds_dataout_stream
output stream to write data to tds protocol
Definition: stream.h:72
tds_encoding::canonic
unsigned char canonic
internal numeric index into array of all encodings
Definition: tds.h:628
tds_socket::out_buf
unsigned char * out_buf
Output buffer.
Definition: tds.h:1189
tds_socket_set_nonblocking
int tds_socket_set_nonblocking(TDS_SYS_SOCKET sock)
Set socket to non-blocking.
Definition: net.c:168
tds_freeze_abort
TDSRET tds_freeze_abort(TDSFREEZE *freeze)
Discard all data written after the freeze.
Definition: packet.c:961
TDS_STATE
enum tds_states TDS_STATE
values for tds->state
tds_connection::product_version
TDS_UINT product_version
version of product (Sybase/MS and full version)
Definition: tds.h:1097
tds_pool_member
Definition: pool.h:86
tds_set_column_type
void tds_set_column_type(TDSCONNECTION *conn, TDSCOLUMN *curcol, TDS_SERVER_TYPE type)
Set type of column initializing all dependency.
Definition: data.c:224
tds_canonical_charset
int tds_canonical_charset(const char *charset_name)
Determine canonical iconv character set.
Definition: iconv.c:976
tds_socket::rows_affected
TDS_INT8 rows_affected
rows updated/deleted/inserted/selected, TDS_NO_COUNT if not valid
Definition: tds.h:1258
tds_socket::in_buf
unsigned char * in_buf
Input buffer.
Definition: tds.h:1181
tds_socket::cur_cursor
TDSCURSOR * cur_cursor
cursor in use
Definition: tds.h:1247
tds_alloc_row
TDSRET tds_alloc_row(TDSRESULTINFO *res_info)
Allocate space for row store return NULL on out of memory.
Definition: mem.c:524
tds_pool_socket
Definition: pool.h:70
tds_iconv_get_info
TDSICONV * tds_iconv_get_info(TDSCONNECTION *conn, int canonic_client, int canonic_server)
Get a iconv info structure, allocate and initialize if needed.
Definition: iconv.c:764
tds_freeze::size_len
unsigned size_len
length size (0, 1, 2 or 4)
Definition: tds.h:1583
tds_datain_stream_init
void tds_datain_stream_init(TDSDATAINSTREAM *stream, TDSSOCKET *tds, size_t wire_size)
Initialize a data input stream.
Definition: stream.c:204
tds_pool::waiters
dlist_users waiters
users in wait state
Definition: pool.h:128
tds_errno_message_flags
Definition: iconv.h:78
tds_datain_stream
input stream to read data from tds protocol
Definition: stream.h:63
tds_canonical_charset_name
const char * tds_canonical_charset_name(const char *charset_name)
Determine canonical iconv character set name.
Definition: iconv.c:988
tds_dynamic_stream::buf
void ** buf
where is stored the pointer
Definition: stream.h:102
tds_process_simple_query
TDSRET tds_process_simple_query(TDSSOCKET *tds)
Process results for simple query as "SET TEXTSIZE" or "USE dbname" If the statement returns results,...
Definition: token.c:881
tds_get_token_size
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 determi...
Definition: token.c:2754
tds_iconv_info_init
static int tds_iconv_info_init(TDSICONV *char_conv, int client_canonic, int server_canonic)
Open iconv descriptors to convert between character sets (both directions).
Definition: iconv.c:450
tds_output_stream::write
int(* write)(struct tds_output_stream *stream, size_t len)
write len bytes from buffer, return <0 if error or len
Definition: stream.h:41
tds_input_stream
define a stream of data used for input
Definition: stream.h:30
tds_message
Definition: tds.h:880
END_LOGIN_EVENT
Definition: user.c:521
tds_pool_event
Definition: pool.h:64
tds_send_cancel
TDSRET tds_send_cancel(TDSSOCKET *tds)
tds_send_cancel() sends an empty packet (8 byte header only) tds_process_cancel should be called dire...
Definition: query.c:2026
tds_column
Metadata about columns in regular and compute rows.
Definition: tds.h:693
tdsiconvinfo
Definition: iconv.h:92
tds_encoding::name
const char * name
name of the encoding (ie UTF-8)
Definition: tds.h:624
tds_connection
Definition: tds.h:1095
tds_datain_stream::wire_size
size_t wire_size
bytes still to read
Definition: stream.h:65
tds_socket::out_flag
unsigned char out_flag
output buffer type
Definition: tds.h:1200
skip_one_input_sequence
static size_t skip_one_input_sequence(iconv_t cd, const TDS_ENCODING *charset, const char **input, size_t *input_size)
Move the input sequence pointer to the next valid position.
Definition: iconv.c:872
tds_set_iconv_name
static const char * tds_set_iconv_name(int charset)
Get iconv name given canonic.
Definition: iconv.c:247
tds_submit_query
TDSRET tds_submit_query(TDSSOCKET *tds, const char *query)
Sends a language string to the database server for processing.
Definition: query.c:210
TDS_SENDING
@ TDS_SENDING
client would send data
Definition: tds.h:796
tds_dynamic_stream_init
TDSRET tds_dynamic_stream_init(TDSDYNAMICSTREAM *stream, void **ptr, size_t allocated)
Initialize a dynamic output stream.
Definition: stream.c:354
tds_addrinfo
Definition: replacements.h:88
tds_read_packet
int tds_read_packet(TDSSOCKET *tds)
Read in one 'packet' from the server.
Definition: packet.c:527
tds_dynamic_stream
output stream to write data to a dynamic buffer
Definition: stream.h:99
tds_result_info
Hold information for any results.
Definition: tds.h:773
TDS_WRITING
@ TDS_WRITING
client is writing data
Definition: tds.h:795
tds_get_size_by_type
int tds_get_size_by_type(TDS_SERVER_TYPE servertype)
Return the number of bytes needed by specified type.
Definition: tds_types.h:9
tds_login::server_name
DSTR server_name
server name (in freetds.conf)
Definition: tds.h:520
tds_socket::in_len
unsigned in_len
input buffer length
Definition: tds.h:1198
tds_socket::out_pos
unsigned out_pos
current position in out_buf
Definition: tds.h:1197
tds_column::column_size
TDS_INT column_size
maximun size of data.
Definition: tds.h:698
tds_copy_stream
TDSRET tds_copy_stream(TDSINSTREAM *istream, TDSOUTSTREAM *ostream)
Reads and writes from a stream to another.
Definition: stream.c:163
tds_dynamic_stream::allocated
size_t allocated
currently allocated buffer
Definition: stream.h:104
tds_convert_stream
TDSRET tds_convert_stream(TDSSOCKET *tds, TDSICONV *char_conv, TDS_ICONV_DIRECTION direction, TDSINSTREAM *istream, TDSOUTSTREAM *ostream)
Reads and writes from a stream converting characters.
Definition: stream.c:71
tds_sys_iconv_open
iconv_t tds_sys_iconv_open(const char *tocode, const char *fromcode)
Inputs are FreeTDS canonical names, no other.
Definition: iconv.c:344
tds_column::column_varint_size
TDS_TINYINT column_varint_size
size of length when reading from wire (0, 1, 2 or 4)
Definition: tds.h:705
tds_staticin_stream_init
void tds_staticin_stream_init(TDSSTATICINSTREAM *stream, const void *ptr, size_t len)
Initialize an input stream for read from a static allocated buffer.
Definition: stream.c:286
tdserror
int tdserror(const TDSCONTEXT *tds_ctx, TDSSOCKET *tds, int msgno, int errnum)
Call the client library's error handler (for library-generated errors only)
Definition: util.c:321
tds_quote_id
size_t tds_quote_id(TDSSOCKET *tds, char *buffer, const char *id, int idlen)
Quote an id.
Definition: query.c:2171
tds_realloc
void * tds_realloc(void **pp, size_t new_size)
Reallocate a pointer and update it if success.
Definition: mem.c:1878
tdsdump_dump_buf
void tdsdump_dump_buf(const char *file, unsigned int level_line, const char *msg, const void *buf, size_t length)
Dump the contents of data into the log file in a human readable format.
Definition: log.c:293
tds_iconv_init
static bool tds_iconv_init(void)
Initialize charset searching for UTF-8, UCS-2 and ISO8859-1.
Definition: iconv.c:92
tds_login::user_name
DSTR user_name
account for login
Definition: tds.h:536
tds_iconv
size_t tds_iconv(TDSSOCKET *tds, TDSICONV *conv, TDS_ICONV_DIRECTION io, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
Wrapper around iconv(3).
Definition: iconv.c:598
TDS_DEAD
@ TDS_DEAD
no connection
Definition: tds.h:799
tds_strndup
char * tds_strndup(const void *s, TDS_INTPTR len)
Copy a string of length len to a new allocated buffer This function does not read more than len bytes...
Definition: util.c:406
tds_error_message
Definition: util.c:237
tds_pool_user
Definition: pool.h:77
tds_freeze::tds
TDSSOCKET * tds
which socket we refer to
Definition: tds.h:1577
tds_get_n
bool tds_get_n(TDSSOCKET *tds, void *dest, size_t need)
Get N bytes from the buffer and return them in the already allocated space given to us.
Definition: read.c:230
TDS_IDLE
@ TDS_IDLE
no data expected
Definition: tds.h:794
tds_socket
Information for a server connection.
Definition: tds.h:1167
tds_socket::in_flag
unsigned char in_flag
input buffer type
Definition: tds.h:1199
tds_encoding
Information relevant to libiconv.
Definition: tds.h:622
tds_dataout_stream_init
void tds_dataout_stream_init(TDSDATAOUTSTREAM *stream, TDSSOCKET *tds)
Initialize a data output stream.
Definition: stream.c:244
tds_socket::out_buf_max
unsigned int out_buf_max
Maximum size of packet pointed by out_buf.
Definition: tds.h:1195
LOGIN_EVENT
Definition: user.c:100
tds_flush_packet
TDSRET tds_flush_packet(TDSSOCKET *tds)
Flush packet to server.
Definition: write.c:224
tds_output_stream
define a stream of data used for output
Definition: stream.h:39
tds_freeze::pkt_pos
unsigned pkt_pos
position in pkt
Definition: tds.h:1581
tds_login::server_charset
DSTR server_charset
charset of server e.g.
Definition: tds.h:525
TDS_PENDING
@ TDS_PENDING
cilent is waiting for data
Definition: tds.h:797
tds_env::block_size
int block_size
packet size (512-65535)
Definition: tds.h:969
tds_column::column_type
TDS_SERVER_TYPE column_type
This type can be different from wire type because conversion (e.g.
Definition: tds.h:700
tds_staticout_stream_init
void tds_staticout_stream_init(TDSSTATICOUTSTREAM *stream, void *ptr, size_t len)
Initialize an output stream for write into a static allocated buffer.
Definition: stream.c:313
tds_context
Definition: tds.h:1033
tds_dynamic_stream::size
size_t size
size of data inside buffer
Definition: stream.h:106
tds_freeze
Definition: tds.h:1575
tds_login
Definition: tds.h:519
tds_staticin_stream_read
static int tds_staticin_stream_read(TDSINSTREAM *stream, void *ptr, size_t len)
Reads data from a static allocated buffer.
Definition: stream.c:268
charset_alias
Definition: charset_lookup.h:36
tdsdump_log
void tdsdump_log(const char *file, unsigned int level_line, const char *fmt,...)
Write a message to the debug log.
Definition: log.c:396
tds_dataout_stream_write
static int tds_dataout_stream_write(TDSOUTSTREAM *stream, size_t len)
Writes data to network for output stream.
Definition: stream.c:215