fast_excel 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -7
- data/CHANGELOG.md +9 -0
- data/Gemfile +1 -1
- data/examples/example.rb +2 -0
- data/examples/example_date_time.rb +38 -0
- data/fast_excel.gemspec +2 -2
- data/lib/fast_excel/binding/format.rb +17 -0
- data/lib/fast_excel/binding/workbook.rb +39 -17
- data/lib/fast_excel/binding/worksheet.rb +57 -13
- data/lib/fast_excel/binding.rb +7 -7
- data/lib/fast_excel.rb +27 -20
- data/libxlsxwriter/.github/FUNDING.yml +1 -0
- data/libxlsxwriter/.github/ISSUE_TEMPLATE.md +85 -0
- data/libxlsxwriter/.github/PULL_REQUEST_TEMPLATE.md +130 -0
- data/libxlsxwriter/.github/workflows/cmake_actions.yml +48 -0
- data/libxlsxwriter/.github/workflows/code_style.yml +23 -0
- data/libxlsxwriter/.github/workflows/coverity.yml +22 -0
- data/libxlsxwriter/.github/workflows/make_actions.yml +52 -0
- data/libxlsxwriter/.github/workflows/valgrind.yml +23 -0
- data/libxlsxwriter/.github/workflows/windows_build.yml +54 -0
- data/libxlsxwriter/.github/workflows/zig_build.yml +22 -0
- data/libxlsxwriter/.gitignore +16 -1
- data/libxlsxwriter/.indent.pro +24 -0
- data/libxlsxwriter/CMakeLists.txt +156 -56
- data/libxlsxwriter/CONTRIBUTING.md +2 -2
- data/libxlsxwriter/Changes.txt +344 -2
- data/libxlsxwriter/LICENSE.txt +66 -8
- data/libxlsxwriter/Makefile +151 -54
- data/libxlsxwriter/Package.swift +42 -0
- data/libxlsxwriter/Readme.md +4 -2
- data/libxlsxwriter/build.zig +324 -0
- data/libxlsxwriter/build.zig.zon +11 -0
- data/libxlsxwriter/cmake/FindMINIZIP.cmake +3 -3
- data/libxlsxwriter/cocoapods/libxlsxwriter-umbrella.h +6 -0
- data/libxlsxwriter/include/xlsxwriter/app.h +2 -1
- data/libxlsxwriter/include/xlsxwriter/chart.h +236 -32
- data/libxlsxwriter/include/xlsxwriter/chartsheet.h +7 -7
- data/libxlsxwriter/include/xlsxwriter/comment.h +76 -0
- data/libxlsxwriter/include/xlsxwriter/common.h +111 -50
- data/libxlsxwriter/include/xlsxwriter/content_types.h +8 -1
- data/libxlsxwriter/include/xlsxwriter/core.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/custom.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/drawing.h +11 -20
- data/libxlsxwriter/include/xlsxwriter/format.h +121 -8
- data/libxlsxwriter/include/xlsxwriter/hash_table.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/metadata.h +49 -0
- data/libxlsxwriter/include/xlsxwriter/packager.h +27 -16
- data/libxlsxwriter/include/xlsxwriter/relationships.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/shared_strings.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/styles.h +13 -7
- data/libxlsxwriter/include/xlsxwriter/table.h +51 -0
- data/libxlsxwriter/include/xlsxwriter/theme.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/third_party/emyg_dtoa.h +26 -0
- data/libxlsxwriter/include/xlsxwriter/third_party/ioapi.h +27 -25
- data/libxlsxwriter/include/xlsxwriter/third_party/md5.h +45 -0
- data/libxlsxwriter/include/xlsxwriter/third_party/zip.h +155 -153
- data/libxlsxwriter/include/xlsxwriter/utility.h +70 -8
- data/libxlsxwriter/include/xlsxwriter/vml.h +55 -0
- data/libxlsxwriter/include/xlsxwriter/workbook.h +218 -47
- data/libxlsxwriter/include/xlsxwriter/worksheet.h +2770 -241
- data/libxlsxwriter/include/xlsxwriter/xmlwriter.h +12 -8
- data/libxlsxwriter/include/xlsxwriter.h +4 -2
- data/libxlsxwriter/libxlsxwriter.podspec +8 -5
- data/libxlsxwriter/src/Makefile +58 -21
- data/libxlsxwriter/src/app.c +5 -2
- data/libxlsxwriter/src/chart.c +396 -81
- data/libxlsxwriter/src/chartsheet.c +22 -22
- data/libxlsxwriter/src/comment.c +443 -0
- data/libxlsxwriter/src/content_types.c +40 -1
- data/libxlsxwriter/src/core.c +2 -2
- data/libxlsxwriter/src/custom.c +1 -1
- data/libxlsxwriter/src/drawing.c +160 -40
- data/libxlsxwriter/src/format.c +109 -25
- data/libxlsxwriter/src/hash_table.c +1 -1
- data/libxlsxwriter/src/metadata.c +283 -0
- data/libxlsxwriter/src/packager.c +794 -94
- data/libxlsxwriter/src/relationships.c +1 -1
- data/libxlsxwriter/src/shared_strings.c +2 -4
- data/libxlsxwriter/src/styles.c +353 -58
- data/libxlsxwriter/src/table.c +304 -0
- data/libxlsxwriter/src/theme.c +1 -1
- data/libxlsxwriter/src/utility.c +143 -43
- data/libxlsxwriter/src/vml.c +1062 -0
- data/libxlsxwriter/src/workbook.c +567 -77
- data/libxlsxwriter/src/worksheet.c +6668 -1462
- data/libxlsxwriter/src/xmlwriter.c +95 -5
- data/libxlsxwriter/third_party/dtoa/Makefile +42 -0
- data/libxlsxwriter/third_party/dtoa/emyg_dtoa.c +461 -0
- data/libxlsxwriter/third_party/dtoa/emyg_dtoa.h +26 -0
- data/libxlsxwriter/third_party/md5/Makefile +42 -0
- data/libxlsxwriter/third_party/md5/md5.c +291 -0
- data/libxlsxwriter/third_party/md5/md5.h +45 -0
- data/libxlsxwriter/third_party/minizip/Makefile +3 -8
- data/libxlsxwriter/third_party/minizip/Makefile.orig +8 -4
- data/libxlsxwriter/third_party/minizip/MiniZip64_Changes.txt +1 -1
- data/libxlsxwriter/third_party/minizip/configure.ac +1 -1
- data/libxlsxwriter/third_party/minizip/crypt.h +13 -16
- data/libxlsxwriter/third_party/minizip/ioapi.c +31 -57
- data/libxlsxwriter/third_party/minizip/ioapi.h +31 -23
- data/libxlsxwriter/third_party/minizip/iowin32.c +29 -45
- data/libxlsxwriter/third_party/minizip/iowin32.h +4 -4
- data/libxlsxwriter/third_party/minizip/miniunz.c +29 -56
- data/libxlsxwriter/third_party/minizip/minizip.c +38 -49
- data/libxlsxwriter/third_party/minizip/mztools.c +1 -7
- data/libxlsxwriter/third_party/minizip/unzip.c +202 -342
- data/libxlsxwriter/third_party/minizip/unzip.h +74 -74
- data/libxlsxwriter/third_party/minizip/zip.c +165 -218
- data/libxlsxwriter/third_party/minizip/zip.h +164 -154
- data/libxlsxwriter/third_party/tmpfileplus/Makefile +3 -3
- data/libxlsxwriter/version.txt +1 -1
- data/test/auto_width_test.rb +20 -0
- data/test/default_format_test.rb +1 -1
- data/test/validations_test.rb +3 -3
- data/test/worksheet_test.rb +6 -1
- metadata +33 -7
- data/libxlsxwriter/.travis.yml +0 -37
@@ -49,7 +49,7 @@
|
|
49
49
|
extern "C" {
|
50
50
|
#endif
|
51
51
|
|
52
|
-
|
52
|
+
/*#define HAVE_BZIP2*/
|
53
53
|
|
54
54
|
#ifndef _ZLIB_H
|
55
55
|
#include "zlib.h"
|
@@ -101,12 +101,12 @@ typedef voidp zipFile;
|
|
101
101
|
/* tm_zip contain date/time info */
|
102
102
|
typedef struct tm_zip_s
|
103
103
|
{
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
104
|
+
int tm_sec; /* seconds after the minute - [0,59] */
|
105
|
+
int tm_min; /* minutes after the hour - [0,59] */
|
106
|
+
int tm_hour; /* hours since midnight - [0,23] */
|
107
|
+
int tm_mday; /* day of the month - [1,31] */
|
108
|
+
int tm_mon; /* months since January - [0,11] */
|
109
|
+
int tm_year; /* years - [1980..2044] */
|
110
110
|
} tm_zip;
|
111
111
|
|
112
112
|
typedef struct
|
@@ -126,8 +126,8 @@ typedef const char* zipcharpc;
|
|
126
126
|
#define APPEND_STATUS_CREATEAFTER (1)
|
127
127
|
#define APPEND_STATUS_ADDINZIP (2)
|
128
128
|
|
129
|
-
extern zipFile ZEXPORT zipOpen
|
130
|
-
extern zipFile ZEXPORT zipOpen64
|
129
|
+
extern zipFile ZEXPORT zipOpen(const char *pathname, int append);
|
130
|
+
extern zipFile ZEXPORT zipOpen64(const void *pathname, int append);
|
131
131
|
/*
|
132
132
|
Create a zipfile.
|
133
133
|
pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on
|
@@ -144,41 +144,46 @@ extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
|
|
144
144
|
|
145
145
|
/* Note : there is no delete function into a zipfile.
|
146
146
|
If you want delete file into a zipfile, you must open a zipfile, and create another
|
147
|
-
Of
|
147
|
+
Of course, you can use RAW reading and writing to copy the file you did not want delete
|
148
148
|
*/
|
149
149
|
|
150
|
-
extern zipFile ZEXPORT zipOpen2
|
151
|
-
|
152
|
-
|
153
|
-
|
150
|
+
extern zipFile ZEXPORT zipOpen2(const char *pathname,
|
151
|
+
int append,
|
152
|
+
zipcharpc* globalcomment,
|
153
|
+
zlib_filefunc_def* pzlib_filefunc_def);
|
154
154
|
|
155
|
-
extern zipFile ZEXPORT zipOpen2_64
|
155
|
+
extern zipFile ZEXPORT zipOpen2_64(const void *pathname,
|
156
156
|
int append,
|
157
157
|
zipcharpc* globalcomment,
|
158
|
-
zlib_filefunc64_def* pzlib_filefunc_def)
|
159
|
-
|
160
|
-
extern
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
158
|
+
zlib_filefunc64_def* pzlib_filefunc_def);
|
159
|
+
|
160
|
+
extern zipFile ZEXPORT zipOpen3(const void *pathname,
|
161
|
+
int append,
|
162
|
+
zipcharpc* globalcomment,
|
163
|
+
zlib_filefunc64_32_def* pzlib_filefunc64_32_def);
|
164
|
+
|
165
|
+
extern int ZEXPORT zipOpenNewFileInZip(zipFile file,
|
166
|
+
const char* filename,
|
167
|
+
const zip_fileinfo* zipfi,
|
168
|
+
const void* extrafield_local,
|
169
|
+
uInt size_extrafield_local,
|
170
|
+
const void* extrafield_global,
|
171
|
+
uInt size_extrafield_global,
|
172
|
+
const char* comment,
|
173
|
+
int method,
|
174
|
+
int level);
|
175
|
+
|
176
|
+
extern int ZEXPORT zipOpenNewFileInZip64(zipFile file,
|
177
|
+
const char* filename,
|
178
|
+
const zip_fileinfo* zipfi,
|
179
|
+
const void* extrafield_local,
|
180
|
+
uInt size_extrafield_local,
|
181
|
+
const void* extrafield_global,
|
182
|
+
uInt size_extrafield_global,
|
183
|
+
const char* comment,
|
184
|
+
int method,
|
185
|
+
int level,
|
186
|
+
int zip64);
|
182
187
|
|
183
188
|
/*
|
184
189
|
Open a file in the ZIP for writing.
|
@@ -197,70 +202,69 @@ extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file,
|
|
197
202
|
*/
|
198
203
|
|
199
204
|
|
200
|
-
extern int ZEXPORT zipOpenNewFileInZip2
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
extern int ZEXPORT zipOpenNewFileInZip2_64
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
205
|
+
extern int ZEXPORT zipOpenNewFileInZip2(zipFile file,
|
206
|
+
const char* filename,
|
207
|
+
const zip_fileinfo* zipfi,
|
208
|
+
const void* extrafield_local,
|
209
|
+
uInt size_extrafield_local,
|
210
|
+
const void* extrafield_global,
|
211
|
+
uInt size_extrafield_global,
|
212
|
+
const char* comment,
|
213
|
+
int method,
|
214
|
+
int level,
|
215
|
+
int raw);
|
216
|
+
|
217
|
+
|
218
|
+
extern int ZEXPORT zipOpenNewFileInZip2_64(zipFile file,
|
219
|
+
const char* filename,
|
220
|
+
const zip_fileinfo* zipfi,
|
221
|
+
const void* extrafield_local,
|
222
|
+
uInt size_extrafield_local,
|
223
|
+
const void* extrafield_global,
|
224
|
+
uInt size_extrafield_global,
|
225
|
+
const char* comment,
|
226
|
+
int method,
|
227
|
+
int level,
|
228
|
+
int raw,
|
229
|
+
int zip64);
|
225
230
|
/*
|
226
231
|
Same than zipOpenNewFileInZip, except if raw=1, we write raw file
|
227
232
|
*/
|
228
233
|
|
229
|
-
extern int ZEXPORT zipOpenNewFileInZip3
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
extern int ZEXPORT zipOpenNewFileInZip3_64
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
));
|
234
|
+
extern int ZEXPORT zipOpenNewFileInZip3(zipFile file,
|
235
|
+
const char* filename,
|
236
|
+
const zip_fileinfo* zipfi,
|
237
|
+
const void* extrafield_local,
|
238
|
+
uInt size_extrafield_local,
|
239
|
+
const void* extrafield_global,
|
240
|
+
uInt size_extrafield_global,
|
241
|
+
const char* comment,
|
242
|
+
int method,
|
243
|
+
int level,
|
244
|
+
int raw,
|
245
|
+
int windowBits,
|
246
|
+
int memLevel,
|
247
|
+
int strategy,
|
248
|
+
const char* password,
|
249
|
+
uLong crcForCrypting);
|
250
|
+
|
251
|
+
extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file,
|
252
|
+
const char* filename,
|
253
|
+
const zip_fileinfo* zipfi,
|
254
|
+
const void* extrafield_local,
|
255
|
+
uInt size_extrafield_local,
|
256
|
+
const void* extrafield_global,
|
257
|
+
uInt size_extrafield_global,
|
258
|
+
const char* comment,
|
259
|
+
int method,
|
260
|
+
int level,
|
261
|
+
int raw,
|
262
|
+
int windowBits,
|
263
|
+
int memLevel,
|
264
|
+
int strategy,
|
265
|
+
const char* password,
|
266
|
+
uLong crcForCrypting,
|
267
|
+
int zip64);
|
264
268
|
|
265
269
|
/*
|
266
270
|
Same than zipOpenNewFileInZip2, except
|
@@ -269,47 +273,45 @@ extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file,
|
|
269
273
|
crcForCrypting : crc of file to compress (needed for crypting)
|
270
274
|
*/
|
271
275
|
|
272
|
-
extern int ZEXPORT zipOpenNewFileInZip4
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
int zip64
|
312
|
-
));
|
276
|
+
extern int ZEXPORT zipOpenNewFileInZip4(zipFile file,
|
277
|
+
const char* filename,
|
278
|
+
const zip_fileinfo* zipfi,
|
279
|
+
const void* extrafield_local,
|
280
|
+
uInt size_extrafield_local,
|
281
|
+
const void* extrafield_global,
|
282
|
+
uInt size_extrafield_global,
|
283
|
+
const char* comment,
|
284
|
+
int method,
|
285
|
+
int level,
|
286
|
+
int raw,
|
287
|
+
int windowBits,
|
288
|
+
int memLevel,
|
289
|
+
int strategy,
|
290
|
+
const char* password,
|
291
|
+
uLong crcForCrypting,
|
292
|
+
uLong versionMadeBy,
|
293
|
+
uLong flagBase);
|
294
|
+
|
295
|
+
|
296
|
+
extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file,
|
297
|
+
const char* filename,
|
298
|
+
const zip_fileinfo* zipfi,
|
299
|
+
const void* extrafield_local,
|
300
|
+
uInt size_extrafield_local,
|
301
|
+
const void* extrafield_global,
|
302
|
+
uInt size_extrafield_global,
|
303
|
+
const char* comment,
|
304
|
+
int method,
|
305
|
+
int level,
|
306
|
+
int raw,
|
307
|
+
int windowBits,
|
308
|
+
int memLevel,
|
309
|
+
int strategy,
|
310
|
+
const char* password,
|
311
|
+
uLong crcForCrypting,
|
312
|
+
uLong versionMadeBy,
|
313
|
+
uLong flagBase,
|
314
|
+
int zip64);
|
313
315
|
/*
|
314
316
|
Same than zipOpenNewFileInZip4, except
|
315
317
|
versionMadeBy : value for Version made by field
|
@@ -317,25 +319,25 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file,
|
|
317
319
|
*/
|
318
320
|
|
319
321
|
|
320
|
-
extern int ZEXPORT zipWriteInFileInZip
|
321
|
-
|
322
|
-
|
322
|
+
extern int ZEXPORT zipWriteInFileInZip(zipFile file,
|
323
|
+
const void* buf,
|
324
|
+
unsigned len);
|
323
325
|
/*
|
324
326
|
Write data in the zipfile
|
325
327
|
*/
|
326
328
|
|
327
|
-
extern int ZEXPORT zipCloseFileInZip
|
329
|
+
extern int ZEXPORT zipCloseFileInZip(zipFile file);
|
328
330
|
/*
|
329
331
|
Close the current file in the zipfile
|
330
332
|
*/
|
331
333
|
|
332
|
-
extern int ZEXPORT zipCloseFileInZipRaw
|
333
|
-
|
334
|
-
|
334
|
+
extern int ZEXPORT zipCloseFileInZipRaw(zipFile file,
|
335
|
+
uLong uncompressed_size,
|
336
|
+
uLong crc32);
|
335
337
|
|
336
|
-
extern int ZEXPORT zipCloseFileInZipRaw64
|
337
|
-
|
338
|
-
|
338
|
+
extern int ZEXPORT zipCloseFileInZipRaw64(zipFile file,
|
339
|
+
ZPOS64_T uncompressed_size,
|
340
|
+
uLong crc32);
|
339
341
|
|
340
342
|
/*
|
341
343
|
Close the current file in the zipfile, for file opened with
|
@@ -343,14 +345,14 @@ extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file,
|
|
343
345
|
uncompressed_size and crc32 are value for the uncompressed size
|
344
346
|
*/
|
345
347
|
|
346
|
-
extern int ZEXPORT zipClose
|
347
|
-
|
348
|
+
extern int ZEXPORT zipClose(zipFile file,
|
349
|
+
const char* global_comment);
|
348
350
|
/*
|
349
351
|
Close the zipfile
|
350
352
|
*/
|
351
353
|
|
352
354
|
|
353
|
-
extern int ZEXPORT zipRemoveExtraInfoBlock
|
355
|
+
extern int ZEXPORT zipRemoveExtraInfoBlock(char* pData, int* dataLen, short sHeader);
|
354
356
|
/*
|
355
357
|
zipRemoveExtraInfoBlock - Added by Mathias Svensson
|
356
358
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* libxlsxwriter
|
3
3
|
*
|
4
|
-
* Copyright 2014-
|
4
|
+
* Copyright 2014-2022, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
|
5
5
|
*/
|
6
6
|
|
7
7
|
/**
|
@@ -9,7 +9,7 @@
|
|
9
9
|
*
|
10
10
|
* @brief Utility functions for libxlsxwriter.
|
11
11
|
*
|
12
|
-
* <!-- Copyright 2014-
|
12
|
+
* <!-- Copyright 2014-2022, John McNamara, jmcnamara@cpan.org -->
|
13
13
|
*
|
14
14
|
*/
|
15
15
|
|
@@ -17,7 +17,9 @@
|
|
17
17
|
#define __LXW_UTILITY_H__
|
18
18
|
|
19
19
|
#include <stdint.h>
|
20
|
+
#ifndef _MSC_VER
|
20
21
|
#include <strings.h>
|
22
|
+
#endif
|
21
23
|
#include "common.h"
|
22
24
|
#include "xmlwriter.h"
|
23
25
|
|
@@ -101,6 +103,20 @@ extern "C" {
|
|
101
103
|
*/
|
102
104
|
const char *lxw_version(void);
|
103
105
|
|
106
|
+
/**
|
107
|
+
* @brief Retrieve the library version ID.
|
108
|
+
*
|
109
|
+
* @return The version ID.
|
110
|
+
*
|
111
|
+
* Get the library version such as "X.Y.Z" as a XYZ integer.
|
112
|
+
*
|
113
|
+
* @code
|
114
|
+
* printf("Libxlsxwriter version id = %d\n", lxw_version_id());
|
115
|
+
* @endcode
|
116
|
+
*
|
117
|
+
*/
|
118
|
+
uint16_t lxw_version_id(void);
|
119
|
+
|
104
120
|
/**
|
105
121
|
* @brief Converts a libxlsxwriter error number to a string.
|
106
122
|
*
|
@@ -155,10 +171,52 @@ void lxw_rowcol_to_formula_abs(char *formula, const char *sheetname,
|
|
155
171
|
|
156
172
|
uint32_t lxw_name_to_row(const char *row_str);
|
157
173
|
uint16_t lxw_name_to_col(const char *col_str);
|
174
|
+
|
158
175
|
uint32_t lxw_name_to_row_2(const char *row_str);
|
159
176
|
uint16_t lxw_name_to_col_2(const char *col_str);
|
160
177
|
|
161
|
-
|
178
|
+
/**
|
179
|
+
* @brief Converts a #lxw_datetime to an Excel datetime number.
|
180
|
+
*
|
181
|
+
* @param datetime A pointer to a #lxw_datetime struct.
|
182
|
+
*
|
183
|
+
* @return A double representing an Excel datetime.
|
184
|
+
*
|
185
|
+
* The `%lxw_datetime_to_excel_datetime()` function converts a datetime in
|
186
|
+
* #lxw_datetime to an Excel datetime number:
|
187
|
+
*
|
188
|
+
* @code
|
189
|
+
* lxw_datetime datetime = {2013, 2, 28, 12, 0, 0.0};
|
190
|
+
*
|
191
|
+
* double excel_datetime = lxw_datetime_to_excel_date(&datetime);
|
192
|
+
* @endcode
|
193
|
+
*
|
194
|
+
* See @ref working_with_dates for more details on the Excel datetime format.
|
195
|
+
*/
|
196
|
+
double lxw_datetime_to_excel_datetime(lxw_datetime *datetime);
|
197
|
+
|
198
|
+
double lxw_datetime_to_excel_date_epoch(lxw_datetime *datetime,
|
199
|
+
uint8_t date_1904);
|
200
|
+
|
201
|
+
/**
|
202
|
+
* @brief Converts a unix datetime to an Excel datetime number.
|
203
|
+
*
|
204
|
+
* @param unixtime Unix time (seconds since 1970-01-01)
|
205
|
+
*
|
206
|
+
* @return A double representing an Excel datetime.
|
207
|
+
*
|
208
|
+
* The `%lxw_unixtime_to_excel_date()` function converts a unix datetime to
|
209
|
+
* an Excel datetime number:
|
210
|
+
*
|
211
|
+
* @code
|
212
|
+
* double excel_datetime = lxw_unixtime_to_excel_date(946684800);
|
213
|
+
* @endcode
|
214
|
+
*
|
215
|
+
* See @ref working_with_dates for more details.
|
216
|
+
*/
|
217
|
+
double lxw_unixtime_to_excel_date(int64_t unixtime);
|
218
|
+
|
219
|
+
double lxw_unixtime_to_excel_date_epoch(int64_t unixtime, uint8_t date_1904);
|
162
220
|
|
163
221
|
char *lxw_strdup(const char *str);
|
164
222
|
char *lxw_strdup_formula(const char *formula);
|
@@ -174,15 +232,19 @@ void lxw_str_tolower(char *str);
|
|
174
232
|
#define lxw_strcasecmp strcasecmp
|
175
233
|
#endif
|
176
234
|
|
177
|
-
FILE *lxw_tmpfile(char *tmpdir);
|
235
|
+
FILE *lxw_tmpfile(const char *tmpdir);
|
236
|
+
FILE *lxw_get_filehandle(char **buf, size_t *size, const char *tmpdir);
|
237
|
+
FILE *lxw_fopen(const char *filename, const char *mode);
|
178
238
|
|
179
|
-
/* Use
|
180
|
-
* macro
|
181
|
-
|
239
|
+
/* Use the third party dtoa function to avoid locale issues with sprintf
|
240
|
+
* double formatting. Otherwise we use a simple macro that falls back to the
|
241
|
+
* default c-lib sprintf.
|
242
|
+
*/
|
243
|
+
#ifdef USE_DTOA_LIBRARY
|
182
244
|
int lxw_sprintf_dbl(char *data, double number);
|
183
245
|
#else
|
184
246
|
#define lxw_sprintf_dbl(data, number) \
|
185
|
-
lxw_snprintf(data, LXW_ATTR_32, "%.
|
247
|
+
lxw_snprintf(data, LXW_ATTR_32, "%.16G", number)
|
186
248
|
#endif
|
187
249
|
|
188
250
|
uint16_t lxw_hash_password(const char *password);
|
@@ -0,0 +1,55 @@
|
|
1
|
+
/*
|
2
|
+
* libxlsxwriter
|
3
|
+
*
|
4
|
+
* Copyright 2014-2022, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
|
5
|
+
*
|
6
|
+
* vml - A libxlsxwriter library for creating Excel XLSX vml files.
|
7
|
+
*
|
8
|
+
*/
|
9
|
+
#ifndef __LXW_VML_H__
|
10
|
+
#define __LXW_VML_H__
|
11
|
+
|
12
|
+
#include <stdint.h>
|
13
|
+
|
14
|
+
#include "common.h"
|
15
|
+
#include "worksheet.h"
|
16
|
+
|
17
|
+
/*
|
18
|
+
* Struct to represent a vml object.
|
19
|
+
*/
|
20
|
+
typedef struct lxw_vml {
|
21
|
+
|
22
|
+
FILE *file;
|
23
|
+
uint8_t type;
|
24
|
+
struct lxw_comment_objs *button_objs;
|
25
|
+
struct lxw_comment_objs *comment_objs;
|
26
|
+
struct lxw_comment_objs *image_objs;
|
27
|
+
char *vml_data_id_str;
|
28
|
+
uint32_t vml_shape_id;
|
29
|
+
uint8_t comment_display_default;
|
30
|
+
|
31
|
+
} lxw_vml;
|
32
|
+
|
33
|
+
|
34
|
+
/* *INDENT-OFF* */
|
35
|
+
#ifdef __cplusplus
|
36
|
+
extern "C" {
|
37
|
+
#endif
|
38
|
+
/* *INDENT-ON* */
|
39
|
+
|
40
|
+
lxw_vml *lxw_vml_new(void);
|
41
|
+
void lxw_vml_free(lxw_vml *vml);
|
42
|
+
void lxw_vml_assemble_xml_file(lxw_vml *self);
|
43
|
+
|
44
|
+
/* Declarations required for unit testing. */
|
45
|
+
#ifdef TESTING
|
46
|
+
|
47
|
+
#endif /* TESTING */
|
48
|
+
|
49
|
+
/* *INDENT-OFF* */
|
50
|
+
#ifdef __cplusplus
|
51
|
+
}
|
52
|
+
#endif
|
53
|
+
/* *INDENT-ON* */
|
54
|
+
|
55
|
+
#endif /* __LXW_VML_H__ */
|