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

LCOV - code coverage report
Current view: top level - ext/standard - crc32.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 7 8 87.5 %
Date: 2014-07-23 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :    +----------------------------------------------------------------------+
       3             :    | PHP Version 5                                                        |
       4             :    +----------------------------------------------------------------------+
       5             :    | Copyright (c) 1997-2013 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             :    | Author: Rasmus Lerdorf <rasmus@php.net>                              |
      16             :    +----------------------------------------------------------------------+
      17             : */
      18             : 
      19             : /* $Id$ */
      20             : 
      21             : #include "php.h"
      22             : #include "basic_functions.h"
      23             : #include "crc32.h"
      24             : 
      25             : /* {{{ proto string crc32(string str)
      26             :    Calculate the crc32 polynomial of a string */
      27         293 : PHP_NAMED_FUNCTION(php_if_crc32)
      28             : {
      29             :         char *p;
      30             :         int len, nr;
      31         293 :         php_uint32 crcinit = 0;
      32             :         register php_uint32 crc;
      33             : 
      34         293 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &p, &nr) == FAILURE) {
      35           0 :                 return;
      36             :         }
      37         293 :         crc = crcinit^0xFFFFFFFF;
      38             : 
      39        6274 :         for (len =+nr; nr--; ++p) {
      40        5981 :                 crc = ((crc >> 8) & 0x00FFFFFF) ^ crc32tab[(crc ^ (*p)) & 0xFF ];
      41             :         }
      42         293 :         RETVAL_LONG(crc^0xFFFFFFFF);
      43             : }
      44             : /* }}} */
      45             : 
      46             : /*
      47             :  * Local variables:
      48             :  * tab-width: 4
      49             :  * c-basic-offset: 4
      50             :  * End:
      51             :  * vim600: sw=4 ts=4 fdm=marker
      52             :  * vim<600: sw=4 ts=4
      53             :  */

Generated by: LCOV version 1.10

Generated at Wed, 23 Jul 2014 19:58:41 +0000 (21 hours ago)

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