-
Notifications
You must be signed in to change notification settings - Fork 4
/
php-enchant-php7.4.patch
145 lines (127 loc) · 4.73 KB
/
php-enchant-php7.4.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
diff -ur php-7.4.26_/ext/enchant/config.m4 php-7.4.26/ext/enchant/config.m4
--- php-7.4.26_/ext/enchant/config.m4
+++ php-7.4.26/ext/enchant/config.m4
@@ -4,7 +4,7 @@
[Include Enchant support])])
if test "$PHP_ENCHANT" != "no"; then
- PKG_CHECK_MODULES([ENCHANT], [enchant >= 1.4.2])
+ PKG_CHECK_MODULES([ENCHANT], [enchant])
PHP_EVAL_INCLINE($ENCHANT_CFLAGS)
PHP_EVAL_LIBLINE($ENCHANT_LIBS, ENCHANT_SHARED_LIBADD)
@@ -13,14 +13,14 @@
PHP_CHECK_LIBRARY(enchant, enchant_get_version,
[
- AC_DEFINE(HAVE_ENCHANT_GET_VERSION, 1, [ enchant_get_version since 1.6.0 ])
+ AC_DEFINE(HAVE_ENCHANT_GET_VERSION, 1, [ ])
], [ ], [
$ENCHANT_LIBS
])
PHP_CHECK_LIBRARY(enchant, enchant_broker_set_param,
[
- AC_DEFINE(HAVE_ENCHANT_BROKER_SET_PARAM, 1, [ enchant_broker_set_param since 1.5.0 and removed in 2.x ])
+ AC_DEFINE(HAVE_ENCHANT_BROKER_SET_PARAM, 1, [ ])
], [ ], [
$ENCHANT_LIBS
])
diff -ur php-7.4.26_/ext/enchant/enchant.c php-7.4.26/ext/enchant/enchant.c
--- php-7.4.26_/ext/enchant/enchant.c
+++ php-7.4.26/ext/enchant/enchant.c
@@ -135,10 +135,9 @@
PHP_FE(enchant_broker_describe, arginfo_enchant_broker_free)
PHP_FE(enchant_dict_check, arginfo_enchant_dict_check)
PHP_FE(enchant_dict_suggest, arginfo_enchant_dict_check)
- PHP_FE(enchant_dict_add, arginfo_enchant_dict_check)
- PHP_FALIAS(enchant_dict_add_to_personal, enchant_dict_add, arginfo_enchant_dict_check)
+ PHP_FE(enchant_dict_add_to_personal, arginfo_enchant_dict_check)
PHP_FE(enchant_dict_add_to_session, arginfo_enchant_dict_check)
- PHP_FE(enchant_dict_is_added, arginfo_enchant_dict_check)
+ PHP_FE(enchant_dict_is_in_session, arginfo_enchant_dict_check)
PHP_FE(enchant_dict_store_replacement, arginfo_enchant_dict_store_replacement)
PHP_FE(enchant_dict_get_error, arginfo_enchant_broker_free_dict)
PHP_FE(enchant_dict_describe, arginfo_enchant_broker_free_dict)
@@ -286,9 +285,6 @@
le_enchant_dict = zend_register_list_destructors_ex(php_enchant_dict_free, NULL, "enchant_dict", module_number);
REGISTER_LONG_CONSTANT("ENCHANT_MYSPELL", PHP_ENCHANT_MYSPELL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("ENCHANT_ISPELL", PHP_ENCHANT_ISPELL, CONST_CS | CONST_PERSISTENT);
-#ifdef HAVE_ENCHANT_GET_VERSION
- REGISTER_STRING_CONSTANT("LIBENCHANT_VERSION", enchant_get_version(), CONST_CS | CONST_PERSISTENT);
-#endif
return SUCCESS;
}
/* }}} */
@@ -396,7 +392,7 @@
{
zval *broker;
enchant_broker *pbroker;
- const char *msg;
+ char *msg;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &broker) == FAILURE) {
RETURN_FALSE;
@@ -742,7 +738,7 @@
for (i = 0; i < n_sugg; i++) {
add_next_index_string(sugg, suggs[i]);
}
- enchant_dict_free_string_list(pdict->pdict, suggs);
+ enchant_dict_free_suggestions(pdict->pdict, suggs);
}
@@ -797,14 +793,14 @@
add_next_index_string(return_value, suggs[i]);
}
- enchant_dict_free_string_list(pdict->pdict, suggs);
+ enchant_dict_free_suggestions(pdict->pdict, suggs);
}
}
/* }}} */
-/* {{{ proto void enchant_dict_add(resource dict, string word)
+/* {{{ proto void enchant_dict_add_to_personal(resource dict, string word)
add 'word' to personal word list */
-PHP_FUNCTION(enchant_dict_add)
+PHP_FUNCTION(enchant_dict_add_to_personal)
{
zval *dict;
char *word;
@@ -817,7 +813,7 @@
PHP_ENCHANT_GET_DICT;
- enchant_dict_add(pdict->pdict, word, wordlen);
+ enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
}
/* }}} */
@@ -840,9 +836,9 @@
}
/* }}} */
-/* {{{ proto bool enchant_dict_is_added(resource dict, string word)
+/* {{{ proto bool enchant_dict_is_in_session(resource dict, string word)
whether or not 'word' exists in this spelling-session */
-PHP_FUNCTION(enchant_dict_is_added)
+PHP_FUNCTION(enchant_dict_is_in_session)
{
zval *dict;
char *word;
@@ -855,7 +851,7 @@
PHP_ENCHANT_GET_DICT;
- RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
+ RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
}
/* }}} */
@@ -888,7 +884,7 @@
{
zval *dict;
enchant_dict *pdict;
- const char *msg;
+ char *msg;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &dict) == FAILURE) {
RETURN_FALSE;
diff -ur php-7.4.26_/ext/enchant/php_enchant.h php-7.4.26/ext/enchant/php_enchant.h
--- php-7.4.26_/ext/enchant/php_enchant.h
+++ php-7.4.26/ext/enchant/php_enchant.h
@@ -53,9 +53,9 @@
PHP_FUNCTION(enchant_dict_check);
PHP_FUNCTION(enchant_dict_suggest);
-PHP_FUNCTION(enchant_dict_add);
+PHP_FUNCTION(enchant_dict_add_to_personal);
PHP_FUNCTION(enchant_dict_add_to_session);
-PHP_FUNCTION(enchant_dict_is_added);
+PHP_FUNCTION(enchant_dict_is_in_session);
PHP_FUNCTION(enchant_dict_store_replacement);
PHP_FUNCTION(enchant_dict_get_error);
PHP_FUNCTION(enchant_dict_describe);