projects
/
free-sw
/
xcb
/
libxcb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
40589db
)
Remove the 'int *error' out-parameter for xcb_poll_for_event.
author
Jamey Sharp
<jamey@minilop.net>
Fri, 6 Oct 2006 23:12:04 +0000
(16:12 -0700)
committer
Jamey Sharp
<jamey@minilop.net>
Fri, 6 Oct 2006 23:35:36 +0000
(16:35 -0700)
src/xcb.h
patch
|
blob
|
history
src/xcb_in.c
patch
|
blob
|
history
diff --git
a/src/xcb.h
b/src/xcb.h
index
15c5768
..
4b5b349
100644
(file)
--- a/
src/xcb.h
+++ b/
src/xcb.h
@@
-224,12
+224,10
@@
xcb_generic_event_t *xcb_wait_for_event(xcb_connection_t *c);
* Returns the next event or error from the server, if one is
* available, or returns @c NULL otherwise. If no event is available, that
* might be because an I/O error like connection close occurred while
* Returns the next event or error from the server, if one is
* available, or returns @c NULL otherwise. If no event is available, that
* might be because an I/O error like connection close occurred while
- * attempting to read the next event. The @p error parameter is a
- * pointer to an int to be filled in with the I/O error status of the
- * operation. If @p error is @c NULL, terminates the application when an
- * I/O error occurs.
+ * attempting to read the next event, in which case the connection is
+ * shut down when this function returns.
*/
*/
-xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c
, int *error
);
+xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c);
/**
* @brief Return the error for a request, or NULL if none can ever arrive.
/**
* @brief Return the error for a request, or NULL if none can ever arrive.
diff --git
a/src/xcb_in.c
b/src/xcb_in.c
index
41764df
..
b252ffc
100644
(file)
--- a/
src/xcb_in.c
+++ b/
src/xcb_in.c
@@
-395,33
+395,18
@@
xcb_generic_event_t *xcb_wait_for_event(xcb_connection_t *c)
return ret;
}
return ret;
}
-xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c
, int *error
)
+xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c)
{
{
+ xcb_generic_event_t *ret = 0;
if(!c->has_error)
{
if(!c->has_error)
{
- xcb_generic_event_t *ret = 0;
- int success;
_xcb_lock_io(c);
/* FIXME: follow X meets Z architecture changes. */
_xcb_lock_io(c);
/* FIXME: follow X meets Z architecture changes. */
- success = _xcb_in_read(c);
- if(success)
+ if(_xcb_in_read(c)) /* _xcb_in_read shuts down the connection on error */
ret = get_event(c);
_xcb_unlock_io(c);
ret = get_event(c);
_xcb_unlock_io(c);
- if(success)
- {
- if(error)
- *error = 0;
- return ret;
- }
- }
- if(error)
- *error = -1;
- else
- {
- fprintf(stderr, "xcb_poll_for_event: I/O error occured, but no handler provided.\n");
- abort();
}
}
- return
0
;
+ return
ret
;
}
xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t cookie)
}
xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t cookie)