@@ -347,23 +347,23 @@ static void fcgi_setup_signals(void)
347347}
348348#endif
349349
350- void fcgi_set_in_shutdown (int new_value )
350+ FCGI_API void fcgi_set_in_shutdown (int new_value )
351351{
352352 in_shutdown = new_value ;
353353}
354354
355- int fcgi_in_shutdown (void )
355+ FCGI_API int fcgi_in_shutdown (void )
356356{
357357 return in_shutdown ;
358358}
359359
360- void fcgi_terminate (void )
360+ FCGI_API void fcgi_terminate (void )
361361{
362362 in_shutdown = 1 ;
363363}
364364
365365#ifndef HAVE_ATTRIBUTE_WEAK
366- void fcgi_set_logger (fcgi_logger lg ) {
366+ FCGI_API void fcgi_set_logger (fcgi_logger lg ) {
367367 fcgi_log = lg ;
368368}
369369#else
@@ -376,7 +376,7 @@ void __attribute__((weak)) fcgi_log(int type, const char *format, ...) {
376376}
377377#endif
378378
379- int fcgi_init (void )
379+ FCGI_API int fcgi_init (void )
380380{
381381 if (!is_initialized ) {
382382#ifndef _WIN32
@@ -442,7 +442,7 @@ int fcgi_init(void)
442442}
443443
444444
445- int fcgi_is_fastcgi (void )
445+ FCGI_API int fcgi_is_fastcgi (void )
446446{
447447 if (!is_initialized ) {
448448 return fcgi_init ();
@@ -451,7 +451,7 @@ int fcgi_is_fastcgi(void)
451451 }
452452}
453453
454- void fcgi_shutdown (void )
454+ FCGI_API void fcgi_shutdown (void )
455455{
456456 if (is_initialized ) {
457457 zend_hash_destroy (& fcgi_mgmt_vars );
@@ -543,7 +543,7 @@ static int is_port_number(const char *bindpath)
543543 return 1 ;
544544}
545545
546- int fcgi_listen (const char * path , int backlog )
546+ FCGI_API int fcgi_listen (const char * path , int backlog )
547547{
548548 char * s ;
549549 int tcp = 0 ;
@@ -723,7 +723,7 @@ int fcgi_listen(const char *path, int backlog)
723723 return listen_socket ;
724724}
725725
726- void fcgi_set_allowed_clients (char * ip )
726+ FCGI_API void fcgi_set_allowed_clients (char * ip )
727727{
728728 char * cur , * end ;
729729 int n ;
@@ -768,7 +768,7 @@ void fcgi_set_allowed_clients(char *ip)
768768 }
769769}
770770
771- fcgi_request * fcgi_init_request (fcgi_request * req , int listen_socket )
771+ FCGI_API fcgi_request * fcgi_init_request (fcgi_request * req , int listen_socket )
772772{
773773 memset (req , 0 , sizeof (fcgi_request ));
774774 req -> listen_socket = listen_socket ;
@@ -799,7 +799,7 @@ fcgi_request *fcgi_init_request(fcgi_request *req, int listen_socket)
799799 return req ;
800800}
801801
802- void fcgi_destroy_request (fcgi_request * req ) {
802+ FCGI_API void fcgi_destroy_request (fcgi_request * req ) {
803803 if (req -> env .buckets ) {
804804 fcgi_hash_destroy (& req -> env );
805805 }
@@ -1093,7 +1093,7 @@ static int fcgi_read_request(fcgi_request *req)
10931093 return 1 ;
10941094}
10951095
1096- int fcgi_read (fcgi_request * req , char * str , int len )
1096+ FCGI_API int fcgi_read (fcgi_request * req , char * str , int len )
10971097{
10981098 int ret , n , rest ;
10991099 fcgi_header hdr ;
@@ -1146,7 +1146,7 @@ int fcgi_read(fcgi_request *req, char *str, int len)
11461146 return n ;
11471147}
11481148
1149- void fcgi_close (fcgi_request * req , int force , int destroy )
1149+ FCGI_API void fcgi_close (fcgi_request * req , int force , int destroy )
11501150{
11511151 if (destroy && req -> has_env ) {
11521152 fcgi_hash_clean (& req -> env );
@@ -1199,7 +1199,7 @@ void fcgi_close(fcgi_request *req, int force, int destroy)
11991199 }
12001200}
12011201
1202- int fcgi_is_closed (fcgi_request * req )
1202+ FCGI_API int fcgi_is_closed (fcgi_request * req )
12031203{
12041204 return (req -> fd < 0 );
12051205}
@@ -1243,7 +1243,7 @@ static int fcgi_is_allowed() {
12431243 return 0 ;
12441244}
12451245
1246- int fcgi_accept_request (fcgi_request * req )
1246+ FCGI_API int fcgi_accept_request (fcgi_request * req )
12471247{
12481248#ifdef _WIN32
12491249 HANDLE pipe ;
@@ -1399,7 +1399,7 @@ static inline void close_packet(fcgi_request *req)
13991399 }
14001400}
14011401
1402- int fcgi_flush (fcgi_request * req , int close )
1402+ FCGI_API int fcgi_flush (fcgi_request * req , int close )
14031403{
14041404 int len ;
14051405
@@ -1429,7 +1429,7 @@ int fcgi_flush(fcgi_request *req, int close)
14291429 return 1 ;
14301430}
14311431
1432- int fcgi_write (fcgi_request * req , fcgi_request_type type , const char * str , int len )
1432+ FCGI_API int fcgi_write (fcgi_request * req , fcgi_request_type type , const char * str , int len )
14331433{
14341434 int limit , rest ;
14351435
@@ -1541,7 +1541,7 @@ int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int l
15411541 return len ;
15421542}
15431543
1544- int fcgi_finish_request (fcgi_request * req , int force_close )
1544+ FCGI_API int fcgi_finish_request (fcgi_request * req , int force_close )
15451545{
15461546 int ret = 1 ;
15471547
@@ -1555,7 +1555,7 @@ int fcgi_finish_request(fcgi_request *req, int force_close)
15551555 return ret ;
15561556}
15571557
1558- char * fcgi_getenv (fcgi_request * req , const char * var , int var_len )
1558+ FCGI_API char * fcgi_getenv (fcgi_request * req , const char * var , int var_len )
15591559{
15601560 unsigned int val_len ;
15611561
@@ -1564,14 +1564,14 @@ char* fcgi_getenv(fcgi_request *req, const char* var, int var_len)
15641564 return fcgi_hash_get (& req -> env , FCGI_HASH_FUNC (var , var_len ), (char * )var , var_len , & val_len );
15651565}
15661566
1567- char * fcgi_quick_getenv (fcgi_request * req , const char * var , int var_len , unsigned int hash_value )
1567+ FCGI_API char * fcgi_quick_getenv (fcgi_request * req , const char * var , int var_len , unsigned int hash_value )
15681568{
15691569 unsigned int val_len ;
15701570
15711571 return fcgi_hash_get (& req -> env , hash_value , (char * )var , var_len , & val_len );
15721572}
15731573
1574- char * fcgi_putenv (fcgi_request * req , char * var , int var_len , char * val )
1574+ FCGI_API char * fcgi_putenv (fcgi_request * req , char * var , int var_len , char * val )
15751575{
15761576 if (!req ) return NULL ;
15771577 if (val == NULL ) {
@@ -1582,7 +1582,7 @@ char* fcgi_putenv(fcgi_request *req, char* var, int var_len, char* val)
15821582 }
15831583}
15841584
1585- char * fcgi_quick_putenv (fcgi_request * req , char * var , int var_len , unsigned int hash_value , char * val )
1585+ FCGI_API char * fcgi_quick_putenv (fcgi_request * req , char * var , int var_len , unsigned int hash_value , char * val )
15861586{
15871587 if (val == NULL ) {
15881588 fcgi_hash_del (& req -> env , hash_value , var , var_len );
@@ -1592,13 +1592,13 @@ char* fcgi_quick_putenv(fcgi_request *req, char* var, int var_len, unsigned int
15921592 }
15931593}
15941594
1595- void fcgi_loadenv (fcgi_request * req , fcgi_apply_func func , zval * array )
1595+ FCGI_API void fcgi_loadenv (fcgi_request * req , fcgi_apply_func func , zval * array )
15961596{
15971597 fcgi_hash_apply (& req -> env , func , array );
15981598}
15991599
16001600#ifdef _WIN32
1601- void fcgi_impersonate (void )
1601+ FCGI_API void fcgi_impersonate (void )
16021602{
16031603 char * os_name ;
16041604
@@ -1609,19 +1609,19 @@ void fcgi_impersonate(void)
16091609}
16101610#endif
16111611
1612- void fcgi_set_mgmt_var (const char * name , size_t name_len , const char * value , size_t value_len )
1612+ FCGI_API void fcgi_set_mgmt_var (const char * name , size_t name_len , const char * value , size_t value_len )
16131613{
16141614 zval zvalue ;
16151615 ZVAL_NEW_STR (& zvalue , zend_string_init (value , value_len , 1 ));
16161616 zend_hash_str_add (& fcgi_mgmt_vars , name , name_len , & zvalue );
16171617}
16181618
1619- void fcgi_free_mgmt_var_cb (zval * zv )
1619+ FCGI_API void fcgi_free_mgmt_var_cb (zval * zv )
16201620{
16211621 pefree (Z_STR_P (zv ), 1 );
16221622}
16231623
1624- const char * fcgi_get_last_client_ip ()
1624+ FCGI_API const char * fcgi_get_last_client_ip ()
16251625{
16261626 static char str [INET6_ADDRSTRLEN ];
16271627
0 commit comments