00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _GATXds_H_
00018 #define _GATXds_H_ 1
00019
00020
00021 #include <stdarg.h>
00022
00023
00024 #include "GATType.h"
00025 #include "GATContext.h"
00026
00027
00028
00029
00030 typedef xds_t *GATXds;
00031
00032 typedef enum
00033 {
00034 GATXdsType_Encode = XDS_ENCODE,
00035 GATXdsType_Decode = XDS_DECODE
00036 } GATXdsType;
00037
00038 typedef enum
00039 {
00040 GATXdsScope_Gift = XDS_GIFT,
00041 GATXdsScope_Loan = XDS_LOAN
00042 } GATXdsScope;
00043
00044 typedef GATResult (* GATXdsSerialiseCallback)(GATObject, GATObject, GATBool);
00045 typedef GATResult (* GATXdsDeSerialiseCallback)(GATContext, GATObject,
00046 GATObject *, GATuint32, va_list);
00047 typedef GATBool (* GATXdsVersionCallback)(GATuint32);
00048
00049 #ifdef __cplusplus
00050 extern "C" {
00051 #endif
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 GATResult GATXds_Init (GATXds *xds, GATXdsType type);
00073 GATResult GATXds_InitEx (GATXds *xds, GATXdsType type, GATContext context);
00074
00075
00076
00077
00078
00079
00080
00081
00082 void GATXds_Destroy (GATXds *xds);
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 GATResult GATXds_Encode(GATXds xds, GATXdsScope flag, void **buffer,
00106 size_t *buffer_len, const char *fmt, ...);
00107 GATResult GATXds_EncodeV(GATXds xds, GATXdsScope flag, void **buffer,
00108 size_t *buffer_len, const char *fmt, va_list args);
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 GATResult GATXds_Decode(GATXds xds, GATXdsScope flag, void *buffer,
00132 size_t buffer_len, const char *fmt, ...);
00133 GATResult GATXds_DecodeV(GATXds xds, GATXdsScope flag, void *buffer,
00134 size_t buffer_len, const char *fmt, va_list args);
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146 size_t GATXds_GetBufferLen(GATXds xds);
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157 size_t GATXds_GetBufferCapacity(GATXds xds);
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176 GATResult GATXds_GetBuffer(GATXds xds, GATXdsScope flag, void **buffer, size_t
00177 *buffer_size);
00178
00179
00180 GATResult
00181 GATXds_SerialiseObject(GATObject object, GATObject stream, GATBool clear_dirty,
00182 GATXdsSerialiseCallback callback, char const *fmt, ...);
00183
00184 GATResult
00185 GATXds_DeSerialiseObject(GATContext context, GATObject stream,
00186 GATXdsDeSerialiseCallback callback, GATXdsVersionCallback version_callback,
00187 GATObject *object, char const *fmt, ...);
00188
00189 #ifdef __cplusplus
00190 }
00191 #endif
00192
00193 #endif