pax_global_header 0000666 0000000 0000000 00000000064 14757674164 0014537 g ustar 00root root 0000000 0000000 52 comment=ad6ea1ed13e44cf5f93e061c6f349450a3f83fe4
jmcnamara-libxlsxwriter-ad6ea1e/ 0000775 0000000 0000000 00000000000 14757674164 0017160 5 ustar 00root root 0000000 0000000 jmcnamara-libxlsxwriter-ad6ea1e/.cirrus.yml 0000664 0000000 0000000 00000000262 14757674164 0021270 0 ustar 00root root 0000000 0000000 FreeBSD_task:
freebsd_instance:
image_family: freebsd-14-0
setup_script:
pkg install -y gmake devel/py-pytest
build_script:
gmake
test_script:
gmake test
jmcnamara-libxlsxwriter-ad6ea1e/.github/ 0000775 0000000 0000000 00000000000 14757674164 0020520 5 ustar 00root root 0000000 0000000 jmcnamara-libxlsxwriter-ad6ea1e/.github/FUNDING.yml 0000664 0000000 0000000 00000000041 14757674164 0022330 0 ustar 00root root 0000000 0000000 custom: ["paypal.me/xlsxwriter"]
jmcnamara-libxlsxwriter-ad6ea1e/.github/ISSUE_TEMPLATE.md 0000664 0000000 0000000 00000004375 14757674164 0023236 0 ustar 00root root 0000000 0000000 # libxlsxwriter: Reporting Bugs
Here are some tips on reporting bugs in `libxlsxwriter`.
### Upgrade to the latest version of the library
Upgrade to the latest version of the library since the bug you are reporting
may already be fixed.
Check the [Changes][changes] section of the documentation to see what has
changed in the latest versions.
[changes]: http://libxlsxwriter.github.io/changes.html
You can check which version of `libxlsxwriter` that you are using by checking
the `xlsxwriter.h` header file or by adding the following to your program:
```C
#include
#include "xlsxwriter.h"
int main() {
printf("Libxlsxwriter version = %s\n", lxw_version());
return 0;
}
```
### Read the documentation
Read or search the `libxlsxwriter` [documentation][docs] to see if the issue
you are encountering is already explained.
[docs]: http://libxlsxwriter.github.io/index.html
### Look at the example programs
There are many [examples programs][examples] in the distribution. Try to
identify an example program that corresponds to your query and adapt it to use
as a bug report.
[examples]: http://libxlsxwriter.github.io/examples.html
### Tips for submitting a bug report
1. Describe the problem as clearly and as concisely as possible.
2. Include a sample program. This is probably the most important step.
It is generally easier to describe a problem in code than in written
prose.
3. The sample program should be as small as possible to demonstrate the
problem. Don't copy and paste large non-relevant sections of your
program.
A sample bug report is shown below. This format helps analyze and respond to
the bug report more quickly.
> Subject: Issue with SOMETHING
>
> Greetings,
>
> I am using libxlsxwriter to do SOMETHING but it appears to do SOMETHING ELSE.
>
> I am using CC version X.Y.Z, OS = uname and libxlsxwriter x.y.z.
>
> Here is some code that demonstrates the problem:
>
>
>```C
>#include "xlsxwriter.h"
>
>int main() {
>
> lxw_workbook *workbook = workbook_new("bug_report.xlsx");
> lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
>
> worksheet_write_string(worksheet, 0, 0, "Hello", NULL);
> worksheet_write_number(worksheet, 1, 0, 123, NULL);
>
> return workbook_close(workbook);
>}
>```
>
jmcnamara-libxlsxwriter-ad6ea1e/.github/PULL_REQUEST_TEMPLATE.md 0000664 0000000 0000000 00000006754 14757674164 0024335 0 ustar 00root root 0000000 0000000 # libxlsxwriter: Submitting Pull Requests
# Pull Requests and Contributing to Libxlsxwriter
All patches and pull requests are welcome but in general you should start with
an issue tracker to describe what you intend to do before you do it.
### Getting Started
1. Pull requests and new feature proposals must start with an [issue
tracker][issues]. This serves as the focal point for the design discussion.
2. Describe what you plan to do. If there are API changes add some code
example to demonstrate them.
3. Fork the repository.
4. Run all the tests to make sure the current code works on your system using
`make test`. See the [Running the Test Suite][tests] section of the docs
for instructions.
5. Create a feature branch for your new feature.
[tests]: http://libxlsxwriter.github.io/running_the_tests.html
### Code Style
The code style is mainly K&R style with 4 space indents.
The author uses GNU indent (`gindent`) 2.2.10 with the following options:
```
--braces-on-if-line
--braces-on-struct-decl-line
--case-indentation 4
--continue-at-parentheses
--declaration-comment-column 0
--format-first-column-comments
--honour-newlines
--ignore-profile
--indent-label 0
--indent-level 4
--no-space-after-function-call-names
--no-tabs
--swallow-optional-blank-lines
```
The [indent configuration file][indentpro] is available in the repo. The code
can be indented automatically if the same version of `gindent` is used with
the following make command:
```shell
make indent
```
Note, make sure you have backed up your files or added them to the index
before running this command.
In general follow the existing style in the code.
[indentpro]: https://github.com/jmcnamara/libxlsxwriter/blob/master/.indent.pro
### Writing and Running Tests
Any significant features should be accompanied by a test. See the `test`
directory and the [Running the Test Suite][tests] section of the docs for
details of the test setup.
The tests can be run as follows:
```shell
make test
```
Same as:
```shell
make test_unit
make test_functional
```
The functional tests require the Python module [pytest][pytest] as a test runner.
If you have `valgrind` installed you can use the test suite to check for memory leaks:
```shell
make test_valgrind
```
When you push your changes they will also be tested automatically using
[GitHub Actions][actions].
[actions]: https://github.com/jmcnamara/libxlsxwriter/actions
[pytest]: http://pytest.org/
### Documentation
The `libxlsxwriter` documentation is written in Doxygen format in the header
files and in additional `.dox` files in the `docs/src` directory of the
repo. The documentation can be built as follows:
```shell
make docs
open docs/html/index.html
```
### Example programs
If applicable add an example program to the `examples` directory. Example
files can be built using:
```shell
make docs
```
### Copyright and License
Copyright remains with the original author. Do not include additional
copyright claims or Licensing requirements. GitHub and the `git` repository
will record your contribution and it will be acknowledged it in the Changes
file.
### Submitting the Pull Request
If your change involves several incremental `git` commits then `rebase` or
`squash` them onto another branch so that the Pull Request is a single commit
or a small number of logical commits.
Push your changes to GitHub and submit the Pull Request with a hash link to
the to the Issue tracker that was opened above.
jmcnamara-libxlsxwriter-ad6ea1e/.github/workflows/ 0000775 0000000 0000000 00000000000 14757674164 0022555 5 ustar 00root root 0000000 0000000 jmcnamara-libxlsxwriter-ad6ea1e/.github/workflows/cmake_actions.yml 0000664 0000000 0000000 00000002720 14757674164 0026101 0 ustar 00root root 0000000 0000000 name: Test CMake build
on: [push, pull_request]
jobs:
build:
name:
Cmake
strategy:
fail-fast: false
matrix:
cc: [gcc, clang]
cmake_flags: ["",
"-DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON",
"-DUSE_DTOA_LIBRARY=ON -DBUILD_TESTS=ON",
"-DUSE_MEM_FILE=ON -DBUILD_TESTS=ON",
"-DUSE_NO_MD5=ON -DBUILD_TESTS=ON",
"-DUSE_OPENSSL_MD5=ON -DBUILD_TESTS=ON",
"-DUSE_STANDARD_TMPFILE=ON -DBUILD_TESTS=ON",
"-DUSE_SYSTEM_MINIZIP=ON -DBUILD_TESTS=ON",
"-DUSE_SYSTEM_MINIZIP=ON -DUSE_OPENSSL_MD5=ON -DBUILD_TESTS=ON"]
runs-on: ubuntu-latest
env:
CC: ${{ matrix.cc }}
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
sudo apt update
sudo apt-get -y install zlib1g-dev
sudo apt-get -y install libminizip-dev
sudo apt-get -y install libssl-dev
- name: Configure CMake
run: |
mkdir build
cd build
cmake .. -DBUILD_TESTS=ON ${{ matrix.cmake_flags }} -DCMAKE_BUILD_TYPE=Release
- name: Build
run: |
cd build
cmake --build . --config Release --parallel
- name: Test
run: |
cd build
ctest -C Release -V
jmcnamara-libxlsxwriter-ad6ea1e/.github/workflows/code_style.yml 0000664 0000000 0000000 00000000744 14757674164 0025437 0 ustar 00root root 0000000 0000000 name: Check code style
on: [push, pull_request]
jobs:
build:
name:
Check code style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get -y install indent
sudo ln -s /usr/bin/indent /usr/bin/gindent
python -m pip install --upgrade pip
pip install gersemi
- name: Make indent
run: |
make indent
git status | grep 'nothing to commit'
jmcnamara-libxlsxwriter-ad6ea1e/.github/workflows/coverity.yml 0000664 0000000 0000000 00000000726 14757674164 0025151 0 ustar 00root root 0000000 0000000 name: Coverity Scan
on:
push:
branches: [coverity]
jobs:
coverity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build third party libs to exclude them from scan
run: make third_party
- uses: vapier/coverity-scan-action@v1
with:
project: libxlsxwriter
email: ${{ secrets.COVERITY_SCAN_EMAIL }}
token: ${{ secrets.COVERITY_SCAN_TOKEN }}
command: make -C src libxlsxwriter.a
jmcnamara-libxlsxwriter-ad6ea1e/.github/workflows/make_32_actions.yml 0000664 0000000 0000000 00000002121 14757674164 0026235 0 ustar 00root root 0000000 0000000 name: Test Make 32bit build
on: [push, pull_request]
jobs:
build:
name:
Make
strategy:
fail-fast: false
matrix:
cc: [gcc, clang]
make_flags: ["CFLAGS=-m32",
"CFLAGS=-m32 USE_STANDARD_TMPFILE=1",
"CFLAGS=-m32 USE_DTOA_LIBRARY=1",
"CFLAGS=-m32 USE_NO_MD5=1",
"CFLAGS=-m32 USE_MEM_FILE=1"]
runs-on: ubuntu-latest
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cc }}
CFLAGS: '-Werror'
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
sudo dpkg --add-architecture i386
sudo apt update
sudo apt-get -y install gcc-multilib
sudo apt-get -y install zlib1g-dev:i386
- name: make
run: ${{ matrix.make_flags }} make V=1
- name: test functional
run: ${{ matrix.make_flags }} make test_functional V=1 -j
- name: test examples
run: ${{ matrix.make_flags }} make examples V=1
jmcnamara-libxlsxwriter-ad6ea1e/.github/workflows/make_actions.yml 0000664 0000000 0000000 00000002450 14757674164 0025736 0 ustar 00root root 0000000 0000000 name: Test Make build
on: [push, pull_request]
jobs:
build:
name:
Make
strategy:
fail-fast: false
matrix:
cc: [gcc, clang]
make_flags: ["",
"USE_STANDARD_TMPFILE=1",
"USE_SYSTEM_MINIZIP=1",
"USE_DTOA_LIBRARY=1",
"USE_NO_MD5=1",
"USE_OPENSSL_MD5=1",
"USE_MEM_FILE=1"]
runs-on: ubuntu-latest
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cc }}
CFLAGS: '-Werror'
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
sudo apt update
sudo apt-get -y install zlib1g-dev
sudo apt-get -y install libminizip-dev
sudo apt-get -y install libssl-dev
sudo apt-get -y install valgrind
- name: make
run: ${{ matrix.make_flags }} make V=1
- name: test unit
run: ${{ matrix.make_flags }} make test_unit V=1
- name: test functional
run: ${{ matrix.make_flags }} make test_functional V=1 -j
- name: test cpp
run: ${{ matrix.make_flags }} make test_cpp V=1
- name: test examples
run: ${{ matrix.make_flags }} make examples V=1
jmcnamara-libxlsxwriter-ad6ea1e/.github/workflows/valgrind.yml 0000664 0000000 0000000 00000000632 14757674164 0025107 0 ustar 00root root 0000000 0000000 name: Test for memory leaks
on: [push, pull_request]
jobs:
build:
name:
Valgrind
runs-on: ubuntu-latest
env:
CC: gcc
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt-get -y install valgrind
sudo apt-get -y install zlib1g-dev
- name: test valgrind
run: make test_valgrind V=1 -j 2
jmcnamara-libxlsxwriter-ad6ea1e/.github/workflows/windows_build.yml 0000664 0000000 0000000 00000003334 14757674164 0026154 0 ustar 00root root 0000000 0000000 name: Test Cmake build on Windows
on: [push, pull_request]
jobs:
build:
name: CMake on Windows
strategy:
fail-fast: false
matrix:
cmake_flags: ["-DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON",
"-DUSE_DTOA_LIBRARY=ON -DBUILD_TESTS=ON",
"-DUSE_SYSTEM_MINIZIP=ON -DBUILD_TESTS=ON",
"-DUSE_SYSTEM_MINIZIP=ON -DUSE_OPENSSL_MD5=ON -DBUILD_TESTS=ON",
"-DUSE_OPENSSL_MD5=ON -DBUILD_TESTS=ON",
]
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: |
vcpkg.exe install zlib:x64-windows minizip:x64-windows openssl:x64-windows
vcpkg.exe integrate install
pip install pytest
- name: Configure CMake
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: |
mkdir build
cd build
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cmake .. -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_flags }} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -A x64
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: |
cd build
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cmake --build . --config Release
- name: Test
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: |
cd build
copy test\functional\src\Release\*.* test\functional\src
pytest -v test/functional
jmcnamara-libxlsxwriter-ad6ea1e/.github/workflows/zig_build.yml 0000664 0000000 0000000 00000001015 14757674164 0025245 0 ustar 00root root 0000000 0000000 name: Zig Build
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: mlugg/setup-zig@v1 # default latest-release version
- name: Build Summary
run: zig build -DBUILD_TESTS -DBUILD_EXAMPLES -DUSE_SYSTEM_MINIZIP --summary all -freference-trace
jmcnamara-libxlsxwriter-ad6ea1e/.gitignore 0000664 0000000 0000000 00000001403 14757674164 0021146 0 ustar 00root root 0000000 0000000 *.a
*.o
*.so
*.so.*
*.to
*.lo
*.la
*.dylib
*.dll
*.gcno
*.gcda
test_*
!test_*.c
!test_*.cpp
!test_*.py
*.tar.gz
*~
TAGS
.#*
*#
~*xlsx
*.xlsx
*.bak
!test/functional/xlsx_files/*.xlsx
*.pyc
.pytest_cache/
.cproject
.project
.pydevproject
.settings/
.DS_Store
__pycache__
.cache
docs/html
docs/latex
.deps
.dirstamp
_temp.c
examples/*
!examples/*.c
!examples/*.png
!examples/Makefile
!examples/vbaProject.bin
cov-int
libxlsxwriter-coverity.tgz
build
third_party/zlib-1.2.8/configure.log
third_party/zlib-1.2.8/contrib/minizip/miniunz
third_party/zlib-1.2.8/contrib/minizip/minizip
third_party/zlib-1.2.8/example
third_party/zlib-1.2.8/examplesh
third_party/zlib-1.2.8/minigzip
third_party/zlib-1.2.8/minigzipsh
third_party/zlib-1.2.8/zlib.pc
.vscode
*zig-cache/
zig-out/
jmcnamara-libxlsxwriter-ad6ea1e/.indent.pro 0000664 0000000 0000000 00000006336 14757674164 0021251 0 ustar 00root root 0000000 0000000 /*
* Indent rules for libxlsxwriter.
*
* The rules for user defined typedefs can be update as follows:
*
perl -i -pe 'print and last if /[l]ibxlsxwriter typedefs/' .indent.pro
ack -h typedef include/xlsxwriter/*.h src/*.c | perl -lne 'print "-T $1" if /\w+\s+\w+\s+(\w+)/' | sort >> .indent.pro
*
*/
/* Command line options used with GNU indent 2.2.10 */
--braces-on-if-line
--braces-on-struct-decl-line
--case-indentation 4
--continue-at-parentheses
--declaration-comment-column 0
--format-first-column-comments
--honour-newlines
--ignore-profile
--indent-label 0
--indent-level 4
--no-space-after-function-call-names
--no-tabs
--swallow-optional-blank-lines
/* Typedefs used in the code. */
-T int8_t
-T int16_t
-T int32_t
-T int64_t
-T uint8_t
-T uint16_t
-T uint32_t
-T uint64_t
-T ssize_t
-T size_t
-T time_t
-T LIST_ENTRY
-T RB_ENTRY
-T SLIST_ENTRY
-T STAILQ_ENTRY
-T TAILQ_ENTRY
-T FILE
/* libxlsxwriter typedefs. */
-T lxw_app
-T lxw_author_id
-T lxw_autofilter
-T lxw_border
-T lxw_button_options
-T lxw_cell
-T lxw_chart
-T lxw_chart_axis
-T lxw_chart_axis_display_unit
-T lxw_chart_axis_label_alignment
-T lxw_chart_axis_label_position
-T lxw_chart_axis_tick_mark
-T lxw_chart_axis_tick_position
-T lxw_chart_axis_type
-T lxw_chart_blank
-T lxw_chart_custom_label
-T lxw_chart_data_label
-T lxw_chart_error_bar_axis
-T lxw_chart_error_bar_cap
-T lxw_chart_error_bar_direction
-T lxw_chart_error_bar_type
-T lxw_chart_fill
-T lxw_chart_font
-T lxw_chart_gridline
-T lxw_chart_label_position
-T lxw_chart_label_separator
-T lxw_chart_legend
-T lxw_chart_legend_position
-T lxw_chart_line
-T lxw_chart_line_dash_type
-T lxw_chart_marker
-T lxw_chart_marker_type
-T lxw_chart_options
-T lxw_chart_pattern
-T lxw_chart_pattern_type
-T lxw_chart_point
-T lxw_chart_series
-T lxw_chart_title
-T lxw_chart_trendline_type
-T lxw_chart_type
-T lxw_chartsheet
-T lxw_chartsheet_name
-T lxw_col_options
-T lxw_col_t
-T lxw_color_t
-T lxw_comment
-T lxw_comment_options
-T lxw_cond_format_hash_element
-T lxw_cond_format_obj
-T lxw_conditional_format
-T lxw_content_types
-T lxw_core
-T lxw_custom
-T lxw_custom_property
-T lxw_data_val_obj
-T lxw_data_validation
-T lxw_datetime
-T lxw_defined_name
-T lxw_doc_properties
-T lxw_drawing
-T lxw_drawing_coords
-T lxw_drawing_object
-T lxw_drawing_rel_id
-T lxw_error
-T lxw_fill
-T lxw_filter_rule
-T lxw_filter_rule_obj
-T lxw_font
-T lxw_format
-T lxw_hash_element
-T lxw_hash_table
-T lxw_header_footer_options
-T lxw_heading_pair
-T lxw_image_md5
-T lxw_image_options
-T lxw_merged_range
-T lxw_metadata
-T lxw_object_properties
-T lxw_packager
-T lxw_panes
-T lxw_part_name
-T lxw_print_area
-T lxw_protection
-T lxw_protection_obj
-T lxw_rel_tuple
-T lxw_relationships
-T lxw_repeat_cols
-T lxw_repeat_rows
-T lxw_rich_string_tuple
-T lxw_rich_value
-T lxw_rich_value_rel
-T lxw_rich_value_structure
-T lxw_rich_value_types
-T lxw_row
-T lxw_row_col_options
-T lxw_row_t
-T lxw_selection
-T lxw_series_data_point
-T lxw_series_error_bars
-T lxw_series_range
-T lxw_sheet
-T lxw_sst
-T lxw_styles
-T lxw_table
-T lxw_table_column
-T lxw_table_obj
-T lxw_table_options
-T lxw_theme
-T lxw_tuple
-T lxw_vml
-T lxw_vml_obj
-T lxw_workbook
-T lxw_workbook_options
-T lxw_worksheet
-T lxw_worksheet_init_data
-T lxw_worksheet_name
jmcnamara-libxlsxwriter-ad6ea1e/CMakeLists.txt 0000664 0000000 0000000 00000041150 14757674164 0021721 0 ustar 00root root 0000000 0000000 # :copyright: 2014-2025. John McNamara, Alex Huszagh.
# :license: SPDX-License-Identifier: BSD-2-Clause
# CMake file for libxlsxwriter
# ============================
#
# To build libxlsxwriter with CMake move to a custom directory, ideally outside
# the root of the source tree, and type `cmake $LXW_SOURCE_LOCATION $FLAGS`,
# where `LXW_SOURCE_LOCATION` is the path to the libxlsxwriter project, and
# `FLAGS` are custom flags to pass to the compiler.
#
# For example, in the project directory, you can build libxlsxwriter as follows:
#
# ```
# mkdir build
# cd build
#
# cmake .. -DCMAKE_BUILD_TYPE=Release
# cmake --build . --config Release
#
# ```
#
# Or to build and run the tests (this can take several minutes):
#
# ```
# mkdir build
# cd build
#
# cmake .. -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release
# cmake --build . --config Release
# ctest -C Release -V
# cmake --build . --config Release --target install
# ```
#
# If the tests run successfully, you can install the library as follows:
#
# ```
# cmake --build . --config Release --target install
# ```
#
# The libxlsxwriter CMake options are shown below.
# ---------------------
# Project configuration
# ---------------------
cmake_minimum_required(VERSION 3.16)
set(XLSX_PROJECT_NAME
"xlsxwriter"
CACHE STRING
"Libxlsxwriter is a C library for creating new Excel XLSX files"
)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
project(${XLSX_PROJECT_NAME} C)
enable_testing()
# -------------------
# Compilation options
# -------------------
# `USE_SYSTEM_MINIZIP`
#
# Libxlsxwriter uses the `minizip` component of `zlib`to create the xlsx zip
# file container. The vendored source files for `minizip` are included in the
# src tree of libxlsxwriter and are statically linked by default.
#
# You can use this option if you have the `minizip` library already installed on
# your system and prefer to dynamically link against it.
#
# To enable this option pass `-DUSE_SYSTEM_MINIZIP=ON` during configuration.
option(
USE_SYSTEM_MINIZIP
"Use system minizip library instead of the vendored copy"
OFF
)
# `USE_STANDARD_TMPFILE`
#
# Uses the standard library `tmpfile` function to handle temp files instead of
# the vendored `tmpfileplus` function. Turning this off eliminates a dependency.
# This option is not recommended for Windows as it doesn't support a
# configurable location and the default location may be in a privileged
# directory.
#
# To enable this option pass `-DUSE_STANDARD_TMPFILE=ON` during configuration.
option(
USE_STANDARD_TMPFILE
"Use the C standard library tmpfile() instead of tmpfileplus"
OFF
)
# `USE_OPENSSL_MD5`
#
# Uses OpenSSL to provide a MD5 digest of image files in order to avoid storing
# duplicates instead of the vendored OpenWall MD5 functions. This will link
# against libcrypto for MD5 support rather than using the local MD5 support.
#
# To enable this option pass `-DUSE_OPENSSL_MD5=ON` during configuration.
option(
USE_OPENSSL_MD5
"Build libxlsxwriter with the OpenSSL MD5 support instead of built in version"
OFF
)
# `USE_NO_MD5`
#
# Compile without third party MD5 support. This will turn off the functionality
# of avoiding duplicate image files in the output xlsx file. This can reduce the
# executable size slightly if you aren't using images.
#
# To enable this option pass `-DUSE_NO_MD5=ON` during configuration.
option(
USE_NO_MD5
"Build libxlsxwriter without MD5 support for eliminating duplicate images"
OFF
)
# `USE_DTOA_LIBRARY`
#
# Use the third party Milo Yip DTOA library to handle string formatting of
# doubles. This is used to avoid issues with double formatting in different
# locales and gives better performance with numeric data.
#
# To enable this library, pass `-DUSE_DTOA_LIBRARY=ON` during configuration.
option(
USE_DTOA_LIBRARY
"Use the Milo Yip DTOA library to handle string formatting of doubles."
OFF
)
# `USE_MEM_FILE`
#
# Use in memory files instead of temp files using the
# `fmemopen()`/`open_memstream()` functions. This option isn't available with
# MSVC.
#
# To enable this option pass `-DUSE_MEM_FILE=ON` during configuration.
if(NOT MSVC)
option(
USE_MEM_FILE
"Use fmemopen()/open_memstream() in place of temporary files"
OFF
)
endif()
# `BUILD_TESTS`
#
# Compile the unit and function tests for libxlsxwriter. This functional tests
# require the Python pytest library. The tests can be run with `ctest` after
# compilation. The uint tests do not work with MSVC and are turned off for that
# platform. Note, the tests can take a while to compile and run.
#
# To enable this option pass `-DBUILD_TESTS=ON` during configuration.
option(
BUILD_TESTS
"Build the libxlsxwriter unit and functional tests (requires pytest)"
OFF
)
# TODO LXW_TARGET_BIG_ENDIAN
# `BUILD_EXAMPLES`
#
# Compile the libxlsxwriter example programs.
#
# To enable this option pass `-DBUILD_EXAMPLES=ON` during configuration.
option(BUILD_EXAMPLES "Build libxlsxwriter examples" OFF)
# `BUILD_FUZZERS`
#
# Compile the fuzzer harnesses.
#
# To enable this option pass `-DBUILD_FUZZERS=ON` during configuration.
option(BUILD_FUZZERS "Build harness(es) for fuzzing" OFF)
# `IOAPI_NO_64`
#
# Turn off `IOAPI_NO_64` support in minizip ioapi.c.
#
# To enable this option pass `-DIOAPI_NO_64=ON` during configuration.
option(IOAPI_NO_64 "Disable 64-bit filesystem support with minizip" OFF)
# `USE_STATIC_MSVC_RUNTIME`
#
# Compile as a static library with the static MSVC runtime library.
#
# To enable this option pass `-DUSE_STATIC_MSVC_RUNTIME=ON` during configuration.
if(MSVC)
option(USE_STATIC_MSVC_RUNTIME "Use the static runtime library" OFF)
endif()
# `ZLIB_ROOT`
#
# The `ZLIB `root directory can be specified either through an environment
# variable (`export ZLIB_ROOT=/usr/include`) or using a flag with CMake
# (`-DZLIB_ROOT:STRING=/usr/include`). This sets the preferred search path for
# the ZLIB installation.
set(ZLIB_ROOT "" CACHE STRING "Optional root for the ZLIB installation")
if(DEFINED ENV{ZLIB_ROOT})
set(ZLIB_ROOT $ENV{ZLIB_ROOT})
endif()
# -------------------------
# Configure the compilation
# -------------------------
if(USE_SYSTEM_MINIZIP)
list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS USE_SYSTEM_MINIZIP)
endif()
if(USE_STANDARD_TMPFILE)
list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS USE_STANDARD_TMPFILE)
endif()
if(NOT USE_OPENSSL_MD5 AND USE_NO_MD5)
list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS USE_NO_MD5)
endif()
if(USE_OPENSSL_MD5)
list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS USE_OPENSSL_MD5)
if(NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
endif()
endif()
if(USE_MEM_FILE OR USE_FMEMOPEN)
list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS USE_FMEMOPEN)
endif()
if(USE_DTOA_LIBRARY)
list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS USE_DTOA_LIBRARY)
endif()
if(IOAPI_NO_64)
list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS IOAPI_NO_64=1)
endif()
if(NOT BUILD_SHARED_LIBS)
if(UNIX)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
elseif(MINGW OR MSYS)
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -static -static-libgcc -Wno-char-subscripts -Wno-long-long"
)
list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS USE_FILE32API)
elseif(MSVC)
set(CMAKE_C_FLAGS_DEBUG
"${CMAKE_C_FLAGS_DEBUG} /Fd\"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb\""
)
set(CMAKE_C_FLAGS_RELEASE
"${CMAKE_C_FLAGS_RELEASE} /Ox /Zi /Fd\"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb\""
)
set(CMAKE_C_FLAGS_MINSIZEREL
"${CMAKE_C_FLAGS_MINSIZEREL} /Zi /Fd\"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb\""
)
set(CMAKE_C_FLAGS_RELWITHDEBINFO
"${CMAKE_C_FLAGS_RELWITHDEBINFO} /Fd\"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb\""
)
endif()
endif()
if(MSVC AND USE_STATIC_MSVC_RUNTIME)
foreach(
flag_var
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELWITHDEBINFO
)
if(${flag_var} MATCHES "/MD")
string(REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif()
endforeach()
endif()
# -----------------------------
# Create the xlsxwriter.pc file
# -----------------------------
set(PREFIX ${CMAKE_INSTALL_PREFIX})
file(READ "include/xlsxwriter.h" ver)
string(REGEX MATCH "LXW_VERSION \"([^\"]+)\"" _ ${ver})
set(VERSION ${CMAKE_MATCH_1})
string(REGEX MATCH "LXW_SOVERSION \"([^\"]+)\"" _ ${ver})
set(SOVERSION ${CMAKE_MATCH_1})
set(ENABLED_OPTIONS "zlib")
if(USE_SYSTEM_MINIZIP)
string(APPEND ENABLED_OPTIONS " minizip")
endif()
if(USE_OPENSSL_MD5)
string(APPEND ENABLED_OPTIONS " libcrypto")
endif()
# Expand out the xlsxwriter.pc file.
configure_file(dev/release/pkg-config.txt xlsxwriter.pc @ONLY)
# ----------------
# Set the includes
# ----------------
enable_language(CXX)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# Set the zlib includes.
find_package(ZLIB "1.2.8" REQUIRED)
list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
# Set the minizip includes.
if(USE_SYSTEM_MINIZIP)
if(MSVC)
find_package(MINIZIP NAMES unofficial-minizip REQUIRED)
set(MINIZIP_LIBRARIES unofficial::minizip::minizip)
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(MINIZIP minizip)
list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${MINIZIP_INCLUDE_DIRS}/..)
endif()
endif()
# Set the openssl includes.
if(USE_OPENSSL_MD5)
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
endif()
# ----------------------------
# Set the library dependencies
# ----------------------------
list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS NOCRYPT NOUNCRYPT)
# Ensure CRT Secure warnings are disabled.
if(MSVC)
list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS _CRT_SECURE_NO_WARNINGS)
endif()
# Ensure "TESTING" macro is defined if building tests.
if(BUILD_TESTS)
list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS TESTING)
endif()
# Define "LXW_BIG_ENDIAN" macro on big-endian architectures.
include(TestBigEndian)
test_big_endian(LXW_TARGET_BIG_ENDIAN)
if(LXW_TARGET_BIG_ENDIAN)
list(APPEND LXW_PRIVATE_COMPILE_DEFINITIONS LXW_BIG_ENDIAN)
endif()
# Set the source files.
file(GLOB LXW_SOURCES src/*.c)
file(GLOB_RECURSE LXW_HEADERS RELATIVE include *.h)
# If not using the system minizip, add the vendored minizip source files.
if(NOT USE_SYSTEM_MINIZIP)
list(
APPEND
LXW_SOURCES
third_party/minizip/ioapi.c
third_party/minizip/zip.c
)
if(MSVC)
list(APPEND LXW_SOURCES third_party/minizip/iowin32.c)
endif()
endif()
# If not using the system tmpfile, add the vendored tmpfileplus files.
if(NOT USE_STANDARD_TMPFILE)
list(APPEND LXW_SOURCES third_party/tmpfileplus/tmpfileplus.c)
endif()
if(NOT USE_OPENSSL_MD5 AND NOT USE_NO_MD5)
list(APPEND LXW_SOURCES third_party/md5/md5.c)
endif()
if(USE_DTOA_LIBRARY)
list(APPEND LXW_SOURCES third_party/dtoa/emyg_dtoa.c)
endif()
# Set project metadata.
set(LXW_PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(LXW_LIB_DIR "${LXW_PROJECT_DIR}/lib")
add_library(${PROJECT_NAME} "")
set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${SOVERSION})
target_sources(${PROJECT_NAME} PRIVATE ${LXW_SOURCES} PUBLIC ${LXW_HEADERS})
target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB)
if(MINIZIP_LINK_LIBRARIES)
target_link_libraries(${PROJECT_NAME} PRIVATE ${MINIZIP_LINK_LIBRARIES})
else()
target_link_libraries(${PROJECT_NAME} PRIVATE ${MINIZIP_LIBRARIES})
endif()
target_link_libraries(
${PROJECT_NAME}
PRIVATE ${LIB_CRYPTO} ${OPENSSL_CRYPTO_LIBRARY}
)
target_compile_definitions(
${PROJECT_NAME}
PRIVATE ${LXW_PRIVATE_COMPILE_DEFINITIONS}
)
# Ensure MSVC supports /utf-8.
if(MSVC AND MSVC_VERSION GREATER_EQUAL 1900)
target_compile_options(${PROJECT_NAME} PRIVATE /utf-8)
endif()
if(WINDOWSSTORE)
target_compile_definitions(
${PROJECT_NAME}
PRIVATE -DIOWIN32_USING_WINRT_API
)
endif()
target_include_directories(
${PROJECT_NAME}
PRIVATE ${LXW_PRIVATE_INCLUDE_DIRS}
PUBLIC include include/xlsxwriter
)
# ------------------------
# Set up and run the tests
# ------------------------
# Macro for handling unit tests.
macro(create_test sources target)
set(output_name xlsxwriter_${target})
set(dependencies ${output_name})
add_executable(${output_name} ${${sources}})
target_link_libraries(${output_name} ${PROJECT_NAME})
target_compile_definitions(${output_name} PRIVATE TESTING COLOR_OK)
add_test(
NAME ${output_name}
COMMAND ${output_name}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
endmacro(create_test)
file(GLOB LXW_UTILITY_SOURCES test/unit/utility/test*.c)
file(GLOB LXW_XMLWRITER_SOURCES test/unit/xmlwriter/test*.c)
file(GLOB LXW_WORKSHEET_SOURCES test/unit/worksheet/test*.c)
file(GLOB LXW_SST_SOURCES test/unit/sst/test*.c)
file(GLOB LXW_WORKBOOK_SOURCES test/unit/workbook/test*.c)
file(GLOB LXW_APP_SOURCES test/unit/app/test*.c)
file(GLOB LXW_CONTENTTYPES_SOURCES test/unit/content_types/test*.c)
file(GLOB LXW_CORE_SOURCES test/unit/core/test*.c)
file(GLOB LXW_RELATIONSHIPS_SOURCES test/unit/relationships/test*.c)
file(GLOB LXW_FORMAT_SOURCES test/unit/format/test*.c)
file(GLOB LXW_STYLES_SOURCES test/unit/styles/test*.c)
file(GLOB LXW_DRAWING_SOURCES test/unit/drawing/test*.c)
file(GLOB LXW_CHART_SOURCES test/unit/chart/test*.c)
file(GLOB LXW_CUSTOM_SOURCES test/unit/custom/test*.c)
file(GLOB LXW_FUNCTIONAL_SOURCES test/functional/src/*.c)
if(NOT MSVC)
# Skip unit tests on Windows since ctest.h doesn't support it.
set(LXW_UNIT_SOURCES
test/unit/test_all.c
${LXW_UTILITY_SOURCES}
${LXW_XMLWRITER_SOURCES}
${LXW_WORKSHEET_SOURCES}
${LXW_SST_SOURCES}
${LXW_WORKBOOK_SOURCES}
${LXW_APP_SOURCES}
${LXW_CONTENTTYPES_SOURCES}
${LXW_CORE_SOURCES}
${LXW_RELATIONSHIPS_SOURCES}
${LXW_FORMAT_SOURCES}
${LXW_STYLES_SOURCES}
${LXW_DRAWING_SOURCES}
${LXW_CHART_SOURCES}
${LXW_CUSTOM_SOURCES}
)
else()
set(LXW_UNIT_SOURCES test/cpp/test_compilation.cpp)
endif()
if(BUILD_TESTS)
# Unit tests.
create_test(LXW_UNIT_SOURCES unit)
# Functional tests.
find_package(Python COMPONENTS Interpreter REQUIRED)
find_program(Pytest_EXECUTABLE NAMES pytest)
if(NOT Pytest_EXECUTABLE)
message(
"Please install the Python pytest library to run the functional tests:"
)
message(" pip install pytest\n")
endif()
foreach(source ${LXW_FUNCTIONAL_SOURCES})
get_filename_component(basename ${source} NAME_WE)
add_executable(${basename} ${source})
target_link_libraries(${basename} xlsxwriter)
set_target_properties(
${basename}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "test/functional/src"
)
endforeach(source)
add_custom_command(
TARGET xlsxwriter_unit
POST_BUILD
COMMAND
${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/test/functional test/functional
)
if(USE_NO_MD5)
add_test(
NAME functional
COMMAND pytest -v test/functional -m "not skipif"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
else()
add_test(
NAME functional
COMMAND pytest -v test/functional
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
endif()
# ------------------------------------
# Compile and run the example programs
# ------------------------------------
file(GLOB LXW_EXAMPLE_SOURCES examples/*.c)
if(BUILD_EXAMPLES)
foreach(source ${LXW_EXAMPLE_SOURCES})
get_filename_component(basename ${source} NAME_WE)
add_executable(${basename} ${source})
target_link_libraries(${basename} ${PROJECT_NAME})
set_target_properties(
${basename}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "examples"
)
endforeach(source)
endif()
# -----------------
# Fuzzing harnesses
# -----------------
if(BUILD_FUZZERS AND DEFINED ENV{LIB_FUZZING_ENGINE})
add_subdirectory(dev/fuzzing)
endif()
# -------------------
# Install the library
# -------------------
include(GNUInstallDirs)
install(
TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(FILES include/xlsxwriter.h DESTINATION include)
install(
DIRECTORY include/xlsxwriter
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING
PATTERN "*.h"
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/xlsxwriter.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
jmcnamara-libxlsxwriter-ad6ea1e/CONTRIBUTING.md 0000664 0000000 0000000 00000013617 14757674164 0021421 0 ustar 00root root 0000000 0000000 # libxlsxwriter: Reporting Bugs and submitting Pull Requests
## Reporting Bugs
Here are some tips on reporting bugs in `libxlsxwriter`.
### Upgrade to the latest version of the library
Upgrade to the latest version of the library since the bug you are reporting
may already be fixed.
Check the [Changes][changes] section of the documentation to see what has
changed in the latest versions.
[changes]: http://libxlsxwriter.github.io/changes.html
You can check which version of `libxlsxwriter` that you are using by checking
the `xlsxwriter.h` header file or by adding the following to your program:
```C
#include
#include "xlsxwriter.h"
int main() {
printf("Libxlsxwriter version = %s\n", lxw_version());
return 0;
}
```
### Read the documentation
Read or search the `libxlsxwriter` [documentation][docs] to see if the issue
you are encountering is already explained.
[docs]: http://libxlsxwriter.github.io/index.html
### Look at the example programs
There are many [examples programs][examples] in the distribution. Try to
identify an example program that corresponds to your query and adapt it to use
as a bug report.
[examples]: http://libxlsxwriter.github.io/examples.html
### Use the xlsxwriter Issue Tracker
The [libxlsxwriter issue tracker][issues] is on GitHub.
[issues]: https://github.com/jmcnamara/libxlsxwriter/issues
### Tips for submitting a bug report
1. Describe the problem as clearly and as concisely as possible.
2. Include a sample program. This is probably the most important step.
It is generally easier to describe a problem in code than in written
prose.
3. The sample program should be as small as possible to demonstrate the
problem. Don't copy and paste large non-relevant sections of your
program.
A sample bug report is shown below. This format helps analyze and respond to
the bug report more quickly.
> Subject: Issue with SOMETHING
>
> Greetings,
>
> I am using libxlsxwriter to do SOMETHING but it appears to do SOMETHING ELSE.
>
> I am using CC version X.Y.Z, OS = uname and libxlsxwriter x.y.z.
>
> Here is some code that demonstrates the problem:
>
>
>```C
>#include "xlsxwriter.h"
>
>int main() {
>
> lxw_workbook *workbook = workbook_new("bug_report.xlsx");
> lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
>
> worksheet_write_string(worksheet, 0, 0, "Hello", NULL);
> worksheet_write_number(worksheet, 1, 0, 123, NULL);
>
> return workbook_close(workbook);
>}
>```
>
# Pull Requests and Contributing to Libxlsxwriter
All patches and pull requests are welcome but in general you should start with
an issue tracker to describe what you intend to do before you do it.
### Getting Started
1. Pull requests and new feature proposals must start with an [issue
tracker][issues]. This serves as the focal point for the design discussion.
2. Describe what you plan to do. If there are API changes add some code
example to demonstrate them.
3. Fork the repository.
4. Run all the tests to make sure the current code works on your system using
`make test`. See the [Running the Test Suite][tests] section of the docs
for instructions.
5. Create a feature branch for your new feature.
[tests]: http://libxlsxwriter.github.io/running_the_tests.html
### Code Style
The code style is mainly K&R style with 4 space indents.
The author uses GNU indent (`gindent`) 2.2.10 with the following options:
```
--braces-on-if-line
--braces-on-struct-decl-line
--case-indentation 4
--continue-at-parentheses
--declaration-comment-column 0
--format-first-column-comments
--honour-newlines
--ignore-profile
--indent-label 0
--indent-level 4
--no-space-after-function-call-names
--no-tabs
--swallow-optional-blank-lines
```
The [indent configuration file][indentpro] is available in the repo. The code
can be indented automatically if the same version of `gindent` is used with
the following make command:
```shell
make indent
```
Note, make sure you have backed up your files or added them to the index
before running this command.
In general follow the existing style in the code.
[indentpro]: https://github.com/jmcnamara/libxlsxwriter/blob/master/.indent.pro
### Writing and Running Tests
Any significant features should be accompanied by a test. See the `test`
directory and the [Running the Test Suite][tests] section of the docs for
details of the test setup.
The tests can be run as follows:
```shell
make test
```
Same as:
```shell
make test_unit
make test_functional
```
The functional tests require the Python module [pytest][pytest] as a test runner.
If you have `valgrind` installed you can use the test suite to check for memory leaks:
```shell
make test_valgrind
```
When you push your changes they will also be tested automatically using
[GitHub Actions][actions].
[actions]: https://github.com/jmcnamara/libxlsxwriter/actions
[pytest]: http://pytest.org/
### Documentation
The `libxlsxwriter` documentation is written in Doxygen format in the header
files and in additional `.dox` files in the `docs/src` directory of the
repo. The documentation can be built as follows:
```shell
make docs
open docs/html/index.html
```
### Example programs
If applicable add an example program to the `examples` directory. Example
files can be built using:
```shell
make docs
```
### Copyright and License
Copyright remains with the original author. Do not include additional
copyright claims or Licensing requirements. GitHub and the `git` repository
will record your contribution and it will be acknowledged it in the Changes
file.
### Submitting the Pull Request
If your change involves several incremental `git` commits then `rebase` or
`squash` them onto another branch so that the Pull Request is a single commit
or a small number of logical commits.
Push your changes to GitHub and submit the Pull Request with a hash link to
the to the Issue tracker that was opened above.
jmcnamara-libxlsxwriter-ad6ea1e/Changes.txt 0000664 0000000 0000000 00000101712 14757674164 0021273 0 ustar 00root root 0000000 0000000 /**
@page changes Changes
## 1.2.1 February 26 2025
- Added the `workbook_set_size()` function to set the size of the window when
the file is opened. This is generally only useful on macOS since Microsoft
Windows uses the window size from the last time an Excel file was
opened/saved. Feature request [#472][gh_472].
[gh_472]: https://github.com/jmcnamara/libxlsxwriter/issues/472
- Improved the cmake build support for using the `minizip` library.
Pull request [#471][gh_471].
[gh_471]: https://github.com/jmcnamara/libxlsxwriter/issues/471
### Packagers:
- This is serial version 1.2.1. This is not a semver version.
- This is shared object library version `libxlsxwriter.so.8`. This should be
updated automatically via `make` and `cmake` as part of the build process.
- This version tries to improve the overall `cmake` build process when using
minizip via the `-DUSE_SYSTEM_MINIZIP=ON` configuration option.
- Please report any downstream patches back upstream to help improve the overall
build process.
## 1.2.0 January 11 2025
- Added `format_set_font_family()` and `format_set_font_charset()` format
functions to support Middle Eastern and Asian fonts.
Feature request [#468][gh_468].
[gh_468]: https://github.com/jmcnamara/libxlsxwriter/issues/468
## 1.1.9 October 24 2024
- Fix minor pointer/value error in `lxw_name_to_row()` and `lxw_name_to_col()`
utility functions. Issue [#459][gh_459].
[gh_459]: https://github.com/jmcnamara/libxlsxwriter/issues/459
## 1.1.8 July 31 2024
- Added support for embedding images into worksheets with
`worksheet_embed_image()`.
This can be useful if you are building up a spreadsheet of products with a
column of images for each product. Embedded images move with the cell so they
can be used in worksheet tables or data ranges that will be sorted or
filtered.
This functionality is the equivalent of Excel's menu option to insert an image
using the option to "Place in Cell" which is available in Excel 365 versions
from 2023 onwards.
- Fixed various issues:
- [Failure on 32bit architectures #441](https://github.com/jmcnamara/libxlsxwriter/issues/441)
- [workbook_validate_sheet_name buffer-overflow #442](https://github.com/jmcnamara/libxlsxwriter/issues/442)
- [workbook_add_worksheet does not return a reasonable worksheet #443](https://github.com/jmcnamara/libxlsxwriter/issues/443)
- [workbook_define_name stack-buffer-underflow #444](https://github.com/jmcnamara/libxlsxwriter/issues/444)
- [workbook_close stack-buffer-overflow #445](https://github.com/jmcnamara/libxlsxwriter/issues/445)
- [_store_array_formula heap-buffer-overflow #446](https://github.com/jmcnamara/libxlsxwriter/issues/446)
- [worksheet_set_selection stack-buffer-overflow #447](https://github.com/jmcnamara/libxlsxwriter/issues/447)
- Note this version is tagged as `v1.1.8` instead of `RELEASE_1.1.8` for better
interoperability with Xcode.
## 1.1.7 April 5 2024
- Bump `.so` version to 6. This was missed in the previous release.
## 1.1.6 April 4 2024
- Updated vendored version of minizip to v 1.3.0 to include upstream fixes.
Feature request [#419][gh_419].
[gh_419]: https://github.com/jmcnamara/libxlsxwriter/issues/419
- Added `quote_prefix` format property.
Feature request [#385][gh_385].
[gh_385]: https://github.com/jmcnamara/libxlsxwriter/issues/385
- Added support for signed VBA projects.
- Fix worksheet password hashing algorithm for long passwords. Replace/fix
the worksheet protection password algorithm so that is works correctly
for strings over 24 chars.
- Fix cmake minizip version check.
Feature request [#405][gh_405].
[gh_405]: https://github.com/jmcnamara/libxlsxwriter/issues/405
- Fix for buffer overflow with utf-8 strings in data validation.
Feature request [#394][gh_394].
[gh_394]: https://github.com/jmcnamara/libxlsxwriter/issues/394
- Fix for range in text type conditional format.
Feature request [#395][gh_395].
[gh_395]: https://github.com/jmcnamara/libxlsxwriter/issues/395
- Fix 32bit multiply with overflow issue for images.
Fix multiply with overflow issue when image locations in the worksheet
were greater than the u32 max value.
- Added Swift package manager support.
- Added support for building Zig library.
## 1.1.5 December 30 2022
- Added support for writing a workbook to a memory buffer instead of to a file
via the `output_buffer` parameter of @ref workbook_new_opt(). See also
@ref output_buffer.c.
- Add support for using in-memory data instead of temporary files on systems where
`fmemopen()` and `open_memstream()` are supported. This requires the `USE_MEM_FILE`
compilation option.
## 1.1.4 October 9 2021
- Added support for Worksheet tables. Tables in Excel are a way of grouping a
range of cells into a single entity that has common formatting or that can
be referenced from formulas. Tables can have column headers, autofilters,
total rows, column formulas and default formatting. See @ref
working_with_tables and @ref tables.c.
- Added support for adding a macro button to a worksheet. See @ref macro.c.
## 1.1.3 August 9 2021
- Changed worksheet_filter_column2() parameter name "operator" to "and_or" to
avoid a conflict with the C++ reserved keyword.
## 1.1.2 August 8 2021
- Added support for autofilter rules. See @ref working_with_autofilters and
@ref autofilter.c.
Feature request [#254][gh_254].
[gh_254]: https://github.com/jmcnamara/libxlsxwriter/issues/254
- Added Description/Alt Text and Decorative accessibility options for
charts. These options were already available for images.
## 1.1.1 July 12 2021
- Added optional third party library to handle sprintf handling of
doubles. This is to avoid issues with number formatting in some locales. The
optional library is the Milo Yip DTOA implementation. See @ref gsg_dtoa.
Issue [#272][gh_272].
[gh_272]: https://github.com/jmcnamara/libxlsxwriter/issues/272
- Added the #LXW_EXPLICIT_FALSE variable to allow the default bold property in
chart title fonts to be turned off.
Issue [#199][gh_199].
[gh_199]: https://github.com/jmcnamara/libxlsxwriter/issues/199
## 1.1.0 July 9 2021
- Fix for Cocoapod issue where local md5 files conflicted with BoringSSL headers.
Issue [#342][gh_342].
[gh_342]: https://github.com/jmcnamara/libxlsxwriter/issues/342
## 1.0.9 July 7 2021
- Added support for Excel 365 dynamic arrays. See
`worksheet_write_dynamic_array_formula()` `worksheet_write_dynamic_formula()`
and @ref ww_formulas_dynamic_arrays.
## 1.0.8 July 3 2021
- Fix for dynamic library soname on Linux.
## 1.0.7 July 1 2021
- Added support for writing Unix date/times via the
`worksheet_write_unixtime()` function.
- Added support for dynamic library soname version to help packagers and build
systems differentiate ABI versions.
## 1.0.6 May 28 2021
- Added support for using OpenSSL MD5 functions instead of built in third
party library. See @ref gsg_md5.
## 1.0.5 May 13 2021
- Added support for worksheet background images via
`worksheet_set_background()`.
## 1.0.4 May 8 2021
- Added support for GIF image files (and in Excel 365, animated GIF files).
## 1.0.3 April 20 2021
- Added some fixes to make the library compile more cleanly as an R library.
## 1.0.2 April 15 2021
- Added option to set row heights and column widths in pixels via the
`worksheet_set_row_pixels()` and `worksheet_set_column_pixels()` functions.
## 1.0.1 March 30 2021
- Added support for [pkg-config][pkg-config] to Make/Cmake installs. See the
@ref gsg_using section of the Getting Started guide.
[pkg-config]: https://www.freedesktop.org/wiki/Software/pkg-config/
- Added ability to add accessibility options "description" and "decorative" to
images via `worksheet_insert_image_opt()` and #lxw_image_options.
- Added the `workbook_read_only_recommended()` function to set the Excel
"Read-only Recommended" option that is available when saving a file.
- Fixed issue where pattern formats without colors were given a default black
fill color.
- Added option to set a chart crossing to 'min' via
`chart_axis_set_crossing_min()` as well as the existing 'max' option. The
'min' option isn't available in the Excel interface but can be enabled via
VBA.
- Added some additional information on using constant_memory mode with memory
mounted /tmp directories. See @ref ww_mem_temp.
Issue [#306][gh_306].
[gh_306]: https://github.com/jmcnamara/libxlsxwriter/issues/306
- Added build option to compile libxlsxwriter as a "universal binary" for both
Apple silicon and Intel-based Macs, i.e., arm64 and x86_64. See @ref
gsg_universal.
- Fixed issue where the limit for header/footer strings was
255 bytes instead of 255 characters and as a result UTF8
strings were being truncated.
Issue [#305][gh_305].
[gh_305]: https://github.com/jmcnamara/libxlsxwriter/issues/305
## 1.0.0 September 7 2020
- Added support for worksheet conditional formatting. See
`worksheet_conditional_format_range()` and @ref
working_with_conditional_formatting.
Feature request [#32][gh_32] and [#302][gh_302].
[gh_302]: https://github.com/jmcnamara/libxlsxwriter/issues/302
[gh_32]: https://github.com/jmcnamara/libxlsxwriter/issues/32
- Added performance optimization for search for control characters in strings
in `worksheet_write_string()`.
Issue [#298][gh_298].
[gh_298]: https://github.com/jmcnamara/libxlsxwriter/issues/298
- Made `lxw_datetime_to_excel_datetime()` a function public.
- There are now over 1000 test cases, including 650 tests that compare the
output from libxlsxwriter, byte for byte, against test files created in
Excel. This is also the 100th release of libxlsxwriter.
## 0.9.9 August 17 2020
- Added support for images in headers and footers. See `worksheet_set_header_opt()`.
- Added `worksheet_ignore_errors()` function to ignore Excel worksheet
errors/warnings in user defined ranges.
## 0.9.8 August 11 2020
- Added formatting for chart data labels and chart custom data labels. See
@ref chart_custom_labels and @ref chart_data_labels.c.
## 0.9.7 August 4 2020
- Changed #lxw_chart_data_label field from `.delete` to `.hide` in order to
avoid reserved word conflict with C++.
Issue [#300][gh_300].
[gh_300]: https://github.com/jmcnamara/libxlsxwriter/issues/300
## 0.9.6 August 3 2020
- Added support for chart custom data labels. See @ref chart_custom_labels and
@ref chart_data_labels.c.
- Fix for issue where array formulas weren't included in the output file for
certain ranges/conditions. Issue [#735][gh_735].
[gh_735]: https://github.com/jmcnamara/XlsxWriter/issues/735
## 0.9.5 May 31 2020
- Fix for issue where hyperlinks urls and tips were ignored for
`worksheet_insert_image_buffer_opt()` images.
Issue [#292][gh_292].
[gh_292]: https://github.com/jmcnamara/libxlsxwriter/issues/292
- Added #LXW_CHART_LINE_STACKED and #LXW_CHART_LINE_STACKED_PERCENT line
charts subtypes.
- Removed LXW_ERROR_SHEETNAME_RESERVED warning which was used with the
reserved worksheet name "History". However, this is an allowed worksheet
name in some Excel variants so the warning has been turned into a
documentation note instead.
## 0.9.4 January 19 2020
- Added option to specify worksheet "object positioning" for images and charts
to define how they move or size with underlying cells. See @ref
ww_object_position_options and @ref working_with_object_positioning.
## 0.9.3 January 13 2020
- Fix Xcode/Cocoapods build warnings.
## 0.9.2 January 13 2020
- Added support for writing cell comments, see @ref working_with_comments.
- Makefile now respects DESTDIR and PREFIX, including when setting rpath on
macOS.
- Changed function names in bundled MD5 code to avoid conflicts with OpenSSL.
## 0.9.1 December 26 2019
- Fix to missing MD5 linkage in Cocoapod file.
Issue [#259][gh_259].
[gh_259]: https://github.com/jmcnamara/libxlsxwriter/issues/259
## 0.9.0 December 26 2019
- Fix to avoid duplicate images being copied to an libxlsxwriter file. Excel
uses an optimization where it only stores one copy of a repeated/duplicate
image in a workbook. Libxlsxwriter didn't do this which meant that the file
size would increase when then was a large number of repeated images. This
release fixes that issue and replicates Excel's behavior.
Note, that this change adds a dependency on the [Openwall MD5] library,
which is now included with the libxlsxwriter third party source files. It is
possible to compile libxlsxwriter without this library, and thus getting the
older behavior, by passing `USE_NO_MD5=1` to make.
[Openwall MD5]: https://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
## 0.8.9 December 16 2019
- Added support for default hyperlink style in `worksheet_write_url()`.
- Added support for hyperlink in images, see `worksheet_insert_image_opt()`.
- Fixed several `worksheet_write_url()` edge cases.
## 0.8.8 November 17 2019
- Added option to allow a user defined, or overridden, image description used
with `worksheet_insert_image()`. By default it uses the filename as the
description.
Issue [#238][gh_238].
[gh_238]: https://github.com/jmcnamara/libxlsxwriter/issues/238
- Added Windows portable version of `fopen` to handle utf8 filenames when
working with images.
Issue [#238][gh_238].
[gh_238]: https://github.com/jmcnamara/libxlsxwriter/issues/238
- Added an option to allow chart fonts to be rotation to 270 deg to give a
stacked orientation. Also added support for East Asian vertical chart fonts.
- Refactored struct types used in pubic APIs to remove or document hidden
fields. @b Note: This change introduces backward incompatible API
changes. However, it should minimize any future changes of this nature.
See issue [#252][gh_252].
[gh_252]: https://github.com/jmcnamara/libxlsxwriter/issues/252
## 0.8.7 June 20 2019
- Added support for adding VBA macros to workbooks. These macros can be
extracted from existing xlsm files, created in Excel, and added to new xlsm
files. See @ref working_with_macros.
Feature request [#29][gh_29].
[gh_29]: https://github.com/jmcnamara/libxlsxwriter/issues/29
- Added support for ZIP64 extensions when writing very large xlsx files to
allow the zip container, or individual XML files within it, to be greater
than 4 GB. See @ref workbook_new_opt().
Feature request [#228][gh_228].
[gh_228]: https://github.com/jmcnamara/libxlsxwriter/issues/228
- Added extra validity checks on worksheet names.
Issues [#223][gh_223] and [#230][gh_230].
[gh_223]: https://github.com/jmcnamara/libxlsxwriter/issues/223
[gh_230]: https://github.com/jmcnamara/libxlsxwriter/issues/230
## 0.8.6 April 7 2019
- Fixed issue where images that started in hidden rows/columns weren't placed
correctly in the worksheet.
- Fixed the mime-type reported by system `file(1)`. The mime-type reported
by "file --mime-type"/magic was incorrect for XlsxWriter files since it
expected the `[Content_types]` to be the first file in the zip container.
## 0.8.5 February 10 2019
- Fix compile-time warnings with strict prototypes enabled.
Issue [#208][gh_208].
[gh_208]: https://github.com/jmcnamara/libxlsxwriter/issues/208
- Make py.test name configurable.
Pull request [#206][gh_206].
[gh_206]: https://github.com/jmcnamara/libxlsxwriter/pull/206
## 0.8.4 November 10 2018
- Fix for issue when hashing number formats.
Issue [#203][gh_203].
[gh_203]: https://github.com/jmcnamara/libxlsxwriter/issues/203
## 0.8.3 October 1 2018
- Added `worksheet_write_rich_string()` function to allow writing of
multi-format rich strings. See @ref rich_strings.c
Feature request [#37][gh_37].
[gh_37]: https://github.com/jmcnamara/libxlsxwriter/issues/37
## 0.8.2 September 16 2018
- Added new chartsheet functionality: `chartsheet_set_tab_color()`, and
`chartsheet_set_zoom()`.
## 0.8.1 September 15 2018
- Fix for chartsheet and worksheet ordering issue.
- Added new chartsheet functionality: `chartsheet_protect()`,
`chartsheet_hide()`, `chartsheet_select()` and
`chartsheet_set_first_sheet()`.
## 0.8.0 September 12 2018
- Added chartsheet support. A chartsheet is a type of worksheet that only
contains a chart. See the @ref chartsheet.h "Chartsheet" object and @ref
chartsheet.c.
## 0.7.9 September 1 2018
- Added `chart_axis_set_label_align()` function to set the alignment of chart
category axis labels.
Feature request [#186][gh_186].
[gh_186]: https://github.com/jmcnamara/libxlsxwriter/issues/186
- Added `lxw_version()` function to get the library version.
Feature request [#194][gh_194].
[gh_194]: https://github.com/jmcnamara/libxlsxwriter/pull/194
## 0.7.8 August 30 2018
- Added `worksheet_insert_image_buffer()` function to insert images from
memory buffers. See @ref image_buffer.c.
Feature request [#125][gh_125].
[gh_125]: https://github.com/jmcnamara/libxlsxwriter/issues/125
## 0.7.7 May 16 2018
- Fix to ensure the use of wide filenames on Windows with Microsoft Visual
C++.
Issue [#153][gh_153].
[gh_153]: https://github.com/jmcnamara/libxlsxwriter/issues/153
- Added docs on building an app with Cmake and Microsoft Visual C++ on
Windows.
## 0.7.6 January 11 2018
- Added support for worksheet Grouping and Outlines.
See @ref working_with_outlines.
Feature request [#30][gh_30].
[gh_30]: https://github.com/jmcnamara/libxlsxwriter/issues/30
- Fix include of libxlsxwriter as a Cocoapod on macOS.
Issue [#94][gh_94].
[gh_94]: https://github.com/jmcnamara/libxlsxwriter/issues/94
## 0.7.5 September 25 2017
- Added support for data validations and dropdown lists. See @ref
working_with_data_validation and @ref data_validate.c.
Feature request [#31][gh_31].
[gh_31]: https://github.com/jmcnamara/libxlsxwriter/issues/31
## 0.7.4 August 20 2017
- Fix make build system "install" target for compatibility with macOS
[brew/homebrew](https://brew.sh) installer. See @ref gsg_brew.
## 0.7.3 August 12 2017
- Build system fixes for Gentoo.
Issue [#116][gh_116].
[gh_116]: https://github.com/jmcnamara/libxlsxwriter/issues/116
## 0.7.2 July 26 2017
- Changed font sizes from integer to double to allow fractional font sizes.
Issue [#114][gh_114].
[gh_114]: https://github.com/jmcnamara/libxlsxwriter/issues/114
## 0.7.1 July 24 2017
- Fixed issue where internal file creation and modification dates were in the
local timezone instead of UTC.
Issue [#110][gh_110].
[gh_110]: https://github.com/jmcnamara/libxlsxwriter/issues/110
## 0.7.0 June 26 2017
- Added support for CMake build system.
Thanks to Alex Huszagh.
- Fixed issue where image filehandles weren't closed until the overall file
was closed causing the system to run out of filehandles.
Issue [#106][gh_106].
[gh_106]: https://github.com/jmcnamara/libxlsxwriter/issues/106
## 0.6.9 January 30 2017
- Added chart trendlines. See @ref chart_trendlines and
@ref chart_data_tools.c.
## 0.6.8 January 28 2017
- Added chart error bars. See @ref chart_error_bars and
@ref chart_data_tools.c.
## 0.6.7 January 24 2017
- Added chart data labels. See @ref chart_labels.
## 0.6.6 January 22 2017
- Added functions to set chart Up-Down bars: see `chart_set_up_down_bars()`
and `chart_set_up_down_bars_format()` and @ref chart_data_tools.c.
- Added functions to handle blank and hidden data in charts: see
`chart_show_blanks_as()` and `chart_show_hidden_data()`.
## 0.6.5 January 21 2017
- Added functions to set the overlap and gap between series: see
`chart_set_series_overlap()` and `chart_set_series_gap()`.
## 0.6.4 January 20 2017
- Added chart data table option, see `chart_set_table()` and
`chart_set_table_grid()`.
- Added Clustered Chart example, see @ref chart_clustered.c.
## 0.6.3 January 19 2017
- Added `chart_set_drop_lines()` and `chart_set_high_low_lines()` functions to
add chart Drop and High-Low lines to indicate category values.
See @ref chart_data_tools.c.
## 0.6.2 January 17 2017
- Added `chart_series_set_smooth()` function to set the line smoothing
property of a line or scatter chart series.
## 0.6.1 January 16 2017
- Added option to set formatting for points in a chart. This allow the colors
of Pie chart segments to be defined. See @ref chart_points.
## 0.6.0 January 15 2017
- Added option to set the number format for a chart axis, see
`chart_axis_set_num_format()`.
- Added "invert if negative" option for series fills, see
`chart_series_set_invert_if_negative()`.
## 0.5.9 January 14 2017
- Added support for chart axis crossing. See `chart_axis_set_crossing()` and
`chart_axis_set_crossing_max()`.
## 0.5.8 January 13 2017
- Added `chart_axis_set_major_tick_mark()` and
`chart_axis_set_minor_tick_mark()` functions to chart axis tick marks.
## 0.5.7 January 12 2017
- Added `chart_axis_set_display_units()` function to set chart axis display
units.
## 0.5.6 January 11 2017
- Added `chart_axis_set_interval_unit()` and `chart_axis_set_interval_tick()`
functions to adjust category axis intervals.
## 0.5.5 January 10 2017
- Added `chart_axis_set_major_unit()` and `chart_axis_set_minor_unit()` to set
the major and minor units of a category axis.
## 0.5.4 January 9 2017
- Added `chart_axis_set_label_position()` option to position the axis labels
(numbers).
- Improved documentation for @ref ww_charts_axes.
## 0.5.3 January 8 2017
- Added `chart_axis_set_position()` option to position a category axis
horizontally on, or between, the axis tick marks.
## 0.5.2 January 7 2017
- Added option to turn off chart axis: `chart_axis_off()`.
## 0.5.1 January 6 2017
- Added chart major and minor gridlines handling, see:
- `chart_axis_major_gridlines_set_visible()`
- `chart_axis_minor_gridlines_set_visible()`
- `chart_axis_major_gridlines_set_line()`
- `chart_axis_minor_gridlines_set_line()`
## 0.5.0 January 5 2017
- Added chart and plot area formatting. See `chart_chartarea_set_line()` and
`chart_plotarea_set_line()`.
## 0.4.9 January 4 2017
- Added support for chart patterns. See @ref chart_patterns.
## 0.4.8 January 3 2017
- Added support for chart markers. See @ref chart_markers.
## 0.4.7 January 2 2017
- Added `chart_axis_set_reverse()` function to reverse the order of a chart
axis.
- Added `chart_axis_set_min()`and `chart_axis_set_max()` functions to set the
minimum and maximum value for a chart axis.
- Added `chart_axis_set_log_base()` function to set the log base of a chart
axis.
Feature request [#70][gh_70].
[gh_70]: https://github.com/jmcnamara/libxlsxwriter/issues/70
## 0.4.6 January 1 2017
- Added functions to set chart line and fill properties, see:
- `chart_series_set_line()`. Feature request [#83][gh_83].
- `chart_series_set_fill()`.
- `chart_axis_set_line()`.
- `chart_axis_set_fill()`.
- @ref chart_lines.
- @ref chart_fills.
[gh_83]: https://github.com/jmcnamara/libxlsxwriter/issues/83
## 0.4.5 December 31 2016
- Added functions to set chart legend properties: see `chart_legend_set_position()`,
`chart_legend_set_font()` and `chart_legend_delete_series()`.
## 0.4.4 December 30 2016
- Added chart fonts. See `chart_axis_set_name_font()`, `chart_axis_set_num_font()`,
`chart_title_set_name_font()` and @ref chart_fonts.
## 0.4.3 December 26 2016
- Added `workbook_get_worksheet_by_name()` function to get a worksheet
object from its name.
- Added `workbook_validate_worksheet_name()` function to validate a worksheet
name.
- Fix for parameter length check when strings are UTF-8.
Issue [#84][gh_84].
[gh_84]: https://github.com/jmcnamara/libxlsxwriter/issues/84
## 0.4.2 July 14 2016
- Added support for OpenBSD and better support for FreeBSD. See @ref gsg_bsd.
## 0.4.1 July 11 2016
- Switched to using
[tmpfileplus](http://www.di-mgt.com.au/c_function_to_create_temp_file.html)
for temporary file handles to work around issue when the temp directory on
Windows isn't writeable. The temp file directory is now also configurable at
runtime, see @ref gsg_tmpdir.
Issue [#63][gh_63].
[gh_63]: https://github.com/jmcnamara/libxlsxwriter/issues/63
## 0.4.0 July 5 2016
- Added fixes for MSVC 2010.
- Refactored public APIs to return #lxw_error instead of int.
## 0.3.9 July 2 2016
- Added support for MinGW, MinGW-w64, Cygwin, MSYS and MSYS2.
See @ref gsg_ming.
## 0.3.8 June 11 2016
- Added workbook functions to set custom document properties. See
`workbook_set_custom_property_string()` and @ref doc_custom_properties.c.
## 0.3.7 June 2 2016
- Added updated Cocoapods file for Cocoapods 1.0.0. This also add support for
the "use_frameworks" directive. Thanks to Ludovico Rossi. See @ref
getting_started for instructions on how to use the cocoapod.
Pull request [#50][gh_50].
[gh_50]: https://github.com/jmcnamara/libxlsxwriter/issues/50
## 0.3.6 June 1 2016
- Fix for `worksheet_insert_image()` issue when handling images with zero dpi.
## 0.3.5 May 31 2016
- Refactored the error handling and reporting for when the file creation
subsystem fails due to file permissions or other issues. The new error codes
are in `#lxw_error` and the codes can be converted to strings, for reporting,
using the new `lxw_strerror()` function.
Issue [#49][gh_49].
[gh_49]: https://github.com/jmcnamara/libxlsxwriter/issues/49
## 0.3.4 May 28 2016
- Updated the @ref getting_started docs with instructions on how to build
libxlsxwriter for Windows using Microsoft Visual Studio and added links to
the example MSVC project:
[MSVCLibXlsxWriter](https://github.com/jmcnamara/MSVCLibXlsxWriter).
## 0.3.3 May 23 2016
- Added support for charts via the @ref chart.h "The Chart object". See the
examples of the supported chart types:
- @ref chart_area.c "Area chart"
- @ref chart_bar.c "Bar chart"
- @ref chart_column.c "Column chart"
- @ref chart_line.c "Line chart"
- @ref chart_scatter.c "Scatter chart"
- @ref chart_radar.c "Radar chart"
- @ref chart_pie.c "Pie chart"
- @ref chart_doughnut.c "Doughnut chart"
- @ref chart_styles.c "Built-in charts styles"
Feature request [#36][gh_36].
[gh_36]: https://github.com/jmcnamara/libxlsxwriter/issues/36
## 0.3.2 April 8 2016
- Added the `worksheet_write_boolean()` function to write Excel boolean
values.
Feature request [#47][gh_47].
[gh_47]: https://github.com/jmcnamara/libxlsxwriter/issues/47
## 0.3.1 January 9 2016
- Improved performance 20-30% for large data files.
## 0.3.0 January 4 2016
- Renamed `worksheet_set_row()` function to `worksheet_set_row_opt()` for
consistency with current and future APIs. The `worksheet_set_row()` function
is now used without the options parameter.
Note: This is a backward incompatible change.
- Renamed `worksheet_set_column()` function to `worksheet_set_column_opt()`
for consistency with current and future APIs. The `worksheet_set_column()`
function is now used without the options parameter.
Note: This is a backward incompatible change.
## 0.2.9 January 3 2016
- Added the `worksheet_insert_image()` function to add PNG and JPG images to
worksheets. See @ref demo.c and @ref images.c.
## 0.2.8 December 22 2015
- Added `worksheet_set_default_row()` function to allow setting of default row
height and hiding unused rows. See the @ref hide_row_col.c example.
## 0.2.7 December 21 2015
- Added support for escaping control characters in strings. This prevents
unreadable files if string data contains control characters.
Issue [#42][gh_42].
[gh_42]: https://github.com/jmcnamara/libxlsxwriter/issues/42
## 0.2.6 December 19 2015
- Added `worksheet_protect()` function to protect Excel worksheet elements
from modification. See the @ref worksheet_protection.c example.
## 0.2.5 December 14 2015
- Added `workbook_set_properties()` function to set Excel document properties
such as Author and Title. See the @ref doc_properties.c example.
## 0.2.4 December 13 2015
- Added `worksheet_hide()` function to hide a worksheet. See the @ref
hide_sheet.c example.
- Added `worksheet_set_first_sheet()` function to set the first visible
worksheet in a workbook with a large number of worksheets.
## 0.2.3 December 12 2015
- Added `worksheet_set_tab_color()` function to set the worksheet tab
color. See the @ref tab_colors.c example.
## 0.2.2 December 11 2015
- Replaced shared strings hash table with a Red/Black tree implementation for
better performance.
Thanks to Martin Renters. Pull Request [#41][gh_41].
[gh_41]: https://github.com/jmcnamara/libxlsxwriter/issues/41
## 0.2.1 December 11 2015
- Added `worksheet_right_to_left()` function. This can be used to change the
default direction of the worksheet from left-to-right when creating Arabic,
Hebrew or other near or far eastern worksheets that use right-to-left as the
default direction.
- Added `worksheet_hide_zero()` function to hide zero cell values.
- Added `worksheet_set_zoom()` method to set the worksheet zoom factor.
## 0.2.0 December 9 2015
- Added `worksheet_set_selection()` function to set the cell selected range on
a worksheet.
## 0.1.9 December 7 2015
- Replaced main worksheet data structure with a Red/Black tree implementation
for better performance when data isn't added in linear row-column order.
Thanks to Martin Renters. Pull Request [#14][gh_14] and [#16][gh_16].
[gh_14]: https://github.com/jmcnamara/libxlsxwriter/issues/14
[gh_16]: https://github.com/jmcnamara/libxlsxwriter/issues/16
## 0.1.8 December 7 2015
- Added `worksheet_freeze_panes()` and `worksheet_split_panes()` to allow
setting worksheet panes. See @ref panes.c example.
- Added link to [Xcode project][libxlsxwriterCocoaExamples] for iOS and OS X
with Objective-C and Swift, provided by Ludovico Rossi.
- Added improved support for Windows.
[libxlsxwriterCocoaExamples]: https://github.com/lrossi/libxlsxwriterCocoaExamples
## 0.1.7 September 27 2015
- Fixed Cocoapod spec file for iOS and OS X.
## 0.1.6 September 27 2015
- Added Cocoapod spec file to allow the library to be installed using
[CocoaPods](https://cocoapods.org).
Pull Request [#7](https://github.com/jmcnamara/libxlsxwriter/issues/7).
## 0.1.5 May 3 2015
- Added `worksheet_write_url()` function to write urls/hyperlinks to
worksheets. See also @ref hyperlinks.c.
## 0.1.4 March 18 2015
- Added `worksheet_autofilter()` function to add autofilters to worksheets.
See also @ref autofilter.c.
## 0.1.3 March 15 2015
- Added `worksheet_write_array_formula()` function to allow writing of
array formulas in worksheets.
## 0.1.2 March 14 2015
- Added `worksheet_set_h_pagebreaks()` and `worksheet_set_v_pagebreaks()`
functions to define worksheet page breaks.
- Added LXW_FOREACH_WORKSHEET() macro to allow iteration over all the
worksheets in a workbook.
- Added `worksheet_set_print_scale()` function to set the scale factor for
the printed page.
- Added `worksheet_set_start_page()` function to set the start page number
when printing.
## 0.1.1 March 13 2015
- Added `worksheet_print_area()` function to control the print area of a
worksheet.
- Added `worksheet_fit_to_pages()` function to fit the printed area to a
specific number of pages both vertically and horizontally.
## 0.1.0 March 12 2015
- Added `worksheet_repeat_rows()` and `worksheet_repeat_columns()` functions
to control the repeated rows/columns on printed worksheets.
## 0.0.9 March 9 2015
- Added `worksheet_gridlines()` function to show/hide screen and print
gridlines.
- Added `worksheet_center_horizontally()` and `worksheet_center_vertically()`
functions to center worksheet on the printed page.
- Added `worksheet_print_row_col_headers()` function to enable printing of row
and column headers.
## 0.0.8 March 8 2015
- Added support for worksheet headers and footers via the
`worksheet_set_header()` and `worksheet_set_footer()` functions. See also
@ref headers_footers.c.
## 0.0.7 March 7 2015
- Added the `worksheet_merge_range()` method to merge worksheet cells. See
also @ref merge_range.c.
## 0.0.6 March 5 2015
- Added the `workbook_define_name()` method to create defined names and ranges
in a workbook or worksheet.
## 0.0.5 March 6 2015
- Added `worksheet_select()` function to set worksheets as selected.
- Added `worksheet_activate()` to set the active worksheet.
- Several portability fixes to fix warnings with different compilers.
## 0.0.4 March 1 2015
- Added `worksheet_set_margins()` function to set top, bottom, left and right
margins in a worksheet.
- Fix for issue where format objects were written to the file in the order of
creation rather than the order of use. This issue caused incorrect formats
in cells.
Issue [#3](https://github.com/jmcnamara/libxlsxwriter/issues/3).
- Fix for issue where tmp files in `constant_memory` mode weren't closed
until application exited.
Issue [#1](https://github.com/jmcnamara/libxlsxwriter/issues/1).
## 0.0.3 January 7 2015
- Added worksheet page setup methods.
- `worksheet_set_landscape()`
- `worksheet_set_portrait()`
- `worksheet_set_page_view()`
- `worksheet_set_paper()`
- `worksheet_print_across()`
## 0.0.2 June 26 2014
- First public release.
## 0.0.1 June 8 2014
- First GitHub release.
*/
jmcnamara-libxlsxwriter-ad6ea1e/License.txt 0000664 0000000 0000000 00000023600 14757674164 0021304 0 ustar 00root root 0000000 0000000 /**
@page license License
Libxlsxwriter is released under a FreeBSD license:
Copyright 2014-2025, John McNamara
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are
those of the authors and should not be interpreted as representing
official policies, either expressed or implied, of the FreeBSD Project.
Libxlsxwriter includes the `queue.h` and `tree.h` macros from FreeBSD. It also
includes and, unless overridden, uses the optional libraries `minizip`,
`tmpfileplus` and `md5`. It also includes the `emyg_dtoa` library but doesn't
use it by default. These components have the following licenses:
Queue.h from FreeBSD:
Copyright (c) 1991, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Tree.h from FreeBSD:
Copyright 2002 Niels Provos
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The `minizip` files used in the libxlsxwriter source tree are taken from the
`zlib` ` contrib/minizip` directory. [Zlib](http://www.zlib.net) has the
following License/Copyright:
(C) 1995-2013 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
The `minizip` files have the following additional copyright declarations:
Copyright (C) 1998-2010 Gilles Vollant
(minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
Note, it is possible to compile libxlsxwriter without statically linking the
`minizip` files and instead dynamically linking to `lminizip`, see
@ref gsg_minizip.
[Tmpfileplus](http://www.di-mgt.com.au/c_function_to_create_temp_file.html)
has the following license:
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Copyright (c) 2012-16 David Ireland, DI Management Services Pty Ltd
.
See the [Mozilla Public License, v. 2.0](http://mozilla.org/MPL/2.0/).
Note, it is possible to compile libxlsxwriter using the standard library
`tmpfile()` function instead of `tmpfileplus`, see @ref gsg_tmpdir.
The [Milo Yip DTOA library](https://github.com/miloyip/dtoa-benchmark) for
converting doubles to strings. It has the following license:
Copyright (C) 2015 Doug Currie
based on dtoa_milo.h
Copyright (C) 2014 Milo Yip
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
This Milo Yip DTOA library (emyg_dtoa) is used to avoid issues where the
standard sprintf() dtoa function changes output based on locale settings. It
is also 40-50% faster than the standard dtoa for raw numeric data. The use of
this library is optional. If you wish to use it you can pass
`USE_DTOA_LIBRARY=1` to make when compiling.
[Openwall MD5](https://openwall.info/wiki/people/solar/software/public-domain-source-code/md5)
has the following licence:
This software was written by Alexander Peslyak in 2001. No copyright is
claimed, and the software is hereby placed in the public domain.
In case this attempt to disclaim copyright and place the software in the
public domain is deemed null and void, then the software is
Copyright (c) 2001 Alexander Peslyak and it is hereby released to the
general public under the following terms:
Redistribution and use in source and binary forms, with or without
modification, are permitted.
There's ABSOLUTELY NO WARRANTY, express or implied.
(This is a heavily cut-down "BSD license".)
Note, the MD5 library is used to avoid including duplicate image files in the
xlsx file. If you don't want to use this code, and the additional licence, you
can use OpenSSL's MD5 functions instead by passing `USE_OPENSSL_MD5=1` to
make. If this functionality isn't required it is possible to compile
libxlsxwriter without image deduplication by passing `USE_NO_MD5=1` to make.
See also @ref gsg_md5.
Next: @ref changes
*/
jmcnamara-libxlsxwriter-ad6ea1e/Makefile 0000664 0000000 0000000 00000022147 14757674164 0020626 0 ustar 00root root 0000000 0000000 ###############################################################################
#
# Makefile for libxlsxwriter library.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright 2014-2025, John McNamara, jmcnamara@cpan.org.
#
# Keep the output quiet by default.
Q=@
ifdef V
Q=
endif
DESTDIR ?=
PREFIX ?= /usr/local
PYTEST ?= py.test
PYTESTFILES ?= test
VERSION = $(shell sed -n -e 's/.*LXW_VERSION \"\(.*\)\"/\1/p' include/xlsxwriter.h)
SOVERSION = $(shell sed -n -e 's/.*LXW_SOVERSION \"\(.*\)\"/\1/p' include/xlsxwriter.h)
ENABLED_OPTIONS = zlib
ifdef USE_SYSTEM_MINIZIP
ENABLED_OPTIONS += minizip
endif
ifdef USE_OPENSSL_MD5
ENABLED_OPTIONS += libcrypto
endif
.PHONY: docs tags examples third_party
# Build libxlsxwriter.
all : third_party
$(Q)$(MAKE) -C src
# Build the third party libs.
third_party :
ifndef USE_SYSTEM_MINIZIP
$(Q)$(MAKE) -C third_party/minizip
endif
ifndef USE_STANDARD_TMPFILE
$(Q)$(MAKE) -C third_party/tmpfileplus
endif
ifndef USE_NO_MD5
ifndef USE_OPENSSL_MD5
$(Q)$(MAKE) -C third_party/md5
endif
endif
ifdef USE_DTOA_LIBRARY
$(Q)$(MAKE) -C third_party/dtoa
endif
# Build a macOS universal binary.
universal_binary :
$(Q)$(MAKE) clean
$(Q)TARGET_ARCH="-target x86_64-apple-macos10.12" $(MAKE) all
$(Q)mv lib/libxlsxwriter.a libxlsxwriter_x86_64.a
$(Q)mv lib/libxlsxwriter.$(SOVERSION).dylib libxlsxwriter_x86_64.dylib
$(Q)$(MAKE) clean
$(Q)TARGET_ARCH="-target arm64-apple-macos11" $(MAKE) all
$(Q)mv lib/libxlsxwriter.a lib/libxlsxwriter_arm64.a
$(Q)mv lib/libxlsxwriter.$(SOVERSION).dylib lib/libxlsxwriter_arm64.dylib
$(Q)mv libxlsxwriter_x86_64.a libxlsxwriter_x86_64.dylib lib
$(Q)lipo -create -output lib/libxlsxwriter.a lib/libxlsxwriter_x86_64.a lib/libxlsxwriter_arm64.a
$(Q)lipo -create -output lib/libxlsxwriter.$(SOVERSION).dylib lib/libxlsxwriter_x86_64.dylib lib/libxlsxwriter_arm64.dylib
$(Q)rm -f lib/libxlsxwriter_x86_64.* lib/libxlsxwriter_arm64.*
# Build the example programs.
examples : all
$(Q)$(MAKE) -C examples
# Build the example programs with CPP for compatibility checking.
examples_cpp : all
$(Q)$(MAKE) -C examples CC=$(CXX)
# Clean src and test directories.
clean :
$(Q)$(MAKE) clean -C src
$(Q)$(MAKE) clean -C test/unit
$(Q)$(MAKE) clean -C test/functional/src
$(Q)$(MAKE) clean -C test/cpp
$(Q)$(MAKE) clean -C examples
$(Q)rm -rf docs/html
$(Q)rm -rf test/functional/__pycache__
$(Q)rm -f test/functional/*.pyc
$(Q)rm -f lib/*
$(Q)$(MAKE) clean -C third_party/minizip
$(Q)$(MAKE) clean -C third_party/tmpfileplus
$(Q)$(MAKE) clean -C third_party/md5
$(Q)$(MAKE) clean -C third_party/dtoa
# Clean src and lib dir only, as a precursor for static analysis.
clean_src :
$(Q)$(MAKE) clean -C src
$(Q)rm -f lib/*
# Run the unit tests.
test : all test_cpp test_unit test_functional
# Test for C++ const correctness on APIs.
test_const : all
$(Q)$(MAKE) clean -C test/functional/src
$(Q)! $(MAKE) -C test/functional/src CFLAGS=-Wwrite-strings 2>&1 | grep -A 1 "note:"
# Run the functional tests.
test_functional : all
$(Q)$(MAKE) -C test/functional/src
$(Q)$(PYTEST) test/functional -v -k $(PYTESTFILES)
# Run all tests.
test_unit : all
$(Q)$(MAKE) -C src test_lib
$(Q)$(MAKE) -C test/unit test
# Test C++ compilation.
test_cpp : all
$(Q)$(MAKE) -C test/cpp
# Test Cmake. This test should really be done with Cmake in the cmake dir but
# this is a workaround for now.
test_cmake :
ifneq ($(findstring m32,$(CFLAGS)),m32)
$(Q)$(MAKE) -C src clean
$(Q)mkdir -p build
$(Q)cd build
$(Q)cmake .. -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON
$(Q)make clean; make; cp libxlsxwriter.a ../src/
$(Q)cmake/xlsxwriter_unit
$(Q)$(MAKE) -C test/functional/src
$(Q)$(PYTEST) test/functional -v -k $(PYTESTFILES)
else
@echo "Skipping Cmake tests on 32 bit target."
endif
# Test the functional test exes with valgrind (in 64bit mode only).
test_valgrind : all
ifndef NO_VALGRIND
$(Q)$(MAKE) -C test/functional/src test_valgrind
$(Q)$(MAKE) -C examples test_valgrind
endif
# Minimal target for quick compile without creating the libs.
test_compile :
$(Q)$(MAKE) -C src test_compile
# Indent the source files with the .indent.pro settings.
indent:
$(Q)gindent src/*.c include/*.h include/xlsxwriter/*.h
$(Q)gersemi --no-warn-about-unknown-commands -i CMakeLists.txt
tags:
$(Q)rm -f TAGS
$(Q)etags src/*.c include/*.h include/xlsxwriter/*.h
# Build the doxygen docs.
doc: docs
docs:
$(Q)$(MAKE) -C docs
@echo "Docs built."
docs_doxygen_only:
$(Q)$(MAKE) -C docs docs_doxygen_only
docs_external:
$(Q)make -C ../libxlsxwriter.github.io release
# Simple install.
install: all
$(Q)mkdir -p $(DESTDIR)$(PREFIX)/include
$(Q)cp -R include/* $(DESTDIR)$(PREFIX)/include
$(Q)mkdir -p $(DESTDIR)$(PREFIX)/lib
$(Q)cp -R lib/* $(DESTDIR)$(PREFIX)/lib
$(Q)mkdir -p $(DESTDIR)$(PREFIX)/lib/pkgconfig
$(Q)sed -e 's|@PREFIX@|$(PREFIX)|g' \
-e 's|@VERSION@|$(VERSION)|g' \
-e 's|@ENABLED_OPTIONS@|$(ENABLED_OPTIONS)|g' \
dev/release/pkg-config.txt \
> $(DESTDIR)$(PREFIX)/lib/pkgconfig/xlsxwriter.pc
# Simpler uninstall.
uninstall:
$(Q)rm -rf $(DESTDIR)$(PREFIX)/include/xlsxwriter*
$(Q)rm $(DESTDIR)$(PREFIX)/lib/libxlsxwriter.*
$(Q)rm $(DESTDIR)$(PREFIX)/lib/pkgconfig/xlsxwriter.pc
# Strip the lib files.
strip:
$(Q)strip lib/*
# Run a coverity static analysis.
coverity: clean_src third_party
$(Q)rm -rf cov-int
$(Q)rm -f libxlsxwriter-coverity.tgz
$(Q)../../cov-analysis-linux64-2019.03/bin/cov-build --dir cov-int make -C src libxlsxwriter.a
$(Q)tar -czf libxlsxwriter-coverity.tgz cov-int
$(Q)$(MAKE) -C src clean
$(Q)rm -f lib/*
# Run address sanitiser.
address_sanitiser: third_party
$(Q)$(MAKE) -C src libxlsxwriter.a CFLAGS="-fsanitize=address -O1 -fsanitize-coverage=trace-pc-guard -fno-omit-frame-pointer -g"
$(Q)$(MAKE) -C examples CFLAGS="-fsanitize=address -O1 -fsanitize-coverage=trace-pc-guard -fno-omit-frame-pointer -g"
# Run gcov coverage analysis.
gcov: third_party
$(Q)$(MAKE) -C src clean
$(Q)$(MAKE) -C src GCOV="--coverage" OPT_LEVEL="-O0"
$(Q)$(MAKE) -C src test_lib GCOV="--coverage"
$(Q)$(MAKE) -C test/unit test GCOV="--coverage"
$(Q)$(MAKE) -C test/functional/src GCOV="--coverage"
$(Q)$(PYTEST) test/functional -v -k $(PYTESTFILES)
$(Q)mkdir -p build
$(Q)gcovr -r src --html-details -o build/libxlsxwriter_gcov.html
$(Q)gcovr -r . -f src --sonarqube build/coverage.xml
# Run sonarcloud analysis.
sonarcloud: gcov
ifndef SONAR_TOKEN
@echo "Please define SONAR_TOKEN to run this analysis."
@exit 1
endif
$(Q)$(MAKE) clean
$(Q)../sonar-scanner-4.6.1.2450-macosx/bin/build-wrapper-macosx-x86 --out-dir build make all
$(Q)../sonar-scanner-4.6.1.2450-macosx/bin/sonar-scanner \
-Dsonar.organization=jmcnamara-github \
-Dsonar.projectKey=jmcnamara_libxlsxwriter \
-Dsonar.projectName=libxlsxwriter \
-Dsonar.projectVersion=$(VERSION) \
-Dsonar.sources=src \
-Dsonar.sourceEncoding=UTF-8 \
-Dsonar.cfamily.build-wrapper-output=build \
-Dsonar.working.directory=build/scannerwork \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.coverageReportPaths=build/coverage.xml
sonarcloud_no_gcov:
ifndef SONAR_TOKEN
@echo "Please define SONAR_TOKEN to run this analysis."
@exit 1
endif
$(Q)$(MAKE) clean
$(Q)../sonar-scanner-4.6.1.2450-macosx/bin/build-wrapper-macosx-x86 --out-dir build make all
$(Q)../sonar-scanner-4.6.1.2450-macosx/bin/sonar-scanner \
-Dsonar.organization=jmcnamara-github \
-Dsonar.projectKey=jmcnamara_libxlsxwriter \
-Dsonar.projectName=libxlsxwriter \
-Dsonar.projectVersion=$(VERSION) \
-Dsonar.sources=src \
-Dsonar.sourceEncoding=UTF-8 \
-Dsonar.cfamily.build-wrapper-output=build \
-Dsonar.working.directory=build/scannerwork \
-Dsonar.host.url=https://sonarcloud.io
# Run a scan-build static analysis.
scan_build: clean_src third_party
$(Q)scan-build make -C src libxlsxwriter.a
$(Q)$(MAKE) -C src clean
$(Q)rm -f lib/*
spellcheck:
$(Q)for f in docs/src/*.dox; do aspell --lang=en_US --check $$f; done
$(Q)for f in include/xlsxwriter/*.h; do aspell --lang=en_US --check $$f; done
$(Q)for f in src/*.c; do aspell --lang=en_US --check $$f; done
$(Q)for f in examples/*.c; do aspell --lang=en_US --check $$f; done
$(Q)aspell --lang=en_US --check Changes.txt
$(Q)aspell --lang=en_US --check Readme.md
$(Q)aspell --lang=en_US --check docs/src/examples.txt
releasecheck:
$(Q)dev/release/release_check.sh
release: releasecheck
@echo
@echo "Pushing to git main ..."
$(Q)git push origin main
$(Q)git push --tags
@echo
@echo "Pushing updated docs ..."
$(Q)make -C ../libxlsxwriter.github.io release
@echo
@echo "Pushing the cocoapod ..."
$(Q)pod trunk push libxlsxwriter.podspec --use-libraries
@echo
@echo "Finished. Opening files."
$(Q)open https://libxlsxwriter.github.io/changes.html
$(Q)open https://cocoadocs.org/docsets/libxlsxwriter
$(Q)open https://github.com/jmcnamara/libxlsxwriter
$(Q)open https://github.com/jmcnamara/libxlsxwriter/releases
jmcnamara-libxlsxwriter-ad6ea1e/Package.swift 0000664 0000000 0000000 00000002171 14757674164 0021572 0 ustar 00root root 0000000 0000000 // swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "libxlsxwriter",
products: [
.library(
name: "libxlsxwriter",
targets: ["libxlsxwriter"]),
],
targets: [
.target(
name: "libxlsxwriter",
path: ".",
exclude: [
"src/Makefile",
],
sources: [
"include",
"src",
"third_party/minizip/zip.c",
"third_party/minizip/ioapi.c",
"third_party/tmpfileplus/tmpfileplus.c",
"third_party/md5/md5.c"
],
publicHeadersPath: "include",
linkerSettings: [
.linkedLibrary("z")
]),
.testTarget(
name: "libxlsxwritertests",
dependencies: ["libxlsxwriter"],
path: ".",
sources: ["test/swift"],
linkerSettings: [
.linkedLibrary("z")
]
)
]
)
jmcnamara-libxlsxwriter-ad6ea1e/Readme.md 0000664 0000000 0000000 00000004306 14757674164 0020702 0 ustar 00root root 0000000 0000000 # libxlsxwriter
Libxlsxwriter: A C library for creating Excel XLSX files.

## The libxlsxwriter library
Libxlsxwriter is a C library that can be used to write text, numbers, formulas
and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.
It supports features such as:
- 100% compatible Excel XLSX files.
- Full Excel formatting.
- Merged cells.
- Defined names.
- Autofilters.
- Charts.
- Data validation and dropdown lists.
- Conditional formatting.
- Worksheet PNG/JPEG/GIF images.
- Cell comments.
- Support for adding Macros.
- Memory optimization mode for writing large files.
- Source code available on [GitHub](https://github.com/jmcnamara/libxlsxwriter).
- FreeBSD license.
- ANSI C.
- Works with GCC, Clang, Xcode, MSVC 2015, ICC, TCC, MinGW, MingGW-w64/32.
- Works on Linux, FreeBSD, OpenBSD, OS X, iOS and Windows. Also works on MSYS/MSYS2 and Cygwin.
- Compiles for 32 and 64 bit.
- Compiles and works on big and little endian systems.
- The only dependency is on `zlib`.
Here is an example that was used to create the spreadsheet shown above:
```C
#include "xlsxwriter.h"
int main() {
/* Create a new workbook and add a worksheet. */
lxw_workbook *workbook = workbook_new("demo.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
/* Add a format. */
lxw_format *format = workbook_add_format(workbook);
/* Set the bold property for the format */
format_set_bold(format);
/* Change the column width for clarity. */
worksheet_set_column(worksheet, 0, 0, 20, NULL);
/* Write some simple text. */
worksheet_write_string(worksheet, 0, 0, "Hello", NULL);
/* Text with formatting. */
worksheet_write_string(worksheet, 1, 0, "World", format);
/* Write some numbers. */
worksheet_write_number(worksheet, 2, 0, 123, NULL);
worksheet_write_number(worksheet, 3, 0, 123.456, NULL);
/* Insert an image. */
worksheet_insert_image(worksheet, 1, 2, "logo.png");
workbook_close(workbook);
return 0;
}
```
See the [full documentation](http://libxlsxwriter.github.io) for the getting
started guide, a tutorial, the main API documentation and examples.
jmcnamara-libxlsxwriter-ad6ea1e/build.zig 0000664 0000000 0000000 00000025660 14757674164 0021003 0 ustar 00root root 0000000 0000000 const std = @import("std");
const xlsxw_version: std.SemanticVersion = .{
.major = 1,
.minor = 1,
.patch = 9,
};
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const shared = b.option(bool, "SHARED_LIBRARY", "Build the Shared Library [default: false]") orelse false;
const examples = b.option(bool, "BUILD_EXAMPLES", "Build libxlsxwriter examples [default: false]") orelse false;
const tests = b.option(bool, "BUILD_TESTS", "Build libxlsxwriter tests [default: false]") orelse false;
const dtoa = b.option(bool, "USE_DTOA_LIBRARY", "Use the locale independent third party Milo Yip DTOA library [default: off]") orelse false;
const minizip = b.option(bool, "USE_SYSTEM_MINIZIP", "Use system minizip installation [default: off]") orelse false;
const md5 = b.option(bool, "USE_OPENSSL_MD5", "Build libxlsxwriter with the OpenSSL MD5 lib [default: off]") orelse false;
const stdtmpfile = b.option(bool, "USE_STANDARD_TMPFILE", "Use the C standard library's tmpfile() [default: off]") orelse false;
const lib = if (shared) b.addSharedLibrary(.{
.name = "xlsxwriter",
.target = target,
.optimize = optimize,
.version = xlsxw_version,
}) else b.addStaticLibrary(.{
.name = "xlsxwriter",
.target = target,
.optimize = optimize,
});
lib.pie = true;
switch (optimize) {
.Debug, .ReleaseSafe => lib.bundle_compiler_rt = true,
else => lib.root_module.strip = true,
}
if (tests)
lib.root_module.addCMacro("TESTING", "");
lib.addCSourceFiles(.{
.files = &.{
"src/vml.c",
"src/chartsheet.c",
"src/theme.c",
"src/content_types.c",
"src/xmlwriter.c",
"src/app.c",
"src/styles.c",
"src/core.c",
"src/comment.c",
"src/utility.c",
"src/metadata.c",
"src/custom.c",
"src/hash_table.c",
"src/relationships.c",
"src/drawing.c",
"src/chart.c",
"src/shared_strings.c",
"src/worksheet.c",
"src/format.c",
"src/table.c",
"src/workbook.c",
"src/packager.c",
"src/rich_value.c",
"src/rich_value_rel.c",
"src/rich_value_structure.c",
"src/rich_value_types.c",
},
.flags = cflags,
});
// minizip
if (minizip) {
lib.addCSourceFiles(.{
.files = switch (lib.rootModuleTarget().os.tag) {
.windows => minizip_src ++ [_][]const u8{
"third_party/minizip/iowin32.c",
},
else => minizip_src,
},
.flags = cflags,
});
}
const zlib = buildZlib(b, .{ target, optimize });
lib.linkLibrary(zlib);
lib.installLibraryHeaders(zlib);
// md5
if (!md5)
lib.addCSourceFile(.{
.file = b.path("third_party/md5/md5.c"),
.flags = cflags,
})
else
lib.linkSystemLibrary("crypto");
// dtoa
if (dtoa)
lib.addCSourceFile(.{
.file = b.path("third_party/dtoa/emyg_dtoa.c"),
.flags = cflags,
});
// tmpfileplus
if (stdtmpfile)
lib.addCSourceFile(.{
.file = b.path("third_party/tmpfileplus/tmpfileplus.c"),
.flags = cflags,
})
else
lib.root_module.addCMacro("USE_STANDARD_TMPFILE", "");
lib.addIncludePath(b.path("include"));
lib.addIncludePath(b.path("third_party"));
lib.linkLibC();
// get headers on include to zig-out/include
lib.installHeadersDirectory(b.path("include"), "", .{});
// get binaries on zig-cache to zig-out
b.installArtifact(lib);
// build examples
if (examples) {
buildExe(b, .{
.lib = lib,
.path = "examples/anatomy.c",
});
buildExe(b, .{
.lib = lib,
.path = "examples/array_formula.c",
});
buildExe(b, .{
.lib = lib,
.path = "examples/autofilter.c",
});
buildExe(b, .{
.lib = lib,
.path = "examples/background.c",
});
buildExe(b, .{
.lib = lib,
.path = "examples/chart_area.c",
});
buildExe(b, .{
.lib = lib,
.path = "examples/chart_column.c",
});
buildExe(b, .{
.lib = lib,
.path = "examples/data_validate.c",
});
buildExe(b, .{
.lib = lib,
.path = "examples/hello.c",
});
buildExe(b, .{
.lib = lib,
.path = "examples/watermark.c",
});
buildExe(b, .{
.lib = lib,
.path = "examples/worksheet_protection.c",
});
}
// build tests
if (tests) {
buildTest(b, .{
.lib = lib,
.path = "test/unit/app/test_app.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/chart/test_chart.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/chartsheet/test_chartsheet.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/content_types/test_content_types.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/content_types/test_content_types_write_default.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/content_types/test_content_types_write_override.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/relationships/test_relationships.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/app/test_app_xml_declaration.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/relationships/test_relationships_xml_declaration.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/custom/test_custom_xml_declaration.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/metadata/test_metadata_xml_declaration.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/core/test_core_xml_declaration.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/sst/test_shared_strings.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/workbook/test_workbook.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/xmlwriter/test_xmlwriter.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/table/test_table01.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/table/test_table02.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/table/test_table03.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/table/test_table04.c",
});
buildTest(b, .{
.lib = lib,
.path = "test/unit/styles/test_styles_write_border.c",
});
}
}
fn buildExe(b: *std.Build, info: BuildInfo) void {
const exe = b.addExecutable(.{
.name = info.filename(),
.optimize = info.lib.root_module.optimize.?,
.target = info.lib.root_module.resolved_target.?,
});
exe.addCSourceFile(.{
.file = b.path(info.path),
.flags = cflags,
});
exe.linkLibrary(info.lib);
for (info.lib.root_module.include_dirs.items) |include| {
exe.root_module.include_dirs.append(b.allocator, include) catch @panic("OOM");
}
exe.linkLibC();
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step(
b.fmt("{s}", .{info.filename()}),
b.fmt("Run the {s} test", .{info.filename()}),
);
run_step.dependOn(&run_cmd.step);
}
fn buildTest(b: *std.Build, info: BuildInfo) void {
const exe = b.addExecutable(.{
.name = info.filename(),
.optimize = info.lib.root_module.optimize.?,
.target = info.lib.root_module.resolved_target.?,
});
exe.root_module.addCMacro("TESTING", "");
exe.addCSourceFile(.{
.file = b.path(info.path),
.flags = cflags,
});
exe.addCSourceFile(.{
.file = b.path("test/unit/test_all.c"),
.flags = cflags,
});
exe.addIncludePath(b.path("test/unit"));
for (info.lib.root_module.include_dirs.items) |include| {
exe.root_module.include_dirs.append(b.allocator, include) catch {};
}
exe.linkLibrary(info.lib);
exe.linkLibC();
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step(
b.fmt("{s}", .{info.filename()}),
b.fmt("Run the {s} test", .{info.filename()}),
);
run_step.dependOn(&run_cmd.step);
}
const cflags = &.{
"-std=c89",
"-Wall",
"-Wextra",
"-Wno-unused-parameter",
};
const minizip_src: []const []const u8 = &.{
"third_party/minizip/ioapi.c",
"third_party/minizip/mztools.c",
"third_party/minizip/unzip.c",
"third_party/minizip/zip.c",
};
const BuildInfo = struct {
lib: *std.Build.Step.Compile,
path: []const u8,
fn filename(self: BuildInfo) []const u8 {
var split = std.mem.splitSequence(u8, std.fs.path.basename(self.path), ".");
return split.first();
}
};
fn buildZlib(b: *std.Build, options: anytype) *std.Build.Step.Compile {
const libz = b.addStaticLibrary(.{
.name = "z",
.target = options[0],
.optimize = options[1],
});
if (b.lazyDependency("zlib", .{
.target = options[0],
.optimize = options[1],
})) |zlib_path| {
libz.addIncludePath(zlib_path.path(""));
libz.addCSourceFiles(.{
.root = zlib_path.path(""),
.files = &.{
"adler32.c",
"crc32.c",
"deflate.c",
"infback.c",
"inffast.c",
"inflate.c",
"inftrees.c",
"trees.c",
"zutil.c",
"compress.c",
"uncompr.c",
"gzclose.c",
"gzlib.c",
"gzread.c",
"gzwrite.c",
},
.flags = cflags,
});
libz.installHeader(zlib_path.path("zconf.h"), "zconf.h");
libz.installHeader(zlib_path.path("zlib.h"), "zlib.h");
}
libz.linkLibC();
return libz;
}
jmcnamara-libxlsxwriter-ad6ea1e/build.zig.zon 0000664 0000000 0000000 00000000750 14757674164 0021601 0 ustar 00root root 0000000 0000000 .{
.name = "libxlsxwriter",
.version = "1.1.9",
.dependencies = .{
.zlib = .{
.url = "git+https://github.com/madler/zlib#v1.3.1",
.hash = "1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb",
},
},
.paths = .{
"build.zig",
"build.zig.zon",
"Readme.md",
"License.txt",
"src",
"include",
"third_party",
},
}
//syntax tip: zig - anon struct (json-like)
jmcnamara-libxlsxwriter-ad6ea1e/cocoapods/ 0000775 0000000 0000000 00000000000 14757674164 0021132 5 ustar 00root root 0000000 0000000 jmcnamara-libxlsxwriter-ad6ea1e/cocoapods/libxlsxwriter-umbrella.h 0000664 0000000 0000000 00000001720 14757674164 0026026 0 ustar 00root root 0000000 0000000 #import
#import "../xlsxwriter.h"
#import "app.h"
#import "chart.h"
#import "chartsheet.h"
#import "comment.h"
#import "common.h"
#import "content_types.h"
#import "core.h"
#import "custom.h"
#import "drawing.h"
#import "format.h"
#import "hash_table.h"
#import "metadata.h"
#import "packager.h"
#import "relationships.h"
#import "rich_value.h"
#import "rich_value_rel.h"
#import "rich_value_structure.h"
#import "rich_value_types.h"
#import "shared_strings.h"
#import "styles.h"
#import "table.h"
#import "theme.h"
#import "third_party/emyg_dtoa.h"
#import "third_party/ioapi.h"
#import "third_party/md5.h"
#import "third_party/queue.h"
#import "third_party/tmpfileplus.h"
#import "third_party/tree.h"
#import "third_party/zip.h"
#import "utility.h"
#import "vml.h"
#import "workbook.h"
#import "worksheet.h"
#import "xmlwriter.h"
FOUNDATION_EXPORT double xlsxwriterVersionNumber;
FOUNDATION_EXPORT const unsigned char xlsxwriterVersionString[];
jmcnamara-libxlsxwriter-ad6ea1e/cocoapods/libxlsxwriter.modulemap 0000664 0000000 0000000 00000000226 14757674164 0025761 0 ustar 00root root 0000000 0000000 framework module xlsxwriter {
umbrella header "xlsxwriter/libxlsxwriter-umbrella.h"
header "xlsxwriter.h"
export *
module * { export * }
}
jmcnamara-libxlsxwriter-ad6ea1e/dev/ 0000775 0000000 0000000 00000000000 14757674164 0017736 5 ustar 00root root 0000000 0000000 jmcnamara-libxlsxwriter-ad6ea1e/dev/fuzzing/ 0000775 0000000 0000000 00000000000 14757674164 0021432 5 ustar 00root root 0000000 0000000 jmcnamara-libxlsxwriter-ad6ea1e/dev/fuzzing/CMakeLists.txt 0000664 0000000 0000000 00000001413 14757674164 0024171 0 ustar 00root root 0000000 0000000 # Utilized by OSSFuzz to build the harness(es) for continuous fuzz-testing
# OSSFuzz defines the following environment variables, that this target relies upon:
# CXX, CFLAGS, LIB_FUZZING_ENGINE, OUT
add_definitions(-DNDEBUG) # Do not want assertions
if (DEFINED ENV{CFLAGS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} $ENV{CFLAGS}")
endif()
if (DEFINED ENV{CXXFLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{CXXFLAGS}")
endif()
add_executable(xlsx_fuzzer xlsx_fuzzer.cpp)
target_link_libraries(xlsx_fuzzer PRIVATE ${PROJECT_NAME} $ENV{LIB_FUZZING_ENGINE})
target_compile_features(xlsx_fuzzer PRIVATE cxx_std_17)
if (DEFINED ENV{OUT})
install(TARGETS xlsx_fuzzer DESTINATION $ENV{OUT})
else ()
message(WARNING "Cannot install if $OUT is not defined!")
endif () jmcnamara-libxlsxwriter-ad6ea1e/dev/fuzzing/build.sh 0000775 0000000 0000000 00000000475 14757674164 0023076 0 ustar 00root root 0000000 0000000 cd $SRC/libxlsxwriter
printenv
mkdir -p build
cmake -S . -B build -DBUILD_FUZZERS=ON && cmake --build build --target install
# Build the corpus using the existing xlsx files in the source
mkdir -p corpus
find $SRC/libxlsxwriter -name "*.xlsx" -exec cp {} corpus \;
zip -q $OUT/xlsx_fuzzer_seed_corpus.zip corpus/*
jmcnamara-libxlsxwriter-ad6ea1e/dev/fuzzing/xlsx_fuzzer.cpp 0000664 0000000 0000000 00000004504 14757674164 0024544 0 ustar 00root root 0000000 0000000 #include
#include
#include
#include "xlsxwriter.h"
const std::string mem_dir{"/dev/shm"};
const std::string file_template = "/fuzzXXXXXX";
char temp_file_dir[FILENAME_MAX] = {0};
/**
* \brief: Performs all prep-work needed for continuous fuzzing
* \return: Whether initialization was successful
*/
int init_for_fuzzing()
{
// Initialize the temporary file directory, based off what is available on the system
if (0 == access(mem_dir.c_str(), W_OK | R_OK))
{
// We can read and write to the in-memory directory
memcpy(temp_file_dir, mem_dir.c_str(), strnlen(mem_dir.c_str(), FILENAME_MAX));
}
else
{
// Default to a temporary directory
const char* tmp_prefix = getenv("TMPDIR");
if (nullptr == tmp_prefix)
{
tmp_prefix = "/tmp";
}
memcpy((void*) temp_file_dir, tmp_prefix, strnlen(tmp_prefix, FILENAME_MAX));
}
return 0;
}
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, const size_t size)
{
static bool init_fuzzing = init_for_fuzzing();
char fuzz_file[FILENAME_MAX + 1] = {0};
int fuzz_fd = 0;
int ret = -1;
ssize_t wc = 0;
size_t byte_len;
lxw_workbook *workbook = nullptr;
lxw_worksheet *worksheet = nullptr;
FuzzedDataProvider fdp{data, size};
std::vector file_bytes{};
strncpy(fuzz_file, temp_file_dir, strlen(temp_file_dir));
strncat(fuzz_file, file_template.c_str(), file_template.length());
if ((fuzz_fd = mkstemp(fuzz_file)) < 0)
{
goto fail;
}
byte_len = fdp.ConsumeIntegralInRange(0, fdp.remaining_bytes());
file_bytes = fdp.ConsumeBytes(byte_len);
write(fuzz_fd, file_bytes.data(), std::min(file_bytes.size(), byte_len));
workbook = workbook_new(fuzz_file);
worksheet = workbook_add_worksheet(workbook, nullptr);
for (int row = 0; row < fdp.ConsumeIntegralInRange(0, 25); ++row)
{
for (int col = 0; col < fdp.ConsumeIntegralInRange(0, 25); ++col)
{
worksheet_write_string(worksheet, row, col, fdp.ConsumeRandomLengthString().c_str(), nullptr);
}
}
ret = 0;
fail:
if (nullptr != workbook)
{
workbook_close(workbook);
}
close(fuzz_fd);
unlink(fuzz_file);
return ret;
}
jmcnamara-libxlsxwriter-ad6ea1e/dev/release/ 0000775 0000000 0000000 00000000000 14757674164 0021356 5 ustar 00root root 0000000 0000000 jmcnamara-libxlsxwriter-ad6ea1e/dev/release/Readme.txt 0000664 0000000 0000000 00000000142 14757674164 0023311 0 ustar 00root root 0000000 0000000
This directory contains some release utilities that are mainly useful
to the library developer.
jmcnamara-libxlsxwriter-ad6ea1e/dev/release/fix_dox.sh 0000775 0000000 0000000 00000000320 14757674164 0023350 0 ustar 00root root 0000000 0000000 #/bin/bash
# Perform some minor clean-ups/fixes to the docs.
perl -i -pe "s/_page/_8h/" html/pages.html
perl -i ../dev/release/fix_example_docs.pl html/examples.html
cp menudata.js html
jmcnamara-libxlsxwriter-ad6ea1e/dev/release/fix_example_docs.pl 0000664 0000000 0000000 00000014560 14757674164 0025232 0 ustar 00root root 0000000 0000000 #!/usr/bin/perl
#
# Simple program to arrange the example programs in a user defined order
# instead of a sorted order. Also add a caption.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright 2014-2025, John McNamara, jmcnamara@cpan.org.
#
use warnings;
use strict;
# The required example order and descriptions.
my @examples = (
[ 'hello.c', 'A simple hello world example' ],
[ 'anatomy.c', 'The anatomy of a libxlsxwriter program' ],
[ 'demo.c', 'Demo of some of the libxlsxwriter features' ],
[ 'tutorial1.c', 'Tutorial 1 from the documentation' ],
[ 'tutorial2.c', 'Tutorial 2 from the documentation' ],
[ 'tutorial3.c', 'Tutorial 3 from the documentation' ],
[ 'format_font.c', 'Example of writing data with font formatting' ],
[ 'format_num_format.c', 'Example of writing data with number formatting' ],
[ 'dates_and_times01.c', 'Writing dates and times with numbers' ],
[ 'dates_and_times02.c', 'Writing dates and times with datetime' ],
[ 'dates_and_times03.c', 'Writing dates and times with Unix datetimes' ],
[ 'dates_and_times04.c', 'Dates and times with different formats' ],
[ 'hyperlinks.c', 'A example of writing urls/hyperlinks' ],
[ 'rich_strings.c', 'A example of writing "rich" multi-format strings' ],
[ 'array_formula.c', 'A example of using array formulas' ],
[ 'dynamic_arrays.c', 'A example of using Excel 365 dynamic array formulas' ],
[ 'utf8.c', 'A example of some UTF-8 text' ],
[ 'constant_memory.c', 'Write a large file with constant memory usage' ],
[ 'output_buffer.c', 'Write a file to a memory buffer' ],
[ 'image_buffer.c', 'Example of inserting an image from a memory buffer.' ],
[ 'embed_image_buffer.c', 'Example of embedding an image from a memory buffer.' ],
[ 'merge_range.c', 'Create a merged range of cells' ],
[ 'merge_rich_string.c', 'Create a merged range with a rich string' ],
[ 'autofilter.c', 'An example of a worksheet autofilter' ],
[ 'data_validate.c', 'Examples of worksheet data validation and dropdown lists' ],
[ 'conditional_format1.c', 'A simple conditional formatting example' ],
[ 'conditional_format2.c', 'An advanced conditional formatting example' ],
[ 'tables.c', 'Example of table to a worksheet.' ],
[ 'images.c', 'Example of inserting images in worksheet cells.' ],
[ 'embed_images.c', 'Example of embedding images in worksheet cells.' ],
[ 'headers_footers.c', 'Example of adding worksheet headers/footers' ],
[ 'defined_name.c', 'Example of how to create defined names' ],
[ 'outline.c', 'Example of grouping and outlines' ],
[ 'outline_collapsed.c', 'Example of grouping and collapsed outlines' ],
[ 'watermark.c', 'Example of how to set a watermark image for a worksheet' ],
[ 'background.c', 'Example of how to set the background image for a worksheet' ],
[ 'tab_colors.c', 'Example of how to set worksheet tab colors' ],
[ 'diagonal_border.c', 'Example of how to set a worksheet cell diagonal border.' ],
[ 'hide_sheet.c', 'Example of hiding a worksheet' ],
[ 'doc_properties.c', 'Example of setting workbook doc properties' ],
[ 'doc_custom_properties.c','Example of setting custom doc properties' ],
[ 'worksheet_protection.c', 'Example of enabling worksheet protection' ],
[ 'hide_row_col.c', 'Example of hiding worksheet rows and columns' ],
[ 'comments1.c', 'Example of adding cell comments to a worksheet' ],
[ 'comments2.c', 'Example of adding cell comments with options' ],
[ 'macro.c', 'Example of adding a VBA macro to a workbook' ],
[ 'panes.c', 'Example of how to create worksheet panes' ],
[ 'ignore_errors.c', 'Example of ignoring worksheet errors/warnings' ],
[ 'lambda.c', 'Example of using the EXCEL 365+ LAMBDA() function' ],
[ 'chart.c', 'Example of a simple column chart' ],
[ 'chart_area.c', 'Examples of area charts' ],
[ 'chart_bar.c', 'Examples of bar charts' ],
[ 'chart_column.c', 'Examples of column charts' ],
[ 'chart_line.c', 'Example of a line chart' ],
[ 'chart_scatter.c', 'Examples of scatter charts' ],
[ 'chart_radar.c', 'Examples of radar charts' ],
[ 'chart_pie.c', 'Examples of pie charts' ],
[ 'chart_doughnut.c', 'Examples of doughnut charts' ],
[ 'chart_clustered.c', 'Examples of clustered category chart' ],
[ 'chart_data_table.c', 'Examples of charts with data tables' ],
[ 'chart_data_tools.c', 'Examples of charts data tools' ],
[ 'chart_data_labels.c', 'Examples of charts data labels' ],
[ 'chart_fonts.c', 'Examples of using charts fonts' ],
[ 'chart_pattern.c', 'Examples of using charts patterns' ],
[ 'chart_styles.c', 'Examples of built-in charts styles' ],
[ 'chartsheet.c', 'Example of a chartsheet chart' ],
);
# Convert the array refs to a hash for lookups.
my %examples;
for my $example (@examples) {
$examples{$example->[0]} = 1;
}
my $in_list = 0;
while ( my $line = <> ) {
# Print all lines not in the list.
print $line if !$in_list;
# Check for