PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LTP GCOV extension - code coverage report
Current view: directory - filter - callback_filter.c
Test: PHP Code Coverage
Date: 2009-11-19 Instrumented lines: 17
Code covered: 100.0 % Executed lines: 17
Legend: not executed executed

       1                 : /*
       2                 :   +----------------------------------------------------------------------+
       3                 :   | PHP Version 5                                                        |
       4                 :   +----------------------------------------------------------------------+
       5                 :   | Copyright (c) 1997-2009 The PHP Group                                |
       6                 :   +----------------------------------------------------------------------+
       7                 :   | This source file is subject to version 3.01 of the PHP license,      |
       8                 :   | that is bundled with this package in the file LICENSE, and is        |
       9                 :   | available through the world-wide-web at the following url:           |
      10                 :   | http://www.php.net/license/3_01.txt                                  |
      11                 :   | If you did not receive a copy of the PHP license and are unable to   |
      12                 :   | obtain it through the world-wide-web, please send a note to          |
      13                 :   | license@php.net so we can mail you a copy immediately.               |
      14                 :   +----------------------------------------------------------------------+
      15                 :   | Authors: Derick Rethans <derick@php.net>                             |
      16                 :   +----------------------------------------------------------------------+
      17                 : */
      18                 : 
      19                 : /* $Id: callback_filter.c 272374 2008-12-31 11:17:49Z sebastian $ */
      20                 : 
      21                 : #include "php_filter.h"
      22                 : 
      23                 : void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
      24              38 : {
      25                 :         zval *retval_ptr;
      26                 :         zval ***args;
      27                 :         int status;
      28                 : 
      29              38 :         if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, NULL)) {
      30               3 :                 php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument is expected to be a valid callback");
      31               3 :                 zval_dtor(value);
      32               3 :                 Z_TYPE_P(value) = IS_NULL;
      33               3 :                 return;
      34                 :         }
      35                 : 
      36              35 :         args = safe_emalloc(sizeof(zval **), 1, 0);
      37              35 :         args[0] = &value;
      38                 :         
      39              35 :         status = call_user_function_ex(EG(function_table), NULL, option_array, &retval_ptr, 1, args, 0, NULL TSRMLS_CC);
      40                 : 
      41              69 :         if (status == SUCCESS && retval_ptr != NULL) {
      42              34 :                 if (retval_ptr != value) {
      43              33 :                         zval_dtor(value);
      44              33 :                         COPY_PZVAL_TO_ZVAL(*value, retval_ptr);
      45                 :                 } else {
      46               1 :                         zval_ptr_dtor(&retval_ptr);
      47                 :                 }
      48                 :         } else {
      49               1 :                 zval_dtor(value);
      50               1 :                 Z_TYPE_P(value) = IS_NULL;
      51                 :         }
      52                 : 
      53              35 :         efree(args);
      54                 : }
      55                 : 
      56                 : /*
      57                 :  * Local variables:
      58                 :  * tab-width: 4
      59                 :  * c-basic-offset: 4
      60                 :  * End:
      61                 :  * vim600: noet sw=4 ts=4 fdm=marker
      62                 :  * vim<600: noet sw=4 ts=4
      63                 :  */

Generated by: LTP GCOV extension version 1.5

Generated at Thu, 19 Nov 2009 08:20:07 +0000 (5 days ago)

Copyright © 2005-2009 The PHP Group
All rights reserved.