about summary refs log tree commit diff stats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/main.c b/main.c
index a51ba88..6f60c9b 100644
--- a/main.c
+++ b/main.c
@@ -62,25 +62,6 @@ scan()
 		XFree(wins);
 }
 
-static int
-winprop(Window w, Atom a, Atom t, long l, unsigned char **prop)
-{
-	int status, format;
-	unsigned long res, extra;
-	Atom real;
-
-	status = XGetWindowProperty(dpy, w, a, 0L, l, False, t, &real, &format,
-			&res, &extra, prop);
-
-	if(status != Success || *prop == 0) {
-		return 0;
-	}
-	if(res == 0) {
-		free((void *) *prop);
-	}
-	return res;
-}
-
 /*
  * Startup Error handler to check if another window manager
  * is already running.
@@ -111,21 +92,20 @@ Window root, barwin;
 int
 getproto(Window w)
 {
-	int protos = 0;
+	int status, format, protos = 0;
 	int i;
-	long res;
-	Atom *protocols;
+	unsigned long extra, res;
+	Atom *protocols, real;
 
-	res = winprop(w, wmatom[WMProtocols], XA_ATOM, 20L,
-			((unsigned char **)&protocols));
-	if(res <= 0) {
+	status = XGetWindowProperty(dpy, w, wmatom[WMProtocols], 0L, 20L,
+			False, XA_ATOM, &real, &format, &res, &extra, (unsigned char **)&protocols);
+	if(status != Success || protocols == 0)
 		return protos;
-	}
 	for(i = 0; i < res; i++) {
 		if(protocols[i] == wmatom[WMDelete])
 			protos |= PROTODELWIN;
 	}
-	free((char *) protocols);
+	free(protocols);
 	return protos;
 }
 
.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
{
  "name": "blotbotboot",
  "version": "1.0.0",
  "description": "small and mostly silent irc bot",
  "main": "bot.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "elioat",
  "license": "UNLICENSE",
  "dependencies": {
    "irc": "^0.5.2"
  }
}