This repository has been archived by the owner on Nov 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
php_blenc.h
113 lines (94 loc) · 3.23 KB
/
php_blenc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: John Coggeshall <[email protected]> |
| Giuseppe Chiesa <[email protected]> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef PHP_BLENC_H
#define PHP_BLENC_H
#if ZEND_MODULE_API_NO >= 20100409
#define ZEND_ENGINE_2_4
#endif
#if ZEND_MODULE_API_NO > 20060613
#define ZEND_ENGINE_2_3
#endif
#if ZEND_MODULE_API_NO > 20050922
#define ZEND_ENGINE_2_2
#endif
#if ZEND_MODULE_API_NO > 20050921
#define ZEND_ENGINE_2_1
#endif
#define PHP_BLENC_VERSION "1.1.4b"
#define BLENC_IDENT "BLENC"
#define BLENC_BUFSIZE 4092
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
extern zend_module_entry blenc_module_entry;
#define phpext_blenc_ptr &blenc_module_entry
#ifdef PHP_WIN32
#define PHP_BLENC_API __declspec(dllexport)
#else
#define PHP_BLENC_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
PHP_MINIT_FUNCTION(blenc);
PHP_MSHUTDOWN_FUNCTION(blenc);
PHP_RINIT_FUNCTION(blenc);
PHP_MINFO_FUNCTION(blenc);
PHP_FUNCTION(blenc_encrypt);
typedef unsigned char b_byte;
typedef unsigned int b_uint;
ZEND_BEGIN_MODULE_GLOBALS(blenc)
char *key_file;
char *decoded;
unsigned int decoded_len;
unsigned int index;
zend_bool keys_loaded;
zend_bool expired;
char *expire_date;
unsigned long expire_date_numerical;
ZEND_END_MODULE_GLOBALS(blenc)
size_t (*old_stream_reader)(void *, char *, size_t TSRMLS_DC);
void (*old_stream_closer)(void * TSRMLS_DC);
zend_op_array *(*zend_compile_file_old)(zend_file_handle *, int TSRMLS_DC);
zend_op_array *blenc_compile(zend_file_handle *, int TSRMLS_DC);
static void php_blenc_make_md5(char *, void *, unsigned int TSRMLS_DC);
static char *php_blenc_file_to_mem(char * TSRMLS_DC);
static int php_blenc_load_keyhash(TSRMLS_D);
b_byte *php_blenc_encode(void *, unsigned char *, int, int * TSRMLS_DC);
b_byte *php_blenc_decode(void *, unsigned char *, int, int * TSRMLS_DC);
static unsigned char *php_blenc_gen_key(TSRMLS_D);
void _php_blenc_pefree_wrapper(void **);
#ifdef ZTS
#define BL_G(v) TSRMG(blenc_globals_id, zend_blenc_globals *, v)
#else
#define BL_G(v) (blenc_globals.v)
#endif
#endif /* PHP_BLENC_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/