locale_t (linux?) question

Gary Jennejohn garyj at jennejohn.org
Fri May 26 01:48:23 PDT 2006


Serge Gagnon writes:
> I searche on google about this locale_t to find some information to know 
> how I can fix it but I didn't found anything useful. Just that locale_t can 
> be a structure or a pointer on a structure... Not really helpful.
> 
> Is there someone here who can help me with this ?
> 

In the Linux sources I have locale_t is a typedef for __localte_t and is
set in /usr/include/locale.h. __locale_t is defined in
/usr/include/xlocale.h as a pointer to a struct __locale_struct which
contains a bunch of pointers. This is what it looks like:

/* Structure for reentrant locale using functions.  This is an
   (almost) opaque type for the user level programs.  The file and
   this data structure is not standardized.  Don't rely on it.  It can
   go away without warning.  */
typedef struct __locale_struct
{
  /* Note: LC_ALL is not a valid index into this array.  */
  struct locale_data *__locales[13]; /* 13 = __LC_LAST. */

  /* To increase the speed of this solution we add some special members.  */
  const unsigned short int *__ctype_b;
  const int *__ctype_tolower;
  const int *__ctype_toupper;

  /* Note: LC_ALL is not a valid index into this array.  */
  const char *__names[13];
} *__locale_t;

Strangely enough I couldn't find a definition of locale_data in any of the
7 trees which I have.

---
Gary Jennejohn / garyjATjennejohnDOTorg gjATfreebsdDOTorg garyjATdenxDOTde



More information about the freebsd-ports mailing list