libxlsxwriter/include/xlsxwriter/xmlwriter.h in fast_excel-0.4.1 vs libxlsxwriter/include/xlsxwriter/xmlwriter.h in fast_excel-0.5.0

- old
+ new

@@ -1,9 +1,9 @@ /* * libxlsxwriter * - * Copyright 2014-2019, John McNamara, jmcnamara@cpan.org. See LICENSE.txt. + * Copyright 2014-2022, John McNamara, jmcnamara@cpan.org. See LICENSE.txt. * * xmlwriter - A libxlsxwriter library for creating Excel XLSX * XML files. * * The xmlwriter library is used to create the XML sub-components files @@ -22,11 +22,11 @@ #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include "utility.h" -#define LXW_MAX_ATTRIBUTE_LENGTH 256 +#define LXW_MAX_ATTRIBUTE_LENGTH 2080 /* Max URL length. */ #define LXW_ATTR_32 32 #define LXW_ATTRIBUTE_COPY(dst, src) \ do{ \ strncpy(dst, src, LXW_MAX_ATTRIBUTE_LENGTH -1); \ @@ -53,11 +53,11 @@ STAILQ_HEAD(xml_attribute_list, xml_attribute); /* Create a new attribute struct to add to a xml_attribute_list. */ struct xml_attribute *lxw_new_attribute_str(const char *key, const char *value); -struct xml_attribute *lxw_new_attribute_int(const char *key, uint32_t value); +struct xml_attribute *lxw_new_attribute_int(const char *key, uint64_t value); struct xml_attribute *lxw_new_attribute_dbl(const char *key, double value); /* Macro to initialize the xml_attribute_list pointers. */ #define LXW_INIT_ATTRIBUTES() \ STAILQ_INIT(&attributes) @@ -83,15 +83,17 @@ STAILQ_INSERT_TAIL(&attributes, attribute, list_entries); \ } while (0) /* Macro to free xml_attribute_list and attribute. */ #define LXW_FREE_ATTRIBUTES() \ - while (!STAILQ_EMPTY(&attributes)) { \ - attribute = STAILQ_FIRST(&attributes); \ - STAILQ_REMOVE_HEAD(&attributes, list_entries); \ - free(attribute); \ - } + do { \ + while (!STAILQ_EMPTY(&attributes)) { \ + attribute = STAILQ_FIRST(&attributes); \ + STAILQ_REMOVE_HEAD(&attributes, list_entries); \ + free(attribute); \ + } \ + } while (0) /** * Create the XML declaration in an XML file. * * @param xmlfile A FILE pointer to the output XML file. @@ -165,10 +167,12 @@ const char *data, struct xml_attribute_list *attributes); void lxw_xml_rich_si_element(FILE * xmlfile, const char *string); +uint8_t lxw_has_control_characters(const char *string); char *lxw_escape_control_characters(const char *string); +char *lxw_escape_url_characters(const char *string, uint8_t escape_hash); char *lxw_escape_data(const char *data); /* *INDENT-OFF* */ #ifdef __cplusplus