1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
/*
* ion/ioncore/dummywc.h
*
* Copyright (c) Tuomo Valkonen 1999-2007.
*
* See the included file LICENSE for details.
*/
/* This file contains dummy implementations of multibyte/widechar routines
* used by Ion for retarded platforms.
*/
#ifndef ION_IONCORE_DUMMYWC_H
#define ION_IONCORE_DUMMYWC_H
#include <string.h>
#include <ctype.h>
#define wchar_t int
#define mbstate_t int
#define iswalnum isalnum
#define iswprint isprint
#define iswspace isspace
#define mbrlen dummywc_mbrlen
#define mbtowc dummywc_mbtowc
#define mbrtowc dummywc_mbrtowc
static size_t dummywc_mbrlen(const char *s, size_t n, mbstate_t *ps)
{
if(*s=='\0')
return 0;
return 1;
}
static int dummywc_mbtowc(wchar_t *pwc, const char *s, size_t n)
{
if(n>0 && *s!='\0'){
*pwc=*s;
return 1;
}
return 0;
}
static size_t dummywc_mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
{
return mbtowc(pwc, s, n);
}
#endif /* ION_IONCORE_DUMMYWC_H */
|