wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

getprop_long.c (645B)


      1 /* Copyright ©2007-2010 Kris Maglione <maglione.k at Gmail>
      2  * See LICENSE file for license details.
      3  */
      4 #include "../x11.h"
      5 
      6 ulong
      7 getprop_long(Window *w, const char *prop, const char *type,
      8 	     ulong offset, long **ret, ulong length) {
      9 	Atom actual;
     10 	ulong n;
     11 	int format;
     12 
     13 	n = getprop(w, prop, type, &actual, &format, offset, (uchar**)ret, length);
     14 	if(n == 0 || format == 32 && xatom(type) == actual)
     15 		return n;
     16 	free(*ret);
     17 	*ret = 0;
     18 	return 0;
     19 }
     20 
     21 ulong
     22 getprop_ulong(Window *w, const char *prop, const char *type,
     23 	      ulong offset, ulong **ret, ulong length) {
     24 	return getprop_long(w, prop, type, offset, (long**)ret, length);
     25 }
     26