zend_API.h revision 573b4602
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
24573b4602SAndi Gutmansint zend_next_free_module(void);
25573b4602SAndi Gutmans
26573b4602SAndi Gutmansint getParameters(HashTable *ht, int param_count,...);
27573b4602SAndi Gutmansint getParametersArray(HashTable *ht, int param_count, zval **argument_array);
28573b4602SAndi Gutmansint getThis(zval **this);
29573b4602SAndi Gutmansint ParameterPassedByReference(HashTable *ht, uint n);
30573b4602SAndi Gutmansint register_functions(function_entry *functions);
31573b4602SAndi Gutmansvoid unregister_functions(function_entry *functions, int count);
32573b4602SAndi Gutmansint register_module(zend_module_entry *module_entry);
33573b4602SAndi Gutmanszend_class_entry *register_internal_class(zend_class_entry *class_entry);
34573b4602SAndi Gutmans
35573b4602SAndi GutmansZEND_API void wrong_param_count(void);
36573b4602SAndi Gutmans
37573b4602SAndi Gutmans#define WRONG_PARAM_COUNT { wrong_param_count(); return; }
38573b4602SAndi Gutmans#define WRONG_PARAM_COUNT_WITH_RETVAL(ret) { wrong_param_count(); return ret; }
39573b4602SAndi Gutmans#define ARG_COUNT(ht) (ht->nNextFreeElement)
40573b4602SAndi Gutmans
41573b4602SAndi Gutmans#define BYREF_NONE 0
42573b4602SAndi Gutmans#define BYREF_FORCE 1
43573b4602SAndi Gutmans#define BYREF_ALLOW 2
44573b4602SAndi Gutmans
45573b4602SAndi Gutmans#if !MSVC5
46573b4602SAndi Gutmans#define DLEXPORT
47573b4602SAndi Gutmans#endif
48573b4602SAndi Gutmans
49573b4602SAndi Gutmansint zend_startup_module(zend_module_entry *module);
50573b4602SAndi Gutmans
51573b4602SAndi GutmansZEND_API int array_init(zval *arg);
52573b4602SAndi GutmansZEND_API int object_init(zval *arg);
53573b4602SAndi GutmansZEND_API int object_init_ex(zval *arg, zend_class_entry *ce);
54573b4602SAndi GutmansZEND_API int add_assoc_long(zval *arg, char *key, long n);
55573b4602SAndi GutmansZEND_API int add_assoc_double(zval *arg, char *key, double d);
56573b4602SAndi GutmansZEND_API int add_assoc_string(zval *arg, char *key, char *str, int duplicate);
57573b4602SAndi GutmansZEND_API int add_assoc_stringl(zval *arg, char *key, char *str, uint length, int duplicate);
58573b4602SAndi GutmansZEND_API int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
59573b4602SAndi GutmansZEND_API int add_index_long(zval *arg, uint idx, long n);
60573b4602SAndi GutmansZEND_API int add_index_double(zval *arg, uint idx, double d);
61573b4602SAndi GutmansZEND_API int add_index_string(zval *arg, uint idx, char *str, int duplicate);
62573b4602SAndi GutmansZEND_API int add_index_stringl(zval *arg, uint idx, char *str, uint length, int duplicate);
63573b4602SAndi GutmansZEND_API int add_next_index_long(zval *arg, long n);
64573b4602SAndi GutmansZEND_API int add_next_index_double(zval *arg, double d);
65573b4602SAndi GutmansZEND_API int add_next_index_string(zval *arg, char *str, int duplicate);
66573b4602SAndi GutmansZEND_API int add_next_index_stringl(zval *arg, char *str, uint length, int duplicate);
67573b4602SAndi Gutmans
68573b4602SAndi GutmansZEND_API int add_get_assoc_string(zval *arg, char *key, char *str, void **dest, int duplicate);
69573b4602SAndi GutmansZEND_API int add_get_assoc_stringl(zval *arg, char *key, char *str, uint length, void **dest, int duplicate);
70573b4602SAndi GutmansZEND_API int add_get_index_long(zval *arg, uint idx, long l, void **dest);
71573b4602SAndi GutmansZEND_API int add_get_index_double(zval *arg, uint idx, double d, void **dest);
72573b4602SAndi GutmansZEND_API int add_get_index_string(zval *arg, uint idx, char *str, void **dest, int duplicate);
73573b4602SAndi GutmansZEND_API int add_get_index_stringl(zval *arg, uint idx, char *str, uint length, void **dest, int duplicate);
74573b4602SAndi Gutmans
75573b4602SAndi GutmansZEND_API int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval, int param_count, zval *params[]);
76573b4602SAndi Gutmans
77573b4602SAndi Gutmans
78573b4602SAndi GutmansZEND_API int add_property_long(zval *arg, char *key, long l);
79573b4602SAndi GutmansZEND_API int add_property_double(zval *arg, char *key, double d);
80573b4602SAndi GutmansZEND_API int add_property_string(zval *arg, char *key, char *str, int duplicate);
81573b4602SAndi GutmansZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length, int duplicate);
82573b4602SAndi Gutmans
83573b4602SAndi Gutmans#define add_method(arg,key,method)	add_assoc_function((arg),(key),(method))
84573b4602SAndi Gutmans
85573b4602SAndi Gutmans#endif							/* _ZEND_API_H */
86573b4602SAndi Gutmans
87573b4602SAndi Gutmans/*
88573b4602SAndi Gutmans * Local variables:
89573b4602SAndi Gutmans * tab-width: 4
90573b4602SAndi Gutmans * c-basic-offset: 4
91573b4602SAndi Gutmans * End:
92573b4602SAndi Gutmans */