2001-01-11 00:59:25 +01:00
|
|
|
/*
|
|
|
|
* msvcrt.dll wide-char functions
|
|
|
|
*
|
|
|
|
* Copyright 1999 Alexandre Julliard
|
|
|
|
* Copyright 2000 Jon Griffiths
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2001-01-22 03:21:54 +01:00
|
|
|
#include <limits.h>
|
|
|
|
#include <stdio.h>
|
2001-01-11 00:59:25 +01:00
|
|
|
#include "msvcrt.h"
|
|
|
|
#include "winnls.h"
|
|
|
|
#include "wine/unicode.h"
|
|
|
|
|
2001-04-11 01:25:25 +02:00
|
|
|
#include "msvcrt/stdio.h"
|
|
|
|
#include "msvcrt/stdlib.h"
|
|
|
|
#include "msvcrt/string.h"
|
|
|
|
#include "msvcrt/wctype.h"
|
|
|
|
|
2002-01-22 01:57:16 +01:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
2001-01-11 00:59:25 +01:00
|
|
|
|
2001-01-22 03:21:54 +01:00
|
|
|
|
2001-01-11 00:59:25 +01:00
|
|
|
/* INTERNAL: MSVCRT_malloc() based wstrndup */
|
2002-12-19 05:21:30 +01:00
|
|
|
MSVCRT_wchar_t* msvcrt_wstrndup(const MSVCRT_wchar_t *buf, unsigned int size)
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2002-12-19 05:21:30 +01:00
|
|
|
MSVCRT_wchar_t* ret;
|
2001-01-11 00:59:25 +01:00
|
|
|
unsigned int len = strlenW(buf), max_len;
|
|
|
|
|
|
|
|
max_len = size <= len? size : len + 1;
|
|
|
|
|
2002-12-19 05:21:30 +01:00
|
|
|
ret = MSVCRT_malloc(max_len * sizeof (MSVCRT_wchar_t));
|
2001-01-11 00:59:25 +01:00
|
|
|
if (ret)
|
|
|
|
{
|
2002-12-19 05:21:30 +01:00
|
|
|
memcpy(ret,buf,max_len * sizeof (MSVCRT_wchar_t));
|
2001-01-11 00:59:25 +01:00
|
|
|
ret[max_len] = 0;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* _wcsdup (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
MSVCRT_wchar_t* _wcsdup( const MSVCRT_wchar_t* str )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2002-12-19 05:21:30 +01:00
|
|
|
MSVCRT_wchar_t* ret = NULL;
|
2001-01-11 00:59:25 +01:00
|
|
|
if (str)
|
|
|
|
{
|
2002-12-19 05:21:30 +01:00
|
|
|
int size = (strlenW(str) + 1) * sizeof(MSVCRT_wchar_t);
|
2001-01-11 00:59:25 +01:00
|
|
|
ret = MSVCRT_malloc( size );
|
|
|
|
if (ret) memcpy( ret, str, size );
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* _wcsicoll (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
INT _wcsicoll( const MSVCRT_wchar_t* str1, const MSVCRT_wchar_t* str2 )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
|
|
|
/* FIXME: handle collates */
|
|
|
|
return strcmpiW( str1, str2 );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* _wcsnset (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
MSVCRT_wchar_t* _wcsnset( MSVCRT_wchar_t* str, MSVCRT_wchar_t c, MSVCRT_size_t n )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2002-12-19 05:21:30 +01:00
|
|
|
MSVCRT_wchar_t* ret = str;
|
2001-01-11 00:59:25 +01:00
|
|
|
while ((n-- > 0) && *str) *str++ = c;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* _wcsrev (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
MSVCRT_wchar_t* _wcsrev( MSVCRT_wchar_t* str )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2002-12-19 05:21:30 +01:00
|
|
|
MSVCRT_wchar_t* ret = str;
|
|
|
|
MSVCRT_wchar_t* end = str + strlenW(str) - 1;
|
2001-01-11 00:59:25 +01:00
|
|
|
while (end > str)
|
|
|
|
{
|
2002-12-19 05:21:30 +01:00
|
|
|
MSVCRT_wchar_t t = *end;
|
2001-01-11 00:59:25 +01:00
|
|
|
*end-- = *str;
|
|
|
|
*str++ = t;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* _wcsset (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
MSVCRT_wchar_t* _wcsset( MSVCRT_wchar_t* str, MSVCRT_wchar_t c )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2002-12-19 05:21:30 +01:00
|
|
|
MSVCRT_wchar_t* ret = str;
|
2001-01-11 00:59:25 +01:00
|
|
|
while (*str) *str++ = c;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* _vsnwprintf (MSVCRT.@)
|
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
int _vsnwprintf(MSVCRT_wchar_t *str, unsigned int len,
|
|
|
|
const MSVCRT_wchar_t *format, va_list valist)
|
2001-01-22 03:21:54 +01:00
|
|
|
{
|
|
|
|
/* If you fix a bug in this function, fix it in ntdll/wcstring.c also! */
|
|
|
|
unsigned int written = 0;
|
2002-12-19 05:21:30 +01:00
|
|
|
const MSVCRT_wchar_t *iter = format;
|
2001-01-22 03:21:54 +01:00
|
|
|
char bufa[256], fmtbufa[64], *fmta;
|
|
|
|
|
|
|
|
TRACE("(%d,%s)\n",len,debugstr_w(format));
|
|
|
|
|
|
|
|
while (*iter)
|
|
|
|
{
|
2002-12-19 05:21:30 +01:00
|
|
|
while (*iter && *iter != '%')
|
2001-01-22 03:21:54 +01:00
|
|
|
{
|
|
|
|
if (written++ >= len)
|
|
|
|
return -1;
|
|
|
|
*str++ = *iter++;
|
|
|
|
}
|
2002-12-19 05:21:30 +01:00
|
|
|
if (*iter == '%')
|
2001-01-22 03:21:54 +01:00
|
|
|
{
|
|
|
|
fmta = fmtbufa;
|
|
|
|
*fmta++ = *iter++;
|
2002-12-19 05:21:30 +01:00
|
|
|
while (*iter == '0' ||
|
|
|
|
*iter == '+' ||
|
|
|
|
*iter == '-' ||
|
|
|
|
*iter == ' ' ||
|
|
|
|
*iter == '0' ||
|
|
|
|
*iter == '*' ||
|
|
|
|
*iter == '#')
|
2001-01-22 03:21:54 +01:00
|
|
|
{
|
2002-12-19 05:21:30 +01:00
|
|
|
if (*iter == '*')
|
2001-01-22 03:21:54 +01:00
|
|
|
{
|
|
|
|
char *buffiter = bufa;
|
|
|
|
int fieldlen = va_arg(valist, int);
|
|
|
|
sprintf(buffiter, "%d", fieldlen);
|
|
|
|
while (*buffiter)
|
|
|
|
*fmta++ = *buffiter++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
*fmta++ = *iter;
|
|
|
|
iter++;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (isdigit(*iter))
|
|
|
|
*fmta++ = *iter++;
|
|
|
|
|
2002-12-19 05:21:30 +01:00
|
|
|
if (*iter == '.')
|
2001-01-22 03:21:54 +01:00
|
|
|
{
|
|
|
|
*fmta++ = *iter++;
|
2002-12-19 05:21:30 +01:00
|
|
|
if (*iter == '*')
|
2001-01-22 03:21:54 +01:00
|
|
|
{
|
|
|
|
char *buffiter = bufa;
|
|
|
|
int fieldlen = va_arg(valist, int);
|
|
|
|
sprintf(buffiter, "%d", fieldlen);
|
|
|
|
while (*buffiter)
|
|
|
|
*fmta++ = *buffiter++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
while (isdigit(*iter))
|
|
|
|
*fmta++ = *iter++;
|
|
|
|
}
|
2002-12-19 05:21:30 +01:00
|
|
|
if (*iter == 'h' ||
|
|
|
|
*iter == 'l')
|
2001-01-22 03:21:54 +01:00
|
|
|
*fmta++ = *iter++;
|
|
|
|
|
|
|
|
switch (*iter)
|
|
|
|
{
|
2002-12-19 05:21:30 +01:00
|
|
|
case 's':
|
2001-01-22 03:21:54 +01:00
|
|
|
{
|
2002-12-19 05:21:30 +01:00
|
|
|
static const MSVCRT_wchar_t none[] = { '(', 'n', 'u', 'l', 'l', ')', 0 };
|
|
|
|
const MSVCRT_wchar_t *wstr = va_arg(valist, const MSVCRT_wchar_t *);
|
|
|
|
const MSVCRT_wchar_t *striter = wstr ? wstr : none;
|
2001-01-22 03:21:54 +01:00
|
|
|
while (*striter)
|
|
|
|
{
|
|
|
|
if (written++ >= len)
|
|
|
|
return -1;
|
|
|
|
*str++ = *striter++;
|
|
|
|
}
|
|
|
|
iter++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2002-12-19 05:21:30 +01:00
|
|
|
case 'c':
|
2001-01-22 03:21:54 +01:00
|
|
|
if (written++ >= len)
|
|
|
|
return -1;
|
2002-12-19 05:21:30 +01:00
|
|
|
*str++ = (MSVCRT_wchar_t)va_arg(valist, int);
|
2001-01-22 03:21:54 +01:00
|
|
|
iter++;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
/* For non wc types, use system sprintf and append to wide char output */
|
|
|
|
/* FIXME: for unrecognised types, should ignore % when printing */
|
|
|
|
char *bufaiter = bufa;
|
2002-12-19 05:21:30 +01:00
|
|
|
if (*iter == 'p')
|
2001-01-22 03:21:54 +01:00
|
|
|
sprintf(bufaiter, "%08lX", va_arg(valist, long));
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*fmta++ = *iter;
|
|
|
|
*fmta = '\0';
|
2002-12-19 05:21:30 +01:00
|
|
|
if (*iter == 'f')
|
2001-04-16 21:00:42 +02:00
|
|
|
sprintf(bufaiter, fmtbufa, va_arg(valist, double));
|
|
|
|
else
|
|
|
|
sprintf(bufaiter, fmtbufa, va_arg(valist, void *));
|
2001-01-22 03:21:54 +01:00
|
|
|
}
|
|
|
|
while (*bufaiter)
|
|
|
|
{
|
|
|
|
if (written++ >= len)
|
|
|
|
return -1;
|
|
|
|
*str++ = *bufaiter++;
|
|
|
|
}
|
|
|
|
iter++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (written >= len)
|
|
|
|
return -1;
|
2002-12-19 05:21:30 +01:00
|
|
|
*str++ = 0;
|
2001-01-22 03:21:54 +01:00
|
|
|
return (int)written;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* vswprintf (MSVCRT.@)
|
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
int MSVCRT_vswprintf( MSVCRT_wchar_t* str, const MSVCRT_wchar_t* format, va_list args )
|
2001-01-22 03:21:54 +01:00
|
|
|
{
|
2001-04-10 23:16:07 +02:00
|
|
|
return _vsnwprintf( str, INT_MAX, format, args );
|
2001-01-22 03:21:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* wcscoll (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
int MSVCRT_wcscoll( const MSVCRT_wchar_t* str1, const MSVCRT_wchar_t* str2 )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
|
|
|
/* FIXME: handle collates */
|
|
|
|
return strcmpW( str1, str2 );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* wcspbrk (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
MSVCRT_wchar_t* MSVCRT_wcspbrk( const MSVCRT_wchar_t* str, const MSVCRT_wchar_t* accept )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2002-12-19 05:21:30 +01:00
|
|
|
const MSVCRT_wchar_t* p;
|
2001-01-11 00:59:25 +01:00
|
|
|
while (*str)
|
|
|
|
{
|
2002-12-19 05:21:30 +01:00
|
|
|
for (p = accept; *p; p++) if (*p == *str) return (MSVCRT_wchar_t*)str;
|
2001-01-11 00:59:25 +01:00
|
|
|
str++;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* wctomb (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
INT MSVCRT_wctomb( char *dst, MSVCRT_wchar_t ch )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
|
|
|
return WideCharToMultiByte( CP_ACP, 0, &ch, 1, dst, 6, NULL, NULL );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* iswalnum (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
INT MSVCRT_iswalnum( MSVCRT_wchar_t wc )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-11-08 20:16:34 +01:00
|
|
|
return isalnumW( wc );
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* iswalpha (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
INT MSVCRT_iswalpha( MSVCRT_wchar_t wc )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-11-08 20:16:34 +01:00
|
|
|
return isalphaW( wc );
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* iswcntrl (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
INT MSVCRT_iswcntrl( MSVCRT_wchar_t wc )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-11-08 20:16:34 +01:00
|
|
|
return iscntrlW( wc );
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* iswdigit (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
INT MSVCRT_iswdigit( MSVCRT_wchar_t wc )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-11-08 20:16:34 +01:00
|
|
|
return isdigitW( wc );
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* iswgraph (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
INT MSVCRT_iswgraph( MSVCRT_wchar_t wc )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-11-08 20:16:34 +01:00
|
|
|
return isgraphW( wc );
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* iswlower (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
INT MSVCRT_iswlower( MSVCRT_wchar_t wc )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-11-08 20:16:34 +01:00
|
|
|
return islowerW( wc );
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* iswprint (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
INT MSVCRT_iswprint( MSVCRT_wchar_t wc )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-11-08 20:16:34 +01:00
|
|
|
return isprintW( wc );
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* iswpunct (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
INT MSVCRT_iswpunct( MSVCRT_wchar_t wc )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-11-08 20:16:34 +01:00
|
|
|
return ispunctW( wc );
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* iswspace (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
INT MSVCRT_iswspace( MSVCRT_wchar_t wc )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-11-08 20:16:34 +01:00
|
|
|
return isspaceW( wc );
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* iswupper (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
INT MSVCRT_iswupper( MSVCRT_wchar_t wc )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-11-08 20:16:34 +01:00
|
|
|
return isupperW( wc );
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-01-22 03:21:54 +01:00
|
|
|
* iswxdigit (MSVCRT.@)
|
2001-01-11 00:59:25 +01:00
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
INT MSVCRT_iswxdigit( MSVCRT_wchar_t wc )
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
2001-11-08 20:16:34 +01:00
|
|
|
return isxdigitW( wc );
|
2001-01-11 00:59:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _itow (MSVCRT.@)
|
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
MSVCRT_wchar_t* _itow(int value,MSVCRT_wchar_t* out,int base)
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
|
|
|
char buf[64];
|
|
|
|
_itoa(value, buf, base);
|
|
|
|
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, buf, -1, out, 128);
|
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _ltow (MSVCRT.@)
|
|
|
|
*/
|
2002-12-19 05:21:30 +01:00
|
|
|
MSVCRT_wchar_t* _ltow(long value,MSVCRT_wchar_t* out,int base)
|
2001-01-11 00:59:25 +01:00
|
|
|
{
|
|
|
|
char buf[128];
|
|
|
|
_ltoa(value, buf, base);
|
|
|
|
MultiByteToWideChar (CP_ACP, MB_PRECOMPOSED, buf, -1, out, 128);
|
|
|
|
return out;
|
|
|
|
}
|