X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcbint.h;h=c50850404f91819c94be0addb8dabbc48930092b;hb=86ce18c22c8daebe8796d3c38e8a1d496ab6e8de;hp=eb90fc36628c7dbf7727d7f7b7eb898ae9f6228c;hpb=6149c7a6b57a193bc132fbc35b1772b75e5c7ca7;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcbint.h b/src/xcbint.h index eb90fc3..c508504 100644 --- a/src/xcbint.h +++ b/src/xcbint.h @@ -28,21 +28,17 @@ #ifndef __XCBINT_H #define __XCBINT_H -/* Not simply (a <= b) because eventually the 32-bit sequence number - * will wrap, causing earlier sequence numbers to be higher than later - * ones for a brief but fatal period. (a and b must be unsigned.) */ -#define _xcb_assert_sequence_less(a,b) assert((b) - (a) < 65536) - -#define _xcb_assert_valid_sequence(c) do { \ - _xcb_assert_sequence_less((c)->in.request_read, (c)->out.request_written); \ - _xcb_assert_sequence_less((c)->out.request_written, (c)->out.request); \ -} while(0) +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif enum workarounds { WORKAROUND_NONE, WORKAROUND_GLX_GET_FB_CONFIGS_BUG }; +#define XCB_PAD(i) (-(i) & 3) + /* xcb_list.c */ typedef struct _xcb_list _xcb_list; @@ -57,14 +53,6 @@ void *_xcb_list_remove_head(_xcb_list *list); void *_xcb_list_remove(_xcb_list *list, int (*cmp)(const void *, const void *), const void *data); void *_xcb_list_find(_xcb_list *list, int (*cmp)(const void *, const void *), const void *data); -typedef _xcb_list _xcb_queue; - -_xcb_queue *_xcb_queue_new(void); -void _xcb_queue_delete(_xcb_queue *q, XCBListFreeFunc do_free); -int _xcb_queue_enqueue(_xcb_queue *q, void *data); -void *_xcb_queue_dequeue(_xcb_queue *q); -int _xcb_queue_is_empty(_xcb_queue *q); - typedef _xcb_list _xcb_map; _xcb_map *_xcb_map_new(void); @@ -74,20 +62,6 @@ void *_xcb_map_get(_xcb_map *q, unsigned int key); void *_xcb_map_remove(_xcb_map *q, unsigned int key); -/* xcb_util.c */ - -/* Index of nearest 4-byte boundary following E. */ -#define XCB_CEIL(E) (((E)+3)&~3) - -#define XCB_PAD(i) ((4 - (i & 3)) & 3) - -int _xcb_set_fd_flags(const int fd); -int _xcb_readn(const int fd, void *buf, const int buflen, int *count); -int _xcb_read_block(const int fd, void *buf, const size_t len); -int _xcb_write(const int fd, char (*buf)[], int *count); -int _xcb_writev(const int fd, struct iovec *vec, int count); - - /* xcb_out.c */ typedef struct _xcb_out { @@ -124,19 +98,22 @@ typedef struct _xcb_in { int queue_len; unsigned int request_read; - _xcb_queue *current_reply; + struct reply_list *current_reply; + struct reply_list **current_reply_tail; _xcb_map *replies; - _xcb_queue *events; + struct event_list *events; + struct event_list **events_tail; _xcb_list *readers; - _xcb_queue *pending_replies; + struct pending_reply *pending_replies; + struct pending_reply **pending_replies_tail; } _xcb_in; int _xcb_in_init(_xcb_in *in); void _xcb_in_destroy(_xcb_in *in); -int _xcb_in_expect_reply(XCBConnection *c, unsigned int request, enum workarounds workaround); +int _xcb_in_expect_reply(XCBConnection *c, unsigned int request, enum workarounds workaround, int flags); int _xcb_in_read(XCBConnection *c); int _xcb_in_read_block(XCBConnection *c, void *buf, int nread); @@ -160,7 +137,8 @@ void _xcb_xid_destroy(XCBConnection *c); typedef struct _xcb_ext { pthread_mutex_t lock; - _xcb_map *extensions; + struct lazyreply *extensions; + int extensions_size; } _xcb_ext; int _xcb_ext_init(XCBConnection *c);