Refactor includes using include-what-you-use.

This commit is contained in:
John McNamara 2021-06-17 20:30:40 +01:00
parent dcf8d418db
commit a281037198
42 changed files with 156 additions and 117 deletions

View file

@ -13,11 +13,6 @@
#ifndef __LXW_XLSXWRITER_H__
#define __LXW_XLSXWRITER_H__
#include "xlsxwriter/workbook.h"
#include "xlsxwriter/worksheet.h"
#include "xlsxwriter/format.h"
#include "xlsxwriter/utility.h"
#define LXW_VERSION "1.0.6"
#define LXW_VERSION_ID 106

View file

@ -9,8 +9,6 @@
#ifndef __LXW_APP_H__
#define __LXW_APP_H__
#include <stdint.h>
#include <string.h>
#include "workbook.h"
#include "common.h"

View file

@ -71,10 +71,6 @@
#ifndef __LXW_CHART_H__
#define __LXW_CHART_H__
#include <stdint.h>
#include <string.h>
#include "common.h"
#include "format.h"
STAILQ_HEAD(lxw_chart_series_list, lxw_chart_series);

View file

@ -57,12 +57,7 @@
#ifndef __LXW_CHARTSHEET_H__
#define __LXW_CHARTSHEET_H__
#include <stdint.h>
#include "common.h"
#include "worksheet.h"
#include "drawing.h"
#include "utility.h"
/**
* @brief Struct to represent an Excel chartsheet.

View file

@ -9,11 +9,6 @@
#ifndef __LXW_COMMENT_H__
#define __LXW_COMMENT_H__
#include <stdint.h>
#include "common.h"
#include "worksheet.h"
/* Define the tree.h RB structs for the red-black head types. */
RB_HEAD(lxw_author_ids, lxw_author_id);

View file

@ -10,11 +10,6 @@
#ifndef __LXW_CONTENT_TYPES_H__
#define __LXW_CONTENT_TYPES_H__
#include <stdint.h>
#include <string.h>
#include "common.h"
#define LXW_APP_PACKAGE "application/vnd.openxmlformats-package."
#define LXW_APP_DOCUMENT "application/vnd.openxmlformats-officedocument."
#define LXW_APP_MSEXCEL "application/vnd.ms-excel."

View file

@ -9,10 +9,7 @@
#ifndef __LXW_CORE_H__
#define __LXW_CORE_H__
#include <stdint.h>
#include "workbook.h"
#include "common.h"
/*
* Struct to represent a core.

View file

@ -9,10 +9,6 @@
#ifndef __LXW_CUSTOM_H__
#define __LXW_CUSTOM_H__
#include <stdint.h>
#include "common.h"
/*
* Struct to represent a custom property file object.
*/

View file

