Back to index

php5  5.3.10
Classes | Defines | Typedefs | Functions
zend_constants.h File Reference
#include "zend_globals.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _zend_constant

Defines

#define CONST_CS   (1<<0) /* Case Sensitive */
#define CONST_PERSISTENT   (1<<1) /* Persistent */
#define CONST_CT_SUBST   (1<<2) /* Allow compile-time substitution */
#define PHP_USER_CONSTANT   INT_MAX /* a constant defined in user space */
#define REGISTER_LONG_CONSTANT(name, lval, flags)   zend_register_long_constant((name), sizeof(name), (lval), (flags), module_number TSRMLS_CC)
#define REGISTER_DOUBLE_CONSTANT(name, dval, flags)   zend_register_double_constant((name), sizeof(name), (dval), (flags), module_number TSRMLS_CC)
#define REGISTER_STRING_CONSTANT(name, str, flags)   zend_register_string_constant((name), sizeof(name), (str), (flags), module_number TSRMLS_CC)
#define REGISTER_STRINGL_CONSTANT(name, str, len, flags)   zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_LONG_CONSTANT(ns, name, lval, flags)   zend_register_long_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (lval), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_DOUBLE_CONSTANT(ns, name, dval, flags)   zend_register_double_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (dval), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags)   zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_STRINGL_CONSTANT(ns, name, str, len, flags)   zend_register_stringl_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (len), (flags), module_number TSRMLS_CC)
#define REGISTER_MAIN_LONG_CONSTANT(name, lval, flags)   zend_register_long_constant((name), sizeof(name), (lval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_DOUBLE_CONSTANT(name, dval, flags)   zend_register_double_constant((name), sizeof(name), (dval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_STRING_CONSTANT(name, str, flags)   zend_register_string_constant((name), sizeof(name), (str), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_STRINGL_CONSTANT(name, str, len, flags)   zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), 0 TSRMLS_CC)
#define ZEND_CONSTANT_DTOR   (void (*)(void *)) free_zend_constant

Typedefs

typedef struct _zend_constant zend_constant

Functions

void clean_module_constants (int module_number TSRMLS_DC)
void free_zend_constant (zend_constant *c)
int zend_startup_constants (TSRMLS_D)
int zend_shutdown_constants (TSRMLS_D)
void zend_register_standard_constants (TSRMLS_D)
void clean_non_persistent_constants (TSRMLS_D)
ZEND_API int zend_get_constant (const char *name, uint name_len, zval *result TSRMLS_DC)
ZEND_API int zend_get_constant_ex (const char *name, uint name_len, zval *result, zend_class_entry *scope, ulong flags TSRMLS_DC)
ZEND_API void zend_register_long_constant (const char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC)
ZEND_API void zend_register_double_constant (const char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC)
ZEND_API void zend_register_string_constant (const char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC)
ZEND_API void zend_register_stringl_constant (const char *name, uint name_len, char *strval, uint strlen, int flags, int module_number TSRMLS_DC)
ZEND_API int zend_register_constant (zend_constant *c TSRMLS_DC)
void zend_copy_constants (HashTable *target, HashTable *sourc)
void copy_zend_constant (zend_constant *c)

Class Documentation

struct _zend_constant

Definition at line 33 of file zend_constants.h.

Class Members
int flags
int module_number
char * name
uint name_len
zval value

Define Documentation

#define CONST_CS   (1<<0) /* Case Sensitive */

Definition at line 27 of file zend_constants.h.

#define CONST_CT_SUBST   (1<<2) /* Allow compile-time substitution */

Definition at line 29 of file zend_constants.h.

#define CONST_PERSISTENT   (1<<1) /* Persistent */

Definition at line 28 of file zend_constants.h.

#define PHP_USER_CONSTANT   INT_MAX /* a constant defined in user space */

Definition at line 31 of file zend_constants.h.

#define REGISTER_DOUBLE_CONSTANT (   name,
  dval,
  flags 
)    zend_register_double_constant((name), sizeof(name), (dval), (flags), module_number TSRMLS_CC)

Definition at line 42 of file zend_constants.h.

#define REGISTER_LONG_CONSTANT (   name,
  lval,
  flags 
)    zend_register_long_constant((name), sizeof(name), (lval), (flags), module_number TSRMLS_CC)

Definition at line 41 of file zend_constants.h.

