]> granicus.if.org Git - php/commitdiff
PHP6 Updates
authorSara Golemon <pollita@php.net>
Sun, 24 Sep 2006 17:09:46 +0000 (17:09 +0000)
committerSara Golemon <pollita@php.net>
Sun, 24 Sep 2006 17:09:46 +0000 (17:09 +0000)
ext/standard/md5.c
ext/standard/sha1.c

index ce1338888f63796d1d7e6c973f9001f9c7d42ccf..1383ae5aacd6af4f3f27af3e09a6fc2f503e2ffb 100644 (file)
@@ -38,7 +38,7 @@ PHPAPI void make_digest(char *md5str, unsigned char *digest)
        *md5str = '\0';
 }
 
-/* {{{ proto string md5(string str, [ bool raw_output])
+/* {{{ proto string md5(string str, [ bool raw_output]) U
    Calculate the md5 hash of a string */
 PHP_NAMED_FUNCTION(php_if_md5)
 {
@@ -49,7 +49,7 @@ PHP_NAMED_FUNCTION(php_if_md5)
        PHP_MD5_CTX context;
        unsigned char digest[16];
        
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &arg, &arg_len, &raw_output) == FAILURE) {
                return;
        }
        
@@ -61,13 +61,13 @@ PHP_NAMED_FUNCTION(php_if_md5)
                RETURN_STRINGL((char*)digest, 16, 1);
        } else {
                make_digest(md5str, digest);
-               RETVAL_ASCII_STRING(md5str, 1);
+               RETVAL_ASCII_STRING(md5str, ZSTR_DUPLICATE);
        }
 
 }
 /* }}} */
 
-/* {{{ proto string md5_file(string filename [, bool raw_output])
+/* {{{ proto string md5_file(string filename [, bool raw_output]) U
    Calculate the md5 hash of given filename */
 PHP_NAMED_FUNCTION(php_if_md5_file)
 {
@@ -81,7 +81,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
        int           n;
        php_stream    *stream;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &arg, &arg_len, &raw_output) == FAILURE) {
                return;
        }
        
@@ -108,7 +108,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
                RETURN_STRINGL((char*)digest, 16, 1);
        } else {
                make_digest(md5str, digest);
-               RETVAL_ASCII_STRING(md5str, 1);
+               RETVAL_ASCII_STRING(md5str, ZSTR_DUPLICATE);
        }
 }
 /* }}} */
index 0c306042751a3a61199e5c4bd25b95a9492f653d..fdfee17e1f3a88bcdd905613f5e2f5c8193753e3 100644 (file)
@@ -36,7 +36,7 @@ PHPAPI void make_sha1_digest(char *sha1str, unsigned char *digest)
        *sha1str = '\0';
 }
 
-/* {{{ proto string sha1(string str [, bool raw_output])
+/* {{{ proto string sha1(string str [, bool raw_output]) U
    Calculate the sha1 hash of a string */
 PHP_FUNCTION(sha1)
 {
@@ -47,7 +47,7 @@ PHP_FUNCTION(sha1)
        PHP_SHA1_CTX context;
        unsigned char digest[20];
        
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &arg, &arg_len, &raw_output) == FAILURE) {
                return;
        }
 
@@ -59,7 +59,7 @@ PHP_FUNCTION(sha1)
                RETURN_STRINGL((char*)digest, 20, 1);
        } else {
                make_sha1_digest(sha1str, digest);
-               RETVAL_ASCII_STRING(sha1str, 1);
+               RETVAL_ASCII_STRING(sha1str, ZSTR_DUPLICATE);
        }
 
 }
@@ -67,7 +67,7 @@ PHP_FUNCTION(sha1)
 /* }}} */
 
 
-/* {{{ proto string sha1_file(string filename [, bool raw_output])
+/* {{{ proto string sha1_file(string filename [, bool raw_output]) U
    Calculate the sha1 hash of given filename */
 PHP_FUNCTION(sha1_file)
 {
@@ -81,7 +81,7 @@ PHP_FUNCTION(sha1_file)
        int           n;
        php_stream    *stream;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &arg, &arg_len, &raw_output) == FAILURE) {
                return;
        }
        
@@ -108,7 +108,7 @@ PHP_FUNCTION(sha1_file)
                RETURN_STRINGL((char*)digest, 20, 1);
        } else {
                make_sha1_digest(sha1str, digest);
-               RETVAL_ASCII_STRING(sha1str, 1);
+               RETVAL_ASCII_STRING(sha1str, ZSTR_DUPLICATE);
        }
 }
 /* }}} */