1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 03:03:26 +02:00

PHP6 Updates

This commit is contained in:
Sara Golemon
2006-09-24 17:09:46 +00:00
parent 1a13bdc516
commit 1f8bbc65a6
2 changed files with 12 additions and 12 deletions
+6 -6
View 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);
}
}
/* }}} */
+6 -6
View 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);
}
}
/* }}} */