xref: /php-src/win32/php_win32_globals.h (revision 01b3fc03)
1 /*
2    +----------------------------------------------------------------------+
3    | Copyright (c) The PHP Group                                          |
4    +----------------------------------------------------------------------+
5    | This source file is subject to version 3.01 of the PHP license,      |
6    | that is bundled with this package in the file LICENSE, and is        |
7    | available through the world-wide-web at the following url:           |
8    | https://www.php.net/license/3_01.txt                                 |
9    | If you did not receive a copy of the PHP license and are unable to   |
10    | obtain it through the world-wide-web, please send a note to          |
11    | license@php.net so we can mail you a copy immediately.               |
12    +----------------------------------------------------------------------+
13    | Author: Wez Furlong <wez@php.net>                                    |
14    +----------------------------------------------------------------------+
15 */
16 
17 #ifndef PHP_WIN32_GLOBALS_H
18 #define PHP_WIN32_GLOBALS_H
19 
20 /* misc globals for thread-safety under win32 */
21 
22 #include "win32/sendmail.h"
23 
24 typedef struct _php_win32_core_globals php_win32_core_globals;
25 
26 #ifdef ZTS
27 # define PW32G(v)		ZEND_TSRMG(php_win32_core_globals_id, php_win32_core_globals*, v)
28 extern PHPAPI int php_win32_core_globals_id;
29 #else
30 # define PW32G(v)		(the_php_win32_core_globals.v)
31 extern PHPAPI struct _php_win32_core_globals the_php_win32_core_globals;
32 #endif
33 
34 struct _php_win32_core_globals {
35 	/* syslog */
36 	char *log_header;
37 	HANDLE log_source;
38 
39 	HKEY       registry_key;
40 	HANDLE     registry_event;
41 	HashTable *registry_directories;
42 
43 	char   mail_buffer[MAIL_BUFFER_SIZE];
44 	SOCKET mail_socket;
45 	char   mail_host[HOST_NAME_LEN];
46 	char   mail_local_host[HOST_NAME_LEN];
47 };
48 
49 void php_win32_core_globals_ctor(void *vg);
50 void php_win32_core_globals_dtor(void *vg);
51 PHP_RSHUTDOWN_FUNCTION(win32_core_globals);
52 
53 #endif
54