Linked Lists

Constants

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

Looks up the value of a registered constant. If found, the value will be copied into result and the function will return 0 indicating success.

Argument

Purpose

name

NULL-terminated name of constant to fetch. May also be in the form CLASSNAME::CONSTANT to fetch class constants.

name_len

Length of constant name not including the terminating NULL byte.

result

Preallocated zval container to populate a copy of the constant into.

void zend_register_long_constant(char *name, uint name_len, long value, int flags, int module_number TSRMLS_DC); void zend_register_double_constant(char *name, uint name_len, double value, int flags, int module_number TSRMLS_DC); void zend_register_string_constant(char *name, uint name_len, char *value, int flags, int module_number TSRMLS_DC); void zend_register_stringl_constant(char *name, uint name_len, char *value, uint value_len, int flags, int module_number TSRMLS_DC); int zend_register_constant(zend_constant *c TSRMLS_DC);

Registers a constant of the specified type with the value passed. Constants of certain other types (not including Arrays and Objects) can also be registered by manually constructing a zend_constant and passing it to zend_register_constant().

Argument

Purpose

name

NULL-terminated name of constant to register.

name_len

Length of constant name including the trailing NULL byte.

value

Value to initialize the constant with.

value_len

Specific to strings, length of the string value not including the trailing NULL byte.

flags

Any combination of CONST_CS and/or CONST_PERSISTENT.

module_number

Passed unmodified from MINIT or RINIT.

c

Initialized zend_constant structure. Refer to Chapter 12, "Startup, Shutdown, and a Few Points in Between" for more information.

Категории