[clug] Looking for string indexing library
jepri at webone.com.au
Mon May 24 11:40:26 GMT 2004
> Jepri wrote:
>> I've got a list of city names (approx 3 million) and I need to write
>> some C code to search through them all quickly.
>> I'm accessing them by by packing them all into a file (with null
>> termination), and then mmaping the file.
>> So the string indexing library would have to accept pointers to the
>> strings, not copy them into some internal store, be able to do
>> substring lookups, and ideally be able to return a key or index value
>> for the string it finds. Even better would be if it could save its
>> index and hot-start from that.
> Not that this is really news to you, but I'd be doing this in Perl... :P
I'd love to do this in Perl, but this is a support library to be linked
into other apps... and only C can do that.
I considered embedding Perl, but pulling a few megs of interpreter into
a 100kb library is a bit much, even for me.
> P.S.: Sorry if this comes in HTML, I'm still taking my new client
Looks just fine and texty here.
More information about the linux