libxlsxwriter/include/xlsxwriter/utility.h in fast_excel-0.2.3 vs libxlsxwriter/include/xlsxwriter/utility.h in fast_excel-0.2.5
- old
+ new
@@ -1,25 +1,26 @@
/*
* libxlsxwriter
*
- * Copyright 2014-2017, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
+ * Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
*/
/**
* @file utility.h
*
* @brief Utility functions for libxlsxwriter.
*
- * <!-- Copyright 2014-2017, John McNamara, jmcnamara@cpan.org -->
+ * <!-- Copyright 2014-2018, John McNamara, jmcnamara@cpan.org -->
*
*/
#ifndef __LXW_UTILITY_H__
#define __LXW_UTILITY_H__
#include <stdint.h>
#include "common.h"
+#include "xmlwriter.h"
/**
* @brief Convert an Excel `A1` cell string into a `(row, col)` pair.
*
* Convert an Excel `A1` cell string into a `(row, col)` pair.
@@ -143,19 +144,24 @@
uint16_t lxw_name_to_col_2(const char *col_str);
double lxw_datetime_to_excel_date(lxw_datetime *datetime, uint8_t date_1904);
char *lxw_strdup(const char *str);
+char *lxw_strdup_formula(const char *formula);
size_t lxw_utf8_strlen(const char *str);
void lxw_str_tolower(char *str);
FILE *lxw_tmpfile(char *tmpdir);
-/* Declarations required for unit testing. */
-#ifdef TESTING
-
+/* Use a user defined function to format doubles in sprintf or else a simple
+ * macro (the default). */
+#ifdef USE_DOUBLE_FUNCTION
+int lxw_sprintf_dbl(char *data, double number);
+#else
+#define lxw_sprintf_dbl(data, number) \
+ lxw_snprintf(data, LXW_ATTR_32, "%.16g", number)
#endif
/* *INDENT-OFF* */
#ifdef __cplusplus
}