[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gperf-bugs] enhanced version of gperf to handle wide-character stri
From: |
Bruno Haible |
Subject: |
Re: [Gperf-bugs] enhanced version of gperf to handle wide-character strings |
Date: |
Wed, 13 Dec 2000 14:52:19 +0100 (CET) |
Dan Field writes:
> I would like to store and look-up key strings consisting of wide characters
> (16 bits for UCS2 and UTF16). Right now, it is impossible to specify the
> key strings with any type other than char*. Do you know anyone who as
> enhanced gperf to deal with wide character types or even an array of
> arbitrary types? This would mean the ability to redefine the string
> equality function of course and impact the switch construct.
>
> Oh yes, I've been looking at version 2.7.2 which I believe is the latest.
Hello Dan,
The goerf version 2.7.2 contains in the tests directory a sample
called "lang-ucs2". It demonstrates how to use UCS-2, UTF-16 or any
other binary data type with gperf. Basically, you produce the binary
representation as a "const char *" yourself, then you use gperf with
the option -l. The latter option forces the use of memcmp instead of
strcmp or strncmp.
Bruno