Linked Lists

Table of contents:

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.



The PHP Life Cycle

Variables from the Inside Out

Memory Management

Setting Up a Build Environment

Your First Extension

Returning Values

Accepting Parameters

Working with Arrays and HashTables

The Resource Data Type

PHP4 Objects

PHP5 Objects

Startup, Shutdown, and a Few Points in Between

INI Settings

Accessing Streams

Implementing Streams

Diverting the Stream

Configuration and Linking

Extension Generators

Setting Up a Host Environment

Advanced Embedding

Appendix A. A Zend API Reference

Appendix B. PHPAPI

Appendix C. Extending and Embedding Cookbook

Appendix D. Additional Resources



Extending and Embedding PHP
Extending and Embedding PHP
ISBN: 067232704X
EAN: 2147483647
Year: 2007
Pages: 175
Authors: Sara Golemon

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net