numbersInternals.h 2.0 KB

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