mirror of
https://github.com/brechtsanders/xlsxio
synced 2025-03-28 21:13:24 +00:00
This commit is contained in:
parent
d653f1604b
commit
1662674ec3
@ -38,14 +38,14 @@ IF(NOT BUILD_STATIC AND NOT BUILD_SHARED)
|
||||
MESSAGE(FATAL_ERROR "Cannot build with both BUILD_STATIC and BUILD_SHARED disabled")
|
||||
ENDIF()
|
||||
|
||||
# dependancies
|
||||
# dependencies
|
||||
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
|
||||
# dependancy: zlib (dependancy of libzip/Minizip, should be detected there)
|
||||
# dependency: zlib (dependency of libzip/Minizip, should be detected there)
|
||||
IF(ZLIB_DIR)
|
||||
SET(ZLIB_ROOT ${ZLIB_DIR})
|
||||
ENDIF()
|
||||
#FIND_PACKAGE(ZLIB REQUIRED)
|
||||
# dependancy: libzip/minizip/minizip-ng
|
||||
# dependency: libzip/minizip/minizip-ng
|
||||
IF(WITH_LIBZIP)
|
||||
FIND_PACKAGE(LibZip REQUIRED)
|
||||
SET(ANYZIP_INCLUDE_DIRS ${LIBZIP_INCLUDE_DIRS})
|
||||
@ -62,7 +62,7 @@ ELSE()
|
||||
SET(ANYZIP_LIBRARIES ${MINIZIP_LIBRARIES})
|
||||
SET(ANYZIP_DEF USE_MINIZIP)
|
||||
ENDIF()
|
||||
# dependancy: expat
|
||||
# dependency: expat
|
||||
IF(EXPAT_DIR)
|
||||
#FIND_PACKAGE(EXPAT MODULE REQUIRED NO_DEFAULT_PATH PATHS ${EXPAT_DIR})
|
||||
FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h NO_DEFAULT_PATH PATHS ${EXPAT_DIR}/include ${EXPAT_DIR})
|
||||
@ -70,7 +70,7 @@ IF(EXPAT_DIR)
|
||||
ELSE()
|
||||
FIND_PACKAGE(EXPAT REQUIRED)
|
||||
ENDIF()
|
||||
# dependancy: expatw (if wide library was requested)
|
||||
# dependency: expatw (if wide library was requested)
|
||||
IF(WITH_WIDE)
|
||||
IF(EXPAT_DIR)
|
||||
FIND_LIBRARY(EXPATW_LIBRARIES NAMES expatw libexpatw NO_DEFAULT_PATH PATHS ${EXPAT_DIR}/lib ${EXPAT_DIR})
|
||||
|
@ -1,5 +1,9 @@
|
||||
0.2.35
|
||||
|
||||
2023-08-03 Brecht Sanders https://github.com/brechtsanders/
|
||||
|
||||
* fix typos discovered by codespell (#122)
|
||||
|
||||
2023-05-30 Brecht Sanders https://github.com/brechtsanders/
|
||||
|
||||
* fix free of uninitialized pointer in xlsxioread_sheetlist_close() (#121)
|
||||
@ -14,7 +18,7 @@
|
||||
|
||||
2022-07-05 Brecht Sanders https://github.com/brechtsanders/
|
||||
|
||||
* PR from JackBoosY to export CMake targets automaticly (to cmake folder under install path) (#105)
|
||||
* PR from JackBoosY to export CMake targets automatically (to cmake folder under install path) (#105)
|
||||
|
||||
0.2.32
|
||||
|
||||
@ -134,7 +138,7 @@
|
||||
2018-06-23 Brecht Sanders https://github.com/brechtsanders/
|
||||
|
||||
* fixed join_basepath_filename in xlsx_read.c to also support absolute paths (issue reported by Matthew James Briggs)
|
||||
* added CMake options to specify custom dependancy paths: ZLIB_DIR/MINIZIP_DIR/LIBZIP_DIR/EXPAT_DIR (requested by Yann Ducruy)
|
||||
* added CMake options to specify custom dependency paths: ZLIB_DIR/MINIZIP_DIR/LIBZIP_DIR/EXPAT_DIR (requested by Yann Ducruy)
|
||||
|
||||
0.2.19
|
||||
|
||||
@ -234,7 +238,7 @@
|
||||
2017-07-12 Brecht Sanders https://github.com/brechtsanders/
|
||||
|
||||
* use strcasecmp instead of stricmp
|
||||
* move shared strings functionality from xlsxio_read.c to seperate file
|
||||
* move shared strings functionality from xlsxio_read.c to separate file
|
||||
|
||||
0.2.8
|
||||
|
||||
@ -353,8 +357,8 @@
|
||||
|
||||
2016-03-20 Brecht Sanders https://github.com/brechtsanders/
|
||||
|
||||
* fixed issue with detecting witdh of columns with NULL data
|
||||
* changed witdh detection to only count first line of multiline data
|
||||
* fixed issue with detecting width of columns with NULL data
|
||||
* changed width detection to only count first line of multiline data
|
||||
* fixed issue with inserting empty rows
|
||||
* only freezes top row when columns were specified
|
||||
|
||||
@ -363,8 +367,8 @@
|
||||
2016-03-19 Brecht Sanders https://github.com/brechtsanders/
|
||||
|
||||
* optimized code for writing cell data
|
||||
* added witdh parameter to xlsxiowrite_add_column()
|
||||
* added column witdh detection and xlsxiowrite_set_detection_rows()
|
||||
* added width parameter to xlsxiowrite_add_column()
|
||||
* added column width detection and xlsxiowrite_set_detection_rows()
|
||||
* added xlsxiowrite_set_row_height()
|
||||
|
||||
0.1.3
|
||||
|
2
Makefile
2
Makefile
@ -90,7 +90,7 @@ endif
|
||||
|
||||
ifdef STATICDLL
|
||||
ifeq ($(OS),Windows_NT)
|
||||
# lines below to compile Windows DLLs with no dependancies
|
||||
# lines below to compile Windows DLLs with no dependencies
|
||||
ifdef WITH_LIBZIP
|
||||
override CFLAGS += -DZIP_STATIC
|
||||
endif
|
||||
|
@ -29,7 +29,7 @@ Reading .xlsx files:
|
||||
- supports .xlsx files without shared string table
|
||||
- worksheet data itself is read on the fly without the need to buffer data in memory
|
||||
- 2 methods are provided
|
||||
+ a simple method that allows the application to iterate trough rows and cells
|
||||
+ a simple method that allows the application to iterate through rows and cells
|
||||
+ an advanced method (with less overhead) which calls callback functions for each cell and after each row
|
||||
|
||||
Writing .xlsx files:
|
||||
|
@ -1,5 +1,5 @@
|
||||
# depslib dependency file v1.0
|
||||
1649959621 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_read.c
|
||||
1685461505 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_read.c
|
||||
"xlsxio_private.h"
|
||||
"xlsxio_read_sharedstrings.h"
|
||||
"xlsxio_read.h"
|
||||
@ -9,6 +9,7 @@
|
||||
<inttypes.h>
|
||||
<string.h>
|
||||
<expat.h>
|
||||
<mz_compat.h>
|
||||
<minizip/unzip.h>
|
||||
<io.h>
|
||||
<unistd.h>
|
||||
@ -27,7 +28,7 @@
|
||||
<time.h>
|
||||
<wchar.h>
|
||||
|
||||
1650012349 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
1685461680 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
|
||||
1522321402 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_read_sharedstrings.c
|
||||
"xlsxio_private.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
# depslib dependency file v1.0
|
||||
1649959621 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_read.c
|
||||
1685461505 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_read.c
|
||||
"xlsxio_private.h"
|
||||
"xlsxio_read_sharedstrings.h"
|
||||
"xlsxio_read.h"
|
||||
@ -9,6 +9,7 @@
|
||||
<inttypes.h>
|
||||
<string.h>
|
||||
<expat.h>
|
||||
<mz_compat.h>
|
||||
<minizip/unzip.h>
|
||||
<io.h>
|
||||
<unistd.h>
|
||||
@ -27,7 +28,7 @@
|
||||
<time.h>
|
||||
<wchar.h>
|
||||
|
||||
1650012349 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
1685461680 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
|
||||
1522321402 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_read_sharedstrings.c
|
||||
"xlsxio_private.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
# depslib dependency file v1.0
|
||||
1649959621 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_read.c
|
||||
1685461505 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_read.c
|
||||
"xlsxio_private.h"
|
||||
"xlsxio_read_sharedstrings.h"
|
||||
"xlsxio_read.h"
|
||||
@ -9,6 +9,7 @@
|
||||
<inttypes.h>
|
||||
<string.h>
|
||||
<expat.h>
|
||||
<mz_compat.h>
|
||||
<minizip/unzip.h>
|
||||
<io.h>
|
||||
<unistd.h>
|
||||
@ -27,7 +28,7 @@
|
||||
<time.h>
|
||||
<wchar.h>
|
||||
|
||||
1650012349 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
1685461680 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
|
||||
1522321402 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_read_sharedstrings.c
|
||||
"xlsxio_private.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
# depslib dependency file v1.0
|
||||
1649959621 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_read.c
|
||||
1685461505 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_read.c
|
||||
"xlsxio_private.h"
|
||||
"xlsxio_read_sharedstrings.h"
|
||||
"xlsxio_read.h"
|
||||
@ -9,6 +9,7 @@
|
||||
<inttypes.h>
|
||||
<string.h>
|
||||
<expat.h>
|
||||
<mz_compat.h>
|
||||
<minizip/unzip.h>
|
||||
<io.h>
|
||||
<unistd.h>
|
||||
@ -27,7 +28,7 @@
|
||||
<time.h>
|
||||
<wchar.h>
|
||||
|
||||
1650012349 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
1685461680 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
|
||||
1522321402 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_read_sharedstrings.c
|
||||
"xlsxio_private.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
# depslib dependency file v1.0
|
||||
1615571496 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_write.c
|
||||
1667387741 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_write.c
|
||||
"xlsxio_write.h"
|
||||
"xlsxio_version.h"
|
||||
<stdlib.h>
|
||||
@ -10,6 +10,7 @@
|
||||
<unistd.h>
|
||||
<fcntl.h>
|
||||
<stdarg.h>
|
||||
<mz_compat.h>
|
||||
<minizip/zip.h>
|
||||
<zip.h>
|
||||
<windows.h>
|
||||
@ -20,7 +21,7 @@
|
||||
<stdint.h>
|
||||
<time.h>
|
||||
|
||||
1650012349 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
1685461680 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
|
||||
1584724326 source:z:\xlsxio\lib\xlsxio_write.c
|
||||
"xlsxio_write.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
# depslib dependency file v1.0
|
||||
1615571496 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_write.c
|
||||
1667387741 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_write.c
|
||||
"xlsxio_write.h"
|
||||
"xlsxio_version.h"
|
||||
<stdlib.h>
|
||||
@ -10,6 +10,7 @@
|
||||
<unistd.h>
|
||||
<fcntl.h>
|
||||
<stdarg.h>
|
||||
<mz_compat.h>
|
||||
<minizip/zip.h>
|
||||
<zip.h>
|
||||
<windows.h>
|
||||
@ -20,7 +21,7 @@
|
||||
<stdint.h>
|
||||
<time.h>
|
||||
|
||||
1650012349 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
1685461680 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
|
||||
1615567896 source:z:\xlsxio\lib\xlsxio_write.c
|
||||
"xlsxio_write.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
# depslib dependency file v1.0
|
||||
1615571496 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_write.c
|
||||
1667387741 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_write.c
|
||||
"xlsxio_write.h"
|
||||
"xlsxio_version.h"
|
||||
<stdlib.h>
|
||||
@ -10,6 +10,7 @@
|
||||
<unistd.h>
|
||||
<fcntl.h>
|
||||
<stdarg.h>
|
||||
<mz_compat.h>
|
||||
<minizip/zip.h>
|
||||
<zip.h>
|
||||
<windows.h>
|
||||
@ -20,7 +21,7 @@
|
||||
<stdint.h>
|
||||
<time.h>
|
||||
|
||||
1650012349 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
1685461680 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
|
||||
1584724326 source:z:\xlsxio\lib\xlsxio_write.c
|
||||
"xlsxio_write.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
# depslib dependency file v1.0
|
||||
1615571496 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_write.c
|
||||
1667387741 source:\\server\users\brecht\sources\cpp\xlsxio\lib\xlsxio_write.c
|
||||
"xlsxio_write.h"
|
||||
"xlsxio_version.h"
|
||||
<stdlib.h>
|
||||
@ -10,6 +10,7 @@
|
||||
<unistd.h>
|
||||
<fcntl.h>
|
||||
<stdarg.h>
|
||||
<mz_compat.h>
|
||||
<minizip/zip.h>
|
||||
<zip.h>
|
||||
<windows.h>
|
||||
@ -20,7 +21,7 @@
|
||||
<stdint.h>
|
||||
<time.h>
|
||||
|
||||
1650012349 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
1685461680 \\server\users\brecht\sources\cpp\xlsxio\include\xlsxio_version.h
|
||||
|
||||
1584724326 source:z:\xlsxio\lib\xlsxio_write.c
|
||||
"xlsxio_write.h"
|
||||
|
@ -35,12 +35,12 @@ THE SOFTWARE.
|
||||
|
||||
const char* filename = "example.xlsx";
|
||||
|
||||
//calback data structure for listing sheets
|
||||
//callback data structure for listing sheets
|
||||
struct xlsx_list_sheets_data {
|
||||
char* firstsheet;
|
||||
};
|
||||
|
||||
//calback function for listing sheets
|
||||
//callback function for listing sheets
|
||||
int xlsx_list_sheets_callback (const char* name, void* callbackdata)
|
||||
{
|
||||
struct xlsx_list_sheets_data* data = (struct xlsx_list_sheets_data*)callbackdata;
|
||||
@ -50,14 +50,14 @@ int xlsx_list_sheets_callback (const char* name, void* callbackdata)
|
||||
return 0;
|
||||
}
|
||||
|
||||
//calback function for end of row
|
||||
//callback function for end of row
|
||||
int sheet_row_callback (size_t row, size_t maxcol, void* callbackdata)
|
||||
{
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//calback function for cell data
|
||||
//callback function for cell data
|
||||
int sheet_cell_callback (size_t row, size_t col, const XLSXIOCHAR* value, void* callbackdata)
|
||||
{
|
||||
if (col > 1)
|
||||
|
@ -1149,7 +1149,7 @@ void data_sheet_expat_callback_find_cell_start (void* callbackdata, const XML_Ch
|
||||
}
|
||||
}
|
||||
}
|
||||
//determing value type
|
||||
//determine value type
|
||||
if ((t = get_expat_attr_by_name(atts, X("t"))) != NULL && XML_Char_icmp(t, X("s")) == 0)
|
||||
data->cell_string_type = shared_string;
|
||||
else
|
||||
@ -1623,7 +1623,7 @@ DLL_EXPORT_XLSXIO int xlsxioread_sheet_next_cell_datetime (xlsxioreadersheet she
|
||||
if (pvalue) {
|
||||
double value = XML_Char_tod(result);
|
||||
if (value != 0) {
|
||||
value = (value - 25569) * 86400; //converstion from Excel to Unix timestamp
|
||||
value = (value - 25569) * 86400; //conversion from Excel to Unix timestamp
|
||||
}
|
||||
*pvalue = value;
|
||||
}
|
||||
|
@ -537,7 +537,7 @@ char* get_A1col (uint64_t col)
|
||||
{
|
||||
char* result = NULL;
|
||||
size_t resultlen = 0;
|
||||
//allocate 19 bytes as the maximum value for 64-bit devided by 26 has 18 digits
|
||||
//allocate 19 bytes as the maximum value for 64-bit divided by 26 has 18 digits
|
||||
if (col > 0 && (result = (char*)malloc(19)) != NULL) {
|
||||
result[0] = 0;
|
||||
do {
|
||||
|
Loading…
x
Reference in New Issue
Block a user