numbersInternals.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #ifndef __XML_XSLT_NUMBERSINTERNALS_H__
  10. #define __XML_XSLT_NUMBERSINTERNALS_H__
  11. #include <libxml/tree.h>
  12. #include "xsltexports.h"
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. /**
  17. * xsltNumberData:
  18. *
  19. * This data structure is just a wrapper to pass xsl:number data in.
  20. */
  21. typedef struct _xsltNumberData xsltNumberData;
  22. typedef xsltNumberData *xsltNumberDataPtr;
  23. struct _xsltNumberData {
  24. const xmlChar *level;
  25. const xmlChar *count;
  26. const xmlChar *from;
  27. const xmlChar *value;
  28. const xmlChar *format;
  29. int has_format;
  30. int digitsPerGroup;
  31. int groupingCharacter;
  32. int groupingCharacterLen;
  33. xmlDocPtr doc;
  34. xmlNodePtr node;
  35. /*
  36. * accelerators
  37. */
  38. };
  39. /**
  40. * xsltFormatNumberInfo,:
  41. *
  42. * This data structure lists the various parameters needed to format numbers.
  43. */
  44. typedef struct _xsltFormatNumberInfo xsltFormatNumberInfo;
  45. typedef xsltFormatNumberInfo *xsltFormatNumberInfoPtr;
  46. struct _xsltFormatNumberInfo {
  47. int integer_hash; /* Number of '#' in integer part */
  48. int integer_digits; /* Number of '0' in integer part */
  49. int frac_digits; /* Number of '0' in fractional part */
  50. int frac_hash; /* Number of '#' in fractional part */
  51. int group; /* Number of chars per display 'group' */
  52. int multiplier; /* Scaling for percent or permille */
  53. char add_decimal; /* Flag for whether decimal point appears in pattern */
  54. char is_multiplier_set; /* Flag to catch multiple occurences of percent/permille */
  55. char is_negative_pattern;/* Flag for processing -ve prefix/suffix */
  56. };
  57. #ifdef __cplusplus
  58. }
  59. #endif
  60. #endif /* __XML_XSLT_NUMBERSINTERNALS_H__ */