php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
lsapilib.h File Reference
#include "lsapidef.h"
#include <stddef.h>
#include <sys/time.h>
#include <sys/types.h>

Go to the source code of this file.

Data Structures

struct  LSAPI_key_value_pair
 
struct  lsapi_request
 

Macros

#define LSAPI_MAX_RESP_HEADERS   1000
 
#define LSAPI_LOG_LEVEL_BITS   0xff
 
#define LSAPI_LOG_FLAG_NONE   0
 
#define LSAPI_LOG_FLAG_DEBUG   1
 
#define LSAPI_LOG_FLAG_INFO   2
 
#define LSAPI_LOG_FLAG_NOTICE   3
 
#define LSAPI_LOG_FLAG_WARN   4
 
#define LSAPI_LOG_FLAG_ERROR   5
 
#define LSAPI_LOG_FLAG_CRIT   6
 
#define LSAPI_LOG_FLAG_FATAL   7
 
#define LSAPI_LOG_TIMESTAMP_BITS   (0xff00)
 
#define LSAPI_LOG_TIMESTAMP_FULL   (0x100)
 
#define LSAPI_LOG_TIMESTAMP_HMS   (0x200)
 
#define LSAPI_LOG_TIMESTAMP_STDERR   (0x400)
 
#define LSAPI_LOG_PID   (0x10000)
 

Typedefs

typedef struct lsapi_request LSAPI_Request
 
typedef int(* LSAPI_CB_EnvHandler) (const char *pKey, int keyLen, const char *pValue, int valLen, void *arg)
 
typedef int(* fn_select_t) (int, fd_set *, fd_set *, fd_set *, struct timeval *)
 
typedef void(* LSAPI_On_Timer_pf) (int *forked_child_pid)
 

Functions

int LSAPI_Init (void)
 
void LSAPI_Stop (void)
 
int LSAPI_Is_Listen_r (LSAPI_Request *pReq)
 
int LSAPI_InitRequest (LSAPI_Request *pReq, int fd)
 
int LSAPI_Accept_r (LSAPI_Request *pReq)
 
void LSAPI_Reset_r (LSAPI_Request *pReq)
 
int LSAPI_Finish_r (LSAPI_Request *pReq)
 
int LSAPI_Release_r (LSAPI_Request *pReq)
 
char * LSAPI_GetHeader_r (LSAPI_Request *pReq, int headerIndex)
 
int LSAPI_ForeachHeader_r (LSAPI_Request *pReq, LSAPI_CB_EnvHandler fn, void *arg)
 
int LSAPI_ForeachOrgHeader_r (LSAPI_Request *pReq, LSAPI_CB_EnvHandler fn, void *arg)
 
int LSAPI_ForeachEnv_r (LSAPI_Request *pReq, LSAPI_CB_EnvHandler fn, void *arg)
 
int LSAPI_ForeachSpecialEnv_r (LSAPI_Request *pReq, LSAPI_CB_EnvHandler fn, void *arg)
 
char * LSAPI_GetEnv_r (LSAPI_Request *pReq, const char *name)
 
ssize_t LSAPI_ReadReqBody_r (LSAPI_Request *pReq, char *pBuf, size_t len)
 
int LSAPI_ReqBodyGetChar_r (LSAPI_Request *pReq)
 
int LSAPI_ReqBodyGetLine_r (LSAPI_Request *pReq, char *pBuf, size_t bufLen, int *getLF)
 
int LSAPI_FinalizeRespHeaders_r (LSAPI_Request *pReq)
 
ssize_t LSAPI_Write_r (LSAPI_Request *pReq, const char *pBuf, size_t len)
 
ssize_t LSAPI_sendfile_r (LSAPI_Request *pReq, int fdIn, off_t *off, size_t size)
 
ssize_t LSAPI_Write_Stderr_r (LSAPI_Request *pReq, const char *pBuf, size_t len)
 
int LSAPI_Flush_r (LSAPI_Request *pReq)
 
int LSAPI_AppendRespHeader_r (LSAPI_Request *pReq, const char *pBuf, int len)
 
int LSAPI_AppendRespHeader2_r (LSAPI_Request *pReq, const char *pHeaderName, const char *pHeaderValue)
 
int LSAPI_ErrResponse_r (LSAPI_Request *pReq, int code, const char **pRespHeaders, const char *pBody, int bodyLen)
 
int LSAPI_End_Response_r (LSAPI_Request *pReq)
 
int LSAPI_Is_Listen (void)
 
int LSAPI_IsRunning (void)
 
int LSAPI_CreateListenSock (const char *pBind, int backlog)
 
int LSAPI_Init_Prefork_Server (int max_children, fn_select_t fp, int avoidFork)
 
void LSAPI_Set_Server_fd (int fd)
 
