#ifndef _PP_H_2ba7dc7c_ #define _PP_H_2ba7dc7c_ #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_SKIP(n) PP__SKIP, pp_to_int(n) #define PP__SKIP 1 #define PP_BLOB(n,p) PP__BLOB, pp_to_int(n), pp_to_void_p(p) #define PP__BLOB 2 #define PP_STRING(p) PP__STRING, pp_to_str_p(p) #define PP__STRING 3 #define PP_STRING_CALL(f,a) PP__STRCALL, pp_to_strcallfn(f), pp_to_void_p(a) #define PP__STRCALL 4 #define PP_BOOL(p) PP__BOOL, pp_to_int_p(p) #define PP__BOOL 5 #define PP_UINT32(p) PP__UINT32, pp_to_unsigned_int_p(p) #define PP__UINT32 6 #define PP_MPINT(p) PP__MPINT, pp_to_mp_int_p(p) #define PP__MPINT 7 #define PP_ENDSHERE PP__ENDSHERE #define PP__ENDSHERE 8 #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); } #endif