Home | History | Annotate | Download | only in c_locale_win32

Lines Matching defs:ltime

272 _Locale_lcid_t* _Locale_get_time_hint(_Locale_time_t* ltime)
273 { return (ltime != 0) ? &ltime->lc : 0; }
719 _Locale_time_t *ltime = (_Locale_time_t*)malloc(sizeof(_Locale_time_t));
721 if (!ltime) { *__err_code = _STLP_LOC_NO_MEMORY; return ltime; }
722 memset(ltime, 0, sizeof(_Locale_time_t));
724 if (__GetLCIDFromName(name, &ltime->lc.id, ltime->cp, lc_hint) == -1)
725 { free(ltime); *__err_code = _STLP_LOC_UNKNOWN_NAME; return NULL; }
728 if ( ltime->lc.id == INVARIANT_LCID && name[0] == 'C' && name[1] == 0 )
729 { ltime->lc.id = 0x409; }
733 size = GetLocaleInfoA(ltime->lc.id, month, NULL, 0);
734 ltime->month[month - LOCALE_SMONTHNAME1] = (char*)malloc(size);
735 if (!ltime->month[month - LOCALE_SMONTHNAME1])
736 { _Locale_time_destroy(ltime); *__err_code = _STLP_LOC_NO_MEMORY; return NULL; }
737 __GetLocaleInfoUsingACP(ltime->lc.id, ltime->cp, month, ltime->month[month - LOCALE_SMONTHNAME1], size, wbuf80, 80);
741 size = GetLocaleInfoA(ltime->lc.id, month, NULL, 0);
742 ltime->abbrev_month[month - LOCALE_SABBREVMONTHNAME1] = (char*)malloc(size);
743 if (!ltime->abbrev_month[month - LOCALE_SABBREVMONTHNAME1])
744 { _Locale_time_destroy(ltime); *__err_code = _STLP_LOC_NO_MEMORY; return NULL; }
745 __GetLocaleInfoUsingACP(ltime->lc.id, ltime->cp, month, ltime->abbrev_month[month - LOCALE_SABBREVMONTHNAME1], size, wbuf80, 80);
750 size = GetLocaleInfoA(ltime->lc.id, dayofweek, NULL, 0);
751 ltime->dayofweek[dayindex] = (char*)malloc(size);
752 if (!ltime->dayofweek[dayindex])
753 { _Locale_time_destroy(ltime); *__err_code = _STLP_LOC_NO_MEMORY; return NULL; }
754 __GetLocaleInfoUsingACP(ltime->lc.id, ltime->cp, dayofweek, ltime->dayofweek[dayindex], size, wbuf80, 80);
759 size = GetLocaleInfoA(ltime->lc.id, dayofweek, NULL, 0);
760 ltime->abbrev_dayofweek[dayindex] = (char*)malloc(size);
761 if (!ltime->abbrev_dayofweek[dayindex])
762 { _Locale_time_destroy(ltime); *__err_code = _STLP_LOC_NO_MEMORY; return NULL; }
763 __GetLocaleInfoUsingACP(ltime->lc.id, ltime->cp, dayofweek, ltime->abbrev_dayofweek[dayindex], size, wbuf80, 80);
766 __GetLocaleInfoUsingACP(ltime->lc.id, ltime->cp, LOCALE_SSHORTDATE, fmt80, 80, wbuf80, 80);
768 ltime->date_format = (char*)malloc(size);
769 if (!ltime->date_format)
770 { _Locale_time_destroy(ltime); *__err_code = _STLP_LOC_NO_MEMORY; return NULL; }
771 __ConvertDate(fmt80, ltime->date_format, size);
773 __GetLocaleInfoUsingACP(ltime->lc.id, ltime->cp, LOCALE_SLONGDATE, fmt80, 80, wbuf80, 80);
775 ltime->long_date_format = (char*)malloc(size);
776 if (!ltime->long_date_format)
777 { _Locale_time_destroy(ltime);*__err_code = _STLP_LOC_NO_MEMORY; return NULL; }
778 __ConvertDate(fmt80, ltime->long_date_format, size);
780 __GetLocaleInfoUsingACP(ltime->lc.id, ltime->cp, LOCALE_STIMEFORMAT, fmt80, 80, wbuf80, 80);
782 ltime->time_format = (char*)malloc(size);
783 if (!ltime->time_format)
784 { _Locale_time_destroy(ltime); *__err_code = _STLP_LOC_NO_MEMORY; return NULL; }
785 __ConvertTime(fmt80, ltime->time_format, size);
788 length = strlen(ltime->date_format) + strlen(ltime->time_format) + 1 /* space */ + 1 /* trailing 0 */;
789 ltime->date_time_format = (char*)malloc(length);
790 if (!ltime->date_time_format)
791 { _Locale_time_destroy(ltime); *__err_code = _STLP_LOC_NO_MEMORY; return NULL; }
792 _STLP_STRCPY(ltime->date_time_format, length, ltime->date_format);
793 _STLP_STRCAT(ltime->date_time_format, length, " ");
794 _STLP_STRCAT(ltime->date_time_format, length, ltime->time_format);
797 length = strlen(ltime->long_date_format) + strlen(ltime->time_format) + 1 /* space */ + 1 /* trailing 0 */;
798 ltime->long_date_time_format = (char*)malloc(length);
799 if (!ltime->long_date_time_format)
800 { _Locale_time_destroy(ltime); *__err_code = _STLP_LOC_NO_MEMORY; return NULL; }
801 _STLP_STRCPY(ltime->long_date_time_format, length, ltime->long_date_format);
802 _STLP_STRCAT(ltime->long_date_time_format, length, " ");
803 _STLP_STRCAT(ltime->long_date_time_format, length, ltime->time_format);
805 __GetLocaleInfoUsingACP(ltime->lc.id, ltime->cp, LOCALE_S1159, ltime->am, 9, wbuf80, 80);
806 __GetLocaleInfoUsingACP(ltime->lc.id, ltime->cp, LOCALE_S2359, ltime->pm, 9, wbuf80, 80);
808 return ltime;
921 char const* _Locale_time_name(const _Locale_time_t* ltime, char* buf)
922 { return __GetLocaleName(ltime->lc.id, ltime->cp, buf); }
949 void _Locale_time_destroy(_Locale_time_t* ltime) {
951 if (!ltime) return;
954 if (ltime->month[i]) free(ltime->month[i]);
955 if (ltime->abbrev_month[i]) free(ltime->abbrev_month[i]);
959 if (ltime->dayofweek[i]) free(ltime->dayofweek[i]);
960 if (ltime->abbrev_dayofweek[i]) free(ltime->abbrev_dayofweek[i]);
963 if (ltime->date_format) free(ltime->date_format);
964 if (ltime->long_date_format) free(ltime->long_date_format);
965 if (ltime->time_format) free(ltime->time_format);
966 if (ltime->date_time_format) free(ltime->date_time_format);
967 if (ltime->long_date_time_format) free(ltime->long_date_time_format);
969 free(ltime);
1264 const char * _Locale_full_monthname(_Locale_time_t * ltime, int month) {
1265 const char **names = (const char**)ltime->month;
1269 const char * _Locale_abbrev_monthname(_Locale_time_t * ltime, int month) {
1270 const char **names = (const char**)ltime->abbrev_month;
1274 const char * _Locale_full_dayofweek(_Locale_time_t * ltime, int day) {
1275 const char **names = (const char**)ltime->dayofweek;
1279 const char * _Locale_abbrev_dayofweek(_Locale_time_t * ltime, int day) {
1280 const char **names = (const char**)ltime->abbrev_dayofweek;
1284 const char* _Locale_d_t_fmt(_Locale_time_t* ltime)
1285 { return ltime->date_time_format; }
1287 const char* _Locale_long_d_t_fmt(_Locale_time_t* ltime)
1288 { return ltime->long_date_time_format; }
1290 const char* _Locale_d_fmt(_Locale_time_t* ltime)
1291 { return ltime->date_format; }
1293 const char* _Locale_long_d_fmt(_Locale_time_t* ltime)
1294 { return ltime->long_date_format; }
1296 const char* _Locale_t_fmt(_Locale_time_t* ltime)
1297 { return ltime->time_format; }
1299 const char* _Locale_am_str(_Locale_time_t* ltime)
1300 { return ltime->am; }
1302 const char* _Locale_pm_str(_Locale_time_t* ltime)
1303 { return ltime->pm; }