#ifndef _PP_H_00a438cc_ #define _PP_H_00a438cc_ #include #include "bpp.h" #include "str.h" extern void parse_packet(BPP *, void (*)(BPP *, const void *, const char *, ...), ...); extern void parse_data(const void *, int, void (*)(const void *, const char *, ...), ...); #define PP_BLOB(n,p) PP__BLOB, pp_to_int(n), pp_to_void_p(p) #define PP__BLOB 1 #define PP_STRING(p) PP__STRING, pp_to_str_p(p) #define PP__STRING 2 #define PP_STRING_CALL(f,a) PP__STRCALL, pp_to_strcallfn(f), pp_to_void_p(a) #define PP__STRCALL 3 #define PP_BOOL(p) PP__BOOL, pp_to_int_p(p) #define PP__BOOL 4 #define PP_UINT32(p) PP__UINT32, pp_to_unsigned_int_p(p) #define PP__UINT32 5 #define PP_MPINT(p) PP__MPINT, pp_to_mp_int_p(p) #define PP__MPINT 6 #define PP_ENDSHERE PP__ENDSHERE #define PP__ENDSHERE 7 #define PP_REST(p,l) PP__REST, pp_to_const_void_pp(p), pp_to_int_p(l) #define PP__REST 8 #define PP_SKIP(x) PP__SKIP, x #define PP__SKIP 9 #define PP_IGNORE(n) PP_SKIP(PP_BLOB(n,0)) #ifndef PP__INLINE #define PP__INLINE extern inline #endif extern int pp_to_int(int); PP__INLINE int pp_to_int(int v) { return(v); } extern void *pp_to_void_p(void *); PP__INLINE void *pp_to_void_p(void *v) { return(v); } extern STR *pp_to_str_p(STR *); PP__INLINE STR *pp_to_str_p(STR *v) { return(v); } extern int *pp_to_int_p(int *); PP__INLINE int *pp_to_int_p(int *v) { return(v); } extern unsigned int *pp_to_unsigned_int_p(unsigned int *); PP__INLINE unsigned int *pp_to_unsigned_int_p(unsigned int *v) { return(v); } extern MP_INT *pp_to_mp_int_p(MP_INT *); PP__INLINE MP_INT *pp_to_mp_int_p(MP_INT *v) { return(v); } extern void (*pp_to_strcallfn(void (*v)(ROSTR, void *)))(ROSTR, void *); PP__INLINE void (*pp_to_strcallfn(void (*v)(ROSTR, void *)))(ROSTR, void *) { return(v); } extern const void *pp_to_const_void_pp(const void **); PP__INLINE const void *pp_to_const_void_pp(const void **v) { return(v); } #endif