#define REGISTER_MAIN_DOUBLE_CONSTANT (   name,
  dval,
  flags 
)    zend_register_double_constant((name), sizeof(name), (dval), (flags), 0 TSRMLS_CC)

Definition at line 52 of file zend_constants.h.

#define REGISTER_MAIN_LONG_CONSTANT (   name,
  lval,
  flags 
)    zend_register_long_constant((name), sizeof(name), (lval), (flags), 0 TSRMLS_CC)

Definition at line 51 of file zend_constants.h.

#define REGISTER_MAIN_STRING_CONSTANT (   name,
  str,
  flags 
)    zend_register_string_constant((name), sizeof(name), (str), (flags), 0 TSRMLS_CC)

Definition at line 53 of file zend_constants.h.

#define REGISTER_MAIN_STRINGL_CONSTANT (   name,
  str,
  len,
  flags 
)    zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), 0 TSRMLS_CC)

Definition at line 54 of file zend_constants.h.

#define REGISTER_NS_DOUBLE_CONSTANT (   ns,
  name,
  dval,
  flags 
)    zend_register_double_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (dval), (flags), module_number TSRMLS_CC)

Definition at line 47 of file zend_constants.h.

#define REGISTER_NS_LONG_CONSTANT (   ns,
  name,
  lval,
  flags 
)    zend_register_long_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (lval), (flags), module_number TSRMLS_CC)

Definition at line 46 of file zend_constants.h.

#define REGISTER_NS_STRING_CONSTANT (   ns,
  name,
  str,
  flags 
)    zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (flags), module_number TSRMLS_CC)

Definition at line 48 of file zend_constants.h.

#define REGISTER_NS_STRINGL_CONSTANT (   ns,
  name,
  str,
  len,
  flags 
)    zend_register_stringl_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (len), (flags), module_number TSRMLS_CC)

Definition at line 49 of file zend_constants.h.

#define REGISTER_STRING_CONSTANT (   name,
  str,
  flags 
)    zend_register_string_constant((name), sizeof(name), (str), (flags), module_number TSRMLS_CC)

Definition at line 43 of file zend_constants.h.

#define REGISTER_STRINGL_CONSTANT (   name,
  str,
  len,
  flags 
)    zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), module_number TSRMLS_CC)

Definition at line 44 of file zend_constants.h.

#define ZEND_CONSTANT_DTOR   (void (*)(void *)) free_zend_constant

Definition at line 74 of file zend_constants.h.


Typedef Documentation

typedef struct _zend_constant zend_constant

Function Documentation

void clean_module_constants ( int module_number  TSRMLS_DC)

Definition at line 78 of file zend_constants.c.