int LSAPI_Prefork_Accept_r (LSAPI_Request *pReq)
 
void LSAPI_No_Check_ppid (void)
 
void LSAPI_Set_Max_Reqs (int reqs)
 
void LSAPI_Set_Max_Idle (int secs)
 
void LSAPI_Set_Max_Children (int maxChildren)
 
void LSAPI_Set_Max_Idle_Children (int maxIdleChld)
 
void LSAPI_Set_Server_Max_Idle_Secs (int serverMaxIdle)
 
void LSAPI_Set_Max_Process_Time (int secs)
 
int LSAPI_Init_Env_Parameters (fn_select_t fp)
 
void LSAPI_Set_Slow_Req_Msecs (int msecs)
 
int LSAPI_Get_Slow_Req_Msecs (void)
 
int LSAPI_is_suEXEC_Daemon (void)
 
int LSAPI_Set_Restored_Parent_Pid (int pid)
 
void LSAPI_Register_Pgrp_Timer_Callback (LSAPI_On_Timer_pf)
 
int LSAPI_Inc_Req_Processed (int cnt)
 
int LSAPI_Accept_Before_Fork (LSAPI_Request *pReq)
 
int LSAPI_Postfork_Child (LSAPI_Request *pReq)
 
int LSAPI_Postfork_Parent (LSAPI_Request *pReq)
 
void LSAPI_Log (int flag, const char *fmt,...)
 

Variables

LSAPI_Request g_req
 

Macro Definition Documentation

◆ LSAPI_LOG_FLAG_CRIT

#define LSAPI_LOG_FLAG_CRIT   6

Definition at line 410 of file lsapilib.h.

◆ LSAPI_LOG_FLAG_DEBUG

#define LSAPI_LOG_FLAG_DEBUG   1

Definition at line 405 of file lsapilib.h.

◆ LSAPI_LOG_FLAG_ERROR

#define LSAPI_LOG_FLAG_ERROR   5

Definition at line 409 of file lsapilib.h.

◆ LSAPI_LOG_FLAG_FATAL

#define LSAPI_LOG_FLAG_FATAL   7

Definition at line 411 of file lsapilib.h.

◆ LSAPI_LOG_FLAG_INFO

#define LSAPI_LOG_FLAG_INFO   2

Definition at line 406 of file lsapilib.h.

◆ LSAPI_LOG_FLAG_NONE

#define LSAPI_LOG_FLAG_NONE   0

Definition at line 404 of file lsapilib.h.

◆ LSAPI_LOG_FLAG_NOTICE

#define LSAPI_LOG_FLAG_NOTICE   3

Definition at line 407 of file lsapilib.h.

◆ LSAPI_LOG_FLAG_WARN

#define LSAPI_LOG_FLAG_WARN   4

Definition at line 408 of file lsapilib.h.

◆ LSAPI_LOG_LEVEL_BITS

#define LSAPI_LOG_LEVEL_BITS   0xff

Definition at line 403 of file lsapilib.h.

◆ LSAPI_LOG_PID

#define LSAPI_LOG_PID   (0x10000)

Definition at line 418 of file lsapilib.h.

◆ LSAPI_LOG_TIMESTAMP_BITS

#define LSAPI_LOG_TIMESTAMP_BITS   (0xff00)

Definition at line 413 of file lsapilib.h.

◆ LSAPI_LOG_TIMESTAMP_FULL

#define LSAPI_LOG_TIMESTAMP_FULL   (0x100)

Definition at line 414 of file lsapilib.h.

◆ LSAPI_LOG_TIMESTAMP_HMS

#define LSAPI_LOG_TIMESTAMP_HMS   (0x200)

Definition at line 415 of file lsapilib.h.

◆ LSAPI_LOG_TIMESTAMP_STDERR

#define LSAPI_LOG_TIMESTAMP_STDERR   (0x400)

Definition at line 416 of file lsapilib.h.

◆ LSAPI_MAX_RESP_HEADERS

#define LSAPI_MAX_RESP_HEADERS   1000

Definition at line 72 of file lsapilib.h.

Typedef Documentation

◆ fn_select_t

typedef int(* fn_select_t) (int, fd_set *, fd_set *, fd_set *, struct timeval *)

Definition at line 360 of file lsapilib.h.

◆ LSAPI_CB_EnvHandler

typedef int(* LSAPI_CB_EnvHandler) (const char *pKey, int keyLen, const char *pValue, int valLen, void *arg)

Definition at line 135 of file lsapilib.h.

◆ LSAPI_On_Timer_pf

typedef void(* LSAPI_On_Timer_pf) (int *forked_child_pid)

Definition at line 392 of file lsapilib.h.

◆ LSAPI_Request

typedef struct lsapi_request LSAPI_Request

