30#define NO_SHLWAPI_STREAM
37#include "wine/unicode.h"
52 LPWSTR thousand_buffer,
int thousand_bufwlen)
62 fmt->lpThousandSep = thousand_buffer;
63 fmt->lpDecimalSep = decimal_buffer;
71 for (
c = grouping; *
c;
c++)
72 if (*
c >=
'0' && *
c <
'9')
75 fmt->Grouping += *
c -
'0';
78 if (
fmt->Grouping % 10 == 0)
95 WCHAR decimal[8], thousand[8];
98 BOOL neg = (qdwValue < 0);
106 *(--
c) =
'0' + (qdwValue%10);
108 }
while (qdwValue > 0);
126 static const WCHAR flfmt[] = {
'%',
'f',0};
129 WCHAR decimal[8], thousand[8];
134 fmt.NumDigits = decimals;
155 if (lpszStr && lpszSrc)
177 if (lpszStr && lpszSrc)
210 WARN(
"Invalid lpStrRet would crash under Win32!\n");
237 FIXME(
"unknown type!\n");
257 WARN(
"Invalid lpStrRet would crash under Win32!\n");
265 switch (
src->uType) {
297 FIXME(
"unknown type!\n");
322 switch (lpStrRet->
uType)
353 switch (lpStrRet->
uType)
422 switch (lpStrRet->
uType)
477 static const WCHAR kb[] = {
' ',
'K',
'B',0};
478 LONGLONG llKB = (llBytes + 1023) >> 10;
512 LPSTR lpszRet = lpszStr;
518 WARN(
"Invalid lpszStr would crash under Win32!\n");
539 WARN(
"Invalid lpszStr would crash under Win32\n");
682 DWORD dwNextDigit = dwNum % 10;
683 *lpszOut-- =
'0' + dwNextDigit;
684 dwNum = (dwNum - dwNextDigit) / 10;
717 UINT uClassStringId,
int iDigits)
719 WCHAR szBuff[64], *szOut = szBuff + 32;
765 TRACE(
"(%p,%d,%ld,%d)\n", lpszStr,
cchMax, dwMS, iDigits);
787 TRACE(
"(%p,%d,%ld,%d)\n", lpszStr,
cchMax, dwMS, iDigits);
792 DWORD dwHours, dwMinutes;
794 if (!iDigits ||
cchMax == 1)
801 dwMS = (dwMS + 500) / 1000;
802 dwHours = dwMS / 3600;
803 dwMS -= dwHours * 3600;
804 dwMinutes = dwMS / 60;
805 dwMS -= dwMinutes * 60;
812 if (dwMinutes && iDigits)
880#define KB ((ULONGLONG)1024)
883#define TB (KB*KB*KB*KB)
884#define PB (KB*KB*KB*KB*KB)
889 { 10*
KB, 10.24, 100.0, 2, IDS_KB_FORMAT },
890 { 100*
KB, 102.4, 10.0, 1, IDS_KB_FORMAT },
891 { 1000*
KB, 1024.0, 1.0, 0, IDS_KB_FORMAT },
892 { 10*
MB, 10485.76, 100.0, 2, IDS_MB_FORMAT },
893 { 100*
MB, 104857.6, 10.0, 1, IDS_MB_FORMAT },
894 { 1000*
MB, 1048576.0, 1.0, 0, IDS_MB_FORMAT },
895 { 10*
GB, 10737418.24, 100.0, 2, IDS_GB_FORMAT },
896 { 100*
GB, 107374182.4, 10.0, 1, IDS_GB_FORMAT },
897 { 1000*
GB, 1073741824.0, 1.0, 0, IDS_GB_FORMAT },
898 { 10*
TB, 10485.76, 100.0, 2, IDS_TB_FORMAT },
899 { 100*
TB, 104857.6, 10.0, 1, IDS_TB_FORMAT },
900 { 1000*
TB, 1048576.0, 1.0, 0, IDS_TB_FORMAT },
901 { 10*
PB, 10737418.24, 100.00, 2, IDS_PB_FORMAT },
902 { 100*
PB, 107374182.4, 10.00, 1, IDS_PB_FORMAT },
903 { 1000*
PB, 1073741824.0, 1.00, 0, IDS_PB_FORMAT },
904 { 0, 10995116277.76, 100.00, 2, IDS_EB_FORMAT }
906 { 10*
KB, 10.24, 100.0, 2,
'K' },
907 { 100*
KB, 102.4, 10.0, 1,
'K' },
908 { 1000*
KB, 1024.0, 1.0, 0,
'K' },
909 { 10*
MB, 10485.76, 100.0, 2,
'M' },
910 { 100*
MB, 104857.6, 10.0, 1,
'M' },
911 { 1000*
MB, 1048576.0, 1.0, 0,
'M' },
912 { 10*
GB, 10737418.24, 100.0, 2,
'G' },
913 { 100*
GB, 107374182.4, 10.0, 1,
'G' },
914 { 1000*
GB, 1073741824.0, 1.0, 0,
'G' },
915 { 10*
TB, 10485.76, 100.0, 2,
'T' },
916 { 100*
TB, 104857.6, 10.0, 1,
'T' },
917 { 1000*
TB, 1048576.0, 1.0, 0,
'T' },
918 { 10*
PB, 10737418.24, 100.00, 2,
'P' },
919 { 100*
PB, 107374182.4, 10.00, 1,
'P' },
920 { 1000*
PB, 1073741824.0, 1.00, 0,
'P' },
921 { 0, 10995116277.76, 100.00, 2,
'E' }
925 WCHAR szBuff[40], wszFormat[40];
927 WCHAR wszAdd[] = {
' ',
'?',
'B',0};
939 WCHAR wszBytesFormat[64];
950 if (llBytes < bfFormats[
i].dLimit)
961 dBytes = (
double)(llBytes >> 20) + 0.001;
963 dBytes = (
double)llBytes + 0.00001;
1046 LPSTR lpszIter, lpszTmp;
1053 if ((lpszIter =
StrChrA(lpszStr,
'&')))
1058 if (*lpszTmp !=
'&')
1075 LPWSTR lpszIter, lpszTmp;
1082 if ((lpszIter =
StrChrW(lpszStr,
'&')))
1084 lpszTmp = lpszIter + 1;
1087 if (*lpszTmp !=
'&')
1167 if (!lpDstStr || !
dstlen)
1194 lpDstStr[needed] =
'\0';
1210 if (reqLen > 0)
memcpy(lpDstStr,
mem, reqLen-1);
1237 lpDstStr[reqLen-1] =
'\0';
1304 return !
wcscmp(lpSrcStr, szBuff);
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void shell(int argc, const char *argv[])
#define ERROR_INSUFFICIENT_BUFFER
void *WINAPI CoTaskMemAlloc(SIZE_T size)
void WINAPI CoTaskMemFree(void *ptr)
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
LPSTR WINAPI StrChrA(LPCSTR lpszStr, WORD ch)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#define WideCharToMultiByte
#define MultiByteToWideChar
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
LPSTR WINAPI CharNextA(const char *ptr)
WCHAR *WINAPI StrCatBuffW(WCHAR *str, const WCHAR *cat, INT max_len)
DWORD WINAPI SHTruncateString(char *str, DWORD size)
WCHAR *WINAPI StrCpyNW(WCHAR *dst, const WCHAR *src, int count)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP double __cdecl floor(double)
_ACRTIMP size_t __cdecl strlen(const char *)
#define IDS_TIME_INTERVAL_MINUTES
#define IDS_TIME_INTERVAL_HOURS
#define IDS_TIME_INTERVAL_SECONDS
static HRESULT _SHStrDupAToBSTR(LPCSTR src, BSTR *pBstrOut)
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
INT WINAPI StrFromTimeIntervalW(LPWSTR lpszStr, UINT cchMax, DWORD dwMS, int iDigits)
struct tagSHLWAPI_BYTEFORMATS SHLWAPI_BYTEFORMATS
WCHAR WINAPI SHStripMneumonicW(LPCWSTR lpszStr)
LPSTR WINAPI StrNCatA(LPSTR lpszStr, LPCSTR lpszCat, INT cchMax)
LPSTR WINAPI StrFormatByteSize64A(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax)
DWORD WINAPI SHAnsiToUnicode(LPCSTR lpSrcStr, LPWSTR lpDstStr, int iLen)
INT WINAPI SHUnicodeToAnsi(LPCWSTR lpSrcStr, LPSTR lpDstStr, INT iLen)
LPWSTR WINAPI StrFormatKBSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
LPWSTR WINAPI StrCatW(LPWSTR lpszStr, LPCWSTR lpszSrc)
HRESULT WINAPI SHStrDupA(LPCSTR lpszStr, LPWSTR *lppszDest)
LPSTR WINAPI StrFormatByteSizeA(DWORD dwBytes, LPSTR lpszDest, UINT cchMax)
INT WINAPI StrFromTimeIntervalA(LPSTR lpszStr, UINT cchMax, DWORD dwMS, int iDigits)
char WINAPI SHStripMneumonicA(LPCSTR lpszStr)
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
HRESULT WINAPI StrRetToBSTR(STRRET *lpStrRet, LPCITEMIDLIST pidl, BSTR *pBstrOut)
static int FormatInt(LONGLONG qdwValue, LPWSTR pszBuf, int cchBuf)
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
BOOL WINAPI DoesStringRoundTripW(LPCWSTR lpSrcStr, LPSTR lpDst, INT iLen)
static HRESULT _SHStrDupAA(LPCSTR, LPSTR *)
HRESULT WINAPI StrFormatByteSizeEx(LONGLONG llBytes, SFBS_FLAGS flags, LPWSTR lpszDest, UINT cchMax)
LPWSTR WINAPI StrNCatW(LPWSTR lpszStr, LPCWSTR lpszCat, INT cchMax)
HRESULT WINAPI StrRetToStrA(LPSTRRET lpStrRet, const ITEMIDLIST *pidl, LPSTR *ppszName)
static int SHLWAPI_FormatSignificant(LPWSTR lpszNum, int dwDigits)
HRESULT WINAPI StrRetToStrW(LPSTRRET lpStrRet, const ITEMIDLIST *pidl, LPWSTR *ppszName)
static LPWSTR SHLWAPI_WriteReverseNum(LPWSTR lpszOut, DWORD dwNum)
HINSTANCE shlwapi_hInstance
static HRESULT _SHStrDupAW(LPCWSTR, LPSTR *)
BOOL WINAPI DoesStringRoundTripA(LPCSTR lpSrcStr, LPSTR lpDst, INT iLen)
LPWSTR WINAPI StrCpyW(LPWSTR lpszStr, LPCWSTR lpszSrc)
static void FillNumberFmt(NUMBERFMTW *fmt, LPWSTR decimal_buffer, int decimal_bufwlen, LPWSTR thousand_buffer, int thousand_bufwlen)
DWORD WINAPI SHAnsiToUnicodeCP(DWORD dwCp, LPCSTR lpSrcStr, LPWSTR lpDstStr, int iLen)
LPSTR WINAPI StrFormatKBSizeA(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax)
HRESULT WINAPI StrRetToBufA(LPSTRRET src, const ITEMIDLIST *pidl, LPSTR dest, UINT len)
DWORD WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr, int dstlen)
static int SHLWAPI_WriteTimeClass(LPWSTR lpszOut, DWORD dwValue, UINT uClassStringId, int iDigits)
static int FormatDouble(double value, int decimals, LPWSTR pszBuf, int cchBuf)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static const WCHAR emptyW[]
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
#define LOCALE_USER_DEFAULT
BSTR WINAPI SysAllocString(LPCOLESTR str)
@ SFBS_FLAGS_TRUNCATE_UNDISPLAYED_DECIMAL_DIGITS
@ SFBS_FLAGS_ROUND_TO_NEAREST_DISPLAYED_DIGIT
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
static CONVERTINETUNICODETOMULTIBYTE ConvertINetUnicodeToMultiByte
DWORD WINAPI GetLastError(void)
#define E_NOT_SUFFICIENT_BUFFER
#define LOCALE_INEGNUMBER