Main Page | Class List | File List | Class Members | File Members | Related Pages

gi_xdr.h

Go to the documentation of this file.
00001 /* 00002 * $Id: gi_xdr.h,v 1.1.2.11 2004/04/22 21:28:52 jasta Exp $ 00003 * 00004 * Copyright (C) 2003 giFT project (gift.sourceforge.net) 00005 * 00006 * This program is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU General Public License as published by the 00008 * Free Software Foundation; either version 2, or (at your option) any 00009 * later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, but 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * General Public License for more details. 00015 */ 00016 00017 #ifndef __GI_XDR_H 00018 #define __GI_XDR_H 00019 00020 /*****************************************************************************/ 00021 00034 /*****************************************************************************/ 00035 00036 #include "gi_buffer.h" 00037 #include "gi_array.h" 00038 00039 /*****************************************************************************/ 00040 00045 typedef enum 00046 { 00047 GI_XDR_ENCODE, 00048 GI_XDR_DECODE, 00049 GI_XDR_FREE 00050 } gi_xdrop_t; 00051 00057 typedef struct gi_xdr 00058 { 00064 gi_xdrop_t op; 00065 00070 GiBuffer buf; 00071 } GiXdr; 00072 00073 /*****************************************************************************/ 00074 00079 typedef bool (*gi_xdrproc_t) (GiXdr *xdrs, void *, ...); 00080 00081 /*****************************************************************************/ 00082 00083 EXTERN_C_BEGIN 00084 00085 /*****************************************************************************/ 00086 00103 LIBGIFT_EXPORT 00104 void gi_xdrmem_create (GiXdr *xdrs, void *buf, size_t size, gi_xdrop_t op); 00105 00110 LIBGIFT_EXPORT 00111 void gi_xdr_destroy (GiXdr *xdrs); 00112 00117 LIBGIFT_EXPORT 00118 bool gi_xdr_free (GiXdr *xdrs, gi_xdrproc_t proc, void *args); 00119 00120 /*****************************************************************************/ 00121 00126 LIBGIFT_EXPORT 00127 bool gi_xdr_void (GiXdr *xdrs); 00128 00129 /*****************************************************************************/ 00130 00134 LIBGIFT_EXPORT 00135 bool gi_xdr_int32_t (GiXdr *xdrs, int32_t *vref); 00136 00140 LIBGIFT_EXPORT 00141 bool gi_xdr_uint32_t (GiXdr *xdrs, uint32_t *vref); 00142 00143 #if INT64_MAX > INT32_MAX 00144 00147 LIBGIFT_EXPORT 00148 bool gi_xdr_int64_t (GiXdr *xdrs, int64_t *vref); 00149 00153 LIBGIFT_EXPORT 00154 bool gi_xdr_uint64_t (GiXdr *xdrs, uint64_t *vref); 00155 #endif /* INT64_MAX > INT32_MAX */ 00156 00157 /*****************************************************************************/ 00158 00163 LIBGIFT_EXPORT 00164 bool gi_xdr_array (GiXdr *xdrs, GiArray *vref, size_t max, gi_xdrproc_t proc); 00165 00170 LIBGIFT_EXPORT 00171 bool gi_xdr_string (GiXdr *xdrs, char **vref, size_t maxlen); 00172 00178 LIBGIFT_EXPORT 00179 bool gi_xdr_bytes (GiXdr *xdrs, unsigned char **vref, size_t *lenref, 00180 size_t maxlen); 00181 00182 /*****************************************************************************/ 00183 00187 LIBGIFT_EXPORT 00188 bool gi_xdr_enum (GiXdr *xdrs, int32_t *vref); 00189 00193 LIBGIFT_EXPORT 00194 bool gi_xdr_bool (GiXdr *xdrs, bool *vref); 00195 00196 /*****************************************************************************/ 00197 00201 LIBGIFT_EXPORT 00202 bool gi_xdr_off_t (GiXdr *xdrs, off_t *vref); 00203 00204 /*****************************************************************************/ 00205 00206 EXTERN_C_END 00207 00208 /*****************************************************************************/ 00209 00210 #endif /* __GI_XDR_H */

Generated on Sun Aug 22 07:56:40 2004 by doxygen 1.3.7