/*
* TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
*
* FILE: tst_types.h
*
* Definitions of data types for each test function
*/
#ifndef TST_TYPES_H
#define TST_TYPES_H
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
#include "tst_funcs.h"
#include "tgn_funcdef.h"
#define MBSSIZE 24
#define WCSSIZE 12
#define MONFMTSIZE 16
#define MONSIZE 64
#define USE_MBCURMAX 99 /* well, but ... */
#define TST_DBL_EPS 2.22153e-16
#define WCSTOK_SEQNUM 3
#define MBLEN_SEQNUM 3
#define MBTOWC_SEQNUM 3
#define MBSTOWCS_SEQNUM 3
#define WCTOMB_SEQNUM 3
#define WCSTOMBS_SEQNUM 3
#define MBRLEN_SEQNUM 3
#define MBRTOWC_SEQNUM 3
#define MBSRTOWCS_SEQNUM 3
#define WCRTOMB_SEQNUM 3
#define WCSRTOMBS_SEQNUM 3
/* Maximum numbers of test in one of the _loc arrays. */
#define MAX_LOC_TEST 300
/*----------------------------------------------------------------------*/
/* FUNCTION */
/*----------------------------------------------------------------------*/
typedef struct
{
char *func_str;
int func_id;
}
TST_FID;
typedef struct
{
int func_id;
const char *locale;
}
TST_HEAD;
typedef struct
{
TST_HEAD *head;
}
TST_FUNCS;
/*----------------------------------------------------------------------*/
/* ISW*: int isw* (wchar_t wc) */
/*----------------------------------------------------------------------*/
TST_ISW_STRUCT (ALNUM, alnum);
TST_ISW_STRUCT (ALPHA, alpha);
TST_ISW_STRUCT (CNTRL, cntrl);
TST_ISW_STRUCT (DIGIT, digit);
TST_ISW_STRUCT (GRAPH, graph);
TST_ISW_STRUCT (LOWER, lower);
TST_ISW_STRUCT (PRINT, print);
TST_ISW_STRUCT (PUNCT, punct);
TST_ISW_STRUCT (SPACE, space);
TST_ISW_STRUCT (UPPER, upper);
TST_ISW_STRUCT (XDIGIT, xdigit);
typedef struct
{
wint_t wc;
const char *ts;
}
TIN_ISWCTYPE_REC;
typedef
TEX_ERRET_REC (int)
TEX_ISWCTYPE_REC;
TMD_RECHEAD (ISWCTYPE);
/*----------------------------------------------------------------------*/
/* MBLEN: int mblen (const char *s, size_t n) */
/*----------------------------------------------------------------------*/
typedef struct
{
char s_flg;
char s[MBSSIZE];
size_t n;
}
TIN_MBLEN_REC;
typedef TEX_ERRET_REC (int) TEX_MBLEN_REC;
TMD_RECHEAD (MBLEN);
/*----------------------------------------------------------------------*/
/* MBRLEN: size_t mbrlen (const char *s, size_t n, mbstate_t *ps) */
/*----------------------------------------------------------------------*/
typedef struct
{
struct
{
int s_flg;
char s[MBSSIZE];
size_t n;
int t_flg;
int t_init;
}
seq[MBRLEN_SEQNUM];
}
TIN_MBRLEN_REC;
typedef TEX_ERRET_REC_SEQ (size_t, MBRLEN_SEQNUM) TEX_MBRLEN_REC;
TMD_RECHEAD (MBRLEN);
/*----------------------------------------------------------------------*/
/* MBRTOWC: size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, */
/* mbstate_t *ps) */
/*----------------------------------------------------------------------*/
typedef struct
{
struct
{
int w_flg;
int s_flg;
char s[MBSSIZE];
size_t n;
int t_flg;
int t_init;
}
seq[MBRTOWC_SEQNUM];
}
TIN_MBRTOWC_REC;
typedef struct
{
struct
{
TMD_ERRET (size_t);
wchar_t wc;
}
seq[MBRTOWC_SEQNUM];
}
TEX_MBRTOWC_REC;
TMD_RECHEAD