cvs: php4 /ext/ircg ircg.c

From: Date: Mon, 13 Aug 2001 22:29:58 +0000
Subject: cvs: php4 /ext/ircg ircg.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6798@lists.php.net to get a copy of this message
sas Mon Aug 13 18:29:58 2001 EDT Modified files: /php4/ext/ircg ircg.c Log: make it build Index: php4/ext/ircg/ircg.c diff -u php4/ext/ircg/ircg.c:1.102 php4/ext/ircg/ircg.c:1.103 --- php4/ext/ircg/ircg.c:1.102 Mon Aug 13 17:37:48 2001 +++ php4/ext/ircg/ircg.c Mon Aug 13 18:29:57 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ircg.c,v 1.102 2001/08/13 21:37:48 sas Exp $ */ +/* $Id: ircg.c,v 1.103 2001/08/13 22:29:57 sas Exp $ */ #include <time.h> @@ -402,7 +402,7 @@ smart_str_append_ex(result, &cache_entries[hash].result, 1); } else { /* No channel message, no caching */ - ircg_mirc_color(src->c, result, src->len); + ircg_mirc_color(src->c, result, src->len, auto_links, gen_br); } } /* }}} */ @@ -1288,15 +1288,27 @@ */ PHP_FUNCTION(ircg_html_encode) { - zval **p1; + zval **p1, **p2, **p3; smart_str res = {0}; + int auto_links = 1; + int conv_br = 0; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &p1) == FAILURE) + if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 3 + || zend_get_parameters_ex(ZEND_NUM_ARGS(), &p1, &p2, &p3) == FAILURE) WRONG_PARAM_COUNT; - convert_to_string_ex(p1); + switch (ZEND_NUM_ARGS()) { + case 3: + convert_to_boolean_ex(p3); + conv_br = Z_LVAL_PP(p3); + case 2: + convert_to_boolean_ex(p2); + auto_links = Z_LVAL_PP(p2); + case 1: + convert_to_string_ex(p1); + } - ircg_mirc_color(Z_STRVAL_PP(p1), &res, Z_STRLEN_PP(p1)); + ircg_mirc_color(Z_STRVAL_PP(p1), &res, Z_STRLEN_PP(p1), auto_links, conv_br); RETVAL_STRINGL(res.c, res.len, 1);

« previous php.cvs (#6798) next »