Back to index

php5  5.3.10
Defines | Typedefs | Functions | Variables
php.h File Reference
#include "php_version.h"
#include "zend.h"
#include "zend_qsort.h"
#include "php_compat.h"
#include "zend_API.h"
#include <stdlib.h>
#include <ctype.h>
#include "zend_hash.h"
#include "php3_compat.h"
#include "zend_alloc.h"
#include "zend_stack.h"
#include "safe_mode.h"
#include "snprintf.h"
#include "spprintf.h"
#include "main/php_output.h"
#include "php_streams.h"
#include "php_memory_streams.h"
#include "fopen_wrappers.h"
#include "tsrm_virtual_cwd.h"
#include "zend_constants.h"
#include "php_reentrancy.h"

Go to the source code of this file.

Defines

#define PHP_API_VERSION   20090626
#define PHP_HAVE_STREAMS
#define YYDEBUG   0
#define sprintf   php_sprintf
#define PHP_DEBUG   ZEND_DEBUG
#define PHPAPI
#define THREAD_LS
#define PHP_DIR_SEPARATOR   '/'
#define PHP_EOL   "\n"
#define assert(expr)   ((void) (0))
#define APACHE   0
#define PHP_STRLCPY(dst, src, size, src_size)
#define strlcpy   php_strlcpy
#define strlcat   php_strlcat
#define CREATE_MUTEX(a, b)
#define SET_MUTEX(a)
#define FREE_MUTEX(a)
#define va_copy(ap1, ap2)   memcpy((&ap1), (&ap2), sizeof(va_list))
#define memcpy(d, s, n)   bcopy((s), (d), (n))
#define memmove(d, s, n)   bcopy ((s), (d), (n))
#define LONG_MAX   2147483647L
#define LONG_MIN   (- LONG_MAX - 1)
#define INT_MAX   2147483647
#define INT_MIN   (- INT_MAX - 1)
#define PHP_GCC_VERSION   ZEND_GCC_VERSION
#define PHP_ATTRIBUTE_MALLOC   ZEND_ATTRIBUTE_MALLOC
#define PHP_ATTRIBUTE_FORMAT   ZEND_ATTRIBUTE_FORMAT
#define EXEC_INPUT_BUF   4096
#define PHP_MIME_TYPE   "application/x-httpd-php"
#define STR_PRINT(str)   ((str)?(str):"")
#define MAXPATHLEN   256 /* Should be safe for any weird systems that do not define it */
#define PHP_SLEEP_NON_VOID
#define php_sleep   sleep
#define php_error   zend_error
#define error_handling_t   zend_error_handling_t
#define PHP_ATTR_FMT_OFFSET   0
#define php_error_docref   php_error_docref0
#define zenderror   phperror
#define zendlex   phplex
#define phpparse   zendparse
#define phprestart   zendrestart
#define phpin   zendin
#define php_memnstr   zend_memnstr
#define PHP_FN   ZEND_FN
#define PHP_MN   ZEND_MN
#define PHP_NAMED_FUNCTION   ZEND_NAMED_FUNCTION
#define PHP_FUNCTION   ZEND_FUNCTION
#define PHP_METHOD   ZEND_METHOD
#define PHP_RAW_NAMED_FE   ZEND_RAW_NAMED_FE
#define PHP_NAMED_FE   ZEND_NAMED_FE
#define PHP_FE   ZEND_FE
#define PHP_DEP_FE   ZEND_DEP_FE
#define PHP_FALIAS   ZEND_FALIAS
#define PHP_DEP_FALIAS   ZEND_DEP_FALIAS
#define PHP_ME   ZEND_ME
#define PHP_MALIAS   ZEND_MALIAS
#define PHP_ABSTRACT_ME   ZEND_ABSTRACT_ME
#define PHP_ME_MAPPING   ZEND_ME_MAPPING
#define PHP_FE_END   ZEND_FE_END
#define PHP_MODULE_STARTUP_N   ZEND_MODULE_STARTUP_N
#define PHP_MODULE_SHUTDOWN_N   ZEND_MODULE_SHUTDOWN_N
#define PHP_MODULE_ACTIVATE_N   ZEND_MODULE_ACTIVATE_N
#define PHP_MODULE_DEACTIVATE_N   ZEND_MODULE_DEACTIVATE_N
#define PHP_MODULE_INFO_N   ZEND_MODULE_INFO_N
#define PHP_MODULE_STARTUP_D   ZEND_MODULE_STARTUP_D
#define PHP_MODULE_SHUTDOWN_D   ZEND_MODULE_SHUTDOWN_D
#define PHP_MODULE_ACTIVATE_D   ZEND_MODULE_ACTIVATE_D
#define PHP_MODULE_DEACTIVATE_D   ZEND_MODULE_DEACTIVATE_D
#define PHP_MODULE_INFO_D   ZEND_MODULE_INFO_D
#define PHP_MINIT   ZEND_MODULE_STARTUP_N
#define PHP_MSHUTDOWN   ZEND_MODULE_SHUTDOWN_N
#define PHP_RINIT   ZEND_MODULE_ACTIVATE_N
#define PHP_RSHUTDOWN   ZEND_MODULE_DEACTIVATE_N
#define PHP_MINFO   ZEND_MODULE_INFO_N
#define PHP_GINIT   ZEND_GINIT
#define PHP_GSHUTDOWN   ZEND_GSHUTDOWN
#define PHP_MINIT_FUNCTION   ZEND_MODULE_STARTUP_D
#define PHP_MSHUTDOWN_FUNCTION   ZEND_MODULE_SHUTDOWN_D
#define PHP_RINIT_FUNCTION   ZEND_MODULE_ACTIVATE_D
#define PHP_RSHUTDOWN_FUNCTION   ZEND_MODULE_DEACTIVATE_D
#define PHP_MINFO_FUNCTION   ZEND_MODULE_INFO_D
#define PHP_GINIT_FUNCTION   ZEND_GINIT_FUNCTION
#define PHP_GSHUTDOWN_FUNCTION   ZEND_GSHUTDOWN_FUNCTION
#define PHP_MODULE_GLOBALS   ZEND_MODULE_GLOBALS
#define PHPWRITE(str, str_len)   php_body_write((str), (str_len) TSRMLS_CC)
#define PUTS(str)
#define PUTC(c)   (php_body_write(&(c), 1 TSRMLS_CC), (c))
#define PHPWRITE_H(str, str_len)   php_header_write((str), (str_len) TSRMLS_CC)
#define PUTS_H(str)
#define PUTC_H(c)   (php_header_write(&(c), 1 TSRMLS_CC), (c))
#define PHP_CONNECTION_NORMAL   0
#define PHP_CONNECTION_ABORTED   1
#define PHP_CONNECTION_TIMEOUT   2

