cvs: pecl /statgrab config.m4 statgrab.c

From: Date: Wed, 15 Mar 2006 02:56:39 +0000
Subject: cvs: pecl /statgrab config.m4 statgrab.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-5474@lists.php.net to get a copy of this message
iliaa Wed Mar 15 02:56:39 2006 UTC Modified files: /pecl/statgrab statgrab.c config.m4 Log: Added detection for new version of libstatgrab that changes structure names http://cvs.php.net/viewcvs.cgi/pecl/statgrab/statgrab.c?r1=1.3&r2=1.4&diff_format=u Index: pecl/statgrab/statgrab.c diff -u pecl/statgrab/statgrab.c:1.3 pecl/statgrab/statgrab.c:1.4 --- pecl/statgrab/statgrab.c:1.3 Fri May 21 14:20:12 2004 +++ pecl/statgrab/statgrab.c Wed Mar 15 02:56:39 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: statgrab.c,v 1.3 2004/05/21 14:20:12 iliaa Exp $ */ +/* $Id: statgrab.c,v 1.4 2006/03/15 02:56:39 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -30,7 +30,7 @@ #include "ext/standard/php_string.h" /* needed for php_explode */ #include "php_statgrab.h" -#define PHP_STATGRAB_VERSION "0.3" +#define PHP_STATGRAB_VERSION "0.5" #define PHP_SG_ADD_FVAL(rtz, key, val) add_assoc_double_ex(rtz, key, sizeof(key), val); #define PHP_SG_ADD_LVAL(rtz, key, val) add_assoc_long_ex(rtz, key, sizeof(key), val); @@ -158,7 +158,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "statgrab support", "enabled"); - php_info_print_table_header(2, "Extension version", PHP_STATGRAB_VERSION " - ($Id: statgrab.c,v 1.3 2004/05/21 14:20:12 iliaa Exp $)"); + php_info_print_table_header(2, "Extension version", PHP_STATGRAB_VERSION " - ($Id: statgrab.c,v 1.4 2006/03/15 02:56:39 iliaa Exp $)"); php_info_print_table_end(); } /* }}} */ @@ -553,7 +553,11 @@ array_init(tmpz); PHP_SG_ADD_LVAL(tmpz, "speed", ifs->speed) +#ifdef HAVE_OLD_STATGRAB PHP_SG_ADD_LVAL(tmpz, "duplex", ifs->dup) +#else + PHP_SG_ADD_LVAL(tmpz, "duplex", ifs->duplex) +#endif add_assoc_bool(tmpz, "active", ifs->up); add_assoc_zval(return_value, ifs->interface_name, tmpz); http://cvs.php.net/viewcvs.cgi/pecl/statgrab/config.m4?r1=1.6&r2=1.7&diff_format=u Index: pecl/statgrab/config.m4 diff -u pecl/statgrab/config.m4:1.6 pecl/statgrab/config.m4:1.7 --- pecl/statgrab/config.m4:1.6 Wed Apr 6 03:42:54 2005 +++ pecl/statgrab/config.m4 Wed Mar 15 02:56:39 2006 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.6 2005/04/06 03:42:54 iliaa Exp $ +dnl $Id: config.m4,v 1.7 2006/03/15 02:56:39 iliaa Exp $ dnl config.m4 for extension statgrab PHP_ARG_WITH(statgrab, for libstatgrab support, @@ -46,6 +46,15 @@ dnl PHP_SUBST(STATGRAB_SHARED_LIBADD) + AC_TRY_COMPILE([ +#include <statgrab.h> + ], [ +sg_network_iface_stats p; +p.dup = SG_IFACE_DUPLEX_UNKNOWN; + ], [ + AC_DEFINE(HAVE_OLD_STATGRAB, 1, [ ]) + ]) + PHP_NEW_EXTENSION(statgrab, statgrab.c, $ext_shared) fi

« previous php.pecl.cvs (#5474) next »