/***************************************************************************** * theme - A library for creating Excel XLSX theme files. * * Used in conjunction with the libxlsxwriter library. * * Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt. * */ #include #include "xlsxwriter/xmlwriter.h" #include "xlsxwriter/theme.h" #include "xlsxwriter/utility.h" const char *theme_strs[] = { "\n", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "\n", "" }; /* * Forward declarations. */ /***************************************************************************** * * Private functions. * ****************************************************************************/ /* * Create a new theme object. */ lxw_theme * lxw_theme_new() { lxw_theme *theme = calloc(1, sizeof(lxw_theme)); GOTO_LABEL_ON_MEM_ERROR(theme, mem_error); return theme; mem_error: lxw_theme_free(theme); return NULL; } /* * Free a theme object. */ void lxw_theme_free(lxw_theme *theme) { if (!theme) return; free(theme); } /***************************************************************************** * * XML functions. * ****************************************************************************/ /* This library isn't a xmlwriter. */ /***************************************************************************** * * XML file assembly functions. * ****************************************************************************/ /* * Assemble and write the XML file. */ void lxw_theme_assemble_xml_file(lxw_theme *self) { int i = 0; while (strlen(theme_strs[i])) { fprintf(self->file, "%s", theme_strs[i]); i++; } } /***************************************************************************** * * Public functions. * ****************************************************************************/