1 /*- 2 * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org> 3 * Copyright (c) 1997 FreeBSD Inc. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28 #define _GNU_SOURCE 29 #include "setlocale.h" 30 31 #define LCTIME_SIZE (sizeof(struct lc_time_T) / sizeof(char *)) 32 33 const struct lc_time_T _C_time_locale = { 34 { 35 "Jan", "Feb", "Mar", "Apr", "May", "Jun", 36 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" 37 }, { 38 "January", "February", "March", "April", "May", "June", 39 "July", "August", "September", "October", "November", "December" 40 }, { 41 "Sun", "Mon", "Tue", "Wed", 42 "Thu", "Fri", "Sat" 43 }, { 44 "Sunday", "Monday", "Tuesday", "Wednesday", 45 "Thursday", "Friday", "Saturday" 46 }, 47 48 /* X_fmt */ 49 "%H:%M:%S", 50 51 /* 52 * x_fmt 53 * Since the C language standard calls for 54 * "date, using locale's date format," anything goes. 55 * Using just numbers (as here) makes Quakers happier; 56 * it's also compatible with SVR4. 57 */ 58 "%m/%d/%y", 59 60 /* 61 * c_fmt 62 */ 63 "%a %b %e %H:%M:%S %Y", 64 65 /* am pm */ 66 { "AM", "PM" }, 67 68 /* date_fmt */ 69 "%a %b %e %H:%M:%S %Z %Y", 70 71 /* alt_month 72 * Standalone months forms for %OB 73 */ 74 { 75 "January", "February", "March", "April", "May", "June", 76 "July", "August", "September", "October", "November", "December" 77 }, 78 79 /* md_order 80 * Month / day order in dates 81 */ 82 "md", 83 84 /* ampm_fmt 85 * To determine 12-hour clock format time (empty, if N/A) 86 */ 87 "%I:%M:%S %p", 88 89 /* era 90 * Era. This and the following entries are used if the alternative 91 * date format is specified in strftime 92 */ 93 "", 94 95 /* era_d_fmt 96 * Era date format used with the %Ex 97 */ 98 "", 99 100 /* era_d_t_fmt 101 * Era date/time format (%Ec) 102 */ 103 "", 104 105 /* era_t_fmt 106 * Era time format (%EX) 107 */ 108 "", 109 110 /* alt_digits 111 * Alternate digits used if %O format prefix is specified 112 */ 113 "" 114 #ifdef __HAVE_LOCALE_INFO_EXTENDED__ 115 , "ASCII", /* codeset */ 116 { 117 L"Jan", L"Feb", L"Mar", L"Apr", L"May", L"Jun", 118 L"Jul", L"Aug", L"Sep", L"Oct", L"Nov", L"Dec" 119 }, { 120 L"January", L"February", L"March", L"April", L"May", L"June", 121 L"July", L"August", L"September", L"October", L"November", 122 L"December" 123 }, { 124 L"Sun", L"Mon", L"Tue", L"Wed", 125 L"Thu", L"Fri", L"Sat" 126 }, { 127 L"Sunday", L"Monday", L"Tuesday", L"Wednesday", 128 L"Thursday", L"Friday", L"Saturday" 129 }, 130 L"%H:%M:%S", 131 L"%m/%d/%y", 132 L"%a %b %e %H:%M:%S %Y", 133 { L"AM", L"PM" }, 134 L"%a %b %e %H:%M:%S %Z %Y", 135 L"%I:%M:%S %p", 136 L"", 137 L"", 138 L"", 139 L"", 140 L"" 141 #endif 142 }; 143 144