X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcb_util.c;h=fde4f85f10a132658b1fad6f1db561871f85cdfe;hb=b64cd0df884e7901ff13def0272df74962035920;hp=63ea75193ffd3bc1b159155e3a7d104fd0a6666e;hpb=1c4717de367fe3bf1cf56bd8ef2bd30586bed023;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_util.c b/src/xcb_util.c index 63ea751..fde4f85 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -28,10 +28,6 @@ #include #include #include -#ifdef DNETCONN -#include -#include -#endif #include #include #include @@ -54,6 +50,12 @@ #include "xcbext.h" #include "xcbint.h" +/* must be after "xcbint.h" to get autoconf #defines */ +#if defined(HAVE_TSOL_LABEL_H) && defined(HAVE_IS_SYSTEM_LABELED) +# include +# include +#endif + int xcb_popcount(uint32_t mask) { uint32_t y; @@ -62,6 +64,16 @@ int xcb_popcount(uint32_t mask) return ((y + (y >> 3)) & 030707070707) % 077; } +int xcb_sumof(uint8_t *list, int len) +{ + int i, s = 0; + for(i=0; in_length; - memcpy(addr.sdn_add.a_addr, nodeaddr->n_addr, addr.sdn_add.a_len); - - addr.sdn_objnamel = sprintf((char *)addr.sdn_objname, "X$X%d", port); - if(addr.sdn_objnamel < 0) - return -1; - addr.sdn_objnum = 0; - - fd = _xcb_socket(PF_DECnet, SOCK_STREAM, 0); - if(fd == -1) - return -1; - - memset(&accessdata, 0, sizeof(accessdata)); - accessdata.acc_accl = sprintf((char*)accessdata.acc_acc, "%d", getuid()); - if(accessdata.acc_accl < 0) - return -1; - setsockopt(fd, DNPROTO_NSP, SO_CONACCESS, &accessdata, sizeof(accessdata)); - - if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) { - close(fd); - return -1; - } - return fd; -} -#endif static int _xcb_open_tcp(const char *host, char *protocol, const unsigned short port) {