Typedefs

typedef unsigned int socklen_t

Functions

PHPAPI size_t php_strlcpy (char *dst, const char *src, size_t siz)
PHPAPI size_t php_strlcat (char *dst, const char *src, size_t siz)
char * strtok_r (char *s, const char *delim, char **last)
char * strerror (int)
void phperror (char *error)
PHPAPI int php_write (void *buf, uint size TSRMLS_DC)
PHPAPI int php_printf (const char *format,...) PHP_ATTRIBUTE_FORMAT(printf
PHPAPI int PHPAPI void php_log_err (char *log_message TSRMLS_DC)
int Debug (char *format,...) PHP_ATTRIBUTE_FORMAT(printf
int int cfgparse (void)
static
ZEND_ATTRIBUTE_DEPRECATED void 
php_set_error_handling (error_handling_t error_handling, zend_class_entry *exception_class TSRMLS_DC)
static
ZEND_ATTRIBUTE_DEPRECATED void 
php_std_error_handling ()
PHPAPI void php_verror (const char *docref, const char *params, int type, const char *format, va_list args TSRMLS_DC) PHP_ATTRIBUTE_FORMAT(printf
PHPAPI void php_error_docref0 (const char *docref TSRMLS_DC, int type, const char *format,...) PHP_ATTRIBUTE_FORMAT(printf
PHPAPI void php_error_docref1 (const char *docref TSRMLS_DC, const char *param1, int type, const char *format,...) PHP_ATTRIBUTE_FORMAT(printf
PHPAPI void php_error_docref2 (const char *docref TSRMLS_DC, const char *param1, const char *param2, int type, const char *format,...) PHP_ATTRIBUTE_FORMAT(printf
PHPAPI int php_register_internal_extensions (TSRMLS_D)
PHPAPI int php_mergesort (void *base, size_t nmemb, register size_t size, int(*cmp)(const void *, const void *TSRMLS_DC) TSRMLS_DC)
PHPAPI void php_register_pre_request_shutdown (void(*func)(void *), void *userdata)
PHPAPI void php_com_initialize (TSRMLS_D)

Variables

char ** environ
PHPAPI void PHP_ATTR_FMT_OFFSET
PHPAPI int(* php_register_internal_extensions_func )(TSRMLS_D)

Define Documentation

#define APACHE   0

Definition at line 92 of file php.h.

#define assert (   expr)    ((void) (0))

Definition at line 89 of file php.h.

#define CREATE_MUTEX (   a,
 
)

Definition at line 153 of file php.h.

Definition at line 288 of file php.h.

#define EXEC_INPUT_BUF   4096

Definition at line 244 of file php.h.

#define FREE_MUTEX (   a)

Definition at line 155 of file php.h.

#define INT_MAX   2147483647

Definition at line 228 of file php.h.

#define INT_MIN   (- INT_MAX - 1)

Definition at line 232 of file php.h.

#define LONG_MAX   2147483647L

Definition at line 220 of file php.h.

#define LONG_MIN   (- LONG_MAX - 1)

Definition at line 224 of file php.h.

#define MAXPATHLEN   256 /* Should be safe for any weird systems that do not define it */

Definition at line 257 of file php.h.

#define memcpy (   d,
  s,
  n 
)    bcopy((s), (d), (n))

Definition at line 193 of file php.h.

#define memmove (   d,
  s,
  n 
)    bcopy ((s), (d), (n))

Definition at line 196 of file php.h.

Definition at line 352 of file php.h.

#define PHP_API_VERSION   20090626

Definition at line 29 of file php.h.

Definition at line 302 of file php.h.

Definition at line 237 of file php.h.

Definition at line 236 of file php.h.

#define PHP_CONNECTION_ABORTED   1

Definition at line 417 of file php.h.

#define PHP_CONNECTION_NORMAL   0

Definition at line 416 of file php.h.

#define PHP_CONNECTION_TIMEOUT   2

Definition at line 418 of file php.h.

#define PHP_DEBUG   ZEND_DEBUG

Definition at line 45 of file php.h.

Definition at line 349 of file php.h.

#define PHP_DEP_FE   ZEND_DEP_FE

Definition at line 347 of file php.h.

#define PHP_DIR_SEPARATOR   '/'

Definition at line 65 of file php.h.

#define PHP_EOL   "\n"

Definition at line 69 of file php.h.

#define php_error   zend_error

Definition at line 287 of file php.h.

Definition at line 317 of file php.h.

#define PHP_FALIAS   ZEND_FALIAS

Definition at line 348 of file php.h.

#define PHP_FE   ZEND_FE

Definition at line 346 of file php.h.

#define PHP_FE_END   ZEND_FE_END

Definition at line 354 of file php.h.

#define PHP_FN   ZEND_FN

Definition at line 338 of file php.h.

Definition at line 341 of file php.h.

Definition at line 235 of file php.h.

#define PHP_GINIT   ZEND_GINIT

Definition at line 374 of file php.h.

Definition at line 382 of file php.h.

Definition at line 375 of file php.h.

Definition at line 383 of file php.h.

Definition at line 30 of file php.h.

#define PHP_MALIAS   ZEND_MALIAS

Definition at line 351 of file php.h.

#define PHP_ME   ZEND_ME

Definition at line 350 of file php.h.

Definition at line 353 of file php.h.

#define php_memnstr   zend_memnstr

Definition at line 326 of file php.h.

#define PHP_METHOD   ZEND_METHOD

Definition at line 342 of file php.h.

#define PHP_MIME_TYPE   "application/x-httpd-php"

Definition at line 246 of file php.h.

Definition at line 373 of file php.h.

Definition at line 381 of file php.h.

Definition at line 369 of file php.h.

Definition at line 377 of file php.h.

#define PHP_MN   ZEND_MN

Definition at line 339 of file php.h.

Definition at line 364 of file php.h.

Definition at line 358 of file php.h.

Definition at line 365 of file php.h.

Definition at line 359 of file php.h.

Definition at line 385 of file php.h.

Definition at line 366 of file php.h.

Definition at line 360 of file php.h.

Definition at line 363 of file php.h.

Definition at line 357 of file php.h.

Definition at line 362 of file php.h.

Definition at line 356 of file php.h.

Definition at line 370 of file php.h.

Definition at line 378 of file php.h.

Definition at line 345 of file php.h.

Definition at line 340 of file php.h.

Definition at line 344 of file php.h.

Definition at line 371 of file php.h.

Definition at line 379 of file php.h.

Definition at line 372 of file php.h.

Definition at line 380 of file php.h.

#define php_sleep   sleep

Definition at line 265 of file php.h.

Definition at line 264 of file php.h.

#define PHP_STRLCPY (   dst,
  src,
  size,
  src_size 
)
Value:
{                                                                            \
              size_t php_str_len;                                     \
												\
		if (src_size >= size)                                 \
                     php_str_len = size - 1;                          \
              else                                                           \
                     php_str_len = src_size;                          \
              memcpy(dst, src, php_str_len);                   \
              dst[php_str_len] = '\0';                         \
       }

Definition at line 115 of file php.h.

#define PHPAPI

Definition at line 61 of file php.h.

#define phpin   zendin

Definition at line 324 of file php.h.

#define phpparse   zendparse

Definition at line 322 of file php.h.

#define phprestart   zendrestart

Definition at line 323 of file php.h.

#define PHPWRITE (   str,
  str_len 
)    php_body_write((str), (str_len) TSRMLS_CC)

Definition at line 390 of file php.h.

#define PHPWRITE_H (   str,
  str_len 
)    php_header_write((str), (str_len) TSRMLS_CC)

