summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJani Taskinen <jani@php.net>2007-11-05 11:52:31 +0000
committerJani Taskinen <jani@php.net>2007-11-05 11:52:31 +0000
commit0903022e29b3a8fd8608d9c6ff13915a92ba298f (patch)
tree1cd76d45f332b58e367a4d23f36e6d439a25013b
parent129c125f7f54952143151fa05e61defc9da104f0 (diff)
downloadphp-git-0903022e29b3a8fd8608d9c6ff13915a92ba298f.tar.gz
MFH: ws + cs + folding tags
-rw-r--r--ext/standard/assert.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index b88dbf80fb..85d559175e 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -14,15 +14,15 @@
+----------------------------------------------------------------------+
| Author: Thies C. Arntzen <thies@thieso.net> |
+----------------------------------------------------------------------+
- */
+*/
/* $Id$ */
-/* {{{ includes/startup/misc */
-
+/* {{{ includes */
#include "php.h"
#include "php_assert.h"
#include "php_ini.h"
+/* }}} */
ZEND_BEGIN_MODULE_GLOBALS(assert)
long active;
@@ -51,7 +51,7 @@ enum {
ASSERT_QUIET_EVAL
};
-static PHP_INI_MH(OnChangeCallback)
+static PHP_INI_MH(OnChangeCallback) /* {{{ */
{
if (EG(in_execution)) {
if (ASSERTG(callback)) {
@@ -75,22 +75,24 @@ static PHP_INI_MH(OnChangeCallback)
}
return SUCCESS;
}
+/* }}} */
PHP_INI_BEGIN()
- STD_PHP_INI_ENTRY("assert.active", "1", PHP_INI_ALL, OnUpdateLong, active, zend_assert_globals, assert_globals)
- STD_PHP_INI_ENTRY("assert.bail", "0", PHP_INI_ALL, OnUpdateLong, bail, zend_assert_globals, assert_globals)
+ STD_PHP_INI_ENTRY("assert.active", "1", PHP_INI_ALL, OnUpdateLong, active, zend_assert_globals, assert_globals)
+ STD_PHP_INI_ENTRY("assert.bail", "0", PHP_INI_ALL, OnUpdateLong, bail, zend_assert_globals, assert_globals)
STD_PHP_INI_ENTRY("assert.warning", "1", PHP_INI_ALL, OnUpdateLong, warning, zend_assert_globals, assert_globals)
- PHP_INI_ENTRY ("assert.callback", NULL, PHP_INI_ALL, OnChangeCallback)
+ PHP_INI_ENTRY("assert.callback", NULL, PHP_INI_ALL, OnChangeCallback)
STD_PHP_INI_ENTRY("assert.quiet_eval", "0", PHP_INI_ALL, OnUpdateLong, quiet_eval, zend_assert_globals, assert_globals)
PHP_INI_END()
-static void php_assert_init_globals(zend_assert_globals *assert_globals_p TSRMLS_DC)
+static void php_assert_init_globals(zend_assert_globals *assert_globals_p TSRMLS_DC) /* {{{ */
{
assert_globals_p->callback = NULL;
assert_globals_p->cb = NULL;
}
+/* }}} */
-PHP_MINIT_FUNCTION(assert)
+PHP_MINIT_FUNCTION(assert) /* {{{ */
{
ZEND_INIT_MODULE_GLOBALS(assert, php_assert_init_globals, NULL);
@@ -104,8 +106,9 @@ PHP_MINIT_FUNCTION(assert)
return SUCCESS;
}
+/* }}} */
-PHP_MSHUTDOWN_FUNCTION(assert)
+PHP_MSHUTDOWN_FUNCTION(assert) /* {{{ */
{
if (ASSERTG(cb)) {
pefree(ASSERTG(cb), 1);
@@ -113,35 +116,34 @@ PHP_MSHUTDOWN_FUNCTION(assert)
}
return SUCCESS;
}
+/* }}} */
-PHP_RSHUTDOWN_FUNCTION(assert)
+PHP_RSHUTDOWN_FUNCTION(assert) /* {{{ */
{
- if (ASSERTG(callback)) {
+ if (ASSERTG(callback)) {
zval_ptr_dtor(&ASSERTG(callback));
ASSERTG(callback) = NULL;
}
return SUCCESS;
}
+/* }}} */
-PHP_MINFO_FUNCTION(assert)
+PHP_MINFO_FUNCTION(assert) /* {{{ */
{
DISPLAY_INI_ENTRIES();
}
-
-/* }}} */
-/* {{{ internal functions */
/* }}} */
+
/* {{{ proto int assert(string|bool assertion)
Checks if assertion is false */
-
PHP_FUNCTION(assert)
{
- zval **assertion;
+ zval **assertion;
int val;
char *myeval = NULL;
char *compiled_string_description;
-
+
if (! ASSERTG(active)) {
RETURN_TRUE;
}
@@ -206,7 +208,7 @@ PHP_FUNCTION(assert)
ZVAL_STRING(args[0], SAFE_STRING(filename), 1);
ZVAL_LONG (args[1], lineno);
ZVAL_STRING(args[2], SAFE_STRING(myeval), 1);
-
+
MAKE_STD_ZVAL(retval);
ZVAL_FALSE(retval);
@@ -231,17 +233,16 @@ PHP_FUNCTION(assert)
zend_bailout();
}
}
-
/* }}} */
+
/* {{{ proto mixed assert_options(int what [, mixed value])
Set/get the various assert flags */
-
PHP_FUNCTION(assert_options)
{
zval **what, **value;
int oldint;
int ac = ZEND_NUM_ARGS();
-
+
if (ac < 1 || ac > 2 || zend_get_parameters_ex(ac, &what, &value) == FAILURE) {
WRONG_PARAM_COUNT;
}
@@ -310,7 +311,6 @@ PHP_FUNCTION(assert_options)
RETURN_FALSE;
}
-
/* }}} */
/*