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_BLACKLIST_H
23 #define ZEND_ACCELERATOR_BLACKLIST_H
24 
25 typedef struct _zend_regexp_list zend_regexp_list;
26 
27 typedef struct _zend_blacklist_entry {
28     char *path;
29     int   path_length;
30 	int   id;
31 } zend_blacklist_entry;
32 
33 typedef struct _zend_blacklist {
34 	zend_blacklist_entry *entries;
35 	int                   size;
36 	int                   pos;
37 	zend_regexp_list     *regexp_list;
38 } zend_blacklist;
39 
40 typedef int (*blacklist_apply_func_arg_t)(zend_blacklist_entry *, zval *);
41 
42 extern zend_blacklist accel_blacklist;
43 
44 void zend_accel_blacklist_init(zend_blacklist *blacklist);
45 void zend_accel_blacklist_shutdown(zend_blacklist *blacklist);
46 
47 void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename);
48 bool zend_accel_blacklist_is_blacklisted(zend_blacklist *blacklist, char *verify_path, size_t verify_path_len);
49 void zend_accel_blacklist_apply(zend_blacklist *blacklist, blacklist_apply_func_arg_t func, void *argument);
50 
51 #endif /* ZEND_ACCELERATOR_BLACKLIST_H */
52