1919
2020#include "php.h"
2121#include "php_ini.h"
22- #include "php_mod_player .h"
22+ #include "php_modplayer .h"
2323#include "mikmod.h"
2424
25- ZEND_DECLARE_MODULE_GLOBALS (mod_player )
25+ ZEND_DECLARE_MODULE_GLOBALS (modplayer )
2626
27- static zend_function_entry mod_player_functions [] = {
27+ static zend_function_entry modplayer_functions [] = {
2828 PHP_FE (play_module_file , NULL )
2929 PHP_FE (mod_player_getpid , NULL )
3030 PHP_FE (stop_module_file , NULL )
3131 {NULL , NULL , NULL }
3232};
3333
34- zend_module_entry mod_player_module_entry = {
34+ zend_module_entry modplayer_module_entry = {
3535 #if ZEND_MODULE_API_NO >= 20010901
3636 STANDARD_MODULE_HEADER ,
3737 #endif
38- PHP_MOD_PLAYER_EXTNAME ,
39- mod_player_functions ,
40- PHP_MINIT (mod_player ),
41- PHP_MSHUTDOWN (mod_player ),
38+ PHP_MODPLAYER_EXTNAME ,
39+ modplayer_functions ,
40+ PHP_MINIT (modplayer ),
41+ PHP_MSHUTDOWN (modplayer ),
4242 NULL ,
4343 NULL ,
4444 NULL ,
4545 #if ZEND_MODULE_API_NO >= 20010901
46- PHP_MOD_PLAYER_VERSION ,
46+ PHP_MODPLAYER_VERSION ,
4747 #endif
4848 STANDARD_MODULE_PROPERTIES
4949};
5050
51- #ifdef COMPILE_DL_MOD_PLAYER
52- ZEND_GET_MODULE (mod_player )
51+ #ifdef COMPILE_DL_MODPLAYER
52+ ZEND_GET_MODULE (modplayer )
5353#endif
5454
5555PHP_INI_BEGIN ()
56- PHP_INI_ENTRY ("mod_player .maxchan" ,"64" ,PHP_INI_ALL ,NULL )
57- PHP_INI_ENTRY ("mod_player .curious" ,"0" ,PHP_INI_ALL ,NULL )
56+ PHP_INI_ENTRY ("modplayer .maxchan" ,"64" ,PHP_INI_ALL ,NULL )
57+ PHP_INI_ENTRY ("modplayer .curious" ,"0" ,PHP_INI_ALL ,NULL )
5858PHP_INI_END ()
5959
60- static void php_mod_player_init_globals ( zend_mod_player_globals * mod_player_globals )
60+ static void php_modplayer_init_globals ( zend_modplayer_globals * modplayer_globals )
6161{
62- mod_player_globals -> pid = 0 ;
62+ modplayer_globals -> pid = 0 ;
6363}
6464
65- PHP_MINIT_FUNCTION (mod_player )
65+ PHP_MINIT_FUNCTION (modplayer )
6666{
67- ZEND_INIT_MODULE_GLOBALS (mod_player , php_mod_player_init_globals , NULL );
67+ ZEND_INIT_MODULE_GLOBALS (modplayer , php_modplayer_init_globals , NULL );
6868 REGISTER_INI_ENTRIES ();
6969 return SUCCESS ;
7070}
7171
72- PHP_MSHUTDOWN_FUNCTION (mod_player )
72+ PHP_MSHUTDOWN_FUNCTION (modplayer )
7373{
74- if (MOD_PLAYER_G (pid ) > 0 ) {
75- kill (MOD_PLAYER_G (pid ), SIGKILL );
74+ if (MODPLAYER_G (pid ) > 0 ) {
75+ kill (MODPLAYER_G (pid ), SIGKILL );
7676 }
7777
7878 UNREGISTER_INI_ENTRIES ();
@@ -89,7 +89,7 @@ PHP_FUNCTION(play_module_file)
8989 RETURN_NULL ();
9090 }
9191
92- if (MOD_PLAYER_G (pid ) > 0 ) {
92+ if (MODPLAYER_G (pid ) > 0 ) {
9393 zend_error (E_ERROR , "You've already started the module player" );
9494 RETURN_NULL ();
9595 }
@@ -101,25 +101,25 @@ PHP_FUNCTION(play_module_file)
101101 RETURN_NULL ();
102102 }
103103
104- s_pid = stream_audio (fptr , INI_INT ("mod_player .maxchan" ), INI_INT ("mod_player .curious" ));
104+ s_pid = stream_audio (fptr , INI_INT ("modplayer .maxchan" ), INI_INT ("modplayer .curious" ));
105105
106106 if (s_pid > 0 ) {
107- MOD_PLAYER_G (pid ) = s_pid ;
107+ MODPLAYER_G (pid ) = s_pid ;
108108 }
109109
110110 RETURN_LONG (s_pid );
111111}
112112
113113PHP_FUNCTION (mod_player_getpid )
114114{
115- RETURN_LONG (MOD_PLAYER_G (pid ));
115+ RETURN_LONG (MODPLAYER_G (pid ));
116116}
117117
118118PHP_FUNCTION (stop_module_file )
119119{
120- if (MOD_PLAYER_G (pid ) > 0 ) {
121- kill (MOD_PLAYER_G (pid ), SIGKILL );
122- MOD_PLAYER_G (pid ) = 0 ;
120+ if (MODPLAYER_G (pid ) > 0 ) {
121+ kill (MODPLAYER_G (pid ), SIGKILL );
122+ MODPLAYER_G (pid ) = 0 ;
123123 }
124124
125125 RETURN_NULL ();
@@ -152,7 +152,7 @@ int stream_audio(FILE *fptr, int maxchan, int curious)
152152 Player_Start (module );
153153
154154 s_pid = getpid ();
155- MOD_PLAYER_G (pid ) = s_pid ;
155+ MODPLAYER_G (pid ) = s_pid ;
156156
157157 while (Player_Active ()) {
158158 usleep (10000 );
@@ -166,7 +166,7 @@ int stream_audio(FILE *fptr, int maxchan, int curious)
166166 fclose (fptr );
167167 MikMod_Exit ();
168168 } else if (m_pid < 0 ) {
169- zend_error (E_ERROR , "Failed to fork CLI Audio Stream process" );
169+ zend_error (E_ERROR , "Failed to fork CLI audio stream process" );
170170 return -1 ;
171171 }
172172
0 commit comments