예제 #1
0
L_ctype_t* _Locale_ctype_create(const char * name, struct _Locale_name_hint* hint) {
  const union locale_data_value *ctypes;
  L_ctype_t* lctype;

  lctype = (L_ctype_t*)malloc(sizeof(L_ctype_t));
  lctype->gcc_data = _Category_create(name, LC_CTYPE);
  ctypes = lctype->gcc_data->values;

  lctype->__class = (_Locale_mask_t *)
    (ctypes[_NL_ITEM_INDEX (_NL_CTYPE_CLASS)] .string) + 128;
#ifdef _STLP_GLIBC_LOCALE_2
  lctype->__tolower = (const int *)
    (ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOLOWER)].string) + 128;
  lctype->__toupper = (const int *)
    (ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOUPPER)].string) + 128;
#else
# if BYTE_ORDER == BIG_ENDIAN
  lctype->__tolower = (const int *)
    (ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOLOWER_EB)].string) + 128;
  lctype->__toupper = (const int *)
    (ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOUPPER_EB)].string) + 128;
# elif BYTE_ORDER == LITTLE_ENDIAN
  lctype->__tolower = (const int *)
    (ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOLOWER_EL)].string) + 128;
  lctype->__toupper = (const int *)
    (ctypes[_NL_ITEM_INDEX (_NL_CTYPE_TOUPPER_EL)].string) + 128;
# else
#  error bizarre byte order
# endif
#endif /* _STLP_GLIBC_LOCALE_2 */
  return lctype;
}
예제 #2
0
L_collate_t* _Locale_collate_create(const char * name, struct _Locale_name_hint* hint) {
  L_collate_t*  lcollate = (L_collate_t*)malloc(sizeof(L_collate_t));
  lcollate->gcc_data = _Category_create(name, LC_COLLATE);
  return lcollate;
}
예제 #3
0
L_messages_t* _Locale_messages_create(const char * name, struct _Locale_name_hint* hint) {
  L_messages_t*  lmsg = (L_messages_t*)malloc(sizeof(L_messages_t));
  lmsg->gcc_data = _Category_create(name, LC_MESSAGES);
  return lmsg;
}
예제 #4
0
L_time_t* _Locale_time_create(const char * name, struct _Locale_name_hint* hint) {
  L_time_t*  ltime = (L_time_t*)malloc(sizeof(L_time_t));
  ltime->gcc_data = _Category_create(name, LC_TIME);
  return ltime;
}
예제 #5
0
L_monetary_t* _Locale_monetary_create(const char* name, struct _Locale_name_hint* hint) {
  L_monetary_t* lmon = (L_monetary_t*)malloc(sizeof(L_monetary_t));
  lmon->gcc_data = _Category_create(name, LC_MONETARY);
  return lmon;
}
예제 #6
0
L_numeric_t*
_Locale_numeric_create(const char * name, struct _Locale_name_hint* hint) {
  L_numeric_t*  lnum = (L_numeric_t*)malloc(sizeof(L_numeric_t));
  lnum->gcc_data = _Category_create(name, LC_NUMERIC);
  return lnum;
}
예제 #7
0
void*
_Locale_numeric_create(const char * name) {
  L_numeric_t*  lnum = (L_numeric_t*)malloc(sizeof(L_numeric_t));
  lnum->gcc_data = _Category_create(name, LC_NUMERIC);
  return (void*)lnum; 
}