XLSX I/O
Typedefs | Functions
xlsxio_write.h File Reference

XLSX I/O header file for writing .xlsx files. More...

#include <stdlib.h>
#include <stdint.h>
#include <time.h>

Go to the source code of this file.

Typedefs

typedef struct xlsxio_write_struct * xlsxiowriter
 write handle for .xlsx object
 

Functions

DLL_EXPORT_XLSXIO void xlsxiowrite_get_version (int *pmajor, int *pminor, int *pmicro)
 get xlsxio_write version More...
 
DLL_EXPORT_XLSXIO const char * xlsxiowrite_get_version_string ()
 get xlsxio_write version string More...
 
DLL_EXPORT_XLSXIO xlsxiowriter xlsxiowrite_open (const char *filename, const char *sheetname)
 create and open .xlsx file More...
 
DLL_EXPORT_XLSXIO int xlsxiowrite_close (xlsxiowriter handle)
 close .xlsx file More...
 
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 More...
 
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 More...
 
DLL_EXPORT_XLSXIO void xlsxiowrite_add_column (xlsxiowriter handle, const char *name, int width)
 add a column cell More...
 
DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_string (xlsxiowriter handle, const char *value)
 add a cell with string data More...
 
DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_int (xlsxiowriter handle, int64_t value)
 add a cell with integer data More...
 
DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_float (xlsxiowriter handle, double value)
 add a cell with floating point data More...
 
DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_datetime (xlsxiowriter handle, time_t value)
 add a cell with date and time data More...
 
DLL_EXPORT_XLSXIO void xlsxiowrite_next_row (xlsxiowriter handle)
 mark the end of a row (next cell will start on a new row) More...
 

Detailed Description

XLSX I/O header file for writing .xlsx files.

Author
Brecht Sanders
Date
2016

Include this header file to use XLSX I/O for writing .xlsx files and link with -lxlsxio_write.

Function Documentation

◆ xlsxiowrite_get_version()

DLL_EXPORT_XLSXIO void xlsxiowrite_get_version ( int *  pmajor,
int *  pminor,
int *  pmicro 
)

get xlsxio_write version

Parameters
pmajorpointer to integer that will receive major version number
pminorpointer to integer that will receive minor version number
pmicropointer to integer that will receive micro version number
See also
xlsxiowrite_get_version_string()

◆ xlsxiowrite_get_version_string()

DLL_EXPORT_XLSXIO const char* xlsxiowrite_get_version_string ( )

get xlsxio_write version string

Returns
version string
See also
xlsxiowrite_get_version()

◆ xlsxiowrite_open()

DLL_EXPORT_XLSXIO xlsxiowriter xlsxiowrite_open ( const char *  filename,
const char *  sheetname 
)

create and open .xlsx file

Parameters
filenamepath of .xlsx file to open
sheetnamename of worksheet
Returns
write handle for .xlsx object or NULL on error
See also
xlsxiowrite_close()

◆ xlsxiowrite_close()

DLL_EXPORT_XLSXIO int xlsxiowrite_close ( xlsxiowriter  handle)

close .xlsx file

Parameters
handlewrite handle for .xlsx object
Returns
zero on success, non-zero on error
See also
xlsxiowrite_open()

◆ 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

Parameters
handlewrite handle for .xlsx object
rowsnumber of rows to buffer in memory, zero for none Must be called before the first call to xlsxiowrite_next_row()
See also
xlsxiowrite_add_column()
xlsxiowrite_next_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

Parameters
handlewrite handle for .xlsx object
heightrow height (in text lines), zero for unspecified Must be called before the first call to any xlsxiowrite_add_ function of the current row
See also
xlsxiowrite_next_row()

◆ xlsxiowrite_add_column()

DLL_EXPORT_XLSXIO void xlsxiowrite_add_column ( xlsxiowriter  handle,
const char *  name,
int  width 
)

add a column cell

Parameters
handlewrite handle for .xlsx object
namecolumn name
widthcolumn width (in characters) Only one row of column names is supported or none. Call for each column, and finish column row by calling xlsxiowrite_next_row(). Must be called before any xlsxiowrite_next_row() or the xlsxiowrite_add_cell_ functions.
See also
xlsxiowrite_next_row()
xlsxiowrite_set_detection_rows()

◆ xlsxiowrite_add_cell_string()

DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_string ( xlsxiowriter  handle,
const char *  value 
)

add a cell with string data

Parameters
handlewrite handle for .xlsx object
valuestring value
See also
xlsxiowrite_next_row()

◆ xlsxiowrite_add_cell_int()

DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_int ( xlsxiowriter  handle,
int64_t  value 
)

add a cell with integer data

Parameters
handlewrite handle for .xlsx object
valueinteger value
See also
xlsxiowrite_next_row()

◆ xlsxiowrite_add_cell_float()

DLL_EXPORT_XLSXIO void xlsxiowrite_add_cell_float ( xlsxiowriter  handle,
double  value 
)

add a cell with floating point data

Parameters
handlewrite handle for .xlsx object
valuefloating point value
See also
xlsxiowrite_next_row()

◆ 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

Parameters
handlewrite handle for .xlsx object
valuedate and time value
See also
xlsxiowrite_next_row()

◆ 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)

Parameters
handlewrite handle for .xlsx object
See also
xlsxiowrite_add_cell_string()