2 Copyright © 1995-2004, 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 /*********************************************************************************************/
29 extern void LIB_LocRawDoFmt(void);
30 extern void LIB_LocStrnicmp(void);
31 extern void LIB_LocStricmp(void);
32 extern void LIB_LocToLower(void);
33 extern void LIB_LocToUpper(void);
34 extern void LIB_LocDateToStr(void);
35 extern void LIB_LocStrToDate(void);
36 extern void LIB_LocDosGetLocalizedString(void);
40 /*********************************************************************************************/
43 static struct patchinfo
51 {LIB_EXEC
, 87 , LIB_LocRawDoFmt
},
52 {LIB_UTILITY
, 28 , LIB_LocStrnicmp
},
53 {LIB_UTILITY
, 27 , LIB_LocStricmp
},
54 {LIB_UTILITY
, 30 , LIB_LocToLower
},
55 {LIB_UTILITY
, 29 , LIB_LocToUpper
},
56 {LIB_DOS
, 124, LIB_LocDateToStr
},
57 {LIB_DOS
, 125, LIB_LocStrToDate
},
58 {LIB_DOS
, 163, LIB_LocDosGetLocalizedString
},
63 static struct patchinfo
72 {LIB_EXEC
, 87 , LIB_LOCALE
, 31}, /* RawDoFmt */
73 {LIB_UTILITY
, 28 , LIB_LOCALE
, 32}, /* Strnicmp */
74 {LIB_UTILITY
, 27 , LIB_LOCALE
, 33}, /* Stricmp */
75 {LIB_UTILITY
, 30 , LIB_LOCALE
, 34}, /* ToLower */
76 {LIB_UTILITY
, 29 , LIB_LOCALE
, 35}, /* ToUpper */
77 {LIB_DOS
, 124, LIB_LOCALE
, 36}, /* DateToStr */
78 {LIB_DOS
, 125, LIB_LOCALE
, 37}, /* StrToDate */
79 {LIB_DOS
, 154, LIB_LOCALE
, 38}, /* DosGetLocalizedString */
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
[] =
121 {SETFUNCTAG_MACHINE
, MACHINE_PPC
},
122 {SETFUNCTAG_TYPE
, SETFUNCTYPE_NORMAL
},
123 {SETFUNCTAG_IDNAME
, (ULONG
) "locale.library Language Patch"},
124 {SETFUNCTAG_DELETE
, TRUE
},
130 for(i
= 0; pi
[i
].library
; i
++)
133 NewSetFunction(GetLib(pi
[i
].library
), pi
[i
].whichpatchfunc
, -pi
[i
].whichfunc
* LIB_VECTSIZE
, PatchTags
);
135 SetFunction(GetLib(pi
[i
].library
),
136 -pi
[i
].whichfunc
* LIB_VECTSIZE
,
137 __AROS_GETVECADDR(GetLib(pi
[i
].patchlibrary
), pi
[i
].whichpatchfunc
));
141 LocaleBase
->lb_SysPatches
= TRUE
;
145 /*********************************************************************************************/