[PR #382] [MERGED] Add buffer support #476

Closed
opened 2026-05-05 12:16:55 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jmcnamara/libxlsxwriter/pull/382
Author: @mohd-akram
Created: 11/9/2022
Status: Merged
Merged: 11/10/2022
Merged by: @jmcnamara

Base: mainHead: buf-support


📝 Commits (3)

  • c48468c Avoid using temporary files when possible
  • 024bac2 Add support for writing to a buffer
  • a5ec4ba Address review comments

📊 Changes

31 files changed (+329 additions, -72 deletions)

View changed files

📝 .github/workflows/cmake_actions.yml (+1 -1)
📝 .github/workflows/make_actions.yml (+1 -1)
📝 CMakeLists.txt (+2 -2)
📝 docs/src/getting_started.dox (+18 -21)
📝 examples/constant_memory.c (+3 -1)
examples/output_buffer.c (+39 -0)
📝 include/xlsxwriter/packager.h (+2 -0)
📝 include/xlsxwriter/utility.h (+1 -0)
📝 include/xlsxwriter/workbook.h (+15 -1)
📝 include/xlsxwriter/worksheet.h (+1 -0)
📝 src/Makefile (+5 -1)
📝 src/packager.c (+134 -28)
📝 src/utility.c (+23 -0)
📝 src/workbook.c (+7 -0)
📝 src/worksheet.c (+9 -2)
📝 test/functional/src/test_optimize01.c (+1 -1)
📝 test/functional/src/test_optimize02.c (+1 -1)
📝 test/functional/src/test_optimize04.c (+1 -1)
📝 test/functional/src/test_optimize05.c (+1 -1)
📝 test/functional/src/test_optimize06.c (+1 -1)

...and 11 more files

📄 Description

This extends the realm of USE_FMEMOPEN to all temporary files, which is accomplished by using open_memstream. It also adds two new workbook options, output_buffer and output_buffer_size, to allow outputting to a buffer when filename is NULL. This allows the library to be used without writing to the filesystem.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jmcnamara/libxlsxwriter/pull/382 **Author:** [@mohd-akram](https://github.com/mohd-akram) **Created:** 11/9/2022 **Status:** ✅ Merged **Merged:** 11/10/2022 **Merged by:** [@jmcnamara](https://github.com/jmcnamara) **Base:** `main` ← **Head:** `buf-support` --- ### 📝 Commits (3) - [`c48468c`](https://github.com/jmcnamara/libxlsxwriter/commit/c48468c30273e57f60dc9ee19ef796cb626e3a18) Avoid using temporary files when possible - [`024bac2`](https://github.com/jmcnamara/libxlsxwriter/commit/024bac2a6dfc2093ba4ef4ac566538f244ad1981) Add support for writing to a buffer - [`a5ec4ba`](https://github.com/jmcnamara/libxlsxwriter/commit/a5ec4ba8c745167674fc8047811d2dedbe1d759f) Address review comments ### 📊 Changes **31 files changed** (+329 additions, -72 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/cmake_actions.yml` (+1 -1) 📝 `.github/workflows/make_actions.yml` (+1 -1) 📝 `CMakeLists.txt` (+2 -2) 📝 `docs/src/getting_started.dox` (+18 -21) 📝 `examples/constant_memory.c` (+3 -1) ➕ `examples/output_buffer.c` (+39 -0) 📝 `include/xlsxwriter/packager.h` (+2 -0) 📝 `include/xlsxwriter/utility.h` (+1 -0) 📝 `include/xlsxwriter/workbook.h` (+15 -1) 📝 `include/xlsxwriter/worksheet.h` (+1 -0) 📝 `src/Makefile` (+5 -1) 📝 `src/packager.c` (+134 -28) 📝 `src/utility.c` (+23 -0) 📝 `src/workbook.c` (+7 -0) 📝 `src/worksheet.c` (+9 -2) 📝 `test/functional/src/test_optimize01.c` (+1 -1) 📝 `test/functional/src/test_optimize02.c` (+1 -1) 📝 `test/functional/src/test_optimize04.c` (+1 -1) 📝 `test/functional/src/test_optimize05.c` (+1 -1) 📝 `test/functional/src/test_optimize06.c` (+1 -1) _...and 11 more files_ </details> ### 📄 Description This extends the realm of `USE_FMEMOPEN` to all temporary files, which is accomplished by using `open_memstream`. It also adds two new workbook options, `output_buffer` and `output_buffer_size`, to allow outputting to a buffer when filename is `NULL`. This allows the library to be used without writing to the filesystem. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 12:16:55 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#476
No description provided.