XLSX I/O
xlsxio_write.h
Go to the documentation of this file.
1 /*****************************************************************************
2 Copyright (C) 2016 Brecht Sanders All Rights Reserved
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 THE SOFTWARE.
21 *****************************************************************************/
22 
34 #ifndef INCLUDED_XLSXIO_WRITE_H
35 #define INCLUDED_XLSXIO_WRITE_H
36 
37 #include <stdlib.h>
38 #if defined(_MSC_VER) && _MSC_VER < 1600
39 typedef signed __int64 int64_t;
40 #else
41 #include <stdint.h>
42 #endif
43 #include <time.h>
44 
46 #ifndef DLL_EXPORT_XLSXIO
47 #ifdef _WIN32
48 #if defined(BUILD_XLSXIO_DLL) || defined(BUILD_XLSXIO_SHARED) || defined(xlsxio_write_SHARED_EXPORTS)
49 #define DLL_EXPORT_XLSXIO __declspec(dllexport)
50 #elif !defined(STATIC) && !defined(BUILD_XLSXIO_STATIC) && !defined(BUILD_XLSXIO)
51 #define DLL_EXPORT_XLSXIO __declspec(dllimport)
52 #else
53 #define DLL_EXPORT_XLSXIO
54 #endif
55 #else
56 #define DLL_EXPORT_XLSXIO
57 #endif
58 #endif
59 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
71 DLL_EXPORT_XLSXIO void xlsxiowrite_get_version (int* pmajor, int* pminor, int* pmicro);
72 
77 DLL_EXPORT_XLSXIO const char* xlsxiowrite_get_version_string ();
78 
80 typedef struct xlsxio_write_struct* xlsxiowriter;
81 
88 DLL_EXPORT_XLSXIO xlsxiowriter xlsxiowrite_open (const char* filename, const char* sheetname);
89 
95 DLL_EXPORT_XLSXIO int xlsxiowrite_close (xlsxiowriter handle);
96 
104 DLL_EXPORT_XLSXIO void xlsxiowrite_set_detection_rows (xlsxiowriter handle, size_t rows);
105 
112 DLL_EXPORT_XLSXIO void xlsxiowrite_set_row_height (xlsxiowriter handle, size_t height);
113 
124 DLL_EXPORT_XLSXIO void xlsxiowrite_add_column (xlsxiowriter handle, const char* name, int width);
125 
131 DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_string (xlsxiowriter handle, const char* value);
132 
138 DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_int (xlsxiowriter handle, int64_t value);
139 
145 DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_float (xlsxiowriter handle, double value);
146 
152 DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_datetime (xlsxiowriter handle, time_t value);
153 
158 DLL_EXPORT_XLSXIO void xlsxiowrite_next_row (xlsxiowriter handle);
159 
160 #ifdef __cplusplus
161 }
162 #endif
163 
164 #endif
xlsxiowrite_get_version
DLL_EXPORT_XLSXIO void xlsxiowrite_get_version(int *pmajor, int *pminor, int *pmicro)
get xlsxio_write version
xlsxiowriter
struct xlsxio_write_struct * xlsxiowriter
write handle for .xlsx object
Definition: xlsxio_write.h:80
xlsxiowrite_add_cell_datetime
DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_datetime(xlsxiowriter handle, time_t value)
add a cell with date and time data
xlsxiowrite_add_column
DLL_EXPORT_XLSXIO void xlsxiowrite_add_column(xlsxiowriter handle, const char *name, int width)
add a column cell
xlsxiowrite_close
DLL_EXPORT_XLSXIO int xlsxiowrite_close(xlsxiowriter handle)
close .xlsx file
xlsxiowrite_get_version_string
DLL_EXPORT_XLSXIO const char * xlsxiowrite_get_version_string()
get xlsxio_write version string
xlsxiowrite_add_cell_string
DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_string(xlsxiowriter handle, const char *value)
add a cell with string data
xlsxiowrite_open
DLL_EXPORT_XLSXIO xlsxiowriter xlsxiowrite_open(const char *filename, const char *sheetname)
create and open .xlsx file
xlsxiowrite_add_cell_int
DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_int(xlsxiowriter handle, int64_t value)
add a cell with integer data
xlsxiowrite_add_cell_float
DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_float(xlsxiowriter handle, double value)
add a cell with floating point data
xlsxiowrite_next_row
DLL_EXPORT_XLSXIO void xlsxiowrite_next_row(xlsxiowriter handle)
mark the end of a row (next cell will start on a new row)
xlsxiowrite_set_row_height
DLL_EXPORT_XLSXIO void xlsxiowrite_set_row_height(xlsxiowriter handle, size_t height)
specify the row height to use for the current and next rows
xlsxiowrite_set_detection_rows
DLL_EXPORT_XLSXIO void xlsxiowrite_set_detection_rows(xlsxiowriter handle, size_t rows)
specify how many initial rows will be buffered in memory to determine column widths