[PHP-CVS] cvs: php-src(PHP_4_3) /ext/ircg ircg.c
sas Wed Oct 22 10:50:20 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/ircg ircg.c Log: MFH channel_mode fix Index: php-src/ext/ircg/ircg.c diff -u php-src/ext/ircg/ircg.c:1.137.2.17 php-src/ext/ircg/ircg.c:1.137.2.18 --- php-src/ext/ircg/ircg.c:1.137.2.17 Sun Sep 28 06:24:41 2003 +++ php-src/ext/ircg/ircg.c Wed Oct 22 10:50:19 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: ircg.c,v 1.137.2.17 2003/09/28 10:24:41 sas Exp $ */ +/* $Id: ircg.c,v 1.137.2.18 2003/10/22 14:50:19 sas Exp $ */ /* {{{ includes */ @@ -1907,7 +1907,8 @@ conn = lookup_irconn(Z_LVAL_PP(args[0])); if (!conn) RETURN_FALSE; - irc_handle_command(conn-conn, MODE, 3, Z_STRVAL_PP(args[1]), + irc_handle_command(conn-conn, MODE, Z_STRLEN_PP(args[3]) 0 ? 3 : 2, + Z_STRVAL_PP(args[1]), Z_STRVAL_PP(args[2]), Z_STRVAL_PP(args[3])); RETVAL_TRUE; #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/ircg ircg.c
sas Sun Sep 28 06:24:42 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/ircg ircg.c Log: Use correct allocator Index: php-src/ext/ircg/ircg.c diff -u php-src/ext/ircg/ircg.c:1.137.2.16 php-src/ext/ircg/ircg.c:1.137.2.17 --- php-src/ext/ircg/ircg.c:1.137.2.16 Wed Aug 13 14:53:42 2003 +++ php-src/ext/ircg/ircg.c Sun Sep 28 06:24:41 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: ircg.c,v 1.137.2.16 2003/08/13 18:53:42 sas Exp $ */ +/* $Id: ircg.c,v 1.137.2.17 2003/09/28 10:24:41 sas Exp $ */ /* {{{ includes */ @@ -699,7 +699,7 @@ t[i].para.v P_CONV_BR); \ } \ ircg_js_escape(tmp, result); \ - smart_str_free(tmp); \ + smart_str_free_ex(tmp, 1); \ break; \ case P_HTML: \ if (!what) break; \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/ircg ircg.c
sas Wed Aug 13 14:53:43 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/ircg ircg.c Log: Fix CTCP handling so that commands without parameters are processed Use %ld for time_t's Provide a warning when irc_connect fails Index: php-src/ext/ircg/ircg.c diff -u php-src/ext/ircg/ircg.c:1.137.2.15 php-src/ext/ircg/ircg.c:1.137.2.16 --- php-src/ext/ircg/ircg.c:1.137.2.15 Tue Jul 8 00:25:40 2003 +++ php-src/ext/ircg/ircg.c Wed Aug 13 14:53:42 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: ircg.c,v 1.137.2.15 2003/07/08 04:25:40 sas Exp $ */ +/* $Id: ircg.c,v 1.137.2.16 2003/08/13 18:53:42 sas Exp $ */ /* {{{ includes */ @@ -867,35 +867,42 @@ static void handle_ctcp(php_irconn_t *conn, smart_str *chan, smart_str *from, smart_str *msg, smart_str *result, smart_str *recipient) { + char *token; char *token_end; - char *real_msg; - char *real_msg_end; - - for (token_end = msg-c + 1; *token_end; token_end++) - if (!isalpha(*token_end)) break; + char *ctcp_arg; + char *ctcp_arg_end; + format_msg_t *fmt_msg; + smart_str tmp = {0}; + int status = 0; - if (*token_end != '\001') { - real_msg = token_end + 1; + token = msg-c + 1; + token_end = strchr(token, 1); - real_msg_end = strchr(real_msg, '\001'); - if (real_msg_end) { - format_msg_t *fmt_msg; - smart_str tmp; - int status = 0; - - *real_msg_end = '\0'; - *token_end = '\0'; - - if (zend_hash_find(conn-ctcp_msgs, msg-c + 1, token_end - msg-c - 1, (void **) fmt_msg) != SUCCESS) { - return; - } + if (!token_end) return; - smart_str_setl(tmp, real_msg, real_msg_end - real_msg); - format_msg(fmt_msg, chan, recipient, from, tmp, result, conn-conn.username, conn-conn.username_len, status); + *token_end = 0; + + ctcp_arg = strchr(token, ' '); + + if (ctcp_arg) { + ctcp_arg_end = token_end; + token_end = ctcp_arg; + *token_end = 0; + ctcp_arg++; + smart_str_setl(tmp, ctcp_arg, ctcp_arg_end - ctcp_arg); + } + + if (zend_hash_find(conn-ctcp_msgs, token, token_end - token, + (void **) fmt_msg) != SUCCESS) { + return; + } + + format_msg(fmt_msg, chan, recipient, from, tmp, result, + conn-conn.username, conn-conn.username_len, status); - if (status == 1) - irc_disconnect(conn-conn, Connection terminated by authenticated CTCP message); - } + if (status == 1) { + irc_disconnect(conn-conn, Connection terminated by + authenticated CTCP message); } } @@ -1390,7 +1397,7 @@ else if (conn-file_fd 0 (ircg_now() - conn-login) WINDOW_TIMEOUT) { char buf[1024]; - sprintf(buf, timeout after %d seconds (%d, %d), ircg_now()-conn-login, + sprintf(buf, timeout after %ld seconds (%ld, %ld), ircg_now()-conn-login, ircg_now(), conn-login); irc_disconnect(ircc, buf); } @@ -2314,6 +2321,7 @@ if (irc_connect(username, register_hooks, conn, server, port, conn-conn)) { free(conn); + php_error(E_WARNING, %s(): irc_connect() failed prematurely, get_active_function_name(TSRMLS_C)); RETURN_FALSE; } irc_connects++; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/ircg ircg.c php_ircg.h
On Tue, 8 Jul 2003, Zeev Suraski wrote: Judging by the complete silence, looks like you have lazy consensus! :) You two would really make for a good pair. :) - Sascha -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/ircg ircg.c php_ircg.h
At 16:31 08/07/2003, Sascha Schumann wrote: On Tue, 8 Jul 2003, Zeev Suraski wrote: Judging by the complete silence, looks like you have lazy consensus! :) You two would really make for a good pair. :) Nah, not enough contrast. I'd go for you and Jani :) Zeev -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/ircg ircg.c php_ircg.h
sas Mon Jul 7 10:39:03 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/ircg ircg.c php_ircg.h Log: Add support for who/invite/notice/lusers Add ircg_names/ircg_invite/ircg_lusers/ircg_oper/ircg_who/ircg_list # feature patch applied to PHP_4_3 due to won't be released status # of PHP_4 and HEAD being IRCG 3 incompatible. Index: php-src/ext/ircg/ircg.c diff -u php-src/ext/ircg/ircg.c:1.137.2.11 php-src/ext/ircg/ircg.c:1.137.2.12 --- php-src/ext/ircg/ircg.c:1.137.2.11 Thu Jul 3 02:59:43 2003 +++ php-src/ext/ircg/ircg.c Mon Jul 7 10:39:03 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: ircg.c,v 1.137.2.11 2003/07/03 06:59:43 sas Exp $ */ +/* $Id: ircg.c,v 1.137.2.12 2003/07/07 14:39:03 sas Exp $ */ /* {{{ includes */ @@ -105,6 +105,18 @@ FMT_MSG_DISCONNECTED, FMT_MSG_LIST, FMT_MSG_LISTEND, + FMT_MSG_WHOREPLY1, + FMT_MSG_WHOREPLY2, + FMT_MSG_ENDOFWHO, + FMT_MSG_INVITE, + FMT_MSG_NOTICE_CHAN, + FMT_MSG_NOTICE_TO_ME, + FMT_MSG_NOTICE_FROM_ME, + FMT_MSG_LUSERCLIENT, + FMT_MSG_LUSEROP, + FMT_MSG_LUSERUNKNOWN, + FMT_MSG_LUSERCHANNELS, + FMT_MSG_LUSERME, NO_FMTS }; /* }}} */ @@ -136,6 +148,12 @@ PHP_FE(ircg_register_format_messages, NULL) PHP_FE(ircg_get_username, NULL) PHP_FE(ircg_eval_ecmascript_params, NULL) + PHP_FE(ircg_names, NULL) + PHP_FE(ircg_invite, NULL) + PHP_FE(ircg_lusers, NULL) + PHP_FE(ircg_oper, NULL) + PHP_FE(ircg_who, NULL) + PHP_FE(ircg_list, NULL) {NULL, NULL, NULL} /* Must be the last line in ircg_functions[] */ }; /* }}} */ @@ -260,7 +278,19 @@ end of ban list for %cbr /, You have been disconnectedbr /, Channel %c has %t users and the topic is '%m'br /, - End of LISTbr / + End of LISTbr /, + Nickname %t has ident %f, realname '%m', hostname %c, , + is on server %t, has flag %f, hopcount %m, and channel %c.br /, + end of whobr /, + %f is inviting %t to %cbr /, + [notice %c] %f: %mbr /, + notice from %f: %mbr /, + notice to %t: %mbr /, + %t users, %f services, %r serversbr /, + %r operatorsbr /, + %r unknown connectionsbr /, + %r formed channelsbr /, + I have %t clients and %r serversbr /, }; /* }}} */ @@ -885,6 +915,27 @@ msg_send(conn, m); } +static void notice_handler(irconn_t *ircc, smart_str *chan, smart_str *from, +smart_str *msg, void *conn_data, void *chan_data) +{ +php_irconn_t *conn = conn_data; +smart_str m = {0}; +smart_str s_username; + +smart_str_setl(s_username, ircc-username, ircc-username_len); + +if (msg-c[0] == '\001') { +handle_ctcp(conn, chan, from, chan?chan:s_username, msg, m); +} else if (chan) { +FORMAT_MSG(conn, FMT_MSG_NOTICE_CHAN, chan, s_username, from, msg, m, conn-conn.username, conn-conn.username_len); +} else { +FORMAT_MSG(conn, FMT_MSG_NOTICE_TO_ME, NULL, s_username, from, +msg, m, conn-conn.username, conn-conn.username_len); +} + +msg_send(conn, m); +} + static void nick_handler(irconn_t *c, smart_str *oldnick, smart_str *newnick, void *dummy) { @@ -976,6 +1027,104 @@ msg_send(conn, m); } +static void whoreply_handler(irconn_t *c, smart_str *chan, smart_str *user, +smart_str *host, smart_str *server, smart_str *nick, smart_str *flag, +smart_str *hopcount, smart_str *realname, void *dummy, +void *chan_data) +{ +php_irconn_t *conn = dummy; +smart_str m = {0}; + +FORMAT_MSG(conn, FMT_MSG_WHOREPLY1, host, nick, user, realname, m, +conn-conn.username, conn-conn.username_len); + +FORMAT_MSG(conn, FMT_MSG_WHOREPLY2, chan, server, flag, hopcount, m, +conn-conn.username, conn-conn.username_len); +msg_send(conn, m); +} + +static void endofwho_handler(irconn_t *c, void *dummy) +{ +php_irconn_t *conn = dummy; +smart_str m = {0}; + +FORMAT_MSG(conn, FMT_MSG_ENDOFWHO, NULL, NULL, NULL, NULL, m, +conn-conn.username, conn-conn.username_len); + +msg_send(conn, m); +} + +static void invite_handler(irconn_t *c, smart_str *nick, smart_str *chan, int mode, void *dummy) +{ +php_irconn_t *conn = dummy; +smart_str m = {0}; +smart_str *from, *to, tmp = {0}; + +smart_str_setl(tmp, conn-conn.username, conn-conn.username_len); +if (mode == 1) { +from = tmp; +to = nick; +} else { +from = nick; +to = tmp; +} + +FORMAT_MSG(conn, FMT_MSG_INVITE, chan, to, from, NULL, m, +conn-conn.username, conn-conn.username_len); +msg_send(conn, m); +} + + +static void luserclient_handler(irconn_t *c, smart_str *users, smart_str *services, smart_str *servers) +{ + php_irconn_t
Re: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/ircg ircg.c php_ircg.h
On Mon, 7 Jul 2003, Sascha Schumann wrote: sas Mon Jul 7 10:39:03 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/ircg ircg.c php_ircg.h Log: Add support for who/invite/notice/lusers Add ircg_names/ircg_invite/ircg_lusers/ircg_oper/ircg_who/ircg_list # feature patch applied to PHP_4_3 due to won't be released status # of PHP_4 and HEAD being IRCG 3 incompatible. Isn't it much better off in PECL, where you have full control over your release cycle? regards, Derick -- Interpreting what the GPL actually means is a job best left to those that read the future by examining animal entrails. - Derick Rethans http://derickrethans.nl/ International PHP Magazine http://php-mag.net/ - -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/ircg ircg.c
sas Mon Jul 7 11:33:08 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/ircg ircg.c Log: Fixing Index: php-src/ext/ircg/ircg.c diff -u php-src/ext/ircg/ircg.c:1.137.2.12 php-src/ext/ircg/ircg.c:1.137.2.13 --- php-src/ext/ircg/ircg.c:1.137.2.12 Mon Jul 7 10:39:03 2003 +++ php-src/ext/ircg/ircg.c Mon Jul 7 11:33:08 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: ircg.c,v 1.137.2.12 2003/07/07 14:39:03 sas Exp $ */ +/* $Id: ircg.c,v 1.137.2.13 2003/07/07 15:33:08 sas Exp $ */ /* {{{ includes */ @@ -1075,7 +1075,7 @@ } -static void luserclient_handler(irconn_t *c, smart_str *users, smart_str *services, smart_str *servers) +static void luserclient_handler(irconn_t *c, smart_str *users, smart_str *services, smart_str *servers, void *dummy) { php_irconn_t *conn = dummy; smart_str m = {0}; @@ -1085,7 +1085,7 @@ msg_send(conn, m); } -static void luserme_handler(irconn_t *c, smart_str *users, smart_str *servers) +static void luserme_handler(irconn_t *c, smart_str *users, smart_str *servers, void *dummy) { php_irconn_t *conn = dummy; smart_str m = {0}; @@ -1095,7 +1095,7 @@ msg_send(conn, m); } -static void luserop_t(irconn_t *dummy, smart_str *str) +static void luserop_handler(irconn_t *c, smart_str *str, void *dummy) { php_irconn_t *conn = dummy; smart_str m = {0}; @@ -1105,7 +1105,7 @@ msg_send(conn, m); } -static void luserunknown_t(irconn_t *dummy, smart_str *str) +static void luserunknown_handler(irconn_t *c, smart_str *str, void *dummy) { php_irconn_t *conn = dummy; smart_str m = {0}; @@ -1115,7 +1115,7 @@ msg_send(conn, m); } -static void luserchannels_t(irconn_t *dummy, smart_str *str) +static void luserchannels_handler(irconn_t *c, smart_str *str, void *dummy) { php_irconn_t *conn = dummy; smart_str m = {0}; @@ -1739,8 +1739,6 @@ irc_handle_command(conn-conn, WHO, ops ? 2 : 1, Z_STRVAL_PP(p2), o); -put_irconn(conn); - RETVAL_TRUE; } #endif @@ -1768,7 +1766,6 @@ irc_handle_command(conn-conn, INVITE, 2, Z_STRVAL_PP(p3), Z_STRVAL_PP(p2)); -put_irconn(conn); RETVAL_TRUE; } @@ -1799,7 +1796,7 @@ if (!conn) RETURN_FALSE; - irc_handle_command(conn-conn, NAMES, ac 2 ? 2 : 1, Z_STRVAL_PP(p2), Z_STRVAL_PP(p3)); + irc_handle_command(conn-conn, NAMES, ac 2 ? 2 : 1, Z_STRVAL_PP(p2), ac 2 ? Z_STRVAL_PP(p3) : NULL); RETVAL_TRUE; } /* }}} */ @@ -2132,8 +2129,10 @@ irc_set_realname(conn, m); } #endif - -#define IFMSG(n, p, q) if (MSG(irconn, n)-ntoken != 0) irc_register_hook(conn, p, q) + +#define MSG_NOT_EMPTY(n) (MSG(irconn,n) MSG(irconn,n)-ntoken != 0) + +#define IFMSG(n, p, q) if (MSG_NOT_EMPTY(n)) irc_register_hook(conn, p, q) irc_register_hook(conn, IRCG_MSG, msg_handler); irc_register_hook(conn, IRCG_QUIT, quit_handler); @@ -2357,8 +2356,8 @@ } /* }}} */ -/* {{{ proto bool ircg_nick(void) - ??? */ +/* {{{ proto bool ircg_nick(int connection, string newnick) + Changes the nickname */ PHP_FUNCTION(ircg_nick) { zval **id, **newnick; @@ -2380,8 +2379,32 @@ } /* }}} */ -/* {{{ proto bool ircg_notice(void) - ??? */ +/* {{{ proto bool ircg_list(int connection, string channel) + List topic/user count of channel(s) */ +PHP_FUNCTION(ircg_list) +{ + zval **id, **p2; + php_irconn_t *conn; + int ac = ZEND_NUM_ARGS(); + + if (ac != 2 || zend_get_parameters_ex(ac, id, p2) == FAILURE) + WRONG_PARAM_COUNT; + + convert_to_long_ex(id); + convert_to_string_ex(p2); + + conn = lookup_irconn(Z_LVAL_PP(id)); + + if (!conn) RETURN_FALSE; + + irc_handle_command(conn-conn, LIST, 1, Z_STRVAL_PP(p2)); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ircg_notice(int connection, string recipient, string message) + Sends a one-way communication NOTICE to a target */ PHP_FUNCTION(ircg_notice) { zval **id, **recipient, **msg; @@ -2666,9 +2689,9 @@ php_info_print_table_start(); php_info_print_table_header(2, ircg support, enabled); - sprintf(buf, %lu, getdtablesize()); + sprintf(buf, %d, getdtablesize()); php_info_print_table_row(2, Maximum number of open fds, buf); - sprintf(buf, %lu, highest_fd); + sprintf(buf, %d, highest_fd); php_info_print_table_row(2, Highest encountered fd, buf); sprintf(buf, %lu, cache_hits); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/ircg ircg.c
sas Mon Jul 7 21:16:59 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/ircg ircg.c Log: Enable HTML-encoding for all IRC data Encode all channel names in the default format messages Index: php-src/ext/ircg/ircg.c diff -u php-src/ext/ircg/ircg.c:1.137.2.13 php-src/ext/ircg/ircg.c:1.137.2.14 --- php-src/ext/ircg/ircg.c:1.137.2.13 Mon Jul 7 11:33:08 2003 +++ php-src/ext/ircg/ircg.c Mon Jul 7 21:16:59 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: ircg.c,v 1.137.2.13 2003/07/07 15:33:08 sas Exp $ */ +/* $Id: ircg.c,v 1.137.2.14 2003/07/08 01:16:59 sas Exp $ */ /* {{{ includes */ @@ -229,8 +229,8 @@ P_JS = 1, P_NICKNAME= 2, P_NICKNAME_JS = 3, - P_MIRC= 4, - P_MIRC_JS = 5, + P_HTML= 4, + P_HTML_JS = 5, P_NOAUTO_LINKS = 8, /* Don't automatically convert links */ P_CONV_BR = 16,/* Convert a special character to br */ P_COND_STOP= 32,/* If argument != username, stop */ @@ -251,39 +251,39 @@ /* {{{ Default format messages */ static char *fmt_msgs_default[] = { - [EMAIL PROTECTED]: %mbr /, + [EMAIL PROTECTED]: %mbr /, %f: %mbr /, To %t: %mbr /, - %f leaves %cbr /, - %f joins %cbr /, - %t was kicked by %f from %c (%m)br /, - %f changes topic on %c to %mbr /, + %f leaves %6cbr /, + %f joins %6cbr /, + %t was kicked by %f from %6c (%m)br /, + %f changes topic on %6c to %mbr /, Error: %mbr /, Fatal Error: %mbr /, , , %f changes nick to %tbr /, %f quits (%m)br /, - Welcome to channel %c:, + Welcome to channel %6c:, %f, -are in the channel %cbr /, +are in the channel %6cbr /, %f: user(%t) host(%c) real name(%m)br /, %f: server(%c) server info(%m)br /, %f has been idle for %m secondsbr /, - %f is on channel %cbr /, + %f is on channel %6cbr /, End of whois for %fbr /, - %f sets voice flag of %t to %m on %cbr /, - %f sets channel operator flag of %t to %m on %cbr /, - banned from %c: %mbr /, - end of ban list for %cbr /, + %f sets voice flag of %t to %m on %6cbr /, + %f sets channel operator flag of %t to %m on %6cbr /, + banned from %6c: %mbr /, + end of ban list for %6cbr /, You have been disconnectedbr /, - Channel %c has %t users and the topic is '%m'br /, + Channel %6c has %t users and the topic is '%m'br /, End of LISTbr /, Nickname %t has ident %f, realname '%m', hostname %c, , is on server %t, has flag %f, hopcount %m, and channel %c.br /, - end of whobr /, - %f is inviting %t to %cbr /, - [notice %c] %f: %mbr /, + End of WHObr /, + %f has invited %t to %6cbr /, + [notice %6c] %f: %mbr /, notice from %f: %mbr /, notice to %t: %mbr /, %t users, %f services, %r serversbr /, @@ -620,6 +620,7 @@ case '3': mode |= P_NOAUTO_LINKS; goto next; case '4': mode |= P_CONV_BR; goto next; case '5': mode |= P_COND_STOP; goto next; + case '6': mode |= P_HTML; goto next; /* associate mode bits with each command where applicable */ case 'c': NEW_TOKEN(C_CHANNEL, v) = mode; break; @@ -627,8 +628,8 @@ case 't': NEW_TOKEN(C_TO, v) = mode; break; case 'f': NEW_TOKEN(C_FROM, v) = mode; break; case 'r': NEW_TOKEN(C_MESSAGE, v) = mode; break; - case 'm': NEW_TOKEN(C_MESSAGE, v) = mode | P_MIRC; break; - case 'j': NEW_TOKEN(C_MESSAGE, v) = mode | P_MIRC | P_JS; break; + case 'm': NEW_TOKEN(C_MESSAGE, v) = mode | P_HTML; break; + case 'j': NEW_TOKEN(C_MESSAGE, v) = mode | P_HTML | P_JS; break; case '%': NEW_TOKEN(C_PERCENT, v) = 0; break; @@ -650,15 +651,14 @@ smart_str *to, smart_str *from, smart_str *msg, smart_str *result, const char *username, int username_len, int *status) { - smart_str encoded_msg = {0}; - int encoded = 0; int i = 0; const token_t *t = fmt_msg-t; int ntoken = fmt_msg-ntoken; + smart_str tmp = {0}; exec_fmt_msgs++; -#define IRCG_APPEND(what) \ +#define IRCG_APPEND(what, use_cache) \ if (t[i].para.v P_COND_STOP) {\ if (username_len != what-len || memcmp(what-c, username, username_len) != 0) \ goto stop; \ @@ -685,37 +685,45 @@
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/ircg ircg.c
sas Tue Jul 8 00:25:41 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/ircg ircg.c Log: protos Index: php-src/ext/ircg/ircg.c diff -u php-src/ext/ircg/ircg.c:1.137.2.14 php-src/ext/ircg/ircg.c:1.137.2.15 --- php-src/ext/ircg/ircg.c:1.137.2.14 Mon Jul 7 21:16:59 2003 +++ php-src/ext/ircg/ircg.c Tue Jul 8 00:25:40 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: ircg.c,v 1.137.2.14 2003/07/08 01:16:59 sas Exp $ */ +/* $Id: ircg.c,v 1.137.2.15 2003/07/08 04:25:40 sas Exp $ */ /* {{{ includes */ @@ -2237,8 +2237,8 @@ } /* }}} */ -/* {{{ proto int ircg_pconnect(void) - ??? */ +/* {{{ proto int ircg_pconnect(string username [, string server [, int port [, string format-msg-set-name [, array ctcp-set [, array user-details [, bool bailout-on-trivial]]) + Create a persistent IRC connection */ PHP_FUNCTION(ircg_pconnect) { /* This should become an array very soon */ @@ -2344,8 +2344,8 @@ } /* }}} */ -/* {{{ proto bool ircg_disconnect(void) - ??? */ +/* {{{ proto bool ircg_disconnect(int connection, string reason) + Terminate IRC connection */ PHP_FUNCTION(ircg_disconnect) { zval **id, **reason; @@ -2432,6 +2432,9 @@ } /* }}} */ +/* {{{ proto array ircg_eval_ecmascript_params(string params) + Decodes a list of JS-encoded parameters into a native array */ + #define ADD_PARA() do { \ if (para.len) smart_str_0(para); \ add_next_index_stringl(return_value, \ @@ -2543,9 +2546,10 @@ smart_str_free(para); } } +/* }}} */ -/* {{{ proto bool ircg_msg(void) - ??? */ +/* {{{ proto bool ircg_msg(int connection, string recipient, string message [,bool loop-suppress]) + Delivers a message to the IRC network */ PHP_FUNCTION(ircg_msg) { zval **id, **recipient, **msg, **suppress; @@ -2696,7 +2700,7 @@ php_info_print_table_header(2, ircg support, enabled); sprintf(buf, %d, getdtablesize()); - php_info_print_table_row(2, Maximum number of open fds, buf); + php_info_print_table_row(2, Maximum number of open fds (system limit), buf); sprintf(buf, %d, highest_fd); php_info_print_table_row(2, Highest encountered fd, buf); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/ircg ircg.c
sas Thu Jul 3 02:27:55 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/ircg ircg.c Log: always provide recipient info, already fixed in HEAD Index: php-src/ext/ircg/ircg.c diff -u php-src/ext/ircg/ircg.c:1.137.2.8 php-src/ext/ircg/ircg.c:1.137.2.9 --- php-src/ext/ircg/ircg.c:1.137.2.8 Mon Jun 2 09:17:45 2003 +++ php-src/ext/ircg/ircg.c Thu Jul 3 02:27:54 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: ircg.c,v 1.137.2.8 2003/06/02 13:17:45 sas Exp $ */ +/* $Id: ircg.c,v 1.137.2.9 2003/07/03 06:27:54 sas Exp $ */ /* {{{ includes */ @@ -829,7 +829,7 @@ /* {{{ IRCG-handlers */ static void handle_ctcp(php_irconn_t *conn, smart_str *chan, smart_str *from, - smart_str *msg, smart_str *result) + smart_str *msg, smart_str *result, smart_str *recipient) { char *token_end; char *real_msg; @@ -844,7 +844,7 @@ real_msg_end = strchr(real_msg, '\001'); if (real_msg_end) { format_msg_t *fmt_msg; - smart_str tmp, tmp2; + smart_str tmp; int status = 0; *real_msg_end = '\0'; @@ -855,8 +855,7 @@ } smart_str_setl(tmp, real_msg, real_msg_end - real_msg); - smart_str_setl(tmp2, conn-conn.username, conn-conn.username_len); - format_msg(fmt_msg, chan, tmp2, from, tmp, result, conn-conn.username, conn-conn.username_len, status); + format_msg(fmt_msg, chan, recipient, from, tmp, result, conn-conn.username, conn-conn.username_len, status); if (status == 1) irc_disconnect(conn-conn, Connection terminated by authenticated CTCP message); @@ -2250,14 +2249,14 @@ case '#': case '': if (l.c[0] == 1) { - handle_ctcp(conn, tmp, tmp2, l, m); + handle_ctcp(conn, tmp, tmp2, l, m, tmp); } else { FORMAT_MSG(conn, FMT_MSG_CHAN, tmp, NULL, tmp2, l, m, conn-conn.username, conn-conn.username_len); } break; default: if (l.c[0] == 1) { - handle_ctcp(conn, NULL, tmp2, l, m); + handle_ctcp(conn, NULL, tmp2, l, m, tmp); } else { FORMAT_MSG(conn, FMT_MSG_PRIV_FROM_ME, NULL, tmp, tmp2, l, m, conn-conn.username, conn-conn.username_len); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/ircg ircg.c
sas Thu Jul 3 02:29:45 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/ircg ircg.c Log: make it compile Index: php-src/ext/ircg/ircg.c diff -u php-src/ext/ircg/ircg.c:1.137.2.9 php-src/ext/ircg/ircg.c:1.137.2.10 --- php-src/ext/ircg/ircg.c:1.137.2.9 Thu Jul 3 02:27:54 2003 +++ php-src/ext/ircg/ircg.c Thu Jul 3 02:29:45 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: ircg.c,v 1.137.2.9 2003/07/03 06:27:54 sas Exp $ */ +/* $Id: ircg.c,v 1.137.2.10 2003/07/03 06:29:45 sas Exp $ */ /* {{{ includes */ @@ -874,7 +874,7 @@ smart_str_setl(s_username, ircc-username, ircc-username_len); if (msg-c[0] == '\001') { - handle_ctcp(conn, chan, from, msg, m); + handle_ctcp(conn, chan, from, msg, m, chan); } else if (chan) { FORMAT_MSG(conn, FMT_MSG_CHAN, chan, s_username, from, msg, m, conn-conn.username, conn-conn.username_len); } else { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/ircg ircg.c
sas Thu Jul 3 02:59:43 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/ircg ircg.c Log: make the recipient parameter actually useful Index: php-src/ext/ircg/ircg.c diff -u php-src/ext/ircg/ircg.c:1.137.2.10 php-src/ext/ircg/ircg.c:1.137.2.11 --- php-src/ext/ircg/ircg.c:1.137.2.10 Thu Jul 3 02:29:45 2003 +++ php-src/ext/ircg/ircg.c Thu Jul 3 02:59:43 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: ircg.c,v 1.137.2.10 2003/07/03 06:29:45 sas Exp $ */ +/* $Id: ircg.c,v 1.137.2.11 2003/07/03 06:59:43 sas Exp $ */ /* {{{ includes */ @@ -874,7 +874,7 @@ smart_str_setl(s_username, ircc-username, ircc-username_len); if (msg-c[0] == '\001') { - handle_ctcp(conn, chan, from, msg, m, chan); + handle_ctcp(conn, chan, from, msg, m, chan?chan:s_username); } else if (chan) { FORMAT_MSG(conn, FMT_MSG_CHAN, chan, s_username, from, msg, m, conn-conn.username, conn-conn.username_len); } else { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php