summaryrefslogtreecommitdiffstats
path: root/termbox-upstream.patch
blob: 34be79eef193400a5ef1dab4e0607b6866314958 (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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
From 4e7d5f3d3c3aef6806f34d0c17001843d91f890c Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@php.net>
Date: Fri, 12 Sep 2014 21:41:07 +0200
Subject: [PATCH] honours --with-libdir option

---
 config.m4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/config.m4 b/config.m4
index f664380..14861f8 100644
--- a/config.m4
+++ b/config.m4
@@ -31,12 +31,12 @@ if test "$PHP_TERMBOX" != "no"; then
   LIBSYMBOL=tb_init
   PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
   [
-    PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $TERMBOX_DIR/lib, TERMBOX_SHARED_LIBADD)
+    PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $TERMBOX_DIR/$PHP_LIBDIR, TERMBOX_SHARED_LIBADD)
     AC_DEFINE(HAVE_TERMBOXLIB,1,[ ])
   ],[
     AC_MSG_ERROR([wrong termbox lib version or lib not found])
   ],[
-    -L$TERMBOX_DIR/lib -lm
+    -L$TERMBOX_DIR/$PHP_LIBDIR -lm
   ])
   PHP_SUBST(TERMBOX_SHARED_LIBADD)
 
-- 
1.9.2

From ee78eacbff59af75e55509d428921afe4e9f8f66 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@php.net>
Date: Fri, 12 Sep 2014 21:43:21 +0200
Subject: [PATCH] fix build with php < 5.3.7

---
 termbox.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/termbox.c b/termbox.c
index 628d3fc..3504990 100644
--- a/termbox.c
+++ b/termbox.c
@@ -56,7 +56,11 @@ const zend_function_entry termbox_functions[] = {
     PHP_FE(termbox_utf8_unicode_to_char, NULL)
     PHP_FE(termbox_print, NULL)
     PHP_FE(termbox_last_error, NULL)
+#ifdef PHP_FE_END
     PHP_FE_END    /* Must be the last line in termbox_functions[] */
+#else
+    {NULL, NULL, NULL}
+#endif
 };
 /* }}} */
 
-- 
1.9.2

From fb8b55a5da5165d6d368405469915ed792b8d983 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@php.net>
Date: Fri, 12 Sep 2014 22:00:01 +0200
Subject: [PATCH] add arginfo to all functions for reflection

---
 termbox.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 64 insertions(+), 19 deletions(-)

