php-src/ext/mcrypt/php_mcrypt.h

98 lines
2.5 KiB
C
Raw Normal View History

1999-04-25 16:50:40 +00:00
#ifndef PHP_MCRYPT_H
#define PHP_MCRYPT_H
#if HAVE_LIBMCRYPT
2000-08-11 18:45:17 +00:00
#ifdef ZTS
#include "TSRM.h"
#endif
#if PHP_API_VERSION < 19990421
#define zend_module_entry zend_module_entry
#include "modules.h"
#include "internal_functions.h"
#endif
1999-04-25 16:50:40 +00:00
extern zend_module_entry mcrypt_module_entry;
2000-08-11 18:45:17 +00:00
1999-04-25 16:50:40 +00:00
#define mcrypt_module_ptr &mcrypt_module_entry
2000-08-11 18:45:17 +00:00
/* Functions for both old and new API */
1999-04-25 16:50:40 +00:00
PHP_FUNCTION(mcrypt_ecb);
1999-04-25 17:04:56 +00:00
PHP_FUNCTION(mcrypt_cbc);
PHP_FUNCTION(mcrypt_cfb);
1999-04-25 21:11:29 +00:00
PHP_FUNCTION(mcrypt_ofb);
PHP_FUNCTION(mcrypt_get_cipher_name);
1999-04-25 20:32:15 +00:00
PHP_FUNCTION(mcrypt_get_block_size);
PHP_FUNCTION(mcrypt_get_key_size);
1999-04-25 21:09:07 +00:00
PHP_FUNCTION(mcrypt_create_iv);
1999-04-25 16:50:40 +00:00
2000-08-11 18:45:17 +00:00
#if HAVE_LIBMCRYPT24
/* Support functions for old API */
PHP_FUNCTION(mcrypt_list_algorithms);
PHP_FUNCTION(mcrypt_list_modes);
PHP_FUNCTION(mcrypt_get_iv_size);
PHP_FUNCTION(mcrypt_encrypt);
PHP_FUNCTION(mcrypt_decrypt);
/* Functions for new API */
PHP_FUNCTION(mcrypt_module_open);
PHP_FUNCTION(mcrypt_generic_init);
PHP_FUNCTION(mcrypt_generic);
PHP_FUNCTION(mdecrypt_generic);
PHP_FUNCTION(mcrypt_generic_end);
PHP_FUNCTION(mcrypt_enc_self_test);
PHP_FUNCTION(mcrypt_enc_is_block_algorithm_mode);
PHP_FUNCTION(mcrypt_enc_is_block_algorithm);
PHP_FUNCTION(mcrypt_enc_is_block_mode);
PHP_FUNCTION(mcrypt_enc_get_block_size);
PHP_FUNCTION(mcrypt_enc_get_key_size);
PHP_FUNCTION(mcrypt_enc_get_supported_key_sizes);
PHP_FUNCTION(mcrypt_enc_get_iv_size);
PHP_FUNCTION(mcrypt_enc_get_algorithms_name);
PHP_FUNCTION(mcrypt_enc_get_modes_name);
PHP_FUNCTION(mcrypt_module_self_test);
PHP_FUNCTION(mcrypt_module_is_block_algorithm_mode);
PHP_FUNCTION(mcrypt_module_is_block_algorithm);
PHP_FUNCTION(mcrypt_module_is_block_mode);
PHP_FUNCTION(mcrypt_module_get_algo_block_size);
PHP_FUNCTION(mcrypt_module_get_algo_key_size);
PHP_FUNCTION(mcrypt_module_get_supported_key_sizes);
PHP_FUNCTION(mcrypt_module_close);
#ifdef ZTS
ZEND_BEGIN_MODULE_GLOBALS(mcrypt)
int le_h;
ZEND_END_MODULE_GLOBALS(mcrypt)
#else
typedef struct mcrypt_global_struct {
int le_h;
} mcrypt_global_struct;
#endif
#ifdef ZTS
# define MCLS_D zend_mcrypt_globals *mcrypt_globals
# define MCLS_DC , MCLS_D
# define MCLS_C mcrypt_globals
# define MCLS_CC , MCLS_C
# define MCG(v) (mcrypt_globals->v)
# define MCLS_FETCH() zend_mcrypt_globals *mcrypt_globals = ts_resource(mcrypt_globals_id)
#else
# define MCLS_D
# define MCLS_DC
# define MCLS_C
# define MCLS_CC
# define MCG(v) (mcrypt_globals.v)
# define MCLS_FETCH()
#endif
#endif
1999-04-25 16:50:40 +00:00
#else
#define mcrypt_module_ptr NULL
#endif
1999-05-06 20:54:56 +00:00
#define phpext_mcrypt_ptr mcrypt_module_ptr
1999-04-25 16:50:40 +00:00
#endif