Function Documentation

◆ LSAPI_Accept_Before_Fork()

int LSAPI_Accept_Before_Fork ( LSAPI_Request * pReq)

Definition at line 3418 of file lsapilib.c.

◆ LSAPI_Accept_r()

int LSAPI_Accept_r ( LSAPI_Request * pReq)

Definition at line 1532 of file lsapilib.c.

◆ LSAPI_AppendRespHeader2_r()

int LSAPI_AppendRespHeader2_r ( LSAPI_Request * pReq,
const char * pHeaderName,
const char * pHeaderValue )

Definition at line 2494 of file lsapilib.c.

◆ LSAPI_AppendRespHeader_r()

int LSAPI_AppendRespHeader_r ( LSAPI_Request * pReq,
const char * pBuf,
int len )

Definition at line 2550 of file lsapilib.c.

◆ LSAPI_CreateListenSock()

int LSAPI_CreateListenSock ( const char * pBind,
int backlog )

Definition at line 2731 of file lsapilib.c.

◆ LSAPI_End_Response_r()

int LSAPI_End_Response_r ( LSAPI_Request * pReq)

Definition at line 1629 of file lsapilib.c.

◆ LSAPI_ErrResponse_r()

int LSAPI_ErrResponse_r ( LSAPI_Request * pReq,
int code,
const char ** pRespHeaders,
const char * pBody,
int bodyLen )

Definition at line 4103 of file lsapilib.c.

◆ LSAPI_FinalizeRespHeaders_r()

int LSAPI_FinalizeRespHeaders_r ( LSAPI_Request * pReq)

Definition at line 2467 of file lsapilib.c.

◆ LSAPI_Finish_r()

int LSAPI_Finish_r ( LSAPI_Request * pReq)

Definition at line 1599 of file lsapilib.c.

◆ LSAPI_Flush_r()

int LSAPI_Flush_r ( LSAPI_Request * pReq)

Definition at line 2082 of file lsapilib.c.

◆ LSAPI_ForeachEnv_r()

int LSAPI_ForeachEnv_r ( LSAPI_Request * pReq,
LSAPI_CB_EnvHandler fn,
void * arg )

Definition at line 2437 of file lsapilib.c.

◆ LSAPI_ForeachHeader_r()

int LSAPI_ForeachHeader_r ( LSAPI_Request * pReq,
LSAPI_CB_EnvHandler fn,
void * arg )

Definition at line 2350 of file lsapilib.c.

◆ LSAPI_ForeachOrgHeader_r()

int LSAPI_ForeachOrgHeader_r ( LSAPI_Request * pReq,
LSAPI_CB_EnvHandler fn,
void * arg )

Definition at line 2274 of file lsapilib.c.

◆ LSAPI_ForeachSpecialEnv_r()

int LSAPI_ForeachSpecialEnv_r ( LSAPI_Request * pReq,
LSAPI_CB_EnvHandler fn,
void * arg )

Definition at line 2451 of file lsapilib.c.

◆ LSAPI_Get_Slow_Req_Msecs()

int LSAPI_Get_Slow_Req_Msecs ( void )

Definition at line 3788 of file lsapilib.c.

◆ LSAPI_GetEnv_r()

char * LSAPI_GetEnv_r ( LSAPI_Request * pReq,
const char * name )

Definition at line 2238 of file lsapilib.c.

◆ LSAPI_GetHeader_r()

char * LSAPI_GetHeader_r ( LSAPI_Request * pReq,
int headerIndex )

Definition at line 1689 of file lsapilib.c.

◆ LSAPI_Inc_Req_Processed()

int LSAPI_Inc_Req_Processed ( int cnt)

Definition at line 4360 of file lsapilib.c.

◆ LSAPI_Init()

int LSAPI_Init ( void )

Definition at line 1435 of file lsapilib.c.

◆ LSAPI_Init_Env_Parameters()

int LSAPI_Init_Env_Parameters ( fn_select_t fp)

Definition at line 3960 of file lsapilib.c.

◆ LSAPI_Init_Prefork_Server()

int LSAPI_Init_Prefork_Server ( int max_children,
fn_select_t fp,
int avoidFork )

Definition at line 2766 of file lsapilib.c.

◆ LSAPI_InitRequest()

int LSAPI_InitRequest ( LSAPI_Request * pReq,
int fd )

Definition at line 1481 of file lsapilib.c.

◆ LSAPI_Is_Listen()

int LSAPI_Is_Listen ( void )

Definition at line 1520 of file lsapilib.c.

◆ LSAPI_Is_Listen_r()

int LSAPI_Is_Listen_r ( LSAPI_Request * pReq)

Definition at line 1526 of file lsapilib.c.

◆ LSAPI_is_suEXEC_Daemon()

