This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: representing charsets


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 nlsfuncs.cc 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
values.

> 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

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]