summaryrefslogtreecommitdiffstats
path: root/18.patch
blob: 59e3d97d04045dcb7e390d41b59acf39d5328fc2 (plain)
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
From b70b6a92c72e053c9ad6ffe25a3e73849ff46379 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 15 Mar 2019 08:45:22 +0100
Subject: [PATCH] add arginfo to all functions for reflection

---
 src/php_ahocorasick.c | 32 ++++++++++++++++++++++++++------
 1 file changed, 26 insertions(+), 6 deletions(-)

diff --git a/src/php_ahocorasick.c b/src/php_ahocorasick.c
index 0ba9c48..f825c4b 100644
--- a/src/php_ahocorasick.c
+++ b/src/php_ahocorasick.c
@@ -56,13 +56,33 @@ static char exception_buffer[8192];
 
 ZEND_DECLARE_MODULE_GLOBALS(ahocorasick)
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ahocorasick_match, 0, 0, 2)
+	ZEND_ARG_INFO(0, needle)
+	ZEND_ARG_INFO(0, id)
+	ZEND_ARG_INFO(0, findAll)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ahocorasick_id, 0, 0, 1)
+	ZEND_ARG_INFO(0, id)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ahocorasick_init, 0, 0, 1)
+	ZEND_ARG_INFO(0, data)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ahocorasick_add_patterns, 0, 0, 2)
+	ZEND_ARG_INFO(0, id)
+	ZEND_ARG_INFO(0, patterns)
+ZEND_END_ARG_INFO()
+
+
 static zend_function_entry ahocorasick_functions[] = {
-    PHP_FE(ahocorasick_match, NULL)
-    PHP_FE(ahocorasick_init, NULL)
-    PHP_FE(ahocorasick_deinit, NULL)
-    PHP_FE(ahocorasick_isValid, NULL)
-    PHP_FE(ahocorasick_finalize, NULL)
-    PHP_FE(ahocorasick_add_patterns, NULL)
+    PHP_FE(ahocorasick_match,          arginfo_ahocorasick_match)
+    PHP_FE(ahocorasick_init,           arginfo_ahocorasick_init)
+    PHP_FE(ahocorasick_deinit,         arginfo_ahocorasick_id)
+    PHP_FE(ahocorasick_isValid,        arginfo_ahocorasick_id)
+    PHP_FE(ahocorasick_finalize,       arginfo_ahocorasick_id)
+    PHP_FE(ahocorasick_add_patterns,   arginfo_ahocorasick_add_patterns)
     PHP_FE_END
 };