1 #ifndef ACL_VBUF_INCLUDE_H 2 #define ACL_VBUF_INCLUDE_H 22 #if defined(_WIN32) || defined(_WIN64) 39 #define ACL_VBUF_TO_APPL(vbuf_ptr,app_type,vbuf_member) \ 40 ((app_type *) (((char *) (vbuf_ptr)) - offsetof(app_type,vbuf_member))) 45 #define ACL_VBUF_FLAG_ERR (1<<0) 46 #define ACL_VBUF_FLAG_EOF (1<<1) 47 #define ACL_VBUF_FLAG_TIMEOUT (1<<2) 48 #define ACL_VBUF_FLAG_BAD \ 49 (ACL_VBUF_FLAG_ERR | ACL_VBUF_FLAG_EOF | ACL_VBUF_FLAG_TIMEOUT) 50 #define ACL_VBUF_FLAG_FIXED (1<<3) 52 #define acl_vbuf_error(v) ((v)->flags & ACL_VBUF_FLAG_BAD) 53 #define acl_vbuf_eof(v) ((v)->flags & ACL_VBUF_FLAG_EOF) 54 #define acl_vbuf_timeout(v) ((v)->flags & ACL_VBUF_FLAG_TIMEOUT) 55 #define acl_vbuf_clearerr(v) ((v)->flags &= ~ACL_VBUF_FLAG_BAD) 60 #define ACL_VBUF_GET(v) ((v)->cnt < 0 ? ++(v)->cnt, \ 61 (int) *(v)->ptr++ : acl_vbuf_get(v)) 63 #define ACL_VBUF_PUT(v,c) ((v)->cnt > 0 ? --(v)->cnt, \ 64 (int) (*(v)->ptr++ = (c)) : acl_vbuf_put((v),(c))) 66 #define ACL_VBUF_SPACE(v,n) ((v)->space((v),(n))) 68 #define ACL_VBUF_CHARAT(v, offset) ((int) (v).data[offset]) 70 #define ACL_VBUF_EOF (-1)
int(* ACL_VBUF_SPACE_FN)(ACL_VBUF *, ssize_t)
int(* ACL_VBUF_PUT_READY_FN)(ACL_VBUF *)
ACL_API int acl_vbuf_get(ACL_VBUF *)
int(* ACL_VBUF_GET_READY_FN)(ACL_VBUF *)
ACL_VBUF_PUT_READY_FN put_ready
ACL_API int acl_vbuf_read(ACL_VBUF *, char *, int)
ACL_API int acl_vbuf_put(ACL_VBUF *, int)
ACL_API int acl_vbuf_unget(ACL_VBUF *, int)
ACL_API int acl_vbuf_write(ACL_VBUF *, const char *, int)
ACL_VBUF_GET_READY_FN get_ready