RPM Community Forums

Mailing List Message of <popt-devel>

Finalizing an API for POPT_ARGS_BITSET

From: Jeff Johnson <n3npq@mac.com>
Date: Sun 26 Jul 2009 - 21:34:14 CEST
Message-id: <69761360-AA44-4FB9-88CC-7A8782A4AC0D@mac.com>
Attached is a toy program to illustrate the new POPT_ARG_BITSET API in  

The toy program uses /usr/share/dict/words as a attribute
universe, and checks arguments to see if they are in the
attribute dictionary.

Here's some usage examples

	$ wc -l /usr/share/dict/words
	479827 /usr/share/dict/words
	$ ./tdict @@@@ XyZZy
	===== No words are in /usr/share/dict/words
	@@@@:	NO
	XyZZy:	NO
	$ ./tdict foo bar baz @@@@ XyZZy
	===== Some words are in /usr/share/dict/words
	foo:	YES
	bar:	YES
	baz:	YES
	@@@@:	NO
	XyZZy:	NO
	===== poptBits N:959654 M:1439481 K:2 (176Kb) total(5) = hits(3) +  

The API doesn't look too bad imho. Other opinions?

Choosing a reasonably sane default for the Bloom filter's N/M/K
parameters in popt will still need some adjustment.

73 de Jeff

  • application/octet-stream attachment: tdict.c
Received on Sun Jul 26 21:34:54 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.