summaryrefslogtreecommitdiff
path: root/ext/snmp/php_snmp.h
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-05-20 17:02:29 +0800
committerXinchen Hui <laruence@php.net>2014-05-20 17:02:29 +0800
commitb36afe8dd330039685b2b74e13e385353d662cfc (patch)
tree404b0f394d48d422d977906a4f934c12b6cd2fc9 /ext/snmp/php_snmp.h
parentf2028491aa44367dbf77cc1008e9e4b027f60666 (diff)
downloadphp-git-b36afe8dd330039685b2b74e13e385353d662cfc.tar.gz
Refactoring ext/snmp
Diffstat (limited to 'ext/snmp/php_snmp.h')
-rw-r--r--ext/snmp/php_snmp.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/snmp/php_snmp.h b/ext/snmp/php_snmp.h
index 09ab8b9e81..50bd272204 100644
--- a/ext/snmp/php_snmp.h
+++ b/ext/snmp/php_snmp.h
@@ -85,7 +85,6 @@ PHP_METHOD(SNMP, getErrno);
PHP_METHOD(SNMP, getError);
typedef struct _php_snmp_object {
- zend_object zo;
struct snmp_session *session;
int max_oids;
int valueretrieval;
@@ -96,10 +95,16 @@ typedef struct _php_snmp_object {
int oid_increasing_check;
int exceptions_enabled;
char snmp_errstr[256];
+ zend_object zo;
} php_snmp_object;
+static inline php_snmp_object *php_snmp_fetch_object(zend_object *obj) {
+ return (php_snmp_object *)((char*)(obj) - XtOffsetOf(php_snmp_object, zo));
+}
+
+#define Z_SNMP_P(zv) php_snmp_fetch_object(Z_OBJ_P((zv)))
-typedef int (*php_snmp_read_t)(php_snmp_object *snmp_object, zval **retval TSRMLS_DC);
+typedef int (*php_snmp_read_t)(php_snmp_object *snmp_object, zval *retval TSRMLS_DC);
typedef int (*php_snmp_write_t)(php_snmp_object *snmp_object, zval *newval TSRMLS_DC);
typedef struct _ptp_snmp_prop_handler {