Mercurial > hg > xemacs-beta
comparison src/intl-win32.c @ 5118:e0db3c197671 ben-lisp-object
merge up to latest default branch, doesn't compile yet
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sat, 26 Dec 2009 21:18:49 -0600 |
parents | 257b468bf2ca |
children | b3ea9c582280 |
comparison
equal
deleted
inserted
replaced
5117:3742ea8250b5 | 5118:e0db3c197671 |
---|---|
781 | 781 |
782 LOCALE should a language string, or a cons (LANG . SUBLANG). | 782 LOCALE should a language string, or a cons (LANG . SUBLANG). |
783 If SUBLANG is omitted, "SUBLANG_DEFAULT" is used. | 783 If SUBLANG is omitted, "SUBLANG_DEFAULT" is used. |
784 | 784 |
785 Recognized language names are | 785 Recognized language names are |
786 (some may not be recognized if the compiler is older than VC++ 6.0) | 786 \(some may not be recognized if the compiler is older than VC++ 6.0) |
787 | 787 |
788 "AFRIKAANS" | 788 "AFRIKAANS" |
789 "ALBANIAN" | 789 "ALBANIAN" |
790 "ARABIC" | 790 "ARABIC" |
791 "ARMENIAN" | 791 "ARMENIAN" |
856 "URDU" | 856 "URDU" |
857 "UZBEK" | 857 "UZBEK" |
858 "VIETNAMESE" | 858 "VIETNAMESE" |
859 | 859 |
860 Recognized sub-language names are | 860 Recognized sub-language names are |
861 (some may not be recognized if the compiler is older than VC++ 6.0) | 861 \(some may not be recognized if the compiler is older than VC++ 6.0) |
862 | 862 |
863 "ARABIC_ALGERIA" | 863 "ARABIC_ALGERIA" |
864 "ARABIC_BAHRAIN" | 864 "ARABIC_BAHRAIN" |
865 "ARABIC_EGYPT" | 865 "ARABIC_EGYPT" |
866 "ARABIC_IRAQ" | 866 "ARABIC_IRAQ" |
1567 #ifndef HAVE_WCSCMP | 1567 #ifndef HAVE_WCSCMP |
1568 | 1568 |
1569 int | 1569 int |
1570 wcscmp (const wchar_t *s1, const wchar_t *s2) | 1570 wcscmp (const wchar_t *s1, const wchar_t *s2) |
1571 { | 1571 { |
1572 if (s1 == NULL || s2 == NULL) return NULL; | |
1572 while (*s1 != '\0' && *s1 == *s2) | 1573 while (*s1 != '\0' && *s1 == *s2) |
1573 { | 1574 { |
1574 s1++; | 1575 s1++; |
1575 s2++; | 1576 s2++; |
1576 } | 1577 } |
1583 #ifndef HAVE_WCSLEN | 1584 #ifndef HAVE_WCSLEN |
1584 | 1585 |
1585 size_t | 1586 size_t |
1586 wcslen (const wchar_t *str) | 1587 wcslen (const wchar_t *str) |
1587 { | 1588 { |
1589 if (str == NULL) return NULL; | |
1588 const wchar_t *start = str; | 1590 const wchar_t *start = str; |
1589 | 1591 |
1590 while (*str) | 1592 while (*str) |
1591 str++; | 1593 str++; |
1592 | 1594 |
1596 #endif /* not HAVE_WCSLEN */ | 1598 #endif /* not HAVE_WCSLEN */ |
1597 | 1599 |
1598 wchar_t * | 1600 wchar_t * |
1599 wcsncpy (wchar_t *dst0, const wchar_t *src0, size_t count) | 1601 wcsncpy (wchar_t *dst0, const wchar_t *src0, size_t count) |
1600 { | 1602 { |
1603 if (dst0 == NULL || src0 == NULL) return NULL; | |
1601 wchar_t *dscan; | 1604 wchar_t *dscan; |
1602 const wchar_t *sscan; | 1605 const wchar_t *sscan; |
1603 | 1606 |
1604 dscan = dst0; | 1607 dscan = dst0; |
1605 sscan = src0; | 1608 sscan = src0; |
1616 } | 1619 } |
1617 | 1620 |
1618 wchar_t * | 1621 wchar_t * |
1619 wcscpy (wchar_t *dst0, const wchar_t *src0) | 1622 wcscpy (wchar_t *dst0, const wchar_t *src0) |
1620 { | 1623 { |
1624 if (dst0 == NULL || src0 == NULL) return NULL; | |
1621 wchar_t *s = dst0; | 1625 wchar_t *s = dst0; |
1622 | 1626 |
1623 while ((*dst0++ = *src0++)) | 1627 while ((*dst0++ = *src0++)) |
1624 ; | 1628 ; |
1625 | 1629 |
1627 } | 1631 } |
1628 | 1632 |
1629 wchar_t * | 1633 wchar_t * |
1630 wcsdup (const wchar_t *str) | 1634 wcsdup (const wchar_t *str) |
1631 { | 1635 { |
1636 if (str == NULL) return NULL; | |
1632 int len = wcslen (str) + 1; | 1637 int len = wcslen (str) + 1; |
1633 wchar_t *val = xnew_array (wchar_t, len); | 1638 wchar_t *val = xnew_array (wchar_t, len); |
1634 | 1639 |
1635 if (val == 0) return 0; | 1640 if (val == 0) return 0; |
1636 return (wchar_t *) memcpy (val, str, len * sizeof (wchar_t)); | 1641 return (wchar_t *) memcpy (val, str, len * sizeof (wchar_t)); |
2342 } | 2347 } |
2343 | 2348 |
2344 void | 2349 void |
2345 complex_vars_of_intl_win32 (void) | 2350 complex_vars_of_intl_win32 (void) |
2346 { | 2351 { |
2347 Fmake_coding_system | 2352 Fmake_coding_system_internal |
2348 (Qmswindows_unicode, Qunicode, | 2353 (Qmswindows_unicode, Qunicode, |
2349 build_msg_string ("MS Windows Unicode"), | 2354 build_msg_string ("MS Windows Unicode"), |
2350 nconc2 (list4 (Qdocumentation, | 2355 nconc2 (list4 (Qdocumentation, |
2351 build_msg_string ( | 2356 build_msg_string ( |
2352 "Converts to the Unicode encoding for Windows API calls.\n" | 2357 "Converts to the Unicode encoding for Windows API calls.\n" |
2353 "This encoding is equivalent to standard UTF16, little-endian." | 2358 "This encoding is equivalent to standard UTF16, little-endian." |
2354 ), | 2359 ), |
2355 Qmnemonic, build_string ("MSW-U")), | 2360 Qmnemonic, build_string ("MSW-U")), |
2356 list4 (Qtype, Qutf_16, | 2361 list4 (Qunicode_type, Qutf_16, |
2357 Qlittle_endian, Qt))); | 2362 Qlittle_endian, Qt))); |
2358 | 2363 |
2359 #ifdef MULE | 2364 #ifdef MULE |
2360 /* Just temporarily. This will get fixed in mule-msw-init.el. */ | 2365 /* Just temporarily. This will get fixed in mule-msw-init.el. */ |
2361 Fdefine_coding_system_alias (Qmswindows_multibyte_system_default, | 2366 Fdefine_coding_system_alias (Qmswindows_multibyte_system_default, |