ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/common.h in xlsxwriter-0.2.1.pre.2 vs ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/common.h in xlsxwriter-0.2.2
- old
+ new
@@ -1,17 +1,17 @@
/*
* libxlsxwriter
*
- * Copyright 2014-2019, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
+ * Copyright 2014-2020, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
*/
/**
* @file common.h
*
* @brief Common functions and defines for the libxlsxwriter library.
*
- * <!-- Copyright 2014-2019, John McNamara, jmcnamara@cpan.org -->
+ * <!-- Copyright 2014-2020, John McNamara, jmcnamara@cpan.org -->
*
*/
#ifndef __LXW_COMMON_H__
#define __LXW_COMMON_H__
@@ -23,10 +23,20 @@
#define STATIC static
#else
#define STATIC
#endif
+#ifndef DEPRECATED
+#if __GNUC__ >= 5
+#define DEPRECATED(func, msg) func __attribute__ ((deprecated(msg)))
+#elif defined(_MSC_VER)
+#define DEPRECATED(func, msg) __declspec(deprecated, msg) func
+#else
+#define DEPRECATED(func, msg) func
+#endif
+#endif
+
/** Integer data type to represent a row value. Equivalent to `uint32_t`.
*
* The maximum row in Excel is 1,048,576.
*/
typedef uint32_t lxw_row_t;
@@ -84,10 +94,13 @@
LXW_ERROR_ZIP_FILE_ADD,
/** Unknown zip error when closing xlsx file. */
LXW_ERROR_ZIP_CLOSE,
+ /** Feature is not currently supported in this configuration. */
+ LXW_ERROR_FEATURE_NOT_SUPPORTED,
+
/** NULL function parameter ignored. */
LXW_ERROR_NULL_PARAMETER_IGNORED,
/** Function parameter validation error. */
LXW_ERROR_PARAMETER_VALIDATION,
@@ -102,13 +115,10 @@
LXW_ERROR_SHEETNAME_START_END_APOSTROPHE,
/** Worksheet name is already in use. */
LXW_ERROR_SHEETNAME_ALREADY_USED,
- /** Worksheet name 'History' is reserved by Excel. */
- LXW_ERROR_SHEETNAME_RESERVED,
-
/** Parameter exceeds Excel's limit of 32 characters. */
LXW_ERROR_32_STRING_LENGTH_EXCEEDED,
/** Parameter exceeds Excel's limit of 128 characters. */
LXW_ERROR_128_STRING_LENGTH_EXCEEDED,
@@ -123,10 +133,13 @@
LXW_ERROR_SHARED_STRING_INDEX_NOT_FOUND,
/** Worksheet row or column index out of range. */
LXW_ERROR_WORKSHEET_INDEX_OUT_OF_RANGE,
+ /** Maximum hyperlink length (2079) exceeded. */
+ LXW_ERROR_WORKSHEET_MAX_URL_LENGTH_EXCEEDED,
+
/** Maximum number of worksheet URLs (65530) exceeded. */
LXW_ERROR_WORKSHEET_MAX_NUMBER_URLS_EXCEEDED,
/** Couldn't read image dimensions or DPI. */
LXW_ERROR_IMAGE_DIMENSIONS,
@@ -162,10 +175,13 @@
LXW_CUSTOM_INTEGER,
LXW_CUSTOM_BOOLEAN,
LXW_CUSTOM_DATETIME
};
+/* Size of MD5 byte arrays. */
+#define LXW_MD5_SIZE 16
+
/* Excel sheetname max of 31 chars. */
#define LXW_SHEETNAME_MAX 31
/* Max with all worksheet chars 4xUTF-8 bytes + start and end quotes + \0. */
#define LXW_MAX_SHEETNAME_LENGTH ((LXW_SHEETNAME_MAX * 4) + 2 + 1)
@@ -185,9 +201,12 @@
/* Max range formula Sheet1!$A$1:$C$5$ style. */
#define LXW_MAX_FORMULA_RANGE_LENGTH (LXW_MAX_SHEETNAME_LENGTH + LXW_MAX_CELL_RANGE_LENGTH)
/* Datetime string length. */
#define LXW_DATETIME_LENGTH sizeof("2016-12-12T23:00:00Z")
+
+/* GUID string length. */
+#define LXW_GUID_LENGTH sizeof("{12345678-1234-1234-1234-1234567890AB}")
#define LXW_EPOCH_1900 0
#define LXW_EPOCH_1904 1
#define LXW_UINT32_T_LENGTH sizeof("4294967296")