@ -9,11 +9,6 @@
#ifndef __LXW_DRAWING_H__
#define __LXW_DRAWING_H__
#include <stdint.h>
#include <string.h>
#include "common.h"
STAILQ_HEAD(lxw_drawing_objects, lxw_drawing_object);
enum lxw_drawing_types {

View file

@ -60,12 +60,8 @@
#ifndef __LXW_FORMAT_H__
#define __LXW_FORMAT_H__
#include <stdint.h>
#include <string.h>
#include "hash_table.h"
#include "common.h"
/**
* @brief The type for RGB colors in libxlsxwriter.
*

View file

@ -10,7 +10,7 @@
#ifndef __LXW_HASH_TABLE_H__
#define __LXW_HASH_TABLE_H__
#include "common.h"
#include "third_party/queue.h"
/* Macro to loop over hash table elements in insertion order. */
#define LXW_FOREACH_ORDERED(elem, hash_table) \

View file

@ -9,10 +9,6 @@
#ifndef __LXW_METADATA_H__
#define __LXW_METADATA_H__
#include <stdint.h>
#include "common.h"
/*
* Struct to represent a metadata object.
*/

View file

@ -9,29 +9,13 @@
#ifndef __LXW_PACKAGER_H__
#define __LXW_PACKAGER_H__
#include <stdint.h>
#ifdef USE_SYSTEM_MINIZIP
#include "minizip/zip.h"
#else
#include "third_party/zip.h"
#endif
#include "common.h"
#include "workbook.h"
#include "worksheet.h"
#include "shared_strings.h"
#include "app.h"
#include "core.h"
#include "custom.h"
#include "theme.h"
#include "styles.h"
#include "format.h"
#include "content_types.h"
#include "relationships.h"
#include "vml.h"
#include "comment.h"
#include "metadata.h"
#define LXW_ZIP_BUFFER_SIZE (16384)

View file

@ -10,10 +10,6 @@
#ifndef __LXW_RELATIONSHIPS_H__
#define __LXW_RELATIONSHIPS_H__
#include <stdint.h>
#include "common.h"
/* Define the queue.h STAILQ structs for the generic data structs. */
STAILQ_HEAD(lxw_rel_tuples, lxw_rel_tuple);

View file

@ -10,9 +10,6 @@
#ifndef __LXW_SST_H__
#define __LXW_SST_H__
#include <string.h>
#include <stdint.h>
#include "common.h"
/* Define a tree.h RB structure for storing shared strings. */

View file

@ -9,9 +9,6 @@
#ifndef __LXW_STYLES_H__
#define __LXW_STYLES_H__
#include <stdint.h>
#include <ctype.h>
#include "format.h"
/*

View file

@ -9,10 +9,6 @@
#ifndef __LXW_THEME_H__
#define __LXW_THEME_H__
#include <stdint.h>
#include "common.h"
/*
* Struct to represent a theme.
*/

View file

@ -9,11 +9,6 @@
#ifndef __LXW_VML_H__
#define __LXW_VML_H__
#include <stdint.h>
#include "common.h"
#include "worksheet.h"
/*
* Struct to represent a vml object.
*/

View file

@ -41,16 +41,7 @@
#ifndef __LXW_WORKBOOK_H__
#define __LXW_WORKBOOK_H__
#include <stdint.h>
#include <stdio.h>
#include <errno.h>
#include "worksheet.h"
#include "chartsheet.h"
#include "chart.h"
#include "shared_strings.h"
#include "hash_table.h"
#include "common.h"
#define LXW_DEFINED_NAME_LENGTH 128

View file

@ -43,16 +43,9 @@
#ifndef __LXW_WORKSHEET_H__
#define __LXW_WORKSHEET_H__
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "shared_strings.h"
#include "chart.h"
#include "drawing.h"
#include "common.h"
#include "format.h"
#include "styles.h"
#include "utility.h"
#include "relationships.h"

View file

@ -20,8 +20,6 @@
#define __XMLWRITER_H__
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "utility.h"
#define LXW_MAX_ATTRIBUTE_LENGTH 2080 /* Max URL length. */

View file

@ -7,9 +7,14 @@
*
*/
#include <stdlib.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/app.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/third_party/queue.h"
#include "xlsxwriter/workbook.h"
/*
* Forward declarations.

View file

@ -7,9 +7,15 @@
*
*/
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/chart.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/format.h"
#include "xlsxwriter/third_party/queue.h"
/*
* Forward declarations.

View file

@ -7,9 +7,17 @@
*
*/
#include <stdint.h>
#include <stdlib.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/chartsheet.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/chart.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/format.h"
#include "xlsxwriter/third_party/queue.h"
#include "xlsxwriter/worksheet.h"
/*
* Forward declarations.

View file

@ -7,9 +7,17 @@
*
*/
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/comment.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/third_party/queue.h"
#include "xlsxwriter/third_party/tree.h"
#include "xlsxwriter/worksheet.h"
/*
* Forward declarations.

View file

@ -7,9 +7,13 @@
*
*/
#include <stdlib.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/content_types.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/third_party/queue.h"
/*
* Forward declarations.

View file

@ -7,9 +7,13 @@
*
*/
#include <stdlib.h>
#include <time.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/core.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/workbook.h"
/*
* Forward declarations.

View file

@ -7,9 +7,13 @@
*
*/
#include <stdint.h>
#include <stdlib.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/custom.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/third_party/queue.h"
/*
* Forward declarations.

View file

@ -7,11 +7,15 @@
*
*/
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/drawing.h"
#include "xlsxwriter/worksheet.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/third_party/queue.h"
#define LXW_OBJ_NAME_LENGTH 14 /* "Picture 65536", or "Chart 65536" */
/*

View file

@ -7,9 +7,14 @@
*
*/
#include "xlsxwriter/xmlwriter.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "xlsxwriter/format.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/hash_table.h"
/*****************************************************************************
*

View file

@ -11,7 +11,10 @@
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include "xlsxwriter/hash_table.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/third_party/queue.h"
/*
* Calculate the hash key using the FNV function. See:

View file

@ -7,9 +7,11 @@
*
*/
#include <stdlib.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/metadata.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/common.h"
/*
* Forward declarations.

View file

@ -8,10 +8,36 @@
*/
#include <zlib.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <zconf.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/packager.h"
#include "xlsxwriter/hash_table.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/app.h"
#include "xlsxwriter/chart.h"
#include "xlsxwriter/chartsheet.h"
#include "xlsxwriter/comment.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/content_types.h"
#include "xlsxwriter/core.h"
#include "xlsxwriter/custom.h"
#include "xlsxwriter/drawing.h"
#include "xlsxwriter/format.h"
#include "xlsxwriter/metadata.h"
#include "xlsxwriter/relationships.h"
#include "xlsxwriter/shared_strings.h"
#include "xlsxwriter/styles.h"
#include "xlsxwriter/theme.h"
#include "xlsxwriter/third_party/queue.h"
#include "xlsxwriter/third_party/zip.h"
#include "xlsxwriter/vml.h"
#include "xlsxwriter/workbook.h"
#include "xlsxwriter/worksheet.h"
STATIC lxw_error _add_file_to_zip(lxw_packager *self, FILE * file,
const char *filename);

View file

@ -7,10 +7,13 @@
*
*/
#include <string.h>
#include <stdlib.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/relationships.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/third_party/queue.h"
/*
* Forward declarations.

View file

@ -7,10 +7,17 @@
*
*/
#include <_ctype.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/shared_strings.h"
#include "xlsxwriter/utility.h"
#include <ctype.h>
#include "xlsxwriter/common.h"
#include "xlsxwriter/third_party/queue.h"
#include "xlsxwriter/third_party/tree.h"
/*
* Forward declarations.

View file

@ -7,9 +7,16 @@
*
*/
#include <_ctype.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/styles.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/format.h"
#include "xlsxwriter/third_party/queue.h"
/*
* Forward declarations.
@ -1416,7 +1423,6 @@ lxw_styles_assemble_xml_file(lxw_styles *self)
/* Write the tableStyles element. */
_write_table_styles(self);
/* Close the style sheet tag. */
lxw_xml_end_tag(self->file, "styleSheet");
}

