1 #ifndef CLIB_LOCALE_PROTOS_H 2 #define CLIB_LOCALE_PROTOS_H 3 4 /* 5 locale.library C prototypes 6 7 Copyright © 2002-2018 The MorphOS Development Team, All Rights Reserved. 8 */ 9 10 #ifndef EXEC_TYPES_H 11 # include <exec/types.h> 12 #endif 13 14 #ifndef LIBRARIES_LOCALE_H 15 # include <libraries/locale.h> 16 #endif 17 18 #ifndef DOS_DOS_H 19 # include <dos/dos.h> 20 #endif 21 22 #ifndef UTILITY_HOOKS_H 23 # include <utility/hooks.h> 24 #endif 25 26 #ifndef UTILITY_TAGITEM_H 27 # include <utility/tagitem.h> 28 #endif 29 30 #ifndef REXX_STORAGE_H 31 # include <rexx/storage.h> 32 #endif 33 34 #ifndef UTILITY_DATE_H 35 # include <utility/date.h> 36 #endif 37 38 #ifndef _SYS_TYPES_H_ 39 # include <sys/types.h> 40 #endif 41 42 #ifdef __cplusplus 43 extern "C" { 44 #endif /* __cplusplus */ 45 46 VOID CloseCatalog( CONST struct Catalog *catalog ); 47 VOID CloseLocale( CONST struct Locale *locale ); 48 ULONG ConvToLower( CONST struct Locale *locale, ULONG character ); 49 ULONG ConvToUpper( CONST struct Locale *locale, ULONG character ); 50 VOID FormatDate( CONST struct Locale *locale, CONST_STRPTR fmtTemplate, CONST struct DateStamp *date, CONST struct Hook *putCharFunc ); 51 APTR FormatString( CONST struct Locale *locale, CONST_STRPTR fmtTemplate, CONST_APTR dataStream, CONST struct Hook *putCharFunc ); 52 STRPTR GetCatalogStr( CONST struct Catalog *catalog, LONG stringNum, CONST_STRPTR defaultString ); 53 STRPTR GetLocaleStr( CONST struct Locale *locale, ULONG stringNum ); 54 BOOL IsAlNum( CONST struct Locale *locale, ULONG character ); 55 BOOL IsAlpha( CONST struct Locale *locale, ULONG character ); 56 BOOL IsCntrl( CONST struct Locale *locale, ULONG character ); 57 BOOL IsDigit( CONST struct Locale *locale, ULONG character ); 58 BOOL IsGraph( CONST struct Locale *locale, ULONG character ); 59 BOOL IsLower( CONST struct Locale *locale, ULONG character ); 60 BOOL IsPrint( CONST struct Locale *locale, ULONG character ); 61 BOOL IsPunct( CONST struct Locale *locale, ULONG character ); 62 BOOL IsSpace( CONST struct Locale *locale, ULONG character ); 63 BOOL IsUpper( CONST struct Locale *locale, ULONG character ); 64 BOOL IsXDigit( CONST struct Locale *locale, ULONG character ); 65 struct Catalog *OpenCatalogA( CONST struct Locale *locale, CONST_STRPTR name, CONST struct TagItem *tags ); 66 #if !defined(USE_INLINE_STDARG) 67 struct Catalog *OpenCatalog( CONST struct Locale *locale, CONST_STRPTR name, Tag tag1, ... ); 68 #endif 69 struct Locale *OpenLocale( CONST_STRPTR name ); 70 BOOL ParseDate( CONST struct Locale *locale, CONST struct DateStamp *date, CONST_STRPTR fmtTemplate, CONST struct Hook *getCharFunc ); 71 ULONG StrConvert( CONST struct Locale *locale, CONST_STRPTR string, APTR buffer, ULONG bufferSize, ULONG type ); 72 LONG StrnCmp( CONST struct Locale *locale, CONST_STRPTR string1, CONST_STRPTR string2, LONG length, ULONG type ); 73 WCHAR UCS4_ConvToLower(WCHAR ucharacter); 74 WCHAR UCS4_ConvToUpper(WCHAR ucharacter); 75 ULONG UTF8_Decode(CONST_STRPTR utf8, WCHAR *ucharacter); 76 ULONG UTF8_Encode(WCHAR ucharacter, STRPTR string); 77 CONST_WSTRPTR UCS4_GetCatalogStr(CONST struct Catalog *catalog, ULONG stringNum, CONST_WSTRPTR defaultString); 78 BOOL UCS4_IsAlNum( WCHAR ucharacter ); 79 BOOL UCS4_IsAlpha( WCHAR ucharacter ); 80 BOOL UCS4_IsCntrl( WCHAR ucharacter ); 81 BOOL UCS4_IsDigit( WCHAR ucharacter ); 82 BOOL UCS4_IsGraph( WCHAR ucharacter ); 83 BOOL UCS4_IsLower( WCHAR ucharacter ); 84 BOOL UCS4_IsPrint( WCHAR ucharacter ); 85 BOOL UCS4_IsPunct( WCHAR ucharacter ); 86 BOOL UCS4_IsSpace( WCHAR ucharacter ); 87 BOOL UCS4_IsUpper( WCHAR ucharacter ); 88 BOOL UCS4_IsXDigit( WCHAR ucharacter ); 89 VOID UCS4_FormatDate( CONST struct Locale *locale, CONST_WSTRPTR formatString, CONST struct DateStamp *date, CONST struct Hook *hook ); 90 APTR UCS4_FormatString( CONST struct Locale *locale, CONST_WSTRPTR fmtTemplate, CONST_APTR dataStream, CONST struct Hook *putCharFunc ); 91 CONST_WSTRPTR UCS4_GetLocaleStr( CONST struct Locale *locale, ULONG stringNum ); 92 LONG UCS4_StrnCmp( CONST struct Locale *locale, CONST_WSTRPTR string1, CONST_WSTRPTR string2, LONG length, ULONG type ); 93 LONG UCS4_StrToLower( CONST struct Locale *locale, CONST_WSTRPTR string, WSTRPTR buffer, ULONG bufferSize, ULONG type ); 94 LONG UCS4_StrToUpper( CONST struct Locale *locale, CONST_WSTRPTR string, WSTRPTR buffer, ULONG bufferSize, ULONG type ); 95 CONST_WSTRPTR UCS4_Decompose( WCHAR ch ); 96 BOOL UCS4_IsNSM( WCHAR ucharacter ); 97 VOID UCS4_Normalize( CONST_WSTRPTR src, WSTRPTR dst, LONG length, ULONG type ); 98 CONST_WSTRPTR UCS4_CanonicalDecompose( WCHAR ch); 99 ULONG ConvertUTF8ToUCS4( CONST_STRPTR src, WSTRPTR dst, LONG length ); 100 ULONG ConvertUCS4ToUTF8( CONST_WSTRPTR src, STRPTR dst, LONG length ); 101 ULONG UCS4_IsCombining( WCHAR ucharacter ); 102 LONG UCS4_Compare( CONST struct Locale *locale, CONST_WSTRPTR string1, CONST_WSTRPTR string2, LONG length, ULONG flags ); 103 ULONG UCS4_GetCombiningClass( WCHAR ucharacter ); 104 ULONG UCS4_NormalizedLength( CONST_WSTRPTR string, LONG length, ULONG type ); 105 LONG UTF8_CheckEncoding(CONST_STRPTR string, LONG length); 106 ULONG IsUnicode(APTR buffer, ULONG length); 107 108 VOID UCS4_FormatClockData(CONST struct Locale *locale, CONST_WSTRPTR formatString, CONST struct ClockData *cData, CONST struct Hook *hook); 109 ssize_t VSNPrintf(CONST struct Locale *locale, STRPTR buffer, ssize_t bufferSize, CONST_STRPTR fmtTemplate, va_list args); 110 ssize_t SNPrintf(CONST struct Locale *locale, STRPTR buffer, ssize_t bufferSize, CONST_STRPTR fmtTemplate, ...); 111 112 struct tm; 113 ULONG TZGetSysLocalTime(ULONG utctime, CONST_STRPTR timezone); 114 APTR TZAlloc(CONST_STRPTR timezone); 115 VOID TZFree(APTR sp); 116 struct tm *TZLocalTime(APTR sp, ULONG t, struct tm *tmp); 117 ULONG TZMKTime(APTR sp, struct tm *tm); 118 ULONG TZTime2Posix(APTR sp, ULONG t); 119 ULONG TZPosix2Time(APTR sp, ULONG t); 120 STRPTR TZAscTime(const struct tm *tm, STRPTR buf); 121 STRPTR TZCTime(ULONG t, STRPTR buf); 122 struct tm *TZGMTime(ULONG t, struct tm *tm); 123 LONG TZGetSysTimeZone(STRPTR buf, LONG size); 124 APTR TZAlloc2(CONST_STRPTR timezone, int *errnoptr); 125 QUAD TZGetSysLocalTime64(QUAD utctime, CONST_STRPTR timezone, struct tm *restm, int *errnoptr); 126 struct tm *TZLocalTime64(APTR sp, QUAD t, struct tm *tmp, int *errnoptr); 127 QUAD TZMKTime64(APTR sp, struct tm *tm, int *errnoptr); 128 QUAD TZTime2Posix64(APTR sp, QUAD t, int *errnoptr); 129 QUAD TZPosix2Time64(APTR sp, QUAD t, int *errnoptr); 130 STRPTR TZCTime64(QUAD t, STRPTR buf, int *errnoptr); 131 struct tm *TZGMTime64(QUAD t, struct tm *tm, int *errnoptr); 132 133 #ifdef __cplusplus 134 } 135 #endif /* __cplusplus */ 136 137 138 #endif /* CLIB_LOCALE_PROTOS_H */