From 8e7f8c02a1c6f1a916376f43cbce1271225c2ec7 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 21 Feb 2012 00:59:16 -0600 Subject: cache return values of XAllocNamedColor round trip to the server on every color lookup is pretty bad --- dzen.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'dzen.h') diff --git a/dzen.h b/dzen.h index afc3da2..fa764f9 100644 --- a/dzen.h +++ b/dzen.h @@ -178,3 +178,6 @@ extern void *emalloc(unsigned int size); /* allocates memory, exits on error */ extern void eprint(const char *errstr, ...); /* prints errstr and exits with 1 */ extern char *estrdup(const char *str); /* duplicates str, exits on allocation error */ extern void spawn(const char *arg); /* execute arg */ + +extern long colorcache_get(const char *name); /* gets a cached color */ +extern void colorcache_set(const char *name, long value); /* sets a cached color */ -- cgit v1.2.3-54-g00ecf