qsort.c in ldb?

simo idra at samba.org
Mon Aug 27 12:27:54 GMT 2007


On Mon, 2007-08-27 at 20:49 +1000, Andrew Bartlett wrote:
> On Mon, 2007-08-27 at 12:46 +0200, Volker Lendecke wrote:
> > Hi, Simo!
> > 
> > Quick question: Why do we have qsort.c in lib/ldb/common/?
> > IIRC qsort is required even in ANSI C. I can see a wrapper
> > function, but the whole thing?
> 
> The problem with standard qsort() is the lack of a context pointer.
> Some of the comparison functions need access an 'ldb' or the like. 

Yes, I was very reluctant but I could see no other way and using a
global variable was not acceptable.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: idra at samba.org
http://samba.org



More information about the samba-technical mailing list