Re: [dwm] dmenu patches: case insensivity, common keys, emacs keys

From: Nico Golde <nico_AT_ngolde.de>
Date: Sat, 22 Sep 2007 18:36:17 +0200

Hi,
* Micha?? Janeczek <janeczek_AT_gmail.com> [2007-09-22 18:02]:
[...]
> +int (*comparefunc)(const char*, const char*, size_t) = strncmp;
[...]
> for(i = allitems; i; i=i->next)
> - if(plen && strncmp(pattern, i->text, plen)
> + if(plen && comparefunc(pattern, i->text, plen)
[...]
> + else if(!strcmp(argv[i], "-c")) {
> + comparefunc = strncasecmp;
> + }
> else if(!strcmp(argv[i], "-fn")) {
> if(++i < argc) font = argv[i];

What is the reason to use a function pointer here to use
different compare functions under the same name besides that
it becomes more difficult to track what the code actually
does?
Kind regards
Nico

-- 
Nico Golde - http://ngolde.de - nion@jabber.ccc.de - GPG: 0x73647CFF
For security reasons, all text in this mail is double-rot13 encrypted.

Received on Sat Sep 22 2007 - 18:36:16 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:54:22 UTC