Author: brane
Date: Mon Nov 5 13:57:35 2012
New Revision: 1405793
URL: http://svn.apache.org/viewvc?rev=1405793&view=rev
Log:
On the wc-collate-path branch: Modify utf8proc to enable inline embedding.
* subversion/libsvn_subr/utf8proc/utf8proc.h:
Prefix all function declarations with UTF8PROC_API.
(UTF8PROC_API, UTF8PROC_DATA, UTF8PROC_DATA_EXPORT): New macros; their
values depend on UTF8PROC_INLINE.
(utf8proc_utf8class): Only export if UTF8PROC_DATA_EXPORT is defined.
* subversion/libsvn_subr/utf8proc/utf8proc.c:
Prefix all function definitions with UTF8PROC_API.
(utf8proc_utf8class): Prefix definition with UTF8PROC_DATA.
* subversion/libsvn_subr/utf8proc/utf8proc_data.c:
Prefix all data table definitions with UTF8PROC_DATA.
Modified:
subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc.c
subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc.h
subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc_data.c
Modified:
subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc.c
URL:
http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc.c?rev=1405793&r1=1405792&r2=1405793&view=diff
==============================================================================
---
subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc.c
(original)
+++
subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc.c
Mon Nov 5 13:57:35 2012
@@ -43,6 +43,7 @@
#include "utf8proc_data.c"
+UTF8PROC_DATA
const int8_t utf8proc_utf8class[256] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -95,10 +96,12 @@ const int8_t utf8proc_utf8class[256] = {
#define UTF8PROC_BOUNDCLASS_LVT 10
+UTF8PROC_API
const char *utf8proc_version(void) {
return "1.1.5";
}
+UTF8PROC_API
const char *utf8proc_errmsg(ssize_t errcode) {
switch (errcode) {
case UTF8PROC_ERROR_NOMEM:
@@ -116,6 +119,7 @@ const char *utf8proc_errmsg(ssize_t errc
}
}
+UTF8PROC_API
ssize_t utf8proc_iterate(
const uint8_t *str, ssize_t strlen, int32_t *dst
) {
@@ -156,6 +160,7 @@ ssize_t utf8proc_iterate(
return length;
}
+UTF8PROC_API
bool utf8proc_codepoint_valid(int32_t uc) {
if (uc < 0 || uc >= 0x110000 ||
((uc & 0xFFFF) >= 0xFFFE) || (uc >= 0xD800 && uc < 0xE000) ||
@@ -163,6 +168,7 @@ bool utf8proc_codepoint_valid(int32_t uc
else return true;
}
+UTF8PROC_API
ssize_t utf8proc_encode_char(int32_t uc, uint8_t *dst) {
if (uc < 0x00) {
return 0;
@@ -193,6 +199,7 @@ ssize_t utf8proc_encode_char(int32_t uc,
} else return 0;
}
+UTF8PROC_API
const utf8proc_property_t *utf8proc_get_property(int32_t uc) {
/* ASSERT: uc >= 0 && uc < 0x110000 */
return utf8proc_properties + (
@@ -206,6 +213,7 @@ const utf8proc_property_t *utf8proc_get_
return utf8proc_decompose_char((replacement_uc), dst, bufsize, \
options & ~UTF8PROC_LUMP, last_boundclass)
+UTF8PROC_API
ssize_t utf8proc_decompose_char(int32_t uc, int32_t *dst, ssize_t bufsize,
int options, int *last_boundclass) {
/* ASSERT: uc >= 0 && uc < 0x110000 */
@@ -351,6 +359,7 @@ ssize_t utf8proc_decompose_char(int32_t
return 1;
}
+UTF8PROC_API
ssize_t utf8proc_decompose(
const uint8_t *str, ssize_t strlen,
int32_t *buffer, ssize_t bufsize, int options
@@ -413,6 +422,7 @@ ssize_t utf8proc_decompose(
return wpos;
}
+UTF8PROC_API
ssize_t utf8proc_reencode(int32_t *buffer, ssize_t length, int options) {
/* UTF8PROC_NULLTERM option will be ignored, 'length' is never ignored
ASSERT: 'buffer' has one spare byte of free space at the end! */
@@ -528,6 +538,7 @@ ssize_t utf8proc_reencode(int32_t *buffe
}
}
+UTF8PROC_API
ssize_t utf8proc_map(
const uint8_t *str, ssize_t strlen, uint8_t **dstptr, int options
) {
@@ -557,6 +568,7 @@ ssize_t utf8proc_map(
return result;
}
+UTF8PROC_API
uint8_t *utf8proc_NFD(const uint8_t *str) {
uint8_t *retval;
utf8proc_map(str, 0, &retval, UTF8PROC_NULLTERM | UTF8PROC_STABLE |
@@ -564,6 +576,7 @@ uint8_t *utf8proc_NFD(const uint8_t *str
return retval;
}
+UTF8PROC_API
uint8_t *utf8proc_NFC(const uint8_t *str) {
uint8_t *retval;
utf8proc_map(str, 0, &retval, UTF8PROC_NULLTERM | UTF8PROC_STABLE |
@@ -571,6 +584,7 @@ uint8_t *utf8proc_NFC(const uint8_t *str
return retval;
}
+UTF8PROC_API
uint8_t *utf8proc_NFKD(const uint8_t *str) {
uint8_t *retval;
utf8proc_map(str, 0, &retval, UTF8PROC_NULLTERM | UTF8PROC_STABLE |
@@ -578,6 +592,7 @@ uint8_t *utf8proc_NFKD(const uint8_t *st
return retval;
}
+UTF8PROC_API
uint8_t *utf8proc_NFKC(const uint8_t *str) {
uint8_t *retval;
utf8proc_map(str, 0, &retval, UTF8PROC_NULLTERM | UTF8PROC_STABLE |
Modified:
subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc.h
URL:
http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc.h?rev=1405793&r1=1405792&r2=1405793&view=diff
==============================================================================
---
subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc.h
(original)
+++
subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc.h
Mon Nov 5 13:57:35 2012
@@ -52,6 +52,22 @@
#define UTF8PROC_H
+/*
+ * Define UTF8PROC_INLINE and include utf8proc.c to embed a static
+ * version of utf8proc in your program or library without exporting
+ * any of its symbols.
+ */
+#ifdef UTF8PROC_INLINE
+#define UTF8PROC_API static
+#undef UTF8PROC_DATA_EXPORT
+#define UTF8PROC_DATA static
+#else
+#define UTF8PROC_API
+#define UTF8PROC_DATA_EXPORT
+#define UTF8PROC_DATA
+#endif
+
+
#include <stdlib.h>
#include <sys/types.h>
#ifdef _MSC_VER
@@ -235,15 +251,20 @@ typedef struct utf8proc_property_struct
#define UTF8PROC_DECOMP_TYPE_FRACTION 15
#define UTF8PROC_DECOMP_TYPE_COMPAT 16
+#ifdef UTF8PROC_DATA_EXPORT
extern const int8_t utf8proc_utf8class[256];
+#endif
+UTF8PROC_API
const char *utf8proc_version(void);
+UTF8PROC_API
const char *utf8proc_errmsg(ssize_t errcode);
/*
* Returns a static error string for the given error code.
*/
+UTF8PROC_API
ssize_t utf8proc_iterate(const uint8_t *str, ssize_t strlen, int32_t *dst);
/*
* Reads a single char from the UTF-8 sequence being pointed to by 'str'.
@@ -255,11 +276,13 @@ ssize_t utf8proc_iterate(const uint8_t *
* negative error code is returned.
*/
+UTF8PROC_API
bool utf8proc_codepoint_valid(int32_t uc);
/*
* Returns 1, if the given unicode code-point is valid, otherwise 0.
*/
+UTF8PROC_API
ssize_t utf8proc_encode_char(int32_t uc, uint8_t *dst);
/*
* Encodes the unicode char with the code point 'uc' as an UTF-8 string in
@@ -270,6 +293,7 @@ ssize_t utf8proc_encode_char(int32_t uc,
* This function does not check if 'uc' is a valid unicode code point.
*/
+UTF8PROC_API
const utf8proc_property_t *utf8proc_get_property(int32_t uc);
/*
* Returns a pointer to a (constant) struct containing information about
@@ -280,6 +304,7 @@ const utf8proc_property_t *utf8proc_get_
* 0x10FFFF, otherwise the program might crash!
*/
+UTF8PROC_API
ssize_t utf8proc_decompose_char(
int32_t uc, int32_t *dst, ssize_t bufsize,
int options, int *last_boundclass
@@ -308,6 +333,7 @@ ssize_t utf8proc_decompose_char(
* 0x10FFFF, otherwise the program might crash!
*/
+UTF8PROC_API
ssize_t utf8proc_decompose(
const uint8_t *str, ssize_t strlen,
int32_t *buffer, ssize_t bufsize, int options
@@ -326,6 +352,7 @@ ssize_t utf8proc_decompose(
* buffer size is returned.
*/
+UTF8PROC_API
ssize_t utf8proc_reencode(int32_t *buffer, ssize_t length, int options);
/*
* Reencodes the sequence of unicode characters given by the pointer
@@ -349,6 +376,7 @@ ssize_t utf8proc_reencode(int32_t *buffe
* crash!
*/
+UTF8PROC_API
ssize_t utf8proc_map(
const uint8_t *str, ssize_t strlen, uint8_t **dstptr, int options
);
@@ -368,9 +396,13 @@ ssize_t utf8proc_map(
* 'malloc', and has theirfore to be freed with 'free'.
*/
+UTF8PROC_API
uint8_t *utf8proc_NFD(const uint8_t *str);
+UTF8PROC_API
uint8_t *utf8proc_NFC(const uint8_t *str);
+UTF8PROC_API
uint8_t *utf8proc_NFKD(const uint8_t *str);
+UTF8PROC_API
uint8_t *utf8proc_NFKC(const uint8_t *str);
/*
* Returns a pointer to newly allocated memory of a NFD, NFC, NFKD or NFKC
Modified:
subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc_data.c
URL:
http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc_data.c?rev=1405793&r1=1405792&r2=1405793&view=diff
==============================================================================
---
subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc_data.c
(original)
+++
subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc/utf8proc_data.c
Mon Nov 5 13:57:35 2012
@@ -42,6 +42,7 @@
*/
+UTF8PROC_DATA
const int32_t utf8proc_sequences[] = {
97, -1, 98, -1, 99, -1, 100,
-1, 101, -1, 102, -1, 103, -1, 104,
@@ -1483,6 +1484,7 @@ const int32_t utf8proc_sequences[] = {
-1, 40709, -1, 40719, -1, 40726, -1, 173568,
-1, };
+UTF8PROC_DATA
const uint16_t utf8proc_stage1table[] = {
0, 256, 512, 768, 1024, 1280, 1536,
1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584,
@@ -2030,6 +2032,7 @@ const uint16_t utf8proc_stage1table[] =
15104, 15104, 15104, 15104, 15104, 15104, 15104, 15104,
23040, };
+UTF8PROC_DATA
const uint16_t utf8proc_stage2table[] = {
1, 1, 1, 1, 1, 1, 1,
1, 1, 2, 3, 2, 4, 3, 1,
@@ -4945,6 +4948,7 @@ const uint16_t utf8proc_stage2table[] =
3440, 3440, 3440, 3440, 3440, 3440, 3440, 0,
0, };
+UTF8PROC_DATA
const utf8proc_property_t utf8proc_properties[] = {
{0, 0, 0, 0, NULL, false, -1, -1, -1, -1, -1, false},
{UTF8PROC_CATEGORY_CC, 0, UTF8PROC_BIDI_CLASS_BN, 0, NULL, false, -1, -1,
-1, -1, -1, false, true, true, false, NULL},
@@ -10566,6 +10570,7 @@ const utf8proc_property_t utf8proc_prope
{UTF8PROC_CATEGORY_LO, 0, UTF8PROC_BIDI_CLASS_L, 0, utf8proc_sequences +
11502, false, -1, -1, -1, -1, -1, false, false, false, false, NULL},
};
+UTF8PROC_DATA
const int32_t utf8proc_combinations[] = {
192, 193, 194, 195, 196, 197, -1,
256, 258, 260, 550, 461, -1, -1, 512,