mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 13:23:04 +00:00
started syncing to Wine-0.9.14
svn path=/trunk/; revision=22042
This commit is contained in:
parent
cf356e801d
commit
8943cd0ea8
11 changed files with 296 additions and 88 deletions
|
@ -16,7 +16,7 @@
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Lesser General Public
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
# License along with this library; if not, write to the Free Software
|
# License along with this library; if not, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
#
|
#
|
||||||
|
|
||||||
# base directory for ftp.unicode.org files
|
# base directory for ftp.unicode.org files
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -156,7 +156,7 @@ static const union cptable * const cptables[60] =
|
||||||
|
|
||||||
static int cmp_codepage( const void *codepage, const void *entry )
|
static int cmp_codepage( const void *codepage, const void *entry )
|
||||||
{
|
{
|
||||||
return *(unsigned int *)codepage - (*(const union cptable *const *)entry)->info.codepage;
|
return *(const unsigned int *)codepage - (*(const union cptable *const *)entry)->info.codepage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Lesser General Public
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
# License along with this library; if not, write to the Free Software
|
# License along with this library; if not, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
#
|
#
|
||||||
# NOTES:
|
# NOTES:
|
||||||
#
|
#
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
|
|
|
@ -15,15 +15,13 @@
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
|
|
||||||
typedef unsigned char uchar;
|
|
||||||
|
|
||||||
/* get the decomposition of a Unicode char */
|
/* get the decomposition of a Unicode char */
|
||||||
static int get_decomposition( WCHAR src, WCHAR *dst, unsigned int dstlen )
|
static int get_decomposition( WCHAR src, WCHAR *dst, unsigned int dstlen )
|
||||||
{
|
{
|
||||||
|
@ -260,25 +258,25 @@ int wine_cp_mbstowcs( const union cptable *table, int flags,
|
||||||
{
|
{
|
||||||
if (flags & MB_ERR_INVALID_CHARS)
|
if (flags & MB_ERR_INVALID_CHARS)
|
||||||
{
|
{
|
||||||
if (check_invalid_chars_sbcs( &table->sbcs, (const uchar*)src, srclen )) return -2;
|
if (check_invalid_chars_sbcs( &table->sbcs, src, srclen )) return -2;
|
||||||
}
|
}
|
||||||
if (!(flags & MB_COMPOSITE))
|
if (!(flags & MB_COMPOSITE))
|
||||||
{
|
{
|
||||||
if (!dstlen) return srclen;
|
if (!dstlen) return srclen;
|
||||||
return mbstowcs_sbcs( &table->sbcs, (const uchar*)src, srclen, dst, dstlen );
|
return mbstowcs_sbcs( &table->sbcs, src, srclen, dst, dstlen );
|
||||||
}
|
}
|
||||||
return mbstowcs_sbcs_decompose( &table->sbcs, (const uchar*)src, srclen, dst, dstlen );
|
return mbstowcs_sbcs_decompose( &table->sbcs, src, srclen, dst, dstlen );
|
||||||
}
|
}
|
||||||
else /* mbcs */
|
else /* mbcs */
|
||||||
{
|
{
|
||||||
if (flags & MB_ERR_INVALID_CHARS)
|
if (flags & MB_ERR_INVALID_CHARS)
|
||||||
{
|
{
|
||||||
if (check_invalid_chars_dbcs( &table->dbcs, (const uchar*)src, srclen )) return -2;
|
if (check_invalid_chars_dbcs( &table->dbcs, src, srclen )) return -2;
|
||||||
}
|
}
|
||||||
if (!(flags & MB_COMPOSITE))
|
if (!(flags & MB_COMPOSITE))
|
||||||
return mbstowcs_dbcs( &table->dbcs, (const uchar*)src, srclen, dst, dstlen );
|
return mbstowcs_dbcs( &table->dbcs, src, srclen, dst, dstlen );
|
||||||
else
|
else
|
||||||
return mbstowcs_dbcs_decompose( &table->dbcs, (const uchar*)src, srclen, dst, dstlen );
|
return mbstowcs_dbcs_decompose( &table->dbcs, src, srclen, dst, dstlen );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
|
|
||||||
|
|
|
@ -15,15 +15,199 @@
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
|
|
||||||
|
extern const WCHAR wine_casemap_lower[];
|
||||||
|
extern const WCHAR wine_casemap_upper[];
|
||||||
|
extern const unsigned short wine_wctype_table[];
|
||||||
|
|
||||||
|
int wine_is_dbcs_leadbyte( const union cptable *table, unsigned char ch )
|
||||||
|
{
|
||||||
|
return (table->info.char_size == 2) && (table->dbcs.cp2uni_leadbytes[ch]);
|
||||||
|
}
|
||||||
|
|
||||||
|
WCHAR tolowerW( WCHAR ch )
|
||||||
|
{
|
||||||
|
return ch + wine_casemap_lower[wine_casemap_lower[ch >> 8] + (ch & 0xff)];
|
||||||
|
}
|
||||||
|
|
||||||
|
WCHAR toupperW( WCHAR ch )
|
||||||
|
{
|
||||||
|
return ch + wine_casemap_upper[wine_casemap_upper[ch >> 8] + (ch & 0xff)];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the character type contains the C1_* flags in the low 12 bits */
|
||||||
|
/* and the C2_* type in the high 4 bits */
|
||||||
|
unsigned short get_char_typeW( WCHAR ch )
|
||||||
|
{
|
||||||
|
return wine_wctype_table[wine_wctype_table[ch >> 8] + (ch & 0xff)];
|
||||||
|
}
|
||||||
|
|
||||||
|
int iscntrlW( WCHAR wc )
|
||||||
|
{
|
||||||
|
return get_char_typeW(wc) & C1_CNTRL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ispunctW( WCHAR wc )
|
||||||
|
{
|
||||||
|
return get_char_typeW(wc) & C1_PUNCT;
|
||||||
|
}
|
||||||
|
|
||||||
|
int isspaceW( WCHAR wc )
|
||||||
|
{
|
||||||
|
return get_char_typeW(wc) & C1_SPACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int isdigitW( WCHAR wc )
|
||||||
|
{
|
||||||
|
return get_char_typeW(wc) & C1_DIGIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
int isxdigitW( WCHAR wc )
|
||||||
|
{
|
||||||
|
return get_char_typeW(wc) & C1_XDIGIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
int islowerW( WCHAR wc )
|
||||||
|
{
|
||||||
|
return get_char_typeW(wc) & C1_LOWER;
|
||||||
|
}
|
||||||
|
|
||||||
|
int isupperW( WCHAR wc )
|
||||||
|
{
|
||||||
|
return get_char_typeW(wc) & C1_UPPER;
|
||||||
|
}
|
||||||
|
|
||||||
|
int isalnumW( WCHAR wc )
|
||||||
|
{
|
||||||
|
return get_char_typeW(wc) & (C1_ALPHA|C1_DIGIT|C1_LOWER|C1_UPPER);
|
||||||
|
}
|
||||||
|
|
||||||
|
int isalphaW( WCHAR wc )
|
||||||
|
{
|
||||||
|
return get_char_typeW(wc) & (C1_ALPHA|C1_LOWER|C1_UPPER);
|
||||||
|
}
|
||||||
|
|
||||||
|
int isgraphW( WCHAR wc )
|
||||||
|
{
|
||||||
|
return get_char_typeW(wc) & (C1_ALPHA|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
|
||||||
|
}
|
||||||
|
|
||||||
|
int isprintW( WCHAR wc )
|
||||||
|
{
|
||||||
|
return get_char_typeW(wc) & (C1_ALPHA|C1_BLANK|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int strlenW( const WCHAR *str )
|
||||||
|
{
|
||||||
|
const WCHAR *s = str;
|
||||||
|
while (*s) s++;
|
||||||
|
return s - str;
|
||||||
|
}
|
||||||
|
|
||||||
|
WCHAR *strcpyW( WCHAR *dst, const WCHAR *src )
|
||||||
|
{
|
||||||
|
WCHAR *p = dst;
|
||||||
|
while ((*p++ = *src++));
|
||||||
|
return dst;
|
||||||
|
}
|
||||||
|
|
||||||
|
int strcmpW( const WCHAR *str1, const WCHAR *str2 )
|
||||||
|
{
|
||||||
|
while (*str1 && (*str1 == *str2)) { str1++; str2++; }
|
||||||
|
return *str1 - *str2;
|
||||||
|
}
|
||||||
|
|
||||||
|
int strncmpW( const WCHAR *str1, const WCHAR *str2, int n )
|
||||||
|
{
|
||||||
|
if (n <= 0) return 0;
|
||||||
|
while ((--n > 0) && *str1 && (*str1 == *str2)) { str1++; str2++; }
|
||||||
|
return *str1 - *str2;
|
||||||
|
}
|
||||||
|
|
||||||
|
WCHAR *strcatW( WCHAR *dst, const WCHAR *src )
|
||||||
|
{
|
||||||
|
strcpyW( dst + strlenW(dst), src );
|
||||||
|
return dst;
|
||||||
|
}
|
||||||
|
|
||||||
|
WCHAR *strchrW( const WCHAR *str, WCHAR ch )
|
||||||
|
{
|
||||||
|
do { if (*str == ch) return (WCHAR *)str; } while (*str++);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
WCHAR *strrchrW( const WCHAR *str, WCHAR ch )
|
||||||
|
{
|
||||||
|
WCHAR *ret = NULL;
|
||||||
|
do { if (*str == ch) ret = (WCHAR *)str; } while (*str++);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
WCHAR *strpbrkW( const WCHAR *str, const WCHAR *accept )
|
||||||
|
{
|
||||||
|
for ( ; *str; str++) if (strchrW( accept, *str )) return (WCHAR *)str;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t strspnW( const WCHAR *str, const WCHAR *accept )
|
||||||
|
{
|
||||||
|
const WCHAR *ptr;
|
||||||
|
for (ptr = str; *ptr; ptr++) if (!strchrW( accept, *ptr )) break;
|
||||||
|
return ptr - str;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t strcspnW( const WCHAR *str, const WCHAR *reject )
|
||||||
|
{
|
||||||
|
const WCHAR *ptr;
|
||||||
|
for (ptr = str; *ptr; ptr++) if (strchrW( reject, *ptr )) break;
|
||||||
|
return ptr - str;
|
||||||
|
}
|
||||||
|
|
||||||
|
WCHAR *strlwrW( WCHAR *str )
|
||||||
|
{
|
||||||
|
WCHAR *ret = str;
|
||||||
|
while ((*str = tolowerW(*str))) str++;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
WCHAR *struprW( WCHAR *str )
|
||||||
|
{
|
||||||
|
WCHAR *ret = str;
|
||||||
|
while ((*str = toupperW(*str))) str++;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n )
|
||||||
|
{
|
||||||
|
const WCHAR *end;
|
||||||
|
for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) return (WCHAR *)ptr;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
WCHAR *memrchrW( const WCHAR *ptr, WCHAR ch, size_t n )
|
||||||
|
{
|
||||||
|
const WCHAR *end, *ret = NULL;
|
||||||
|
for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) ret = ptr;
|
||||||
|
return (WCHAR *)ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
long int atolW( const WCHAR *str )
|
||||||
|
{
|
||||||
|
return strtolW( str, (WCHAR **)0, 10 );
|
||||||
|
}
|
||||||
|
|
||||||
|
int atoiW( const WCHAR *str )
|
||||||
|
{
|
||||||
|
return (int)atolW( str );
|
||||||
|
}
|
||||||
|
|
||||||
int strcmpiW( const WCHAR *str1, const WCHAR *str2 )
|
int strcmpiW( const WCHAR *str1, const WCHAR *str2 )
|
||||||
{
|
{
|
||||||
for (;;)
|
for (;;)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __WINE_UNICODE_H
|
#ifndef __WINE_UNICODE_H
|
||||||
|
@ -95,18 +95,18 @@ extern int snprintfW( WCHAR *str, size_t len, const WCHAR *format, ... );
|
||||||
extern int vsprintfW( WCHAR *str, const WCHAR *format, va_list valist );
|
extern int vsprintfW( WCHAR *str, const WCHAR *format, va_list valist );
|
||||||
extern int vsnprintfW( WCHAR *str, size_t len, const WCHAR *format, va_list valist );
|
extern int vsnprintfW( WCHAR *str, size_t len, const WCHAR *format, va_list valist );
|
||||||
|
|
||||||
static inline int is_dbcs_leadbyte( const union cptable *table, unsigned char ch )
|
extern inline int wine_is_dbcs_leadbyte( const union cptable *table, unsigned char ch )
|
||||||
{
|
{
|
||||||
return (table->info.char_size == 2) && (table->dbcs.cp2uni_leadbytes[ch]);
|
return (table->info.char_size == 2) && (table->dbcs.cp2uni_leadbytes[ch]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline WCHAR tolowerW( WCHAR ch )
|
extern inline WCHAR tolowerW( WCHAR ch )
|
||||||
{
|
{
|
||||||
extern WINE_UNICODE_API const WCHAR wine_casemap_lower[];
|
extern WINE_UNICODE_API const WCHAR wine_casemap_lower[];
|
||||||
return ch + wine_casemap_lower[wine_casemap_lower[ch >> 8] + (ch & 0xff)];
|
return ch + wine_casemap_lower[wine_casemap_lower[ch >> 8] + (ch & 0xff)];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline WCHAR toupperW( WCHAR ch )
|
extern inline WCHAR toupperW( WCHAR ch )
|
||||||
{
|
{
|
||||||
extern WINE_UNICODE_API const WCHAR wine_casemap_upper[];
|
extern WINE_UNICODE_API const WCHAR wine_casemap_upper[];
|
||||||
return ch + wine_casemap_upper[wine_casemap_upper[ch >> 8] + (ch & 0xff)];
|
return ch + wine_casemap_upper[wine_casemap_upper[ch >> 8] + (ch & 0xff)];
|
||||||
|
@ -114,177 +114,172 @@ static inline WCHAR toupperW( WCHAR ch )
|
||||||
|
|
||||||
/* the character type contains the C1_* flags in the low 12 bits */
|
/* the character type contains the C1_* flags in the low 12 bits */
|
||||||
/* and the C2_* type in the high 4 bits */
|
/* and the C2_* type in the high 4 bits */
|
||||||
static inline unsigned short get_char_typeW( WCHAR ch )
|
extern inline unsigned short get_char_typeW( WCHAR ch )
|
||||||
{
|
{
|
||||||
extern WINE_UNICODE_API const unsigned short wine_wctype_table[];
|
extern WINE_UNICODE_API const unsigned short wine_wctype_table[];
|
||||||
return wine_wctype_table[wine_wctype_table[ch >> 8] + (ch & 0xff)];
|
return wine_wctype_table[wine_wctype_table[ch >> 8] + (ch & 0xff)];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static int iscntrlW( WCHAR wc )
|
extern inline int iscntrlW( WCHAR wc )
|
||||||
{
|
{
|
||||||
return get_char_typeW(wc) & C1_CNTRL;
|
return get_char_typeW(wc) & C1_CNTRL;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static int ispunctW( WCHAR wc )
|
extern inline int ispunctW( WCHAR wc )
|
||||||
{
|
{
|
||||||
return get_char_typeW(wc) & C1_PUNCT;
|
return get_char_typeW(wc) & C1_PUNCT;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static int isspaceW( WCHAR wc )
|
extern inline int isspaceW( WCHAR wc )
|
||||||
{
|
{
|
||||||
return get_char_typeW(wc) & C1_SPACE;
|
return get_char_typeW(wc) & C1_SPACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static int isdigitW( WCHAR wc )
|
extern inline int isdigitW( WCHAR wc )
|
||||||
{
|
{
|
||||||
return get_char_typeW(wc) & C1_DIGIT;
|
return get_char_typeW(wc) & C1_DIGIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static int isxdigitW( WCHAR wc )
|
extern inline int isxdigitW( WCHAR wc )
|
||||||
{
|
{
|
||||||
return get_char_typeW(wc) & C1_XDIGIT;
|
return get_char_typeW(wc) & C1_XDIGIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static int islowerW( WCHAR wc )
|
extern inline int islowerW( WCHAR wc )
|
||||||
{
|
{
|
||||||
return get_char_typeW(wc) & C1_LOWER;
|
return get_char_typeW(wc) & C1_LOWER;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static int isupperW( WCHAR wc )
|
extern inline int isupperW( WCHAR wc )
|
||||||
{
|
{
|
||||||
return get_char_typeW(wc) & C1_UPPER;
|
return get_char_typeW(wc) & C1_UPPER;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static int isalnumW( WCHAR wc )
|
extern inline int isalnumW( WCHAR wc )
|
||||||
{
|
{
|
||||||
return get_char_typeW(wc) & (C1_ALPHA|C1_DIGIT|C1_LOWER|C1_UPPER);
|
return get_char_typeW(wc) & (C1_ALPHA|C1_DIGIT|C1_LOWER|C1_UPPER);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static int isalphaW( WCHAR wc )
|
extern inline int isalphaW( WCHAR wc )
|
||||||
{
|
{
|
||||||
return get_char_typeW(wc) & (C1_ALPHA|C1_LOWER|C1_UPPER);
|
return get_char_typeW(wc) & (C1_ALPHA|C1_LOWER|C1_UPPER);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static int isgraphW( WCHAR wc )
|
extern inline int isgraphW( WCHAR wc )
|
||||||
{
|
{
|
||||||
return get_char_typeW(wc) & (C1_ALPHA|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
|
return get_char_typeW(wc) & (C1_ALPHA|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static int isprintW( WCHAR wc )
|
extern inline int isprintW( WCHAR wc )
|
||||||
{
|
{
|
||||||
return get_char_typeW(wc) & (C1_ALPHA|C1_BLANK|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
|
return get_char_typeW(wc) & (C1_ALPHA|C1_BLANK|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* some useful string manipulation routines */
|
/* some useful string manipulation routines */
|
||||||
|
|
||||||
static inline unsigned int strlenW( const WCHAR *str )
|
extern inline unsigned int strlenW( const WCHAR *str )
|
||||||
{
|
{
|
||||||
const WCHAR *s = str;
|
const WCHAR *s = str;
|
||||||
while (*s) s++;
|
while (*s) s++;
|
||||||
return s - str;
|
return s - str;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline WCHAR *strcpyW( WCHAR *dst, const WCHAR *src )
|
extern inline WCHAR *strcpyW( WCHAR *dst, const WCHAR *src )
|
||||||
{
|
{
|
||||||
WCHAR *p = dst;
|
WCHAR *p = dst;
|
||||||
while ((*p++ = *src++));
|
while ((*p++ = *src++));
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int strcmpW( const WCHAR *str1, const WCHAR *str2 )
|
/* strncpy doesn't do what you think, don't use it */
|
||||||
|
#define strncpyW(d,s,n) error do_not_use_strncpyW_use_lstrcpynW_or_memcpy_instead
|
||||||
|
|
||||||
|
extern inline int strcmpW( const WCHAR *str1, const WCHAR *str2 )
|
||||||
{
|
{
|
||||||
while (*str1 && (*str1 == *str2)) { str1++; str2++; }
|
while (*str1 && (*str1 == *str2)) { str1++; str2++; }
|
||||||
return *str1 - *str2;
|
return *str1 - *str2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int strncmpW( const WCHAR *str1, const WCHAR *str2, int n )
|
extern inline int strncmpW( const WCHAR *str1, const WCHAR *str2, int n )
|
||||||
{
|
{
|
||||||
if (n <= 0) return 0;
|
if (n <= 0) return 0;
|
||||||
while ((--n > 0) && *str1 && (*str1 == *str2)) { str1++; str2++; }
|
while ((--n > 0) && *str1 && (*str1 == *str2)) { str1++; str2++; }
|
||||||
return *str1 - *str2;
|
return *str1 - *str2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline WCHAR *strncpyW( WCHAR *str1, const WCHAR *str2, int n )
|
extern inline WCHAR *strcatW( WCHAR *dst, const WCHAR *src )
|
||||||
{
|
|
||||||
WCHAR *ret = str1;
|
|
||||||
while (n-- > 0) if (!(*str1++ = *str2++)) break;
|
|
||||||
while (n-- > 0) *str1++ = 0;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline WCHAR *strcatW( WCHAR *dst, const WCHAR *src )
|
|
||||||
{
|
{
|
||||||
strcpyW( dst + strlenW(dst), src );
|
strcpyW( dst + strlenW(dst), src );
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline WCHAR *strchrW( const WCHAR *str, WCHAR ch )
|
extern inline WCHAR *strchrW( const WCHAR *str, WCHAR ch )
|
||||||
{
|
{
|
||||||
for ( ; *str; str++) if (*str == ch) return (WCHAR *)str;
|
do { if (*str == ch) return (WCHAR *)str; } while (*str++);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline WCHAR *strrchrW( const WCHAR *str, WCHAR ch )
|
extern inline WCHAR *strrchrW( const WCHAR *str, WCHAR ch )
|
||||||
{
|
{
|
||||||
WCHAR *ret = NULL;
|
WCHAR *ret = NULL;
|
||||||
for ( ; *str; str++) if (*str == ch) ret = (WCHAR *)str;
|
do { if (*str == ch) ret = (WCHAR *)str; } while (*str++);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline WCHAR *strpbrkW( const WCHAR *str, const WCHAR *accept )
|
extern inline WCHAR *strpbrkW( const WCHAR *str, const WCHAR *accept )
|
||||||
{
|
{
|
||||||
for ( ; *str; str++) if (strchrW( accept, *str )) return (WCHAR *)str;
|
for ( ; *str; str++) if (strchrW( accept, *str )) return (WCHAR *)str;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline size_t strspnW( const WCHAR *str, const WCHAR *accept )
|
extern inline size_t strspnW( const WCHAR *str, const WCHAR *accept )
|
||||||
{
|
{
|
||||||
const WCHAR *ptr;
|
const WCHAR *ptr;
|
||||||
for (ptr = str; *ptr; ptr++) if (!strchrW( accept, *ptr )) break;
|
for (ptr = str; *ptr; ptr++) if (!strchrW( accept, *ptr )) break;
|
||||||
return ptr - str;
|
return ptr - str;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline size_t strcspnW( const WCHAR *str, const WCHAR *reject )
|
extern inline size_t strcspnW( const WCHAR *str, const WCHAR *reject )
|
||||||
{
|
{
|
||||||
const WCHAR *ptr;
|
const WCHAR *ptr;
|
||||||
for (ptr = str; *ptr; ptr++) if (strchrW( reject, *ptr )) break;
|
for (ptr = str; *ptr; ptr++) if (strchrW( reject, *ptr )) break;
|
||||||
return ptr - str;
|
return ptr - str;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline WCHAR *strlwrW( WCHAR *str )
|
extern inline WCHAR *strlwrW( WCHAR *str )
|
||||||
{
|
{
|
||||||
WCHAR *ret = str;
|
WCHAR *ret = str;
|
||||||
while ((*str = tolowerW(*str))) str++;
|
while ((*str = tolowerW(*str))) str++;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline WCHAR *struprW( WCHAR *str )
|
extern inline WCHAR *struprW( WCHAR *str )
|
||||||
{
|
{
|
||||||
WCHAR *ret = str;
|
WCHAR *ret = str;
|
||||||
while ((*str = toupperW(*str))) str++;
|
while ((*str = toupperW(*str))) str++;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n )
|
extern inline WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n )
|
||||||
{
|
{
|
||||||
const WCHAR *end;
|
const WCHAR *end;
|
||||||
for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) return (WCHAR *)ptr;
|
for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) return (WCHAR *)ptr;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline WCHAR *memrchrW( const WCHAR *ptr, WCHAR ch, size_t n )
|
extern inline WCHAR *memrchrW( const WCHAR *ptr, WCHAR ch, size_t n )
|
||||||
{
|
{
|
||||||
const WCHAR *end, *ret = NULL;
|
const WCHAR *end, *ret = NULL;
|
||||||
for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) ret = ptr;
|
for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) ret = ptr;
|
||||||
return (WCHAR *)ret;
|
return (WCHAR *)ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline long int atolW( const WCHAR *str )
|
extern inline long int atolW( const WCHAR *str )
|
||||||
{
|
{
|
||||||
return strtolW( str, (WCHAR **)0, 10 );
|
return strtolW( str, (WCHAR **)0, 10 );
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int atoiW( const WCHAR *str )
|
extern inline int atoiW( const WCHAR *str )
|
||||||
{
|
{
|
||||||
return (int)atolW( str );
|
return (int)atolW( str );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,44 @@
|
||||||
LIBRARY libwine_unicode.dll
|
LIBRARY libwine_unicode.dll
|
||||||
|
|
||||||
EXPORTS
|
EXPORTS
|
||||||
|
atoiW
|
||||||
|
atolW
|
||||||
|
get_char_typeW
|
||||||
|
isalnumW
|
||||||
|
isalphaW
|
||||||
|
iscntrlW
|
||||||
|
isdigitW
|
||||||
|
isgraphW
|
||||||
|
islowerW
|
||||||
|
isprintW
|
||||||
|
ispunctW
|
||||||
|
isspaceW
|
||||||
|
isupperW
|
||||||
|
isxdigitW
|
||||||
|
memchrW
|
||||||
memicmpW
|
memicmpW
|
||||||
|
memrchrW
|
||||||
snprintfW
|
snprintfW
|
||||||
sprintfW
|
sprintfW
|
||||||
|
strcatW
|
||||||
|
strchrW
|
||||||
|
strcmpW
|
||||||
strcmpiW
|
strcmpiW
|
||||||
|
strcpyW
|
||||||
|
strcspnW
|
||||||
|
strlenW
|
||||||
|
strlwrW
|
||||||
|
strncmpW
|
||||||
strncmpiW
|
strncmpiW
|
||||||
|
strpbrkW
|
||||||
|
strrchrW
|
||||||
|
strspnW
|
||||||
strstrW
|
strstrW
|
||||||
strtolW
|
strtolW
|
||||||
strtoulW
|
strtoulW
|
||||||
|
struprW
|
||||||
|
tolowerW
|
||||||
|
toupperW
|
||||||
vsnprintfW
|
vsnprintfW
|
||||||
vsprintfW
|
vsprintfW
|
||||||
wine_casemap_lower
|
wine_casemap_lower
|
||||||
|
@ -22,6 +52,7 @@ EXPORTS
|
||||||
wine_cpsymbol_wcstombs
|
wine_cpsymbol_wcstombs
|
||||||
wine_fold_string
|
wine_fold_string
|
||||||
wine_get_sortkey
|
wine_get_sortkey
|
||||||
|
wine_is_dbcs_leadbyte
|
||||||
wine_utf8_mbstowcs
|
wine_utf8_mbstowcs
|
||||||
wine_utf8_wcstombs
|
wine_utf8_wcstombs
|
||||||
wine_wctype_table
|
wine_wctype_table
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue