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 uscanf.h
15 ******************************************************************************
21 #include "unicode/utypes.h"
23 #if !UCONFIG_NO_FORMATTING
25 #include "unicode/ustdio.h"
30 * Struct encapsulating a single uscanf format specification.
32 struct u_sscanf_spec_info
{
33 UChar fSpec
; /* Format specification */
35 int32_t fWidth
; /* Width */
37 UChar fPadChar
; /* Padding character */
39 UBool fIsLongDouble
; /* L flag */
40 UBool fIsShort
; /* h flag */
41 UBool fIsLong
; /* l flag */
42 UBool fIsLongLong
; /* ll flag */
44 typedef struct u_sscanf_spec_info u_sscanf_spec_info
;
46 struct u_localized_string
{
47 UChar
*str
; /* Place to write the string */
48 int32_t pos
; /* Number of codeunits available to write to */
49 int32_t len
; /* Maximum number of code units that can be written to output */
51 ULocaleBundle
*fBundle
; /* formatters */
52 UBool fOwnBundle
; /* TRUE if fBundle should be deleted */
54 typedef struct u_localized_string u_localized_string
;
57 * A u_scanf handler function.
58 * A u_scanf handler is responsible for handling a single u_scanf
59 * format specification, for example 'd' or 's'.
60 * @param stream The UFILE to which to write output.
61 * @param info A pointer to a <TT>u_scanf_spec_info</TT> struct containing
62 * information on the format specification.
63 * @param args A pointer to the argument data
64 * @param fmt A pointer to the first character in the format string
66 * @param consumed On output, set to the number of characters consumed
68 * @return The number of arguments converted and assigned, or -1 if an
71 typedef int32_t (*u_sscanf_handler
) (u_localized_string
*input
,
72 const u_sscanf_spec_info
*info
,
77 #endif /* #if !UCONFIG_NO_FORMATTING */