~ubuntu-branches/ubuntu/gutsy/icu/gutsy-updates

« back to all changes in this revision

Viewing changes to source/extra/ustdio/sprintf.h

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2005-11-19 11:29:31 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20051119112931-vcizkrp10tli4enw
Tags: 3.4-3
Explicitly build with g++ 3.4.  The current ICU fails its test suite
with 4.0 but not with 3.4.  Future versions should work properly with
4.0.

Show diffs side-by-side

added added

removed removed

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