2 ******************************************************************************
4 * Copyright (C) 2000-2001, International Business Machines
5 * Corporation and others. All Rights Reserved.
7 ******************************************************************************
11 * Modification History:
13 * Date Name Description
14 * 02/08/00 george Creation. Copied from uprintf.h
15 ******************************************************************************
21 #include "unicode/utypes.h"
23 #if !UCONFIG_NO_FORMATTING
25 #include "unicode/ustdio.h"
30 * Struct encapsulating a single uprintf format specification.
32 struct u_sprintf_spec_info
{
33 UChar fSpec
; /* Conversion specification */
35 int32_t fPrecision
; /* Precision */
36 int32_t fWidth
; /* Width */
38 UChar fPadChar
; /* Padding character */
40 UBool fAlt
; /* # flag */
41 UBool fSpace
; /* Space flag */
42 UBool fLeft
; /* - flag */
43 UBool fShowSign
; /* + flag */
44 UBool fZero
; /* 0 flag */
46 UBool fIsLongDouble
; /* L flag */
47 UBool fIsShort
; /* h flag */
48 UBool fIsLong
; /* l flag */
49 UBool fIsLongLong
; /* ll flag */
51 typedef struct u_sprintf_spec_info u_sprintf_spec_info
;
53 struct u_localized_string
{
54 UChar
*str
; /* Place to write the string */
55 int32_t available
;/* Number of codeunits available to write to */
56 int32_t len
; /* Maximum number of code units that can be written to output */
58 ULocaleBundle
*fBundle
; /* formatters */
59 UBool fOwnBundle
; /* TRUE if fBundle should be deleted */
61 typedef struct u_localized_string u_localized_string
;
64 * A u_printf handler function.
65 * A u_printf handler is responsible for handling a single u_printf
66 * format specification, for example 'd' or 's'.
67 * @param info A pointer to a <TT>u_printf_spec_info</TT> struct containing
68 * information on the format specification.
69 * @param args A pointer to the argument data
70 * @return The number of Unicode characters written to <TT>stream</TT>.
72 typedef int32_t (*u_sprintf_handler
) (u_localized_string
*output
,
73 const u_sprintf_spec_info
*info
,
74 const ufmt_args
*args
);
76 #endif /* #if !UCONFIG_NO_FORMATTING */