Definition at line 397 of file php.h.

#define PUTC (   c)    (php_body_write(&(c), 1 TSRMLS_CC), (c))

Definition at line 396 of file php.h.

#define PUTC_H (   c)    (php_header_write(&(c), 1 TSRMLS_CC), (c))

Definition at line 403 of file php.h.

#define PUTS (   str)
Value:
do {                 \
       const char *__str = (str);                                     \
       php_body_write(__str, strlen(__str) TSRMLS_CC);  \
} while (0)

Definition at line 391 of file php.h.

#define PUTS_H (   str)
Value:
do {                        \
       const char *__str = (str);                                            \
       php_header_write(__str, strlen(__str) TSRMLS_CC);       \
} while (0)

Definition at line 398 of file php.h.

#define SET_MUTEX (   a)

Definition at line 154 of file php.h.

#define sprintf   php_sprintf

Definition at line 41 of file php.h.

#define STR_PRINT (   str)    ((str)?(str):"")

Definition at line 249 of file php.h.

#define strlcat   php_strlcat

Definition at line 140 of file php.h.

#define strlcpy   php_strlcpy

Definition at line 132 of file php.h.

#define THREAD_LS

Definition at line 64 of file php.h.

#define va_copy (   ap1,
  ap2 
)    memcpy((&ap1), (&ap2), sizeof(va_list))

