Back to index

php5  5.3.10
php_wddx_api.h
Go to the documentation of this file.
00001 /* 
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Author:  Andrei Zmievski <andrei@ispi.net>                           |
00016    +----------------------------------------------------------------------+
00017  */
00018 
00019 /* $Id: php_wddx_api.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef PHP_WDDX_API_H
00022 #define PHP_WDDX_API_H
00023 
00024 #include "ext/standard/php_smart_str.h"
00025 
00026 #define WDDX_ARRAY_S               "<array length='%d'>"
00027 #define WDDX_ARRAY_E               "</array>"
00028 #define WDDX_BINARY_S                     "<binary>"
00029 #define WDDX_BINARY_E                     "</binary>"
00030 #define WDDX_BOOLEAN_TRUE          "<boolean value='true'/>"
00031 #define WDDX_BOOLEAN_FALSE         "<boolean value='false'/>"
00032 #define WDDX_CHAR                         "<char code='%02X'/>"
00033 #define WDDX_COMMENT_S                    "<comment>"
00034 #define WDDX_COMMENT_E                    "</comment>"
00035 #define WDDX_DATA_S                       "<data>"
00036 #define WDDX_DATA_E                       "</data>"
00037 #define WDDX_HEADER                       "<header/>"
00038 #define WDDX_HEADER_S                     "<header>"
00039 #define WDDX_HEADER_E                     "</header>"
00040 #define WDDX_NULL                         "<null/>"
00041 #define WDDX_NUMBER                       "<number>%s</number>"
00042 #define WDDX_PACKET_S                     "<wddxPacket version='1.0'>"
00043 #define WDDX_PACKET_E                     "</wddxPacket>"
00044 #define WDDX_STRING_S                     "<string>"
00045 #define WDDX_STRING_E                     "</string>"
00046 #define WDDX_STRUCT_S                     "<struct>"
00047 #define WDDX_STRUCT_E                     "</struct>"
00048 #define WDDX_VAR_S                        "<var name='%s'>"
00049 #define WDDX_VAR_E                        "</var>"
00050 
00051 #define php_wddx_add_chunk(packet, str)   smart_str_appends(packet, str)
00052 #define php_wddx_add_chunk_ex(packet, str, len)  smart_str_appendl(packet, str, len)
00053 #define php_wddx_add_chunk_static(packet, str) smart_str_appendl(packet, str, sizeof(str)-1)
00054 
00055 typedef smart_str wddx_packet;
00056 
00057 wddx_packet* php_wddx_constructor(void);
00058 void           php_wddx_destructor(wddx_packet *packet);
00059 
00060 void           php_wddx_packet_start(wddx_packet *packet, char *comment, int comment_len);
00061 void           php_wddx_packet_end(wddx_packet *packet);
00062 
00063 void           php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name_len TSRMLS_DC);
00064 int            php_wddx_deserialize_ex(char *, int, zval *return_value);
00065 #define php_wddx_gather(packet) estrndup(packet->c, packet->len)
00066 
00067 #endif /* PHP_WDDX_API_H */