representing charsets

Corinna Vinschen
Fri Apr 2 21:17:00 GMT 2010

On Apr  2 22:00, Andy Koppe wrote:
> Corinna Vinschen:
> >> Unfortunately I can't see where to store the enums for the locale
> >> category codesets, since __part_load_locale in newlib and the new
> >> rebase_locale_buf in assume that the various lc_*_T
> >> structs consist entirely of pointers.
> >
> > And that should stay that way.  This is consistent with the way the
> > data is loaded from files.  There doesn't speak anything against
> > storing a pointer to the enum in the structure, though.
> So that enum would need to be placed in the the various _local_bufs
> then, which means it would need to appear in binary form in the locale
> file format on non-Cygwin systems. Can we do that?

Not necessarily.  It can be placed as chrset string in the file and then
overwritten analog to the lmonetary.c overwriting of char with numerical

> Also, I belatedly realised why the charsets might be represented as
> strings in the first place: because charset definitions could be read
> from disk rather than being hardcoded as they are in newlib. Should I
> still pursue the enum idea or go back to your idea of passing a
> pointer to the relevant charmap table (if any) around?

Whatever you like.  Eventually we should get rid of the charset
parameter anyway, as soon as struct reent has a pointer to a locale_t.

> Thanks for the patch.

No worries.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

More information about the Cygwin-developers mailing list