Definition at line 180 of file php.h.

#define YYDEBUG   0

Definition at line 31 of file php.h.

#define zenderror   phperror

Definition at line 319 of file php.h.

#define zendlex   phplex

Definition at line 320 of file php.h.


Typedef Documentation

typedef unsigned int socklen_t

Definition at line 150 of file php.h.


Function Documentation

int int cfgparse ( void  )
int Debug ( char *  format,
  ... 
)

Definition at line 1699 of file main.c.

{
#ifdef PHP_WIN32
       if (!PG(com_initialized)) {
              if (CoInitialize(NULL) == S_OK) {
                     PG(com_initialized) = 1;
              }
       }
#endif
}

Here is the caller graph for this function:

PHPAPI void php_error_docref0 ( const char *docref  TSRMLS_DC,
int  type,
const char *  format,
  ... 
)
PHPAPI void php_error_docref1 ( const char *docref  TSRMLS_DC,
const char *  param1,
int  type,
const char *  format,
  ... 
)
PHPAPI void php_error_docref2 ( const char *docref  TSRMLS_DC,
const char *  param1,
const char *  param2,
int  type,
const char *  format,
  ... 
)
PHPAPI int PHPAPI void php_log_err ( char *log_message  TSRMLS_DC)

Definition at line 576 of file main.c.

