Added 'wine' prefix to libwine_unicode exports.

This commit is contained in:
Alexandre Julliard 2003-03-21 21:30:51 +00:00
parent be900ebd20
commit 25fe361010
16 changed files with 91 additions and 93 deletions

View File

@ -43,13 +43,13 @@ static const union cptable *oem_table;
inline static const union cptable *get_ansi_table(void)
{
if (!ansi_table) ansi_table = cp_get_table( 1252 );
if (!ansi_table) ansi_table = wine_cp_get_table( 1252 );
return ansi_table;
}
inline static const union cptable *get_oem_table(void)
{
if (!oem_table) oem_table = cp_get_table( 437 );
if (!oem_table) oem_table = wine_cp_get_table( 437 );
return oem_table;
}
@ -557,7 +557,7 @@ NTSTATUS WINAPI RtlMultiByteToUnicodeN( LPWSTR dst, DWORD dstlen, LPDWORD reslen
LPCSTR src, DWORD srclen )
{
int ret = cp_mbstowcs( get_ansi_table(), 0, src, srclen, dst, dstlen/sizeof(WCHAR) );
int ret = wine_cp_mbstowcs( get_ansi_table(), 0, src, srclen, dst, dstlen/sizeof(WCHAR) );
if (reslen)
*reslen = (ret >= 0) ? ret*sizeof(WCHAR) : dstlen; /* overflow -> we filled up to dstlen */
return STATUS_SUCCESS;
@ -570,7 +570,7 @@ NTSTATUS WINAPI RtlMultiByteToUnicodeN( LPWSTR dst, DWORD dstlen, LPDWORD reslen
NTSTATUS WINAPI RtlOemToUnicodeN( LPWSTR dst, DWORD dstlen, LPDWORD reslen,
LPCSTR src, DWORD srclen )
{
int ret = cp_mbstowcs( get_oem_table(), 0, src, srclen, dst, dstlen/sizeof(WCHAR) );
int ret = wine_cp_mbstowcs( get_oem_table(), 0, src, srclen, dst, dstlen/sizeof(WCHAR) );
if (reslen)
*reslen = (ret >= 0) ? ret*sizeof(WCHAR) : dstlen; /* overflow -> we filled up to dstlen */
return STATUS_SUCCESS;
@ -583,8 +583,8 @@ NTSTATUS WINAPI RtlOemToUnicodeN( LPWSTR dst, DWORD dstlen, LPDWORD reslen,
NTSTATUS WINAPI RtlUnicodeToMultiByteN( LPSTR dst, DWORD dstlen, LPDWORD reslen,
LPCWSTR src, DWORD srclen )
{
int ret = cp_wcstombs( get_ansi_table(), 0, src, srclen / sizeof(WCHAR),
dst, dstlen, NULL, NULL );
int ret = wine_cp_wcstombs( get_ansi_table(), 0, src, srclen / sizeof(WCHAR),
dst, dstlen, NULL, NULL );
if (reslen)
*reslen = (ret >= 0) ? ret : dstlen; /* overflow -> we filled up to dstlen */
return STATUS_SUCCESS;
@ -597,8 +597,8 @@ NTSTATUS WINAPI RtlUnicodeToMultiByteN( LPSTR dst, DWORD dstlen, LPDWORD reslen,
NTSTATUS WINAPI RtlUnicodeToOemN( LPSTR dst, DWORD dstlen, LPDWORD reslen,
LPCWSTR src, DWORD srclen )
{
int ret = cp_wcstombs( get_oem_table(), 0, src, srclen / sizeof(WCHAR),
dst, dstlen, NULL, NULL );
int ret = wine_cp_wcstombs( get_oem_table(), 0, src, srclen / sizeof(WCHAR),
dst, dstlen, NULL, NULL );
if (reslen)
*reslen = (ret >= 0) ? ret : dstlen; /* overflow -> we filled up to dstlen */
return STATUS_SUCCESS;
@ -817,7 +817,7 @@ NTSTATUS WINAPI RtlUpcaseUnicodeToOemN( LPSTR dst, DWORD dstlen, LPDWORD reslen,
*/
UINT WINAPI RtlOemStringToUnicodeSize( const STRING *str )
{
int ret = cp_mbstowcs( get_oem_table(), 0, str->Buffer, str->Length, NULL, 0 );
int ret = wine_cp_mbstowcs( get_oem_table(), 0, str->Buffer, str->Length, NULL, 0 );
return (ret + 1) * sizeof(WCHAR);
}
@ -859,7 +859,7 @@ DWORD WINAPI RtlAnsiStringToUnicodeSize( const STRING *str )
*/
NTSTATUS WINAPI RtlMultiByteToUnicodeSize( DWORD *size, LPCSTR str, UINT len )
{
*size = cp_mbstowcs( get_ansi_table(), 0, str, len, NULL, 0 ) * sizeof(WCHAR);
*size = wine_cp_mbstowcs( get_ansi_table(), 0, str, len, NULL, 0 ) * sizeof(WCHAR);
return STATUS_SUCCESS;
}
@ -880,7 +880,7 @@ NTSTATUS WINAPI RtlMultiByteToUnicodeSize( DWORD *size, LPCSTR str, UINT len )
*/
NTSTATUS WINAPI RtlUnicodeToMultiByteSize( PULONG size, LPCWSTR str, ULONG len )
{
*size = cp_wcstombs( get_ansi_table(), 0, str, len / sizeof(WCHAR), NULL, 0, NULL, NULL );
*size = wine_cp_wcstombs( get_ansi_table(), 0, str, len / sizeof(WCHAR), NULL, 0, NULL, NULL );
return STATUS_SUCCESS;
}
@ -921,8 +921,8 @@ DWORD WINAPI RtlUnicodeStringToAnsiSize( const UNICODE_STRING *str )
*/
DWORD WINAPI RtlUnicodeStringToOemSize( const UNICODE_STRING *str )
{
return cp_wcstombs( get_oem_table(), 0, str->Buffer, str->Length / sizeof(WCHAR),
NULL, 0, NULL, NULL ) + 1;
return wine_cp_wcstombs( get_oem_table(), 0, str->Buffer, str->Length / sizeof(WCHAR),
NULL, 0, NULL, NULL ) + 1;
}

View File

@ -59,17 +59,17 @@ union cptable
struct dbcs_table dbcs;
};
extern const union cptable *cp_get_table( unsigned int codepage );
extern const union cptable *cp_enum_table( unsigned int index );
extern const union cptable *wine_cp_get_table( unsigned int codepage );
extern const union cptable *wine_cp_enum_table( unsigned int index );
extern int cp_mbstowcs( const union cptable *table, int flags,
const char *src, int srclen,
WCHAR *dst, int dstlen );
extern int cp_wcstombs( const union cptable *table, int flags,
const WCHAR *src, int srclen,
char *dst, int dstlen, const char *defchar, int *used );
extern int utf8_wcstombs( const WCHAR *src, int srclen, char *dst, int dstlen );
extern int utf8_mbstowcs( int flags, const char *src, int srclen, WCHAR *dst, int dstlen );
extern int wine_cp_mbstowcs( const union cptable *table, int flags,
const char *src, int srclen,
WCHAR *dst, int dstlen );
extern int wine_cp_wcstombs( const union cptable *table, int flags,
const WCHAR *src, int srclen,
char *dst, int dstlen, const char *defchar, int *used );
extern int wine_utf8_wcstombs( const WCHAR *src, int srclen, char *dst, int dstlen );
extern int wine_utf8_mbstowcs( int flags, const char *src, int srclen, WCHAR *dst, int dstlen );
extern int strcmpiW( const WCHAR *str1, const WCHAR *str2 );
extern int strncmpiW( const WCHAR *str1, const WCHAR *str2, int n );
@ -88,22 +88,22 @@ static inline int is_dbcs_leadbyte( const union cptable *table, unsigned char ch
static inline WCHAR tolowerW( WCHAR ch )
{
extern const WCHAR casemap_lower[];
return ch + casemap_lower[casemap_lower[ch >> 8] + (ch & 0xff)];
extern const WCHAR wine_casemap_lower[];
return ch + wine_casemap_lower[wine_casemap_lower[ch >> 8] + (ch & 0xff)];
}
static inline WCHAR toupperW( WCHAR ch )
{
extern const WCHAR casemap_upper[];
return ch + casemap_upper[casemap_upper[ch >> 8] + (ch & 0xff)];
extern const WCHAR wine_casemap_upper[];
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 */
static inline unsigned short get_char_typeW( WCHAR ch )
{
extern const unsigned short wctype_table[];
return wctype_table[wctype_table[ch >> 8] + (ch & 0xff)];
extern const unsigned short wine_wctype_table[];
return wine_wctype_table[wine_wctype_table[ch >> 8] + (ch & 0xff)];
}
inline static int iscntrlW( WCHAR wc )

View File

@ -3,7 +3,7 @@
#include "wine/unicode.h"
const WCHAR casemap_lower[3328] =
const WCHAR wine_casemap_lower[3328] =
{
/* index */
0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, 0x0100, 0x0100,
@ -435,7 +435,7 @@ const WCHAR casemap_lower[3328] =
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};
const WCHAR casemap_upper[3328] =
const WCHAR wine_casemap_upper[3328] =
{
/* index */
0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, 0x0100, 0x0100,

View File

@ -738,8 +738,8 @@ sub DUMP_CASE_MAPPINGS
printf OUTPUT "/* Automatically generated; DO NOT EDIT!! */\n\n";
printf OUTPUT "#include \"wine/unicode.h\"\n\n";
DUMP_CASE_TABLE( "casemap_lower", @tolower_table );
DUMP_CASE_TABLE( "casemap_upper", @toupper_table );
DUMP_CASE_TABLE( "wine_casemap_lower", @tolower_table );
DUMP_CASE_TABLE( "wine_casemap_upper", @toupper_table );
close OUTPUT;
}
@ -820,7 +820,7 @@ sub DUMP_CTYPE_TABLES
}
}
printf OUTPUT "const unsigned short wctype_table[%d] =\n{\n", $#array+1;
printf OUTPUT "const unsigned short wine_wctype_table[%d] =\n{\n", $#array+1;
printf OUTPUT " /* offsets */\n%s,\n", DUMP_ARRAY( "0x%04x", 0, @array[0..255] );
printf OUTPUT " /* values */\n%s\n};\n", DUMP_ARRAY( "0x%04x", 0, @array[256..$#array] );

View File

@ -161,7 +161,7 @@ static int cmp_codepage( const void *codepage, const void *entry )
/* get the table of a given code page */
const union cptable *cp_get_table( unsigned int codepage )
const union cptable *wine_cp_get_table( unsigned int codepage )
{
const union cptable **res;
@ -172,7 +172,7 @@ const union cptable *cp_get_table( unsigned int codepage )
/* enum valid codepages */
const union cptable *cp_enum_table( unsigned int index )
const union cptable *wine_cp_enum_table( unsigned int index )
{
if (index >= NB_CODEPAGES) return NULL;
return cptables[index];

View File

@ -249,9 +249,9 @@ static int mbstowcs_dbcs_decompose( const struct dbcs_table *table,
/* return -1 on dst buffer overflow, -2 on invalid input char */
int cp_mbstowcs( const union cptable *table, int flags,
const char *src, int srclen,
WCHAR *dst, int dstlen )
int wine_cp_mbstowcs( const union cptable *table, int flags,
const char *src, int srclen,
WCHAR *dst, int dstlen )
{
if (table->info.char_size == 1)
{

View File

@ -60,7 +60,7 @@ inline static int get_length_wcs_utf8( const WCHAR *src, unsigned int srclen )
/* wide char to UTF-8 string conversion */
/* return -1 on dst buffer overflow */
int utf8_wcstombs( const WCHAR *src, int srclen, char *dst, int dstlen )
int wine_utf8_wcstombs( const WCHAR *src, int srclen, char *dst, int dstlen )
{
int ret = srclen;
@ -140,7 +140,7 @@ inline static int get_length_mbs_utf8( const unsigned char *src, int srclen )
/* UTF-8 to wide char string conversion */
/* return -1 on dst buffer overflow, -2 on invalid input char */
int utf8_mbstowcs( int flags, const char *src, int srclen, WCHAR *dst, int dstlen )
int wine_utf8_mbstowcs( int flags, const char *src, int srclen, WCHAR *dst, int dstlen )
{
int len, count;
unsigned int res;

View File

@ -420,9 +420,9 @@ static int wcstombs_dbcs_slow( const struct dbcs_table *table, int flags,
/* wide char to multi byte string conversion */
/* return -1 on dst buffer overflow */
int cp_wcstombs( const union cptable *table, int flags,
const WCHAR *src, int srclen,
char *dst, int dstlen, const char *defchar, int *used )
int wine_cp_wcstombs( const union cptable *table, int flags,
const WCHAR *src, int srclen,
char *dst, int dstlen, const char *defchar, int *used )
{
if (table->info.char_size == 1)
{

View File

@ -3,7 +3,7 @@
#include "wine/unicode.h"
const unsigned short wctype_table[13568] =
const unsigned short wine_wctype_table[13568] =
{
/* offsets */
0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, 0x0800,

View File

@ -1,19 +1,19 @@
EXPORTS
casemap_lower
casemap_upper
cp_enum_table
cp_get_table
cp_mbstowcs
cp_wcstombs
snprintfW
sprintfW
strcmpiW
strncmpiW
strstrW
strtolW
strtoulW
utf8_mbstowcs
utf8_wcstombs
vsnprintfW
vsprintfW
wctype_table
snprintfW
sprintfW
strcmpiW
strncmpiW
strstrW
strtolW
strtoulW
vsnprintfW
vsprintfW
wine_casemap_lower
wine_casemap_upper
wine_cp_enum_table
wine_cp_get_table
wine_cp_mbstowcs
wine_cp_wcstombs
wine_utf8_mbstowcs
wine_utf8_wcstombs
wine_wctype_table

View File

@ -41,9 +41,9 @@ static LCID default_lcid = MAKELCID( MAKELANGID(LANG_ENGLISH,SUBLANG_DEFAULT), S
/* setup default codepage info before we can get at the locale stuff */
static void init_codepages(void)
{
ansi_cptable = cp_get_table( 1252 );
oem_cptable = cp_get_table( 437 );
mac_cptable = cp_get_table( 10000 );
ansi_cptable = wine_cp_get_table( 1252 );
oem_cptable = wine_cp_get_table( 437 );
mac_cptable = wine_cp_get_table( 10000 );
assert( ansi_cptable );
assert( oem_cptable );
assert( mac_cptable );
@ -74,7 +74,7 @@ static const union cptable *get_codepage_table( unsigned int codepage )
if (codepage == ansi_cptable->info.codepage) return ansi_cptable;
if (codepage == oem_cptable->info.codepage) return oem_cptable;
if (codepage == mac_cptable->info.codepage) return mac_cptable;
ret = cp_get_table( codepage );
ret = wine_cp_get_table( codepage );
break;
}
return ret;
@ -91,9 +91,9 @@ void CODEPAGE_Init( UINT ansi, UINT oem, UINT mac, LCID lcid )
default_lcid = lcid;
if (!ansi_cptable) init_codepages(); /* just in case */
if ((table = cp_get_table( ansi ))) ansi_cptable = table;
if ((table = cp_get_table( oem ))) oem_cptable = table;
if ((table = cp_get_table( mac ))) mac_cptable = table;
if ((table = wine_cp_get_table( ansi ))) ansi_cptable = table;
if ((table = wine_cp_get_table( oem ))) oem_cptable = table;
if ((table = wine_cp_get_table( mac ))) mac_cptable = table;
__wine_init_codepages( ansi_cptable, oem_cptable );
TRACE( "ansi=%03d oem=%03d mac=%03d\n", ansi_cptable->info.codepage,
@ -135,7 +135,7 @@ BOOL WINAPI IsValidCodePage( UINT codepage )
case CP_UTF8:
return TRUE;
default:
return cp_get_table( codepage ) != NULL;
return wine_cp_get_table( codepage ) != NULL;
}
}
@ -257,7 +257,7 @@ BOOL WINAPI EnumSystemCodePagesA( CODEPAGE_ENUMPROCA lpfnCodePageEnum, DWORD fla
for (;;)
{
if (!(table = cp_enum_table( index++ ))) break;
if (!(table = wine_cp_enum_table( index++ ))) break;
sprintf( buffer, "%d", table->info.codepage );
if (!lpfnCodePageEnum( buffer )) break;
}
@ -276,7 +276,7 @@ BOOL WINAPI EnumSystemCodePagesW( CODEPAGE_ENUMPROCW lpfnCodePageEnum, DWORD fla
for (;;)
{
if (!(table = cp_enum_table( index++ ))) break;
if (!(table = wine_cp_enum_table( index++ ))) break;
p = buffer + sizeof(buffer)/sizeof(WCHAR);
*--p = 0;
page = table->info.codepage;
@ -340,7 +340,7 @@ INT WINAPI MultiByteToWideChar( UINT page, DWORD flags, LPCSTR src, INT srclen,
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
return 0;
case CP_UTF8:
ret = utf8_mbstowcs( flags, src, srclen, dst, dstlen );
ret = wine_utf8_mbstowcs( flags, src, srclen, dst, dstlen );
break;
default:
if (!(table = get_codepage_table( page )))
@ -348,7 +348,7 @@ INT WINAPI MultiByteToWideChar( UINT page, DWORD flags, LPCSTR src, INT srclen,
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
ret = cp_mbstowcs( table, flags, src, srclen, dst, dstlen );
ret = wine_cp_mbstowcs( table, flags, src, srclen, dst, dstlen );
break;
}
@ -413,7 +413,7 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen,
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
return 0;
case CP_UTF8:
ret = utf8_wcstombs( src, srclen, dst, dstlen );
ret = wine_utf8_wcstombs( src, srclen, dst, dstlen );
break;
default:
if (!(table = get_codepage_table( page )))
@ -421,8 +421,8 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen,
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
ret = cp_wcstombs( table, flags, src, srclen, dst, dstlen,
defchar, used ? &used_tmp : NULL );
ret = wine_cp_wcstombs( table, flags, src, srclen, dst, dstlen,
defchar, used ? &used_tmp : NULL );
if (used) *used = used_tmp;
break;
}

View File

@ -152,7 +152,7 @@ void show_codepages(void)
unsigned i;
const union cptable *cpp;
printf("Codepages:\n");
for(i = 0; (cpp = cp_enum_table(i)); i++)
for(i = 0; (cpp = wine_cp_enum_table(i)); i++)
{
printf("%-5d %s\n", cpp->info.codepage, cpp->info.name);
}
@ -160,5 +160,5 @@ void show_codepages(void)
const union cptable *find_codepage(int id)
{
return cp_get_table(id);
return wine_cp_get_table(id);
}

View File

@ -201,7 +201,7 @@ try_again:
else if(!cptr)
return 0;
assert(codepage_def != NULL);
n = cp_mbstowcs(codepage_def, 0, xlatebuffer, strlen(xlatebuffer)+1, inputbuffer, INPUTBUFFER_SIZE);
n = wine_cp_mbstowcs(codepage_def, 0, xlatebuffer, strlen(xlatebuffer)+1, inputbuffer, INPUTBUFFER_SIZE);
if(n < 0)
internal_error(__FILE__, __LINE__, "Could not translate to unicode (%d)", n);
if(n <= 1)
@ -745,4 +745,3 @@ int yylex(void)
}
}
}

View File

@ -99,7 +99,7 @@ static char *dup_u2c(int cp, const WCHAR *uc)
const union cptable *cpdef = find_codepage(cp);
if(!cpdef)
internal_error(__FILE__, __LINE__, "Codepage %d not found (vanished?)", cp);
if((len = cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, cptr, len+1, NULL, NULL)) < 0)
if((len = wine_cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, cptr, len+1, NULL, NULL)) < 0)
internal_error(__FILE__, __LINE__, "Buffer overflow? code %d.", len);
return cptr;
}
@ -382,7 +382,7 @@ static char *make_string(WCHAR *uc, int len, int codepage)
const union cptable *cpdef = find_codepage(codepage);
assert(cpdef != NULL);
if((i = cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, tmp, 2*len+1, NULL, NULL)) < 0)
if((i = wine_cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, tmp, 2*len+1, NULL, NULL)) < 0)
internal_error(__FILE__, __LINE__, "Buffer overflow? code %d.", i);
*cptr++ = ' ';
*cptr++ = '"';
@ -506,4 +506,3 @@ void write_bin_files(void)
{
assert(rcinline == 0);
}

View File

@ -353,7 +353,7 @@ static struct keyword *iskeyword(char *kw)
yy_pop_state();
while (*p < '0' || *p > '9') p++;
current_codepage = strtol( p, NULL, 10 );
if (current_codepage && !cp_get_table( current_codepage ))
if (current_codepage && !wine_cp_get_table( current_codepage ))
{
yyerror("Codepage %d not supported", current_codepage);
current_codepage = 0;

View File

@ -247,7 +247,7 @@ int compare_name_id(name_id_t *n1, name_id_t *n2)
string_t *convert_string(const string_t *str, enum str_e type, int codepage)
{
const union cptable *cptable = codepage ? cp_get_table( codepage ) : NULL;
const union cptable *cptable = codepage ? wine_cp_get_table( codepage ) : NULL;
string_t *ret = xmalloc(sizeof(*ret));
if (!cptable && str->type != type)
@ -256,18 +256,18 @@ string_t *convert_string(const string_t *str, enum str_e type, int codepage)
if((str->type == str_char) && (type == str_unicode))
{
ret->type = str_unicode;
ret->size = cp_mbstowcs( cptable, 0, str->str.cstr, str->size, NULL, 0 );
ret->size = wine_cp_mbstowcs( cptable, 0, str->str.cstr, str->size, NULL, 0 );
ret->str.wstr = xmalloc( (ret->size+1) * sizeof(WCHAR) );
cp_mbstowcs( cptable, 0, str->str.cstr, str->size, ret->str.wstr, ret->size );
wine_cp_mbstowcs( cptable, 0, str->str.cstr, str->size, ret->str.wstr, ret->size );
ret->str.wstr[ret->size] = 0;
}
else if((str->type == str_unicode) && (type == str_char))
{
ret->type = str_char;
ret->size = cp_wcstombs( cptable, 0, str->str.wstr, str->size,
NULL, 0, NULL, NULL );
ret->size = wine_cp_wcstombs( cptable, 0, str->str.wstr, str->size,
NULL, 0, NULL, NULL );
ret->str.cstr = xmalloc( ret->size + 1 );
cp_wcstombs( cptable, 0, str->str.wstr, str->size, ret->str.cstr, ret->size,
wine_cp_wcstombs( cptable, 0, str->str.wstr, str->size, ret->str.cstr, ret->size,
NULL, NULL );
ret->str.cstr[ret->size] = 0;
}
@ -436,6 +436,6 @@ int get_language_codepage( unsigned short lang, unsigned short sublang )
}
if (cp == -1) cp = defcp;
assert( cp <= 0 || cp_get_table(cp) );
assert( cp <= 0 || wine_cp_get_table(cp) );
return cp;
}