NCBI C++ ToolKit
Enumerations | Functions | Variables
charconv.c File Reference
#include "common.h"
#include <freetds/iconv.h>
#include <freetds/stream.h>
#include <common/test_assert.h>
+ Include dependency graph for charconv.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Enumerations

enum  Odd {
  ODD_NONE = 0 , ODD_NORMAL , ODD_INVALID , ODD_INCOMPLETE ,
  ODD_NUM_VALUES
}
 

Functions

static TDSRET convert (TDSSOCKET *tds, TDSICONV *conv, TDS_ICONV_DIRECTION direction, const char *from, size_t from_len, char *dest, size_t *dest_len)
 
static int add_odd (char *buf, int *pos, enum Odd type)
 
static void add_odd2 (char *buf, int *pos, enum Odd type)
 
static int err_handler (const TDSCONTEXT *tds_ctx, TDSSOCKET *tds, TDSMESSAGE *msg)
 
static void test (TDSSOCKET *tds, enum Odd odd_type)
 
static void big_test (TDSSOCKET *tds)
 
int main (int argc, char **argv)
 

Variables

static char buf [4096+80]
 
static char buf_out [4096+80]
 
static int last_errno = 0
 
static const char * odd_names []
 
static int captured_errno = 0
 
static TDSICONVconv = NULL
 
static int pos_type = 0
 

Enumeration Type Documentation

◆ Odd

enum Odd
Enumerator
ODD_NONE 
ODD_NORMAL 
ODD_INVALID 
ODD_INCOMPLETE 
ODD_NUM_VALUES 

Definition at line 83 of file charconv.c.

Function Documentation

◆ add_odd()

static int add_odd ( char *  buf,
int pos,
enum Odd  type 
)
static

Definition at line 96 of file charconv.c.

References assert, buf, EILSEQ, ODD_INCOMPLETE, ODD_INVALID, ODD_NONE, and ODD_NORMAL.

Referenced by test().

◆ add_odd2()

static void add_odd2 ( char *  buf,
int pos,
enum Odd  type 
)
static

Definition at line 128 of file charconv.c.

References assert, buf, ODD_INCOMPLETE, ODD_INVALID, ODD_NONE, and ODD_NORMAL.

Referenced by test().

◆ big_test()

static void big_test ( TDSSOCKET tds)
static

Definition at line 260 of file charconv.c.

References assert, buf, buf_out, captured_errno, conv, convert(), exit(), i, last_errno, tds, TDS_FAILED, TDS_SUCCEED, and to_client.

Referenced by main().

◆ convert()

static TDSRET convert ( TDSSOCKET tds,
TDSICONV conv,
TDS_ICONV_DIRECTION  direction,
const char *  from,
size_t  from_len,
char *  dest,
size_t *  dest_len 
)
static

◆ err_handler()

static int err_handler ( const TDSCONTEXT tds_ctx,
TDSSOCKET tds,
TDSMESSAGE msg 
)
static

◆ main()

int main ( int  argc,
char **  argv 
)

◆ test()

static void test ( TDSSOCKET tds,
enum Odd  odd_type 
)
static

Variable Documentation

◆ buf

char buf[4096+80]
static

Definition at line 51 of file charconv.c.

Referenced by add_odd(), add_odd2(), big_test(), and test().

◆ buf_out

char buf_out[4096+80]
static

Definition at line 52 of file charconv.c.

Referenced by big_test(), and test().

◆ captured_errno

int captured_errno = 0
static

Definition at line 148 of file charconv.c.

Referenced by big_test(), err_handler(), and test().

◆ conv

TDSICONV* conv = NULL
static

◆ last_errno

int last_errno = 0
static

Definition at line 54 of file charconv.c.

Referenced by big_test(), convert(), and test().

◆ odd_names

const char* odd_names[]
static
Initial value:
= {
"None", "Normal", "Invalid", "Incomplete"
}

Definition at line 91 of file charconv.c.

Referenced by test().

◆ pos_type

int pos_type = 0
static

Definition at line 169 of file charconv.c.

Referenced by CFastaReader::GetCurrentPos(), mu::ParserInt::IsHexVal(), main(), and test().

Modified on Sat Feb 24 07:47:14 2024 by modify_doxy.py rev. 669887