View file

@ -8,10 +8,11 @@
*/
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/theme.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/common.h"
const char *theme_strs[] = {
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n",

View file

@ -7,14 +7,16 @@
*
*/
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <_ctype.h>
#include "xlsxwriter.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/third_party/tmpfileplus.h"
#include "xlsxwriter/utility.h"
char *error_strings[LXW_MAX_ERRNO + 1] = {
"No error.",

View file

@ -7,9 +7,17 @@
*
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/vml.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/drawing.h"
#include "xlsxwriter/format.h"
#include "xlsxwriter/third_party/queue.h"
#include "xlsxwriter/worksheet.h"
/*
* Forward declarations.

View file

@ -7,11 +7,26 @@
*
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/errno.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/workbook.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/packager.h"
#include "xlsxwriter/hash_table.h"
#include "xlsxwriter/chart.h"
#include "xlsxwriter/chartsheet.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/drawing.h"
#include "xlsxwriter/format.h"
#include "xlsxwriter/shared_strings.h"
#include "xlsxwriter/third_party/queue.h"
#include "xlsxwriter/third_party/tree.h"
#include "xlsxwriter/worksheet.h"
STATIC int _worksheet_name_cmp(lxw_worksheet_name *name1,
lxw_worksheet_name *name2);

View file

@ -11,10 +11,23 @@
#define _POSIX_C_SOURCE 200809L
#endif
#include <_ctype.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/worksheet.h"
#include "xlsxwriter/format.h"
#include "xlsxwriter/utility.h"
#include "xlsxwriter/chart.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/drawing.h"
#include "xlsxwriter/relationships.h"
#include "xlsxwriter/shared_strings.h"
#include "xlsxwriter/styles.h"
#include "xlsxwriter/third_party/queue.h"
#include "xlsxwriter/third_party/tree.h"
#ifdef USE_OPENSSL_MD5
#include <openssl/md5.h>

View file

@ -10,8 +10,12 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <_ctype.h>
#include <stdint.h>
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/common.h"
#include "xlsxwriter/third_party/queue.h"
#define LXW_AMP "&amp;"
#define LXW_LT "&lt;"