Commit Graph

11 Commits

Author SHA1 Message Date
Corinna Vinschen 3728c79d48 * locale.cc (print_locale_with_codeset): Align printing of locale names
to POSIX.
2011-05-03 10:34:25 +00:00
Corinna Vinschen 71d8f118da * loadlib.h: New header implementing safe LoadLibrary calls.
Include throughout files using LoadLibrary function.
	* cygcheck.cc (dump_sysinfo): Retrieve kernel32.dll handle via
	GetModuleHandle, rather than using LoadLibrary.
	* cygpath.cc (get_long_name): Ditto.
	(do_sysfolders): Append .dll suffix in LoadLibrary call.
	* ldh.cc (WinMain): Use LoadLibraryExW with DONT_RESOLVE_DLL_REFERENCES
	to avoid loading malicious library code.
	* locale.cc (print_locale_with_codeset): Change way to retrieve
	kernel32.dll path.
2010-08-28 11:22:37 +00:00
Corinna Vinschen 22b6e8101e * locale.cc (print_lc_xxx_charset): Remove.
(enum type_t): Change according to the fact that nl_langinfo now returns
	all locale category values.
	(lc_ctype_names): Add new category members.  Redefine for exclusive
	nl_langinfo usage.
	(lc_numeric_names): Ditto.
	(lc_time_names): Ditto.
	(lc_collate_names): Ditto.
	(lc_monetary_names): Ditto.
	(lc_messages_names): Ditto.
	(print_lc): Change switch according to new type_t values.
2010-04-28 10:00:40 +00:00
Corinna Vinschen 0b66e4d7aa * locale.cc (print_charmaps): Add EUC-CN and GB2312. 2010-03-27 21:08:02 +00:00
Corinna Vinschen 536ad25322 * locale.cc (add_locale_alias_locales): Always use loc_num at function
start to avoid confusing bsearch.
2010-03-23 21:26:03 +00:00
Corinna Vinschen 1399e29a1f * locale.cc: Revert accidental checkin of unfinished changes. 2010-03-23 21:20:31 +00:00
Corinna Vinschen 1d4c87a15d * locale.cc (print_locale_with_codeset): Drop redundant name parameter.
Simplify creating locale string.  Add "@" in case of a modifier.
	(print_locale): Drop name parameter in calls to
	print_locale_with_codeset.
2010-03-23 21:01:01 +00:00
Corinna Vinschen a2036998b1 * locale.cc (printlocale): Remove.
(loc_t): New type to keep locale information for printing.
	(print_codeset): New function to print codeset as on Linux.
	(print_locale_with_codeset): New function to print single locale.
	Print verbose style as the Linux locale(1) tool.
	(print_locale): New function to print single locale plus its UTF-8
	variation, if available.
	(compare_locales): New helper function for bsearch and qsort on loc_t.
	(add_locale): New function to store locale in loc_t array.
	(add_locale_alias_locales): New function to store locales from
	locale.alias file in loc_t.
	(print_all_locales): Call add_locale instead of printlocale.
	Call add_locale_alias_locales, sort locales alphabetically and print
	them.
2010-02-23 14:07:08 +00:00
Corinna Vinschen bd87c87f81 * locale.cc (lc_time_names): Add "date_fmt" entry. 2010-02-22 10:56:00 +00:00
Corinna Vinschen f13fe16475 * locale.cc (print_lc_mstrings): New function to print
semicolon-separated strings.
	(enum type_t): New type is_sepstrings_linf.
	(lc_time_names): Change type of era and alt_digits entry to
	is_sepstrings_linf.
	(print_lc): Add case for is_sepstrings_linf and call print_lc_mstrings
	in that case.
2010-02-19 17:27:05 +00:00
Corinna Vinschen ce4f5f76ab * Makefile.in (CYGWIN_BINS): Rename getlocale to locale.
* getlocale.c: Rename to ...
	* locale.cc: Revamp to add full functionality of POSIX locale(1) tool,
	as far as Cygwin supports it.
	* utils.sgml (getlocale): Move and rename to ...
	(locale): Accommodate new functionality.
2010-02-17 15:01:56 +00:00