shape.c
shaping.c
usp10.c
- usp10_internal.h
+ precomp.h
${CMAKE_CURRENT_BINARY_DIR}/usp10_stubs.c)
add_library(usp10 SHARED
set_module_type(usp10 win32dll)
target_link_libraries(usp10 wine)
add_importlibs(usp10 advapi32 user32 gdi32 msvcrt kernel32 ntdll)
-add_pch(usp10 usp10_internal.h SOURCE)
+add_pch(usp10 precomp.h SOURCE)
add_cd_file(TARGET usp10 DESTINATION reactos/system32 FOR all)
* has been modified.
*/
-#include <windef.h>
-
-#include <wine/list.h>
+#include "config.h"
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winnls.h"
+#include "usp10.h"
+#include "wine/unicode.h"
+#include "wine/debug.h"
+#include "wine/heap.h"
+#include "wine/list.h"
#include "usp10_internal.h"
WCHAR *open_stack;
int *stack_index;
int stack_top = iso_run->length;
+ unsigned int pair_count = 0;
BracketPair *out = NULL;
- int pair_count = 0;
+ SIZE_T out_size = 0;
int i;
open_stack = heap_alloc(iso_run->length * sizeof(*open_stack));
for (i = 0; i < iso_run->length; i++)
{
unsigned short ubv = get_table_entry(bidi_bracket_table, iso_run->item[i].ch);
- if (ubv)
+
+ if (!ubv)
+ continue;
+
+ if ((ubv >> 8) == 0)
{
- if (!out)
- {
- out = heap_alloc(sizeof(*out));
- out[0].start = -1;
- }
+ --stack_top;
+ open_stack[stack_top] = iso_run->item[i].ch + (signed char)(ubv & 0xff);
+ /* Deal with canonical equivalent U+2329/232A and U+3008/3009. */
+ if (open_stack[stack_top] == 0x232a)
+ open_stack[stack_top] = 0x3009;
+ stack_index[stack_top] = i;
+ }
+ else if ((ubv >> 8) == 1)
+ {
+ unsigned int j;
- if ((ubv >> 8) == 0)
- {
- stack_top --;
- open_stack[stack_top] = iso_run->item[i].ch + (signed char)(ubv & 0xff);
- /* deal with canonical equivalent U+2329/232A and U+3008/3009 */
- if (open_stack[stack_top] == 0x232A)
- open_stack[stack_top] = 0x3009;
- stack_index[stack_top] = i;
- }
- else if ((ubv >> 8) == 1)
+ for (j = stack_top; j < iso_run->length; ++j)
{
- int j;
- if (stack_top == iso_run->length) continue;
- for (j = stack_top; j < iso_run->length; j++)
- {
- WCHAR c = iso_run->item[i].ch;
- if (c == 0x232A) c = 0x3009;
- if (c == open_stack[j])
- {
- out[pair_count].start = stack_index[j];
- out[pair_count].end = i;
- pair_count++;
- out = HeapReAlloc(GetProcessHeap(), 0, out, sizeof(BracketPair) * (pair_count+1));
- out[pair_count].start = -1;
- stack_top = j+1;
- break;
- }
- }
+ WCHAR c = iso_run->item[i].ch;
+
+ if (c == 0x232a)
+ c = 0x3009;
+
+ if (c != open_stack[j])
+ continue;
+
+ if (!(usp10_array_reserve((void **)&out, &out_size, pair_count + 2, sizeof(*out))))
+ ERR("Failed to grow output array.\n");
+
+ out[pair_count].start = stack_index[j];
+ out[pair_count].end = i;
+ ++pair_count;
+
+ out[pair_count].start = -1;
+ stack_top = j + 1;
+ break;
}
}
}
- if (pair_count == 0)
- {
- heap_free(out);
- out = NULL;
- }
- else if (pair_count > 1)
- qsort(out, pair_count, sizeof(BracketPair), compr);
heap_free(open_stack);
heap_free(stack_index);
+
+ if (!pair_count)
+ return NULL;
+
+ qsort(out, pair_count, sizeof(*out), compr);
+
return out;
}
/* generated from http://www.unicode.org/Public/10.0.0/ucd/BidiBrackets.txt */
/* DO NOT EDIT!! */
-const unsigned short /* DECLSPEC_HIDDEN */ bidi_bracket_table[768] =
+#include "wine/unicode.h"
+
+const unsigned short DECLSPEC_HIDDEN bidi_bracket_table[768] =
{
/* level 1 offsets */
0x0100, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110,
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
+#include "config.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "wingdi.h"
+#include "winnls.h"
+#include "usp10.h"
+#include "winternl.h"
+
+#include "wine/debug.h"
+#include "wine/heap.h"
#include "usp10_internal.h"
WINE_DEFAULT_DEBUG_CHANNEL(uniscribe);
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
-
+#include "config.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "wingdi.h"
+#include "winnls.h"
+#include "usp10.h"
+#include "winternl.h"
+
+#include "wine/debug.h"
+#include "wine/heap.h"
#include "usp10_internal.h"
WINE_DEFAULT_DEBUG_CHANNEL(uniscribe);
/* and from http://www.unicode.org/Public/10.0.0/ucd/IndicPositionalCategory.txt */
/* DO NOT EDIT!! */
-const unsigned short /* DECLSPEC_HIDDEN */ indic_syllabic_table[3312] =
+#include "wine/unicode.h"
+
+const unsigned short DECLSPEC_HIDDEN indic_syllabic_table[3312] =
{
/* level 1 offsets */
0x0100, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110,
/* generated from http://www.unicode.org/Public/10.0.0/ucd/LineBreak.txt */
/* DO NOT EDIT!! */
-const unsigned short /* DECLSPEC_HIDDEN */ wine_linebreak_table[7248] =
+#include "wine/unicode.h"
+
+const unsigned short DECLSPEC_HIDDEN wine_linebreak_table[7248] =
{
/* level 1 offsets */
0x0100, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0170,
/* generated from http://www.unicode.org/Public/10.0.0/ucd/BidiMirroring.txt */
/* DO NOT EDIT!! */
-#include <windef.h>
-#include <winnt.h>
+#include "wine/unicode.h"
const WCHAR DECLSPEC_HIDDEN wine_mirror_map[3292] =
{
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
+#include <stdarg.h>
+#include <stdlib.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winnls.h"
+#include "usp10.h"
+#include "winternl.h"
#include "usp10_internal.h"
-#include <winternl.h>
+#include "wine/debug.h"
+#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(uniscribe);
--- /dev/null
+
+#ifndef _USP10_PRECOMP_H_
+#define _USP10_PRECOMP_H_
+
+#include <config.h>
+
+#include <stdarg.h>
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+#include <windef.h>
+#include <winbase.h>
+#include <wingdi.h>
+#include <usp10.h>
+
+#include <wine/debug.h>
+#include <wine/unicode.h>
+
+#include "usp10_internal.h"
+
+#endif /* !_USP10_PRECOMP_H_ */
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
+#include <stdarg.h>
+#include <stdlib.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winnls.h"
+#include "usp10.h"
+#include "winternl.h"
#include "usp10_internal.h"
+#include "wine/debug.h"
+#include "wine/heap.h"
+
WINE_DEFAULT_DEBUG_CHANNEL(uniscribe);
#define FIRST_ARABIC_CHAR 0x0600
/* generated from http://www.unicode.org/Public/10.0.0/ucd/ArabicShaping.txt */
/* DO NOT EDIT!! */
-const unsigned short /* DECLSPEC_HIDDEN */ wine_shaping_table[2912] =
+#include "wine/unicode.h"
+
+const unsigned short DECLSPEC_HIDDEN wine_shaping_table[2912] =
{
/* level 1 offsets */
0x0100, 0x0110, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160,
0x0000, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000
};
-const unsigned short /* DECLSPEC_HIDDEN */ wine_shaping_forms[256][4] =
+const unsigned short DECLSPEC_HIDDEN wine_shaping_forms[256][4] =
{
{ 0x0600, 0x0600, 0x0600, 0x0600 },
{ 0x0601, 0x0601, 0x0601, 0x0601 },
* and filtering characters and bi-directional text with custom line breaks.
*/
+#include <stdarg.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winnls.h"
+#include "winreg.h"
+#include "usp10.h"
+
#include "usp10_internal.h"
-#include <math.h>
-#include <winuser.h>
-#include <winreg.h>
+#include "wine/debug.h"
+#include "wine/heap.h"
+#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(uniscribe);
if (!props && !num) return E_INVALIDARG;
- if (num) *num = sizeof(script_props)/sizeof(script_props[0]);
+ if (num) *num = ARRAY_SIZE(script_props);
if (props) *props = script_props;
return S_OK;
if (!psa->fNoGlyphIndex) /* Have Glyphs? */
fuOptions |= ETO_GLYPH_INDEX; /* Say don't do translation to glyph */
- lpDx = heap_alloc(cGlyphs * sizeof(INT) * 2);
- if (!lpDx) return E_OUTOFMEMORY;
+ if (!(lpDx = heap_calloc(cGlyphs, 2 * sizeof(*lpDx))))
+ return E_OUTOFMEMORY;
fuOptions |= ETO_PDY;
if (psa->fRTL && psa->fLogicalOrder)
{
- reordered_glyphs = heap_alloc( cGlyphs * sizeof(WORD) );
- if (!reordered_glyphs)
+ if (!(reordered_glyphs = heap_calloc(cGlyphs, sizeof(*reordered_glyphs))))
{
heap_free( lpDx );
return E_OUTOFMEMORY;
if (!level || (!vistolog && !logtovis))
return E_INVALIDARG;
- indexs = heap_alloc(sizeof(int) * runs);
- if (!indexs)
+ if (!(indexs = heap_calloc(runs, sizeof(*indexs))))
return E_OUTOFMEMORY;
if (vistolog)
*
*/
-#ifndef _USP10_INTERNAL_H_
-#define _USP10_INTERNAL_H_
+#pragma once
-#include <config.h>
-
-#include <stdarg.h>
-
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-
-#include <windef.h>
-#include <winbase.h>
-#include <wingdi.h>
-#include <usp10.h>
-
-#include <wine/debug.h>
-#include <wine/unicode.h>
-#include <wine/list.h>
+#include "wine/list.h"
#define MS_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
( ( (ULONG)_x4 << 24 ) | \
enum {lex_Halant, lex_Composed_Vowel, lex_Matra_post, lex_Matra_pre, lex_Matra_above, lex_Matra_below, lex_ZWJ, lex_ZWNJ, lex_NBSP, lex_Modifier, lex_Vowel, lex_Consonant, lex_Generic, lex_Ra, lex_Vedic, lex_Anudatta, lex_Nukta};
-static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t size)
-{
- return HeapAlloc(GetProcessHeap(), 0, size);
-}
-
-static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t size)
-{
- return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
-}
-
-static inline BOOL heap_free(void *mem)
-{
- return HeapFree(GetProcessHeap(), 0, mem);
-}
-
static inline BOOL is_consonant( int type )
{
return (type == lex_Ra || type == lex_Consonant);
HRESULT OpenType_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags) DECLSPEC_HIDDEN;
HRESULT OpenType_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pLanguageTags, int *pcTags) DECLSPEC_HIDDEN;
HRESULT OpenType_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG language_tag, BOOL filtered, OPENTYPE_TAG searchingFor, char tableType, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags, LoadedFeature** feature) DECLSPEC_HIDDEN;
-
-#endif /* _USP10_INTERNAL_H_ */
reactos/dll/win32/updspapi # Synced to WineStaging-3.3
reactos/dll/win32/url # Synced to WineStaging-3.3
reactos/dll/win32/urlmon # Synced to WineStaging-3.3
-reactos/dll/win32/usp10 # Synced to Wine-3.0
+reactos/dll/win32/usp10 # Synced to WineStaging-3.3
reactos/dll/win32/uxtheme # Forked
reactos/dll/win32/vbscript # Synced to Wine-3.0
reactos/dll/win32/version # Synced to Wine-3.0