cvs: embed /php-irssi ext-irssi.c php-core.c

[email protected] ("Wez Furlong") Tue, 01 Apr 2003 00:53:02 -0000
Newsgroups php.embed.cvs
Message-ID <cvswez1049158382@cvsserver>
wez		Mon Mar 31 19:53:02 2003 EDT

  Modified files:              
    /embed/php-irssi	ext-irssi.c php-core.c 
  Log:
  Partially back out those settings thingies (causes a segfault on shutdown).
  
  Really enable the massjoin signal.
  
  
  
Index: embed/php-irssi/ext-irssi.c
diff -u embed/php-irssi/ext-irssi.c:1.21 embed/php-irssi/ext-irssi.c:1.22
--- embed/php-irssi/ext-irssi.c:1.21	Mon Mar 31 16:00:22 2003
+++ embed/php-irssi/ext-irssi.c	Mon Mar 31 19:53:02 2003
@@ -14,7 +14,7 @@
   +----------------------------------------------------------------------+
   | Author: Wez Furlong <[email protected]>                                    |
   +----------------------------------------------------------------------+
-  $Id: ext-irssi.c,v 1.21 2003/03/31 21:00:22 wez Exp $
+  $Id: ext-irssi.c,v 1.22 2003/04/01 00:53:02 wez Exp $
 */
 #include "php-irssi.h"
 #include "php-signals-list.h" /* generated by php during make */
@@ -209,7 +209,17 @@
 					php_irssi_export_GList(val, (GSList*)args[i], PIAT_STRING TSRMLS_CC);
 					break;
 				case PIAT_ARRAY_OF_NICK:
-					php_irssi_export_GList(val, (GSList*)args[i], PIAT_NICK TSRMLS_CC);
+					{
+						GSList *the_list = (GSList*)args[i];
+						zval *tmp;
+						
+						array_init(val);
+						for (; the_list != NULL; the_list = the_list->next) {
+							MAKE_STD_ZVAL(tmp);
+							php_irssi_export_NICK(tmp, (CHANNEL_REC*)args[i-1], (NICK_REC*)the_list->data TSRMLS_CC);
+							add_next_index_zval(val, tmp);
+						}
+					}
 					break;
 				default:
 					ZVAL_NULL(val);
Index: embed/php-irssi/php-core.c
diff -u embed/php-irssi/php-core.c:1.21 embed/php-irssi/php-core.c:1.22
--- embed/php-irssi/php-core.c:1.21	Mon Mar 31 18:54:09 2003
+++ embed/php-irssi/php-core.c	Mon Mar 31 19:53:02 2003
@@ -15,7 +15,7 @@
   | Authors: Wez Furlong <[email protected]>                                   |
   |          Tal Peer <[email protected]>                                      | 
   +----------------------------------------------------------------------+
-  $Id: php-core.c,v 1.21 2003/03/31 23:54:09 wez Exp $
+  $Id: php-core.c,v 1.22 2003/04/01 00:53:02 wez Exp $
 */
 #define MODULE_NAME "php/core"
 #include "common.h"
@@ -274,7 +274,6 @@
 		default:
 			printtext_window(active_win, MSGLEVEL_CLIENTCRAP, "-!- php: autoload bailed out status=%d", EG(exit_status));
 	}
-	settings_check();
 }
 
 /* "irssi init finished" event handler.
@@ -304,7 +303,8 @@
 	command_bind("php load", NULL, (SIGNAL_FUNC)cmd_php_load);
 	command_bind("php version", NULL, (SIGNAL_FUNC)cmd_php_version);
 	command_bind("php set", NULL, (SIGNAL_FUNC)cmd_php_set);
-	
+
+#if 0
 	spprintf(&tmp, -1, "%s/scripts:%s", get_irssi_dir(), SCRIPTDIR);
 	include_path = g_strdup(tmp);
 	efree(tmp);
@@ -312,6 +312,11 @@
 	settings_add_str("php", "php_include_path", include_path);
 	
 	php_set_ini_entry("include_path", (char*)settings_get_str("php_include_path"), PHP_INI_STAGE_ACTIVATE);
+#else
+	spprintf(&include_path, -1, "%s/scripts:%s", get_irssi_dir(), SCRIPTDIR);
+	php_set_ini_entry("include_path", include_path, PHP_INI_STAGE_ACTIVATE);
+#endif
+
 	php_set_ini_entry("html_errors", "0", PHP_INI_STAGE_ACTIVATE);
 	php_set_ini_entry("display_errors", "1", PHP_INI_STAGE_ACTIVATE);
 	php_set_ini_entry("display_startup_errors", "1", PHP_INI_STAGE_ACTIVATE);
@@ -322,6 +327,7 @@
 	} else {
 		/* otherwise arrange for it to be run when init is completed */
 		signal_add("irssi init finished", (SIGNAL_FUNC)sig_autorun);
+		settings_check();
 	}
 	
 	/* Tell irssi that we are loaded and ready */