2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Locale_RawDoFmt - locale.library's private replacement
6 of exec.library/RawDoFmt function. IPrefs will install
12 #include <exec/rawfmt.h>
13 #include <exec/types.h>
14 #include <proto/exec.h>
15 #include <proto/locale.h>
16 #include "locale_intern.h"
17 #include <aros/asmcall.h>
21 AROS_UFH3(VOID
, LocRawDoFmtFormatStringFunc
,
22 AROS_UFHA(struct Hook
*, hook
, A0
),
23 AROS_UFHA(struct Locale
*, locale
, A2
),
24 AROS_UFHA(char, fill
, A1
))
29 register char *pdata
asm("a3") = hook
->h_Data
;
31 char *pdata
= hook
->h_Data
;
34 switch ((IPTR
) hook
->h_SubEntry
)
36 case (IPTR
) RAWFMTFUNC_STRING
:
37 /* Standard Array Function */
40 case (IPTR
) RAWFMTFUNC_SERIAL
:
41 /* Standard Serial Function */
44 case (IPTR
) RAWFMTFUNC_COUNT
:
45 /* Standard Count Function */
46 (*((ULONG
*) pdata
))++;
49 AROS_UFC3NR(void, hook
->h_SubEntry
,
50 AROS_UFCA(char, fill
, D0
),
51 AROS_UFCA(APTR
, pdata
, A3
),
52 AROS_UFCA(struct ExecBase
*, SysBase
, A6
));
59 AROS_UFH3(VOID
, LocRawDoFmtFormatStringFunc_SysV
,
60 AROS_UFHA(struct Hook
*, hook
, A0
),
61 AROS_UFHA(struct Locale
*, locale
, A2
), AROS_UFHA(char, fill
, A1
))
65 APTR(*proc
) (APTR
, UBYTE
) = (APTR
) hook
->h_SubEntry
;
66 char *pdata
= hook
->h_Data
;
68 switch ((IPTR
) hook
->h_SubEntry
)
70 case (IPTR
) RAWFMTFUNC_STRING
:
71 /* Standard Array Function */
75 case (IPTR
) RAWFMTFUNC_SERIAL
:
76 /* Standard Serial Function */
80 case (IPTR
) RAWFMTFUNC_COUNT
:
81 /* Standard Count Function */
82 (*((ULONG
*) pdata
))++;
86 pdata
= proc(pdata
, fill
);
95 /*****************************************************************************
98 #include <proto/locale.h>
100 AROS_PLH4(APTR
, LocRawDoFmt
,
103 AROS_LHA(CONST_STRPTR
, FormatString
, A0
),
104 AROS_LHA(APTR
, DataStream
, A1
),
105 AROS_LHA(VOID_FUNC
, PutChProc
, A2
),
106 AROS_LHA(APTR
, PutChData
, A3
),
109 struct ExecBase
*, SysBase
, 31, Locale
)
112 See exec.library/RawDoFmt
115 See exec.library/RawDoFmt
120 This function is not called by apps directly. Instead dos.library/DosGet-
121 LocalizedString is patched to use this function. This means, that the
122 LocaleBase parameter above actually points to SysBase, so we make use of
123 the global LocaleBase variable. This function is marked as private,
124 thus the headers generator won't mind the different basename in the header.
131 RawDoFmt(), FormatString().
135 *****************************************************************************/
142 hook
.h_Entry
= (HOOKFUNC
) AROS_ASMSYMNAME(LocRawDoFmtFormatStringFunc
);
143 hook
.h_SubEntry
= (HOOKFUNC
) PutChProc
;
144 hook
.h_Data
= PutChData
;
146 //kprintf("LocRawDoFmt: FormatString = \"%s\"\n", FormatString);
150 retval
= FormatString(&(IntLB(LocaleBase
)->lb_CurrentLocale
->il_Locale
),
151 (STRPTR
) FormatString
, DataStream
, &hook
);
155 //kprintf("LocRawDoFmt: FormatString: returning %x\n", retval);
163 /*****************************************************************************
166 #include <proto/locale.h>
168 AROS_PLH4(APTR
, LocVNewRawDoFmt
,
171 AROS_LHA(CONST_STRPTR
, FormatString
, A0
),
172 AROS_LHA(VOID_FUNC
, PutChProc
, A2
),
173 AROS_LHA(APTR
, PutChData
, A3
),
174 AROS_LHA(va_list , DataStream
, A1
),
177 struct ExecBase
*, SysBase
, 39, Locale
)
180 See exec.library/VNewRawDoFmt
183 See exec.library/VNewRawDoFmt
188 This function is not called by apps directly. Instead exec.library/VNewRawDoFmt
189 is patched to use this function. This means, that the library base parameter above
190 actually points to SysBase, so we make use of the global LocaleBase variable.
191 This function is marked as private, thus the headers generator won't mind the
192 different basename in the header.
199 RawDoFmt(), FormatString().
203 *****************************************************************************/
211 (HOOKFUNC
) AROS_ASMSYMNAME(LocRawDoFmtFormatStringFunc_SysV
);
212 hook
.h_SubEntry
= (HOOKFUNC
) PutChProc
;
213 hook
.h_Data
= PutChData
;
217 InternalFormatString(&(IntLB(LocaleBase
)->lb_CurrentLocale
->il_Locale
),
218 (STRPTR
) FormatString
, NULL
, &hook
, DataStream
);