00001 #ifndef _PUP_C_H
00002 #define _PUP_C_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 #ifdef __cplusplus
00061 extern "C" {
00062 #endif
00063
00064 #include "conv-config.h"
00065
00066
00067
00068
00069 typedef void *pup_er;
00070
00071
00072 pup_er pup_new_sizer();
00073 pup_er pup_new_toMem(void *Nbuf);
00074 pup_er pup_new_fromMem(const void *Nbuf);
00075 pup_er pup_new_network_sizer();
00076 pup_er pup_new_network_pack(void *Nbuf);
00077 pup_er pup_new_network_unpack(const void *Nbuf);
00078 #if CMK_CCS_AVAILABLE
00079 pup_er pup_new_fmt(pup_er p);
00080 void pup_fmt_sync_begin_object(pup_er p);
00081 void pup_fmt_sync_end_object(pup_er p);
00082 void pup_fmt_sync_begin_array(pup_er p);
00083 void pup_fmt_sync_end_array(pup_er p);
00084 void pup_fmt_sync_item(pup_er p);
00085 #endif
00086 void pup_destroy(pup_er p);
00087
00088
00089
00090 int pup_isPacking(const pup_er p);
00091 int pup_isUnpacking(const pup_er p);
00092 int pup_isSizing(const pup_er p);
00093 int pup_isDeleting(const pup_er p);
00094 int pup_isUserlevel(const pup_er p);
00095 int pup_isRestarting(const pup_er p);
00096 char *pup_typeString(const pup_er p);
00097
00098
00099 void pup_syncComment(const pup_er p, unsigned int sync, char *message);
00100 void pup_comment(const pup_er p, char *message);
00101
00102
00103 int pup_size(const pup_er p);
00104
00105
00106
00107
00108
00109
00110 #define PUP_BASIC_DATATYPE(typeName,type) \
00111 void pup_##typeName(pup_er p,type *v); \
00112 void pup_##typeName##s(pup_er p,type *arr,int nItems);
00113
00114 PUP_BASIC_DATATYPE(char,char)
00115 PUP_BASIC_DATATYPE(short,short)
00116 PUP_BASIC_DATATYPE(int,int)
00117 PUP_BASIC_DATATYPE(long,long)
00118 PUP_BASIC_DATATYPE(uchar,unsigned char)
00119 PUP_BASIC_DATATYPE(ushort,unsigned short)
00120 PUP_BASIC_DATATYPE(uint,unsigned int)
00121 PUP_BASIC_DATATYPE(ulong,unsigned long)
00122 PUP_BASIC_DATATYPE(float,float)
00123 PUP_BASIC_DATATYPE(double,double)
00124 PUP_BASIC_DATATYPE(pointer,void*)
00125 PUP_BASIC_DATATYPE(int8, CMK_TYPEDEF_INT8)
00126
00127
00128 void pup_bytes(pup_er p,void *ptr,int nBytes);
00129
00130
00131 enum {
00132 pup_sync_builtin=0x70000000,
00133 pup_sync_begin=pup_sync_builtin+0x01000000,
00134 pup_sync_end=pup_sync_builtin+0x02000000,
00135 pup_sync_last_system=pup_sync_builtin+0x09000000,
00136 pup_sync_array_m=0x00100000,
00137 pup_sync_list_m=0x00200000,
00138 pup_sync_object_m=0x00300000,
00139
00140 pup_sync_begin_array=pup_sync_begin+pup_sync_array_m,
00141 pup_sync_begin_list=pup_sync_begin+pup_sync_list_m,
00142 pup_sync_begin_object=pup_sync_begin+pup_sync_object_m,
00143
00144 pup_sync_end_array=pup_sync_end+pup_sync_array_m,
00145 pup_sync_end_list=pup_sync_end+pup_sync_list_m,
00146 pup_sync_end_object=pup_sync_end+pup_sync_object_m,
00147
00148 pup_sync_item=pup_sync_builtin+0x00110000,
00149 pup_sync_index=pup_sync_builtin+0x00120000,
00150
00151 pup_sync_last
00152 };
00153
00154 #ifdef __cplusplus
00155 }
00156 #endif
00157
00158 #endif