Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=xbdmenu.git;a=commitdiff;h=aa68ab29f13cbd3d82116c416105bced9650566a

commit aa68ab29f13cbd3d82116c416105bced9650566a
Author: James Buren <[email protected]>
Date:   Mon Mar 16 12:19:53 2009 -0500

mem.c
* add xcb connect/disconnect reference wrappers

diff --git a/mem.c b/mem.c
index cc77561..93e1f2c 100644
--- a/mem.c
+++ b/mem.c
@@ -3,6 +3,7 @@
#include <string.h>
#include <errno.h>
#include <gd.h>
+#include <xcb/xcb.h>
#include "mem.h"
#include "env.h"
#include "menu.h"
@@ -100,6 +101,31 @@ extern void free_image(gdImagePtr ptr)
}
}

+extern xcb_connection_t *z_xcb_connect(const char *dn,int *sp)
+{
+       xcb_connection_t *con = xcb_connect(dn,sp);
+       if(xcb_connection_has_error(con))
+       {
+               printf("Failed to open connection to X server.\n");
+               exit(EXIT_FAILURE);
+       }
+       ++rc;
+       return(con);
+}
+
+extern void z_xcb_disconnect(xcb_connection_t *con)
+{
+       if(con==NULL)
+       {
+               printf("Invalid pointer passed to z_xcb_disconnect().\n");
+       }
+       else
+       {
+               xcb_disconnect(con);
+               --rc;
+       }
+}
+
/* cleanup global variables */
extern void cleanup(void)
{
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to