Date: 03/30/99
- Next message: Adam Trachtenberg: "Re: [PHP-DEV] CVS update: php3/doc/functions"
- Previous message: rasmus: "[PHP-DEV] CVS update: php3/doc/functions"
- Next in thread: rasmus: "[PHP-DEV] CVS update: php3/functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tuesday March 30, 1999 @ 7:55
Author: rasmus
Update of /repository/php3/functions
In directory asf:/home/rasmus/php3/functions
Modified Files:
crypt.c php3_string.h
Log Message:
Change crypt_salt_length() function to a constant
Index: php3/functions/crypt.c
diff -c php3/functions/crypt.c:1.42 php3/functions/crypt.c:1.43
*** php3/functions/crypt.c:1.42 Tue Mar 30 06:25:03 1999
--- php3/functions/crypt.c Tue Mar 30 07:55:12 1999
***************
*** 28,34 ****
| Rasmus Lerdorf <rasmus <email protected>> |
+----------------------------------------------------------------------+
*/
! /* $Id: crypt.c,v 1.42 1999/03/30 11:25:03 rasmus Exp $ */
#include <stdlib.h>
#include "php.h"
--- 28,34 ----
| Rasmus Lerdorf <rasmus <email protected>> |
+----------------------------------------------------------------------+
*/
! /* $Id: crypt.c,v 1.43 1999/03/30 12:55:12 rasmus Exp $ */
#include <stdlib.h>
#include "php.h"
***************
*** 62,73 ****
function_entry crypt_functions[] = {
{"crypt", php3_crypt, NULL},
- {"crypt_salt_length", php3_crypt_salt_length, NULL},
{NULL, NULL, NULL}
};
php3_module_entry crypt_module_entry = {
! "Crypt", crypt_functions, NULL, NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES
};
--- 62,72 ----
function_entry crypt_functions[] = {
{"crypt", php3_crypt, NULL},
{NULL, NULL, NULL}
};
php3_module_entry crypt_module_entry = {
! "Crypt", crypt_functions, php3_minit_crypt, NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES
};
***************
*** 103,108 ****
--- 102,118 ----
#endif
#endif
+ int php3_minit_crypt(INIT_FUNC_ARGS) {
+ #ifdef PHP3_STD_DES_CRYPT
+ REGISTER_LONG_CONSTANT("CRYPT_SALT_LENGTH", 2, CONST_CS | CONST_PERSISTENT);
+ #else
+ #if PHP3_MD5_CRYPT
+ REGISTER_LONG_CONSTANT("CRYPT_SALT_LENGTH", 12, CONST_CS | CONST_PERSISTENT);
+ #endif
+ #endif
+ return SUCCESS;
+ }
+
static unsigned char itoa64[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static void php3i_to64(char *s, long v, int n) {
***************
*** 169,187 ****
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
pval_copy_constructor(return_value);
- }
- /* }}} */
-
- /* {{{ proto crypt_salt_length(void)
- Return the length of the salt used in the crypt function on this system */
- void php3_crypt_salt_length(INTERNAL_FUNCTION_PARAMETERS) {
- #ifdef PHP3_STD_DES_CRYPT
- RETVAL_LONG(2);
- #else
- #if PHP3_MD5_CRYPT
- RETVAL_LONG(12);
- #endif
- #endif
}
/* }}} */
--- 179,184 ----
Index: php3/functions/php3_string.h
diff -c php3/functions/php3_string.h:1.38 php3/functions/php3_string.h:1.39
*** php3/functions/php3_string.h:1.38 Tue Mar 30 07:43:30 1999
--- php3/functions/php3_string.h Tue Mar 30 07:55:13 1999
***************
*** 29,35 ****
*/
! /* $Id: php3_string.h,v 1.38 1999/03/30 12:43:30 rasmus Exp $ */
#ifndef _PHPSTRING_H
#define _PHPSTRING_H
--- 29,35 ----
*/
! /* $Id: php3_string.h,v 1.39 1999/03/30 12:55:13 rasmus Exp $ */
#ifndef _PHPSTRING_H
#define _PHPSTRING_H
***************
*** 85,91 ****
extern php3_module_entry crypt_module_entry;
#define crypt_module_ptr &crypt_module_entry
extern void php3_crypt(INTERNAL_FUNCTION_PARAMETERS);
! extern void php3_crypt_salt_length(INTERNAL_FUNCTION_PARAMETERS);
#else
#define crypt_module_ptr NULL
#endif
--- 85,91 ----
extern php3_module_entry crypt_module_entry;
#define crypt_module_ptr &crypt_module_entry
extern void php3_crypt(INTERNAL_FUNCTION_PARAMETERS);
! extern int php3_minit_crypt(INIT_FUNC_ARGS);
#else
#define crypt_module_ptr NULL
#endif
-- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe <email protected> For help: php-dev-help <email protected>
- Next message: Adam Trachtenberg: "Re: [PHP-DEV] CVS update: php3/doc/functions"
- Previous message: rasmus: "[PHP-DEV] CVS update: php3/doc/functions"
- Next in thread: rasmus: "[PHP-DEV] CVS update: php3/functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