{
       int fd = -1;
       time_t error_time;

       if (PG(in_error_log)) {
              /* prevent recursive invocation */
              return;
       }
       PG(in_error_log) = 1;

       /* Try to use the specified logging location. */
       if (PG(error_log) != NULL) {
#ifdef HAVE_SYSLOG_H
              if (!strcmp(PG(error_log), "syslog")) {
                     php_syslog(LOG_NOTICE, "%s", log_message);
                     PG(in_error_log) = 0;
                     return;
              }
#endif
              fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | O_WRONLY, 0644);
              if (fd != -1) {
                     char *tmp;
                     int len;
                     char *error_time_str;

                     time(&error_time);
                     error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 0 TSRMLS_CC);
                     len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str, log_message, PHP_EOL);
#ifdef PHP_WIN32
                     php_flock(fd, 2);
#endif
                     write(fd, tmp, len);
                     efree(tmp);
                     efree(error_time_str);
                     close(fd);
                     PG(in_error_log) = 0;
                     return;
              }
       }

       /* Otherwise fall back to the default logging location, if we have one */

       if (sapi_module.log_message) {
              sapi_module.log_message(log_message);
       }
       PG(in_error_log) = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PHPAPI int php_mergesort ( void *  base,
size_t  nmemb,
register size_t  size,
int(*)(const void *, const void *TSRMLS_DC) TSRMLS_DC  cmp 
)
PHPAPI int php_printf ( const char *  format,
  ... 
)

Definition at line 87 of file internal_functions_nw.c.

Here is the call graph for this function:

PHPAPI void php_register_pre_request_shutdown ( void(*)(void *)  func,
void *  userdata 
)
static ZEND_ATTRIBUTE_DEPRECATED void php_set_error_handling ( error_handling_t  error_handling,
zend_class_entry *exception_class  TSRMLS_DC 
) [inline, static]

Definition at line 291 of file php.h.

{
       zend_replace_error_handling(error_handling, exception_class, NULL TSRMLS_CC);
}

Here is the call graph for this function:

static ZEND_ATTRIBUTE_DEPRECATED void php_std_error_handling ( ) [inline, static]

Definition at line 295 of file php.h.

{}
PHPAPI size_t php_strlcat ( char *  dst,
const char *  src,
size_t  siz 
)

Definition at line 67 of file strlcat.c.

{
       register char *d = dst;
       register const char *s = src;
       register size_t n = siz;
       size_t dlen;

       /* Find the end of dst and adjust bytes left but don't go past end */
       while (*d != '\0' && n-- != 0)
              d++;
       dlen = d - dst;
       n = siz - dlen;

       if (n == 0)
              return(dlen + strlen(s));
       while (*s != '\0') {
              if (n != 1) {
                     *d++ = *s;
                     n--;
              }
              s++;
       }
       *d = '\0';

       return(dlen + (s - src));   /* count does not include NUL */
}
PHPAPI size_t php_strlcpy ( char *  dst,
const char *  src,
size_t  siz 
)

Definition at line 66 of file strlcpy.c.

{
       register char *d = dst;
       register const char *s = src;
       register size_t n = siz;

       /* Copy as many bytes as will fit */
       if (n != 0 && --n != 0) {
              do {
                     if ((*d++ = *s++) == 0)
                            break;
              } while (--n != 0);
       }

       /* Not enough room in dst, add NUL and traverse rest of src */
       if (n == 0) {
              if (siz != 0)
                     *d = '\0';           /* NUL-terminate dst */
              while (*s++)
                     ;
       }

       return(s - src - 1); /* count does not include NUL */
}
PHPAPI void php_verror ( const char *  docref,
const char *  params,
int  type,
const char *  format,
va_list args  TSRMLS_DC 
)
PHPAPI int php_write ( void *  buf,
uint size  TSRMLS_DC 
)

Definition at line 628 of file main.c.

{
       return PHPWRITE(buf, size);
}

Here is the caller graph for this function:

void phperror ( char *  error)
char* strerror ( int  )

Here is the caller graph for this function:

char* strtok_r ( char *  s,
const char *  delim,
char **  last 
)

Variable Documentation

char** environ

Definition at line 307 of file php.h.

Definition at line 117 of file main.c.