NCBI C++ ToolKit
Macros | Typedefs | Enumerations | Functions | Variables
iconv.c File Reference

This file implements a very simple iconv. More...

#include <config.h>
#include <assert.h>
#include <ctype.h>
#include <freetds/tds.h>
#include <freetds/bytes.h>
#include <freetds/iconv.h>
+ Include dependency graph for iconv.c:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Macros

#define MASK(n)   ((0xffffffffu << (n)) & 0xffffffffu)
 
#define CD   ((int) (TDS_INTPTR) cd)
 

Typedefs

typedef TDS_UINT ICONV_CHAR
 
typedef int(* iconv_get_t) (const unsigned char *p, size_t len, ICONV_CHAR *out)
 
typedef int(* iconv_put_t) (unsigned char *buf, size_t buf_len, ICONV_CHAR c)
 

Enumerations

enum  ICONV_CD_VALUE { Like_to_Like = 0x100 , Like_to_Like = 0x100 }
 

Functions

static int get_utf8 (const unsigned char *p, size_t len, ICONV_CHAR *out)
 
static int put_utf8 (unsigned char *buf, size_t buf_len, ICONV_CHAR c)
 
static int get_ucs4le (const unsigned char *p, size_t len, ICONV_CHAR *out)
 
static int put_ucs4le (unsigned char *buf, size_t buf_len, ICONV_CHAR c)
 
static int get_ucs4be (const unsigned char *p, size_t len, ICONV_CHAR *out)
 
static int put_ucs4be (unsigned char *buf, size_t buf_len, ICONV_CHAR c)
 
static int get_utf16le (const unsigned char *p, size_t len, ICONV_CHAR *out)
 
static int put_utf16le (unsigned char *buf, size_t buf_len, ICONV_CHAR c)
 
static int get_utf16be (const unsigned char *p, size_t len, ICONV_CHAR *out)
 
static int put_utf16be (unsigned char *buf, size_t buf_len, ICONV_CHAR c)
 
static int get_iso1 (const unsigned char *p, size_t len, ICONV_CHAR *out)
 
static int put_iso1 (unsigned char *buf, size_t buf_len, ICONV_CHAR c)
 
static int get_ascii (const unsigned char *p, size_t len, ICONV_CHAR *out)
 
static int put_ascii (unsigned char *buf, size_t buf_len, ICONV_CHAR c)
 
static int get_err (const unsigned char *p, size_t len, ICONV_CHAR *out)
 
static int put_err (unsigned char *buf, size_t buf_len, ICONV_CHAR c)
 
iconv_t tds_sys_iconv_open (const char *tocode, const char *fromcode)
 Inputs are FreeTDS canonical names, no other. More...
 
int tds_sys_iconv_close (iconv_t cd)
 
size_t tds_sys_iconv (iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
 

Variables

static const unsigned char utf8_lengths [256]
 
static const unsigned char utf8_masks [7]
 
static const iconv_get_t iconv_gets [8]
 
static const iconv_put_t iconv_puts [8]
 

Detailed Description

This file implements a very simple iconv.

Its purpose is to allow ASCII clients to communicate with Microsoft servers that encode their metadata in Unicode (UTF-16).

It supports ISO-8859-1, ASCII, UTF-16, UCS-4 and UTF-8

Definition in file iconv.c.

Macro Definition Documentation

◆ CD

#define CD   ((int) (TDS_INTPTR) cd)

◆ MASK

#define MASK (   n)    ((0xffffffffu << (n)) & 0xffffffffu)
Modified on Fri Sep 20 14:58:27 2024 by modify_doxy.py rev. 669887