int LSAPI_is_suEXEC_Daemon ( void )

Definition at line 900 of file lsapilib.c.

◆ LSAPI_IsRunning()

int LSAPI_IsRunning ( void )

Definition at line 1469 of file lsapilib.c.

◆ LSAPI_Log()

void LSAPI_Log ( int flag,
const char * fmt,
... )

Definition at line 242 of file lsapilib.c.

◆ LSAPI_No_Check_ppid()

void LSAPI_No_Check_ppid ( void )

Definition at line 3794 of file lsapilib.c.

◆ LSAPI_Postfork_Child()

int LSAPI_Postfork_Child ( LSAPI_Request * pReq)

Definition at line 3362 of file lsapilib.c.

◆ LSAPI_Postfork_Parent()

int LSAPI_Postfork_Parent ( LSAPI_Request * pReq)

Definition at line 3403 of file lsapilib.c.

◆ LSAPI_Prefork_Accept_r()

int LSAPI_Prefork_Accept_r ( LSAPI_Request * pReq)

Definition at line 3562 of file lsapilib.c.

◆ LSAPI_ReadReqBody_r()

ssize_t LSAPI_ReadReqBody_r ( LSAPI_Request * pReq,
char * pBuf,
size_t len )

Definition at line 1790 of file lsapilib.c.

◆ LSAPI_Register_Pgrp_Timer_Callback()

void LSAPI_Register_Pgrp_Timer_Callback ( LSAPI_On_Timer_pf cb)

Definition at line 1475 of file lsapilib.c.

◆ LSAPI_Release_r()

int LSAPI_Release_r ( LSAPI_Request * pReq)

Definition at line 1675 of file lsapilib.c.

◆ LSAPI_ReqBodyGetChar_r()

int LSAPI_ReqBodyGetChar_r ( LSAPI_Request * pReq)

Definition at line 1729 of file lsapilib.c.

◆ LSAPI_ReqBodyGetLine_r()

int LSAPI_ReqBodyGetLine_r ( LSAPI_Request * pReq,
char * pBuf,
size_t bufLen,
int * getLF )

Definition at line 1743 of file lsapilib.c.

◆ LSAPI_Reset_r()

void LSAPI_Reset_r ( LSAPI_Request * pReq)

Definition at line 1664 of file lsapilib.c.

◆ LSAPI_sendfile_r()

ssize_t LSAPI_sendfile_r ( LSAPI_Request * pReq,
int fdIn,
off_t * off,
size_t size )

Definition at line 2034 of file lsapilib.c.

◆ LSAPI_Set_Max_Children()

void LSAPI_Set_Max_Children ( int maxChildren)

Definition at line 3747 of file lsapilib.c.

◆ LSAPI_Set_Max_Idle()

void LSAPI_Set_Max_Idle ( int secs)

Definition at line 3743 of file lsapilib.c.

◆ LSAPI_Set_Max_Idle_Children()

void LSAPI_Set_Max_Idle_Children ( int maxIdleChld)

Definition at line 3768 of file lsapilib.c.

◆ LSAPI_Set_Max_Process_Time()

void LSAPI_Set_Max_Process_Time ( int secs)

Definition at line 3761 of file lsapilib.c.

◆ LSAPI_Set_Max_Reqs()

void LSAPI_Set_Max_Reqs ( int reqs)

Definition at line 3740 of file lsapilib.c.

◆ LSAPI_Set_Restored_Parent_Pid()

int LSAPI_Set_Restored_Parent_Pid ( int pid)

Definition at line 4352 of file lsapilib.c.

◆ LSAPI_Set_Server_fd()

void LSAPI_Set_Server_fd ( int fd)

Definition at line 2808 of file lsapilib.c.

◆ LSAPI_Set_Server_Max_Idle_Secs()

void LSAPI_Set_Server_Max_Idle_Secs ( int serverMaxIdle)

Definition at line 3775 of file lsapilib.c.

◆ LSAPI_Set_Slow_Req_Msecs()

void LSAPI_Set_Slow_Req_Msecs ( int msecs)

Definition at line 3782 of file lsapilib.c.

◆ LSAPI_Stop()

void LSAPI_Stop ( void )

Definition at line 1463 of file lsapilib.c.

◆ LSAPI_Write_r()

ssize_t LSAPI_Write_r ( LSAPI_Request * pReq,
const char * pBuf,
size_t len )

Definition at line 1839 of file lsapilib.c.

◆ LSAPI_Write_Stderr_r()

ssize_t LSAPI_Write_Stderr_r ( LSAPI_Request * pReq,
const char * pBuf,
size_t len )

Definition at line 2125 of file lsapilib.c.

Variable Documentation

◆ g_req

LSAPI_Request g_req
extern

Definition at line 173 of file lsapilib.c.