1 | /* |
2 | * Summary: Implementation of the XSLT number functions |
3 | * Description: Implementation of the XSLT number functions |
4 | * |
5 | * Copy: See Copyright for the status of this software. |
6 | * |
7 | * Author: Bjorn Reese <breese@users.sourceforge.net> and Daniel Veillard |
8 | */ |
9 | |
10 | #ifndef __XML_XSLT_NUMBERSINTERNALS_H__ |
11 | #define __XML_XSLT_NUMBERSINTERNALS_H__ |
12 | |
13 | #include <libxml/tree.h> |
14 | #include "xsltexports.h" |
15 | |
16 | #ifdef __cplusplus |
17 | extern "C" { |
18 | #endif |
19 | |
20 | struct _xsltCompMatch; |
21 | |
22 | /** |
23 | * xsltNumberData: |
24 | * |
25 | * This data structure is just a wrapper to pass xsl:number data in. |
26 | */ |
27 | typedef struct _xsltNumberData xsltNumberData; |
28 | typedef xsltNumberData *xsltNumberDataPtr; |
29 | |
30 | struct _xsltNumberData { |
31 | const xmlChar *level; |
32 | const xmlChar *count; |
33 | const xmlChar *from; |
34 | const xmlChar *value; |
35 | const xmlChar *format; |
36 | int has_format; |
37 | int digitsPerGroup; |
38 | int groupingCharacter; |
39 | int groupingCharacterLen; |
40 | xmlDocPtr doc; |
41 | xmlNodePtr node; |
42 | struct _xsltCompMatch *countPat; |
43 | struct _xsltCompMatch *fromPat; |
44 | |
45 | /* |
46 | * accelerators |
47 | */ |
48 | }; |
49 | |
50 | /** |
51 | * xsltFormatNumberInfo,: |
52 | * |
53 | * This data structure lists the various parameters needed to format numbers. |
54 | */ |
55 | typedef struct _xsltFormatNumberInfo xsltFormatNumberInfo; |
56 | typedef xsltFormatNumberInfo *xsltFormatNumberInfoPtr; |
57 | |
58 | struct _xsltFormatNumberInfo { |
59 | int integer_hash; /* Number of '#' in integer part */ |
60 | int integer_digits; /* Number of '0' in integer part */ |
61 | int frac_digits; /* Number of '0' in fractional part */ |
62 | int frac_hash; /* Number of '#' in fractional part */ |
63 | int group; /* Number of chars per display 'group' */ |
64 | int multiplier; /* Scaling for percent or permille */ |
65 | char add_decimal; /* Flag for whether decimal point appears in pattern */ |
66 | char is_multiplier_set; /* Flag to catch multiple occurences of percent/permille */ |
67 | char is_negative_pattern;/* Flag for processing -ve prefix/suffix */ |
68 | }; |
69 | |
70 | #ifdef __cplusplus |
71 | } |
72 | #endif |
73 | #endif /* __XML_XSLT_NUMBERSINTERNALS_H__ */ |
74 | |