1 /*
2    +----------------------------------------------------------------------+
3    | Zend OPcache                                                         |
4    +----------------------------------------------------------------------+
5    | Copyright (c) The PHP Group                                          |
6    +----------------------------------------------------------------------+
7    | This source file is subject to version 3.01 of the PHP license,      |
8    | that is bundled with this package in the file LICENSE, and is        |
9    | available through the world-wide-web at the following url:           |
10    | https://www.php.net/license/3_01.txt                                 |
11    | If you did not receive a copy of the PHP license and are unable to   |
12    | obtain it through the world-wide-web, please send a note to          |
13    | license@php.net so we can mail you a copy immediately.               |
14    +----------------------------------------------------------------------+
15    | Authors: Andi Gutmans <andi@php.net>                                 |
16    |          Zeev Suraski <zeev@php.net>                                 |
17    |          Stanislav Malyshev <stas@zend.com>                          |
18    |          Dmitry Stogov <dmitry@php.net>                              |
19    +----------------------------------------------------------------------+
20 */
21 
22 #ifndef ZEND_ACCELERATOR_UTIL_FUNCS_H
23 #define ZEND_ACCELERATOR_UTIL_FUNCS_H
24 
25 #include "zend.h"
26 #include "ZendAccelerator.h"
27 
28 BEGIN_EXTERN_C()
29 
30 zend_persistent_script* create_persistent_script(void);
31 void free_persistent_script(zend_persistent_script *persistent_script, int destroy_elements);
32 
33 void zend_accel_move_user_functions(HashTable *str, uint32_t count, zend_script *script);
34 void zend_accel_move_user_classes(HashTable *str, uint32_t count, zend_script *script);
35 void zend_accel_build_delayed_early_binding_list(zend_persistent_script *persistent_script);
36 void zend_accel_finalize_delayed_early_binding_list(zend_persistent_script *persistent_script);
37 void zend_accel_free_delayed_early_binding_list(zend_persistent_script *persistent_script);
38 
39 zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, int from_shared_memory);
40 
41 #define ADLER32_INIT 1     /* initial Adler-32 value */
42 
43 unsigned int zend_adler32(unsigned int checksum, unsigned char *buf, uint32_t len);
44 
45 unsigned int zend_accel_script_checksum(zend_persistent_script *persistent_script);
46 
47 END_EXTERN_C()
48 
49 #endif /* ZEND_ACCELERATOR_UTIL_FUNCS_H */
50