cvs: php4 /ext/ircg ircg.c php_ircg.h
| From: | Sascha Schumann | Date: | Wed, 07 Mar 2001 22:18:50 +0000 |
| Subject: | cvs: php4 /ext/ircg ircg.c php_ircg.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-4435@lists.php.net to get a copy of this message | ||
sas Wed Mar 7 14:18:50 2001 EDT
Modified files:
/php4/ext/ircg ircg.c php_ircg.h
Log:
Add simplistic ircg_channel_mode() function
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.48 php4/ext/ircg/ircg.c:1.49
--- php4/ext/ircg/ircg.c:1.48 Wed Mar 7 13:05:43 2001
+++ php4/ext/ircg/ircg.c Wed Mar 7 14:18:50 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ircg.c,v 1.48 2001/03/07 21:05:43 sas Exp $ */
+/* $Id: ircg.c,v 1.49 2001/03/07 22:18:50 sas Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -75,6 +75,7 @@
PHP_FE(ircg_msg, NULL)
PHP_FE(ircg_nick, NULL)
PHP_FE(ircg_topic, NULL)
+ PHP_FE(ircg_channel_mode, NULL)
PHP_FE(ircg_whois, NULL)
PHP_FE(ircg_kick, NULL)
PHP_FE(ircg_disconnect, NULL)
@@ -636,6 +637,29 @@
if (!conn) RETURN_FALSE;
irc_handle_command(&conn->conn, "WHOIS", 1, Z_STRVAL_PP(p2));
+ RETVAL_TRUE;
+#endif
+}
+
+PHP_FUNCTION(ircg_channel_mode)
+{
+#if defined(IRCG_API_VERSION) && IRCG_API_VERSION >= 20010227
+ zval **args[4];
+ php_irconn_t *conn;
+
+ if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) == FAILURE)
+ WRONG_PARAM_COUNT;
+
+ convert_to_long_ex(args[0]);
+ convert_to_string_ex(args[1]);
+ convert_to_string_ex(args[2]);
+ convert_to_string_ex(args[3]);
+
+ conn = lookup_irconn(Z_LVAL_PP(args[0]));
+ if (!conn) RETURN_FALSE;
+
+ irc_handle_command(&conn->conn, "MODE", 3, Z_STRVAL_PP(args[1]),
+ Z_STRVAL_PP(args[2]), Z_STRVAL_PP(args[3]));
RETVAL_TRUE;
#endif
}
Index: php4/ext/ircg/php_ircg.h
diff -u php4/ext/ircg/php_ircg.h:1.7 php4/ext/ircg/php_ircg.h:1.8
--- php4/ext/ircg/php_ircg.h:1.7 Mon Feb 26 15:11:06 2001
+++ php4/ext/ircg/php_ircg.h Wed Mar 7 14:18:50 2001
@@ -39,6 +39,7 @@
PHP_FUNCTION(ircg_nick);
PHP_FUNCTION(ircg_kick);
PHP_FUNCTION(ircg_topic);
+PHP_FUNCTION(ircg_channel_mode);
PHP_FUNCTION(ircg_disconnect);
PHP_FUNCTION(ircg_is_conn_alive);
PHP_FUNCTION(ircg_lookup_format_messages);