summaryrefslogtreecommitdiffstats
path: root/termbox-upstream.patch
diff options
context:
space:
mode:
Diffstat (limited to 'termbox-upstream.patch')
-rw-r--r--termbox-upstream.patch194
1 files changed, 194 insertions, 0 deletions
diff --git a/termbox-upstream.patch b/termbox-upstream.patch
new file mode 100644
index 0000000..34be79e
--- /dev/null
+++ b/termbox-upstream.patch
@@ -0,0 +1,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
+