diff --git a/termbox.c b/termbox.c
index 3504990..2a3e585 100644
--- a/termbox.c
+++ b/termbox.c
@@ -32,30 +32,75 @@
 
 ZEND_DECLARE_MODULE_GLOBALS(termbox)
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_termbox_none, 0, 0, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_termbox_set_clear_attributes, 0, 0, 2)
+        ZEND_ARG_INFO(0, fg)
+        ZEND_ARG_INFO(0, bg)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_termbox_set_cursor, 0, 0, 2)
+        ZEND_ARG_INFO(0, x)
+        ZEND_ARG_INFO(0, y)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_termbox_change_cell, 0, 0, 5)
+        ZEND_ARG_INFO(0, x)
+        ZEND_ARG_INFO(0, y)
+        ZEND_ARG_INFO(0, ch)
+        ZEND_ARG_INFO(0, fg)
+        ZEND_ARG_INFO(0, bg)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_termbox_mode, 0, 0, 1)
+        ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_termbox_peek_event, 0, 0, 1)
+        ZEND_ARG_INFO(0, timeout_ms)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_termbox_utf8_char_to_unicode, 0, 0, 1)
+        ZEND_ARG_INFO(0, char)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_termbox_utf8_unicode_to_char, 0, 0, 1)
+        ZEND_ARG_INFO(0, unicode)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_termbox_print, 0, 0, 5)
+        ZEND_ARG_INFO(0, str)
+        ZEND_ARG_INFO(0, x)
+        ZEND_ARG_INFO(0, y)
+        ZEND_ARG_INFO(0, fg)
+        ZEND_ARG_INFO(0, bg)
+ZEND_END_ARG_INFO()
+
 /* {{{ termbox_functions[]
  *
  * Every user visible function must have an entry in termbox_functions[].
  */
 const zend_function_entry termbox_functions[] = {
-    PHP_FE(termbox_init, NULL)
-    PHP_FE(termbox_shutdown, NULL)
-    PHP_FE(termbox_width, NULL)
-    PHP_FE(termbox_height, NULL)
-    PHP_FE(termbox_clear, NULL)
-    PHP_FE(termbox_set_clear_attributes, NULL)
-    PHP_FE(termbox_present, NULL)
-    PHP_FE(termbox_set_cursor, NULL)
-    PHP_FE(termbox_change_cell, NULL)
-    PHP_FE(termbox_set_input_mode, NULL)
-    PHP_FE(termbox_get_input_mode, NULL)
-    PHP_FE(termbox_set_output_mode, NULL)
-    PHP_FE(termbox_get_output_mode, NULL)
-    PHP_FE(termbox_peek_event, NULL)
-    PHP_FE(termbox_poll_event, NULL)
-    PHP_FE(termbox_utf8_char_to_unicode, NULL)
-    PHP_FE(termbox_utf8_unicode_to_char, NULL)
-    PHP_FE(termbox_print, NULL)
-    PHP_FE(termbox_last_error, NULL)
+    PHP_FE(termbox_init,                 arginfo_termbox_none)
+    PHP_FE(termbox_shutdown,             arginfo_termbox_none)
+    PHP_FE(termbox_width,                arginfo_termbox_none)
+    PHP_FE(termbox_height,               arginfo_termbox_none)
+    PHP_FE(termbox_clear,                arginfo_termbox_none)
+    PHP_FE(termbox_set_clear_attributes, arginfo_termbox_set_clear_attributes)
+    PHP_FE(termbox_present,              arginfo_termbox_none)
+    PHP_FE(termbox_set_cursor,           arginfo_termbox_set_cursor)
+    PHP_FE(termbox_change_cell,          arginfo_termbox_change_cell)
+    PHP_FE(termbox_set_input_mode,       arginfo_termbox_mode)
+    PHP_FE(termbox_get_input_mode,       arginfo_termbox_none)
+    PHP_FE(termbox_set_output_mode,      arginfo_termbox_mode)
+    PHP_FE(termbox_get_output_mode,      arginfo_termbox_none)
+    PHP_FE(termbox_peek_event,           arginfo_termbox_peek_event)
+    PHP_FE(termbox_poll_event,           arginfo_termbox_none)
+    PHP_FE(termbox_utf8_char_to_unicode, arginfo_termbox_utf8_char_to_unicode)
+    PHP_FE(termbox_utf8_unicode_to_char, arginfo_termbox_utf8_unicode_to_char)
+    PHP_FE(termbox_print,                arginfo_termbox_print)
+    PHP_FE(termbox_last_error,           arginfo_termbox_none)
 #ifdef PHP_FE_END
     PHP_FE_END    /* Must be the last line in termbox_functions[] */
 #else
-- 
1.9.2

From 6db4f5325cdb0a9664357076542e7ff5e0592b4e Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@php.net>
Date: Fri, 12 Sep 2014 22:02:06 +0200
Subject: [PATCH] clean [-Wunused-variable]

---
 termbox.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/termbox.c b/termbox.c
index 2a3e585..f6d1145 100644
--- a/termbox.c
+++ b/termbox.c
@@ -453,7 +453,6 @@ PHP_FUNCTION(termbox_utf8_char_to_unicode)
     char *str;
     int str_len;
     uint32_t unicode_int;
-    int rc;
 
     if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
         return;
-- 
1.9.2