cvs: php4 /ext/ircg ircg.c
| From: | Sascha Schumann | Date: | Sat, 19 Apr 2003 18:36:37 +0000 |
| Subject: | cvs: php4 /ext/ircg ircg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20405@lists.php.net to get a copy of this message | ||
sas Sat Apr 19 14:36:37 2003 EDT
Modified files:
/php4/ext/ircg ircg.c
Log:
Further refine output of phpinfo
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.169 php4/ext/ircg/ircg.c:1.170
--- php4/ext/ircg/ircg.c:1.169 Sat Apr 19 14:03:47 2003
+++ php4/ext/ircg/ircg.c Sat Apr 19 14:36:37 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ircg.c,v 1.169 2003/04/19 18:03:47 sas Exp $ */
+/* $Id: ircg.c,v 1.170 2003/04/19 18:36:37 sas Exp $ */
/* {{{ includes */
@@ -2219,11 +2219,22 @@
#include <ircg_log.h>
#endif
+static void php_ircg_print_table_row(const char *name, unsigned int d)
+{
+ char buf[32];
+
+ PUTS("<tr><td class='e'>");
+ PUTS(name);
+ PUTS("</td><td class='v' style='text-align: right'>");
+ PUTS(smart_str_print_unsigned(buf + sizeof(buf) - 1, d));
+ PUTS("</td></tr>");
+}
+
+
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(ircg)
{
- char buf[100];
#if IRCG_API_VERSION >= 20021127
int i;
const char *name;
@@ -2232,26 +2243,27 @@
php_info_print_table_start();
php_info_print_table_header(2, "Property", "Value");
- sprintf(buf, "%lu", php_ircg->max_concurrency);
- php_info_print_table_row(2, "Maximum concurrent IRC connections", buf);
- sprintf(buf, "%lu", php_ircg->cache_hits);
- php_info_print_table_row(2, "Scanner result cache hits", buf);
- sprintf(buf, "%lu", php_ircg->cache_misses);
- php_info_print_table_row(2, "Scanner result cache misses", buf);
- sprintf(buf, "%lu", php_ircg->exec_fmt_msgs);
- php_info_print_table_row(2, "Handled format messages", buf);
- sprintf(buf, "%lu", php_ircg->exec_token_compiler);
- php_info_print_table_row(2, "Tokenizer invocations", buf);
- sprintf(buf, "%lu", php_ircg->irc_connects);
- php_info_print_table_row(2, "Initiated IRC connections", buf);
- sprintf(buf, "%lu", php_ircg->irc_quit_handlers);
- php_info_print_table_row(2, "Terminated IRC connections", buf);
- sprintf(buf, "%lu", php_ircg->irc_set_currents);
- php_info_print_table_row(2, "Persistent HTTP connections", buf);
- sprintf(buf, "%lu", php_ircg->failed_set_currents);
- php_info_print_table_row(2, "Failed persistent HTTP connections", buf);
- sprintf(buf, "%lu", php_ircg->irc_wbuf_destructs);
- php_info_print_table_row(2, "Write buffer destructs", buf);
+
+
+ php_ircg_print_table_row("Maximum concurrent IRC connections",
+ php_ircg->max_concurrency);
+ php_ircg_print_table_row("Scanner result cache hits", php_ircg->cache_hits);
+ php_ircg_print_table_row("Scanner result cache misses",
+ php_ircg->cache_misses);
+ php_ircg_print_table_row("Handled format messages",
+ php_ircg->exec_fmt_msgs);
+ php_ircg_print_table_row("Tokenizer invocations",
+ php_ircg->exec_token_compiler);
+ php_ircg_print_table_row("Initiated IRC connections",
+ php_ircg->irc_connects);
+ php_ircg_print_table_row("Terminated IRC connections",
+ php_ircg->irc_quit_handlers);
+ php_ircg_print_table_row("Persistent HTTP connections",
+ php_ircg->irc_set_currents);
+ php_ircg_print_table_row("Failed persistent HTTP connections",
+ php_ircg->failed_set_currents);
+ php_ircg_print_table_row("Write buffer destructs",
+ php_ircg->irc_wbuf_destructs);
#if IRCG_API_VERSION >= 20021127
@@ -2261,8 +2273,7 @@
for (i = 0; i < IRCG_LOG_CNT_NR; i++) {
ircg_log_get(i, &val, &name);
- sprintf(buf, IRCG_LOG_INT_FMT, val);
- php_info_print_table_row_ex(2, "vr", name, buf);
+ php_ircg_print_table_row(name, val);
}
#endif