utf8proc 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ext/utf8proc_native.c +33 -4
- metadata +2 -2
data/ext/utf8proc_native.c
CHANGED
@@ -53,11 +53,30 @@
|
|
53
53
|
|
54
54
|
|
55
55
|
#include <stdlib.h>
|
56
|
-
#include <stdbool.h>
|
57
56
|
#include <sys/types.h>
|
57
|
+
#ifdef _MSC_VER
|
58
|
+
typedef signed char int8_t;
|
59
|
+
typedef unsigned char uint8_t;
|
60
|
+
typedef short int16_t;
|
61
|
+
typedef unsigned short uint16_t;
|
62
|
+
typedef int int32_t;
|
63
|
+
#ifdef _WIN64
|
64
|
+
#define ssize_t __int64
|
65
|
+
#else
|
66
|
+
#define ssize_t int
|
67
|
+
#endif
|
68
|
+
typedef unsigned char bool;
|
69
|
+
enum {false, true};
|
70
|
+
#else
|
71
|
+
#include <stdbool.h>
|
58
72
|
#include <inttypes.h>
|
73
|
+
#endif
|
59
74
|
#include <limits.h>
|
60
75
|
|
76
|
+
#ifdef __cplusplus
|
77
|
+
extern "C" {
|
78
|
+
#endif
|
79
|
+
|
61
80
|
#ifndef SSIZE_MAX
|
62
81
|
#define SSIZE_MAX ((size_t)SIZE_MAX/2)
|
63
82
|
#endif
|
@@ -358,6 +377,9 @@ uint8_t *utf8proc_NFKC(const uint8_t *str);
|
|
358
377
|
* normalized version of the null-terminated string 'str'.
|
359
378
|
*/
|
360
379
|
|
380
|
+
#ifdef __cplusplus
|
381
|
+
}
|
382
|
+
#endif
|
361
383
|
|
362
384
|
#endif
|
363
385
|
|
@@ -13840,7 +13862,7 @@ const int8_t utf8proc_utf8class[256] = {
|
|
13840
13862
|
|
13841
13863
|
|
13842
13864
|
const char *utf8proc_version(void) {
|
13843
|
-
return "1.1.
|
13865
|
+
return "1.1.5";
|
13844
13866
|
}
|
13845
13867
|
|
13846
13868
|
const char *utf8proc_errmsg(ssize_t errcode) {
|
@@ -14362,6 +14384,13 @@ uint8_t *utf8proc_NFKC(const uint8_t *str) {
|
|
14362
14384
|
|
14363
14385
|
#include "ruby.h"
|
14364
14386
|
|
14387
|
+
#ifndef RSTRING_PTR
|
14388
|
+
#define RSTRING_PTR(s) (RSTRING(s)->ptr)
|
14389
|
+
#endif
|
14390
|
+
#ifndef RSTRING_LEN
|
14391
|
+
#define RSTRING_LEN(s) (RSTRING(s)->len)
|
14392
|
+
#endif
|
14393
|
+
|
14365
14394
|
typedef struct utf8proc_ruby_mapenv_struct {
|
14366
14395
|
int32_t *buffer;
|
14367
14396
|
} utf8proc_ruby_mapenv_t;
|
@@ -14407,14 +14436,14 @@ VALUE utf8proc_ruby_map(VALUE self, VALUE str_param, VALUE options_param) {
|
|
14407
14436
|
options = NUM2INT(options_param) & ~UTF8PROC_NULLTERM;
|
14408
14437
|
env_obj = Data_Make_Struct(rb_cObject, utf8proc_ruby_mapenv_t, NULL,
|
14409
14438
|
utf8proc_ruby_mapenv_free, env);
|
14410
|
-
result = utf8proc_decompose(
|
14439
|
+
result = utf8proc_decompose(RSTRING_PTR(str), RSTRING_LEN(str),
|
14411
14440
|
NULL, 0, options);
|
14412
14441
|
if (result < 0) {
|
14413
14442
|
utf8proc_ruby_map_error(result);
|
14414
14443
|
return Qnil; /* needed to prevent problems with optimization */
|
14415
14444
|
}
|
14416
14445
|
env->buffer = ALLOC_N(int32_t, result+1);
|
14417
|
-
result = utf8proc_decompose(
|
14446
|
+
result = utf8proc_decompose(RSTRING_PTR(str), RSTRING_LEN(str),
|
14418
14447
|
env->buffer, result, options);
|
14419
14448
|
if (result < 0) {
|
14420
14449
|
free(env->buffer);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utf8proc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Public Software Group e. V., Berlin, Germany
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-10-15 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|