2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
6 /**************************************************************************/
8 #include "locale_intern.h"
10 #include <exec/execbase.h>
11 #include <aros/libcall.h>
13 #include <proto/exec.h>
14 #include <proto/dos.h>
15 #include <proto/utility.h>
16 #include <proto/locale.h>
18 /**************************************************************************/
25 /**************************************************************************/
27 AROS_LD4(APTR
, LocRawDoFmt
,
28 AROS_LDA(CONST_STRPTR
, FormatString
, A0
),
29 AROS_LDA(APTR
, DataStream
, A1
),
30 AROS_LDA(VOID_FUNC
, PutChProc
, A2
),
31 AROS_LDA(APTR
, PutChData
, A3
), struct ExecBase
*, SysBase
, 31, Locale
);
32 AROS_LD4(APTR
, LocVNewRawDoFmt
,
33 AROS_LDA(CONST_STRPTR
, FormatString
, A0
),
34 AROS_LDA(VOID_FUNC
, PutChProc
, A2
),
35 AROS_LDA(APTR
, PutChData
, A3
),
36 AROS_LDA(va_list, DataStream
, A1
),
37 struct ExecBase
*, SysBase
, 39, Locale
);
38 AROS_LD3(LONG
, LocStrnicmp
,
39 AROS_LDA(CONST_STRPTR
, string1
, A0
),
40 AROS_LDA(CONST_STRPTR
, string2
, A1
),
41 AROS_LDA(LONG
, length
, D0
),
42 struct UtilityBase
*, UtilityBase
, 32, Locale
);
43 AROS_LD2(LONG
, LocStricmp
,
44 AROS_LDA(CONST_STRPTR
, string1
, A0
),
45 AROS_LDA(CONST_STRPTR
, string2
, A1
),
46 struct UtilityBase
*, UtilityBase
, 33, Locale
);
47 AROS_LD1(ULONG
, LocToLower
,
48 AROS_LDA(ULONG
, character
, D0
),
49 struct UtilityBase
*, UtilityBase
, 34, Locale
);
50 AROS_LD1(ULONG
, LocToUpper
,
51 AROS_LDA(ULONG
, character
, D0
),
52 struct UtilityBase
*, UtilityBase
, 35, Locale
);
53 AROS_LD1(LONG
, LocDateToStr
,
54 AROS_LDA(struct DateTime
*, datetime
, D1
),
55 struct DosLibrary
*, DOSBase
, 36, Locale
);
56 AROS_LD1(LONG
, LocStrToDate
,
57 AROS_LDA(struct DateTime
*, datetime
, D1
),
58 struct DosLibrary
*, DOSBase
, 37, Locale
);
59 AROS_LD1(CONST_STRPTR
, LocDosGetLocalizedString
,
60 AROS_LDA(LONG
, stringNum
, D1
),
61 struct DosLibrary
*, DOSBase
, 38, Locale
);
63 /**************************************************************************/
65 static struct patchinfo
72 {LIB_EXEC
, 87, AROS_SLIB_ENTRY(LocRawDoFmt
, Locale
, 31)},
73 {LIB_UTILITY
, 28, AROS_SLIB_ENTRY(LocStrnicmp
, Locale
, 32)},
74 {LIB_UTILITY
, 27, AROS_SLIB_ENTRY(LocStricmp
, Locale
, 33)},
75 {LIB_UTILITY
, 30, AROS_SLIB_ENTRY(LocToLower
, Locale
, 34)},
76 {LIB_UTILITY
, 29, AROS_SLIB_ENTRY(LocToUpper
, Locale
, 35)},
77 {LIB_DOS
, 124, AROS_SLIB_ENTRY(LocDateToStr
, Locale
, 36)},
78 {LIB_DOS
, 125, AROS_SLIB_ENTRY(LocStrToDate
, Locale
, 37)},
79 {LIB_DOS
, 163, AROS_SLIB_ENTRY(LocDosGetLocalizedString
, Locale
, 38)},
80 {LIB_EXEC
, 137, AROS_SLIB_ENTRY(LocVNewRawDoFmt
, Locale
, 39)},
84 /**************************************************************************/
86 static struct Library
*GetLib(WORD which
)
88 struct Library
*lib
= NULL
;
93 lib
= (struct Library
*)SysBase
;
97 lib
= (struct Library
*)DOSBase
;
101 lib
= (struct Library
*)UtilityBase
;
105 lib
= (struct Library
*)LocaleBase
;
112 /**************************************************************************/
114 void InstallPatches(void)
119 static const struct TagItem PatchTags
[] = {
120 {SETFUNCTAG_MACHINE
, MACHINE_PPC
},
121 {SETFUNCTAG_TYPE
, SETFUNCTYPE_NORMAL
},
122 {SETFUNCTAG_IDNAME
, (ULONG
) "locale.library Language Patch"},
123 {SETFUNCTAG_DELETE
, TRUE
},
129 for (i
= 0; pi
[i
].library
; i
++)
132 NewSetFunction(GetLib(pi
[i
].library
), pi
[i
].whichpatchfunc
,
133 -pi
[i
].whichfunc
* LIB_VECTSIZE
, PatchTags
);
135 SetFunction(GetLib(pi
[i
].library
),
136 -pi
[i
].whichfunc
* LIB_VECTSIZE
, pi
[i
].whichpatchfunc
);
140 LocaleBase
->lb_SysPatches
= TRUE
;
143 /**************************************************************************/