summaryrefslogtreecommitdiff
path: root/src/xcb_xid.c
diff options
context:
space:
mode:
authorJosh Triplett <josh@freedesktop.org>2006-09-23 12:22:22 -0700
committerJosh Triplett <josh@freedesktop.org>2006-09-23 12:22:22 -0700
commita3bd6f4760b5b3f5f360a690920839646e2b9d06 (patch)
tree4a7ad7c07bc77f16de5c344aac65b2b1ecce8e35 /src/xcb_xid.c
parentca72e777740f917753f3c180fdfdb55df91c09c4 (diff)
The Great XCB Renaming
Rename API to follow a new naming convention: * XCB_CONSTANTS_UPPERCASE_WITH_UNDERSCORES * xcb_functions_lowercase_with_underscores * xcb_types_lowercase_with_underscores_and_suffix_t * expand all abbreviations like "req", "rep", and "iter" Word boundaries for the names in the protocol descriptions fall: * Wherever the protocol descriptions already have an underscore * Between a lowercase letter and a subsequent uppercase letter * Before the last uppercase letter in a string of uppercase letters followed by a lowercase letter (such as in LSBFirst between LSB and First) * Before and after a string of digits (with exceptions for sized types like xcb_char2b_t and xcb_glx_float32_t to match the stdint.h convention) Also fix up some particular naming issues: * Rename shape_op and shape_kind to drop the "shape_" prefix, since otherwise these types end up as xcb_shape_shape_{op,kind}_t. * Remove leading underscores from enums in the GLX protocol description, previously needed to ensure a word separator, but now redundant. This renaming breaks code written for the previous API naming convention. The scripts in XCB's tools directory will convert code written for the old API to use the new API; they work well enough that we used them to convert the non-program-generated code in XCB, and when run on the old program-generated code, they almost exactly reproduce the new program-generated code (modulo whitespace and bugs in the old code generator). Authors: Vincent Torri, Thomas Hunger, Josh Triplett
Diffstat (limited to 'src/xcb_xid.c')
-rw-r--r--src/xcb_xid.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/xcb_xid.c b/src/xcb_xid.c
index a2e7dec..6ca6bd9 100644
--- a/src/xcb_xid.c
+++ b/src/xcb_xid.c
@@ -33,16 +33,16 @@
/* Public interface */
-CARD32 XCBGenerateID(XCBConnection *c)
+uint32_t xcb_generate_id(xcb_connection_t *c)
{
- CARD32 ret;
+ uint32_t ret;
if(c->has_error)
return -1;
pthread_mutex_lock(&c->xid.lock);
if(c->xid.last == c->xid.max)
{
- XCBXCMiscGetXIDRangeRep *range;
- range = XCBXCMiscGetXIDRangeReply(c, XCBXCMiscGetXIDRange(c), 0);
+ xcb_xc_misc_get_xid_range_reply_t *range;
+ range = xcb_xc_misc_get_xid_range_reply(c, xcb_xc_misc_get_xid_range(c), 0);
if(!range)
{
pthread_mutex_unlock(&c->xid.lock);
@@ -60,7 +60,7 @@ CARD32 XCBGenerateID(XCBConnection *c)
/* Private interface */
-int _xcb_xid_init(XCBConnection *c)
+int _xcb_xid_init(xcb_connection_t *c)
{
if(pthread_mutex_init(&c->xid.lock, 0))
return 0;
@@ -71,7 +71,7 @@ int _xcb_xid_init(XCBConnection *c)
return 1;
}
-void _xcb_xid_destroy(XCBConnection *c)
+void _xcb_xid_destroy(xcb_connection_t *c)
{
pthread_mutex_destroy(&c->xid.lock);
}