zend_API.h revision 342c6e0b
1573b4602SAndi Gutmans/*
2573b4602SAndi Gutmans   +----------------------------------------------------------------------+
3573b4602SAndi Gutmans   | Zend Engine                                                          |
4573b4602SAndi Gutmans   +----------------------------------------------------------------------+
5573b4602SAndi Gutmans   | Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski                  |
6573b4602SAndi Gutmans   +----------------------------------------------------------------------+
7573b4602SAndi Gutmans   | This source file is subject to the Zend license, that is bundled     |
8573b4602SAndi Gutmans   | with this package in the file LICENSE.  If you did not receive a     |
9573b4602SAndi Gutmans   | copy of the Zend license, please mail us at zend@zend.com so we can  |
10573b4602SAndi Gutmans   | send you a copy immediately.                                         |
11573b4602SAndi Gutmans   +----------------------------------------------------------------------+
12573b4602SAndi Gutmans   | Authors: Andi Gutmans <andi@zend.com>                                |
13573b4602SAndi Gutmans   |          Zeev Suraski <zeev@zend.com>                                |
14573b4602SAndi Gutmans   +----------------------------------------------------------------------+
15573b4602SAndi Gutmans*/
16573b4602SAndi Gutmans
17573b4602SAndi Gutmans#ifndef _ZEND_API_H
18573b4602SAndi Gutmans#define _ZEND_API_H
19573b4602SAndi Gutmans
20573b4602SAndi Gutmans#include "modules.h"
21573b4602SAndi Gutmans#include "zend_list.h"
22573b4602SAndi Gutmans
23573b4602SAndi Gutmans
24342c6e0bSZeev Suraski#define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
25342c6e0bSZeev Suraski#define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(zend_if_##name)
26342c6e0bSZeev Suraski
27342c6e0bSZeev Suraski#define ZEND_NAMED_FE(runtime_name, name, arg_types) { #runtime_name, name, arg_types },
28342c6e0bSZeev Suraski#define ZEND_FE(name, arg_types) ZEND_NAMED_FE(name, zend_if_##name, arg_types)
29342c6e0bSZeev Suraski
30342c6e0bSZeev Suraski
31573b4602SAndi Gutmansint zend_next_free_module(void);
32573b4602SAndi Gutmans
3339a7f4c3SZeev Suraskiint getParameters(int ht, int param_count,...);
3439a7f4c3SZeev Suraskiint getParametersArray(int ht, int param_count, zval **argument_array);
3539f9487eSAndi Gutmansint getParametersEx(int param_count,...);
3639f9487eSAndi Gutmansint getParametersArrayEx(int param_count, zval ***argument_array);
3739f9487eSAndi Gutmans
38573b4602SAndi Gutmansint getThis(zval **this);
3939f9487eSAndi Gutmans
4039f9487eSAndi Gutmans
4139a7f4c3SZeev Suraskiint ParameterPassedByReference(int ht, uint n);
42342c6e0bSZeev Suraskiint register_functions(zend_function_entry *functions);
43342c6e0bSZeev Suraskivoid unregister_functions(zend_function_entry *functions, int count);
44573b4602SAndi Gutmansint register_module(zend_module_entry *module_entry);
45573b4602SAndi Gutmanszend_class_entry *register_internal_class(zend_class_entry *class_entry);
46573b4602SAndi Gutmans
47573b4602SAndi GutmansZEND_API void wrong_param_count(void);
48573b4602SAndi Gutmans
49573b4602SAndi Gutmans#define WRONG_PARAM_COUNT { wrong_param_count(); return; }
50573b4602SAndi Gutmans#define WRONG_PARAM_COUNT_WITH_RETVAL(ret) { wrong_param_count(); return ret; }
5139a7f4c3SZeev Suraski#define ARG_COUNT(ht) (ht)
52573b4602SAndi Gutmans
53573b4602SAndi Gutmans#define BYREF_NONE 0
54573b4602SAndi Gutmans#define BYREF_FORCE 1
55573b4602SAndi Gutmans#define BYREF_ALLOW 2
56573b4602SAndi Gutmans
57573b4602SAndi Gutmans#if !MSVC5
58573b4602SAndi Gutmans#define DLEXPORT
59573b4602SAndi Gutmans#endif
60573b4602SAndi Gutmans
61573b4602SAndi Gutmansint zend_startup_module(zend_module_entry *module);
62573b4602SAndi Gutmans
63573b4602SAndi GutmansZEND_API int array_init(zval *arg);
64573b4602SAndi GutmansZEND_API int object_init(zval *arg);
65573b4602SAndi GutmansZEND_API int object_init_ex(zval *arg, zend_class_entry *ce);
66573b4602SAndi GutmansZEND_API int add_assoc_long(zval *arg, char *key, long n);
67573b4602SAndi GutmansZEND_API int add_assoc_double(zval *arg, char *key, double d);
68573b4602SAndi GutmansZEND_API int add_assoc_string(zval *arg, char *key, char *str, int duplicate);
69573b4602SAndi GutmansZEND_API int add_assoc_stringl(zval *arg, char *key, char *str, uint length, int duplicate);
70573b4602SAndi GutmansZEND_API int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
71573b4602SAndi GutmansZEND_API int add_index_long(zval *arg, uint idx, long n);
72573b4602SAndi GutmansZEND_API int add_index_double(zval *arg, uint idx, double d);
73573b4602SAndi GutmansZEND_API int add_index_string(zval *arg, uint idx, char *str, int duplicate);
74573b4602SAndi GutmansZEND_API int add_index_stringl(zval *arg, uint idx, char *str, uint length, int duplicate);
75573b4602SAndi GutmansZEND_API int add_next_index_long(zval *arg, long n);
76573b4602SAndi GutmansZEND_API int add_next_index_double(zval *arg, double d);
77573b4602SAndi GutmansZEND_API int add_next_index_string(zval *arg, char *str, int duplicate);
78573b4602SAndi GutmansZEND_API int add_next_index_stringl(zval *arg, char *str, uint length, int duplicate);
79573b4602SAndi Gutmans
80573b4602SAndi GutmansZEND_API int add_get_assoc_string(zval *arg, char *key, char *str, void **dest, int duplicate);
81573b4602SAndi GutmansZEND_API int add_get_assoc_stringl(zval *arg, char *key, char *str, uint length, void **dest, int duplicate);
82573b4602SAndi GutmansZEND_API int add_get_index_long(zval *arg, uint idx, long l, void **dest);
83573b4602SAndi GutmansZEND_API int add_get_index_double(zval *arg, uint idx, double d, void **dest);
84573b4602SAndi GutmansZEND_API int add_get_index_string(zval *arg, uint idx, char *str, void **dest, int duplicate);
85573b4602SAndi GutmansZEND_API int add_get_index_stringl(zval *arg, uint idx, char *str, uint length, void **dest, int duplicate);
86573b4602SAndi Gutmans
87573b4602SAndi GutmansZEND_API int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval, int param_count, zval *params[]);
88573b4602SAndi Gutmans
89573b4602SAndi Gutmans
90573b4602SAndi GutmansZEND_API int add_property_long(zval *arg, char *key, long l);
91573b4602SAndi GutmansZEND_API int add_property_double(zval *arg, char *key, double d);
92573b4602SAndi GutmansZEND_API int add_property_string(zval *arg, char *key, char *str, int duplicate);
93573b4602SAndi GutmansZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length, int duplicate);
94573b4602SAndi Gutmans
95573b4602SAndi Gutmans#define add_method(arg,key,method)	add_assoc_function((arg),(key),(method))
96573b4602SAndi Gutmans
97573b4602SAndi Gutmans#endif							/* _ZEND_API_H */
98573b4602SAndi Gutmans
99573b4602SAndi Gutmans/*
100573b4602SAndi Gutmans * Local variables:
101573b4602SAndi Gutmans * tab-width: 4
102573b4602SAndi Gutmans * c-basic-offset: 4
103573b4602SAndi Gutmans * End:
104573b4602SAndi Gutmans */
105