{
       zend_hash_apply_with_argument(EG(zend_constants), (apply_func_arg_t) clean_module_constant, (void *) &module_number TSRMLS_CC);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 167 of file zend_constants.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 39 of file zend_constants.c.

{
       c->name = zend_strndup(c->name, c->name_len - 1);
       if (!(c->flags & CONST_PERSISTENT)) {
              zval_copy_ctor(&c->value);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 30 of file zend_constants.c.

{
       if (!(c->flags & CONST_PERSISTENT)) {
              zval_dtor(&c->value);
       }
       free(c->name);
}
void zend_copy_constants ( HashTable target,
HashTable sourc 
)

Definition at line 48 of file zend_constants.c.

{
       zend_constant tmp_constant;

       zend_hash_copy(target, source, (copy_ctor_func_t) copy_zend_constant, &tmp_constant, sizeof(zend_constant));
}

Here is the call graph for this function:

ZEND_API int zend_get_constant ( const char *  name,
uint  name_len,
zval *result  TSRMLS_DC 
)

Definition at line 226 of file zend_constants.c.

{
       zend_constant *c;
       int retval = 1;
       char *lookup_name;

       if (zend_hash_find(EG(zend_constants), name, name_len+1, (void **) &c) == FAILURE) {
              lookup_name = zend_str_tolower_dup(name, name_len);

              if (zend_hash_find(EG(zend_constants), lookup_name, name_len+1, (void **) &c)==SUCCESS) {
                     if (c->flags & CONST_CS) {
                            retval=0;
                     }
              } else {
                     static char haltoff[] = "__COMPILER_HALT_OFFSET__";

                     if (!EG(in_execution)) {
                            retval = 0;
                     } else if (name_len == sizeof("__COMPILER_HALT_OFFSET__")-1 &&
                               !memcmp(name, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) {
                            char *cfilename, *haltname;
                            int len, clen;

                            cfilename = zend_get_executed_filename(TSRMLS_C);
                            clen = strlen(cfilename);
                            /* check for __COMPILER_HALT_OFFSET__ */
                            zend_mangle_property_name(&haltname, &len, haltoff,
                                   sizeof("__COMPILER_HALT_OFFSET__") - 1, cfilename, clen, 0);
                            if (zend_hash_find(EG(zend_constants), haltname, len+1, (void **) &c) == SUCCESS) {
                                   retval = 1;
                            } else {
                                   retval=0;
                            }
                            pefree(haltname, 0);
                     } else {
                            retval=0;
                     }
              }
              efree(lookup_name);
       }

       if (retval) {
              *result = c->value;
              zval_copy_ctor(result);
              Z_SET_REFCOUNT_P(result, 1);
              Z_UNSET_ISREF_P(result);
       }

       return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API int zend_get_constant_ex ( const char *  name,
uint  name_len,
zval *  result,
zend_class_entry *  scope,
ulong flags  TSRMLS_DC 
)

Definition at line 277 of file zend_constants.c.

{
       zend_constant *c;
       int retval = 1;
       char *colon;
       zend_class_entry *ce = NULL;
       char *class_name;
       zval **ret_constant;

       /* Skip leading \\ */
       if (name[0] == '\\') {
              name += 1;
              name_len -= 1;
       }


       if ((colon = zend_memrchr(name, ':', name_len)) &&
           colon > name && (*(colon - 1) == ':')) {
              int class_name_len = colon - name - 1;
              int const_name_len = name_len - class_name_len - 2;
              char *constant_name = colon + 1;
              char *lcname;

              class_name = estrndup(name, class_name_len);
              lcname = zend_str_tolower_dup(class_name, class_name_len);
              if (!scope) {
                     if (EG(in_execution)) {
                            scope = EG(scope);
                     } else {
                            scope = CG(active_class_entry);
                     }
              }

              if (class_name_len == sizeof("self")-1 &&
                  !memcmp(lcname, "self", sizeof("self")-1)) {
                     if (scope) {
                            ce = scope;
                     } else {
                            zend_error(E_ERROR, "Cannot access self:: when no class scope is active");
                            retval = 0;
                     }
                     efree(lcname);
              } else if (class_name_len == sizeof("parent")-1 &&
                         !memcmp(lcname, "parent", sizeof("parent")-1)) {
                     if (!scope) {
                            zend_error(E_ERROR, "Cannot access parent:: when no class scope is active");
                     } else if (!scope->parent) {
                            zend_error(E_ERROR, "Cannot access parent:: when current class scope has no parent");
                     } else {
                            ce = scope->parent;
                     }
                     efree(lcname);
              } else if (class_name_len == sizeof("static")-1 &&
                         !memcmp(lcname, "static", sizeof("static")-1)) {
                     if (EG(called_scope)) {
                            ce = EG(called_scope);
                     } else {
                            zend_error(E_ERROR, "Cannot access static:: when no class scope is active");
                     }
                     efree(lcname);
              } else {
                     efree(lcname);
                     ce = zend_fetch_class(class_name, class_name_len, flags TSRMLS_CC);
              }
              if (retval && ce) {
                     if (zend_hash_find(&ce->constants_table, constant_name, const_name_len+1, (void **) &ret_constant) != SUCCESS) {
                            retval = 0;
                            if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
                                   zend_error(E_ERROR, "Undefined class constant '%s::%s'", class_name, constant_name);
                            }
                     }
              } else if (!ce) {
                     retval = 0;
              }
              efree(class_name);
              goto finish;
       }

       /* non-class constant */
       if ((colon = zend_memrchr(name, '\\', name_len)) != NULL) {
              /* compound constant name */
              int prefix_len = colon - name;
              int const_name_len = name_len - prefix_len - 1;
              char *constant_name = colon + 1;
              char *lcname;
              int found_const = 0;

              lcname = zend_str_tolower_dup(name, prefix_len);
              /* Check for namespace constant */

              /* Concatenate lowercase namespace name and constant name */
              lcname = erealloc(lcname, prefix_len + 1 + const_name_len + 1);
              lcname[prefix_len] = '\\';
              memcpy(lcname + prefix_len + 1, constant_name, const_name_len + 1);

              if (zend_hash_find(EG(zend_constants), lcname, prefix_len + 1 + const_name_len + 1, (void **) &c) == SUCCESS) {
                     found_const = 1;
              } else {
                     /* try lowercase */
                     zend_str_tolower(lcname + prefix_len + 1, const_name_len);
                     if (zend_hash_find(EG(zend_constants), lcname, prefix_len + 1 + const_name_len + 1, (void **) &c) == SUCCESS) {
                            if ((c->flags & CONST_CS) == 0) {
                                   found_const = 1;
                            }
                     }
              }
              efree(lcname);
              if(found_const) {
                     *result = c->value;
                     zval_update_constant_ex(&result, (void*)1, NULL TSRMLS_CC);
                     zval_copy_ctor(result);
                     Z_SET_REFCOUNT_P(result, 1);
                     Z_UNSET_ISREF_P(result);
                     return 1;
              }
              /* name requires runtime resolution, need to check non-namespaced name */
              if ((flags & IS_CONSTANT_UNQUALIFIED) != 0) {
                     name = constant_name;
                     name_len = const_name_len;
                     return zend_get_constant(name, name_len, result TSRMLS_CC);
              }
              retval = 0;
finish:
              if (retval) {
                     zval_update_constant_ex(ret_constant, (void*)1, ce TSRMLS_CC);
                     *result = **ret_constant;
                     zval_copy_ctor(result);
                     INIT_PZVAL(result);
              }

              return retval;
       }

       return zend_get_constant(name, name_len, result TSRMLS_CC);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 413 of file zend_constants.c.

{
       char *lowercase_name = NULL;
       char *name;
       int ret = SUCCESS;

#if 0
       printf("Registering constant for module %d\n", c->module_number);
#endif

       if (!(c->flags & CONST_CS)) {
              /* keep in mind that c->name_len already contains the '\0' */
              lowercase_name = estrndup(c->name, c->name_len-1);
              zend_str_tolower(lowercase_name, c->name_len-1);
              name = lowercase_name;
       } else {
              char *slash = strrchr(c->name, '\\');
              if(slash) {
                     lowercase_name = estrndup(c->name, c->name_len-1);
                     zend_str_tolower(lowercase_name, slash-c->name);
                     name = lowercase_name;
              } else {
                     name = c->name;
              }
       }

       /* Check if the user is trying to define the internal pseudo constant name __COMPILER_HALT_OFFSET__ */
       if ((c->name_len == sizeof("__COMPILER_HALT_OFFSET__")
              && !memcmp(name, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1))
              || zend_hash_add(EG(zend_constants), name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) {
              
              /* The internal __COMPILER_HALT_OFFSET__ is prefixed by NULL byte */
              if (c->name[0] == '\0' && c->name_len > sizeof("\0__COMPILER_HALT_OFFSET__")
                     && memcmp(name, "\0__COMPILER_HALT_OFFSET__", sizeof("\0__COMPILER_HALT_OFFSET__")) == 0) {
                     name++;
              }
              zend_error(E_NOTICE,"Constant %s already defined", name);
              free(c->name);
              if (!(c->flags & CONST_PERSISTENT)) {
                     zval_dtor(&c->value);
              }
              ret = FAILURE;
       }
       if (lowercase_name) {
              efree(lowercase_name);
       }
       return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API void zend_register_double_constant ( const char *  name,
uint  name_len,
double  dval,
int  flags,
int module_number  TSRMLS_DC 
)

Definition at line 191 of file zend_constants.c.

{
       zend_constant c;
       
       c.value.type = IS_DOUBLE;
       c.value.value.dval = dval;
       c.flags = flags;
       c.name = zend_strndup(name, name_len-1);
       c.name_len = name_len;
       c.module_number = module_number;
       zend_register_constant(&c TSRMLS_CC);
}

Here is the call graph for this function:

ZEND_API void zend_register_long_constant ( const char *  name,
uint  name_len,
long  lval,
int  flags,
int module_number  TSRMLS_DC 
)

Definition at line 177 of file zend_constants.c.

{
       zend_constant c;
       
       c.value.type = IS_LONG;
       c.value.value.lval = lval;
       c.flags = flags;
       c.name = zend_strndup(name, name_len-1);
       c.name_len = name_len;
       c.module_number = module_number;
       zend_register_constant(&c TSRMLS_CC);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 96 of file zend_constants.c.

{
       REGISTER_MAIN_LONG_CONSTANT("E_ERROR", E_ERROR, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("E_RECOVERABLE_ERROR", E_RECOVERABLE_ERROR, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("E_WARNING", E_WARNING, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("E_PARSE", E_PARSE, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("E_NOTICE", E_NOTICE, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("E_STRICT", E_STRICT, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("E_DEPRECATED", E_DEPRECATED, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("E_CORE_ERROR", E_CORE_ERROR, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("E_CORE_WARNING", E_CORE_WARNING, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("E_COMPILE_ERROR", E_COMPILE_ERROR, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("E_COMPILE_WARNING", E_COMPILE_WARNING, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("E_USER_ERROR", E_USER_ERROR, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("E_USER_WARNING", E_USER_WARNING, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("E_USER_NOTICE", E_USER_NOTICE, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("E_USER_DEPRECATED", E_USER_DEPRECATED, CONST_PERSISTENT | CONST_CS);

       REGISTER_MAIN_LONG_CONSTANT("E_ALL", E_ALL, CONST_PERSISTENT | CONST_CS);

       REGISTER_MAIN_LONG_CONSTANT("DEBUG_BACKTRACE_PROVIDE_OBJECT", DEBUG_BACKTRACE_PROVIDE_OBJECT, CONST_PERSISTENT | CONST_CS);
       REGISTER_MAIN_LONG_CONSTANT("DEBUG_BACKTRACE_IGNORE_ARGS", DEBUG_BACKTRACE_IGNORE_ARGS, CONST_PERSISTENT | CONST_CS);
       /* true/false constants */
       {
              zend_constant c;
       
              c.flags = CONST_PERSISTENT | CONST_CT_SUBST;
              c.module_number = 0;

              c.name = zend_strndup(ZEND_STRL("TRUE"));
              c.name_len = sizeof("TRUE");
              c.value.value.lval = 1;
              c.value.type = IS_BOOL;
              zend_register_constant(&c TSRMLS_CC);
              
              c.name = zend_strndup(ZEND_STRL("FALSE"));
              c.name_len = sizeof("FALSE");
              c.value.value.lval = 0;
              c.value.type = IS_BOOL;
              zend_register_constant(&c TSRMLS_CC);

              c.name = zend_strndup(ZEND_STRL("NULL"));
              c.name_len = sizeof("NULL");
              c.value.type = IS_NULL;
              zend_register_constant(&c TSRMLS_CC);

              c.flags = CONST_PERSISTENT;

              c.name = zend_strndup(ZEND_STRL("ZEND_THREAD_SAFE"));
              c.name_len = sizeof("ZEND_THREAD_SAFE");
              c.value.value.lval = ZTS_V;
              c.value.type = IS_BOOL;
              zend_register_constant(&c TSRMLS_CC);

              c.name = zend_strndup(ZEND_STRL("ZEND_DEBUG_BUILD"));
              c.name_len = sizeof("ZEND_DEBUG_BUILD");
              c.value.value.lval = ZEND_DEBUG;
              c.value.type = IS_BOOL;
              zend_register_constant(&c TSRMLS_CC);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API void zend_register_string_constant ( const char *  name,
uint  name_len,
char *  strval,
int  flags,
int module_number  TSRMLS_DC 
)

Definition at line 220 of file zend_constants.c.

{
       zend_register_stringl_constant(name, name_len, strval, strlen(strval), flags, module_number TSRMLS_CC);
}

Here is the call graph for this function:

ZEND_API void zend_register_stringl_constant ( const char *  name,
uint  name_len,
char *  strval,
uint  strlen,
int  flags,
int module_number  TSRMLS_DC 
)

Definition at line 205 of file zend_constants.c.

{
       zend_constant c;
       
       c.value.type = IS_STRING;
       c.value.value.str.val = strval;
       c.value.value.str.len = strlen;
       c.flags = flags;
       c.name = zend_strndup(name, name_len-1);
       c.name_len = name_len;
       c.module_number = module_number;
       zend_register_constant(&c TSRMLS_CC);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 159 of file zend_constants.c.

{
       zend_hash_destroy(EG(zend_constants));
       free(EG(zend_constants));
       return SUCCESS;
}

Here is the call graph for this function:

Definition at line 84 of file zend_constants.c.

{
       EG(zend_constants) = (HashTable *) malloc(sizeof(HashTable));

       if (zend_hash_init(EG(zend_constants), 20, NULL, ZEND_CONSTANT_DTOR, 1)==FAILURE) {
              return FAILURE;
       }
       return SUCCESS;
}