-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathphp_sfml.cpp
78 lines (69 loc) · 1.76 KB
/
php_sfml.cpp
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
//
// Created by Jack Noordhuis on 4/2/20.
//
#include "src/config.h"
#include "src/system/system.h"
#include "php_sfml.h"
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(sfml)
{
// register php things
if(
PHP_MINIT_CALL(sfml_config) == SUCCESS &&
PHP_MINIT_CALL(sfml_system) == SUCCESS
){
return SUCCESS;
}
return FAILURE;
}
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(sfml)
{
php_info_print_table_start();
php_info_print_table_header(2, "sfml support", "enabled");
php_info_print_table_end();
}
/* }}} */
/* {{{ PHP_MSHUTDOWN
*/
PHP_MSHUTDOWN_FUNCTION(sfml)
{
return SUCCESS;
}
/* }}} */
/* {{{ sdl_functions[] */
static zend_function_entry sfml_functions[] = {
// system
ZEND_NS_FE("sf", sleep, arginfo_Sleep_sleep)
ZEND_NS_FE("sf", seconds, arginfo_Time_seconds)
ZEND_NS_FE("sf", milliseconds, arginfo_Time_milliseconds)
ZEND_NS_FE("sf", microseconds, arginfo_Time_microseconds)
ZEND_FE_END
};
/* }}} */
/* {{{ sfml_module_entry
*/
zend_module_entry sfml_module_entry = {
STANDARD_MODULE_HEADER,
"sfml", /* Extension name */
sfml_functions, /* zend_function_entry */
PHP_MINIT(sfml), /* PHP_MINIT - Module initialization */
PHP_MSHUTDOWN(sfml), /* PHP_MSHUTDOWN - Module shutdown */
NULL, /* PHP_RINIT - Request initialization */
NULL, /* PHP_RSHUTDOWN - Request shutdown */
PHP_MINFO(sfml), /* PHP_MINFO - Module info */
PHP_SFML_VERSION, /* Version */
STANDARD_MODULE_PROPERTIES
};
/* }}} */
#ifdef COMPILE_DL_SFML
extern "C"{
#ifdef ZTS
ZEND_TSRMLS_CACHE_DEFINE()
#endif
ZEND_GET_MODULE(sfml)
}
#endif