-
Notifications
You must be signed in to change notification settings - Fork 1
Version History
This page records the version history of cfstream.
It summarizes the main changes from version 1.0.0 to the current version.
For the latest release package, see the repository releases page:
Current version:
1.3.0
For most users, the recommended version is:
V1.3.0
If your project must use a C standard earlier than C99, the recommended version is:
V1.2.0
Version 1.3.0 is recommended for all users, especially users who need macOS, Linux, or multi-file project support.
| Version | Release Date | Main Changes |
|---|---|---|
1.0.0 |
2026-04-27 | Initial release; C++ header only; Windows-only stream restoration |
1.1.0 |
2026-05-01 | Added version query and improved safety behavior |
1.2.0 |
2026-05-17 | Added C support; split C++ and C headers; added NULL support for selective redirection |
1.3.0 |
2026-06-19 | Added cross-platform console restoration; changed functions to static inline; added C99 check and C++ nullptr support |
Release date:
2026-06-19
Tag:
V1.3.0
Cross-platform and major safety update.
This version is recommended for all users.
For both C and C++ versions:
- Added cross-platform support for restoring standard streams.
- Replaced Windows-only console restoration with platform-dependent console device selection.
- Changed functions to
static inlineto improve header safety in multi-file projects. - Kept file stream objects independent in each source file.
For the C++ version, cfs.hpp:
- Added support for passing
nullptrtocfs::cfs()in C++11 and later. - Kept
NULLfully compatible. - Added the internal
CFS_NULLPTRcompatibility macro. - Added platform-dependent console device macros.
- Updated the version string to
1.3.0.
For the C version, cfs.h:
- Added a C99 or later standard check.
- Added platform-dependent console device macros.
- Changed public functions to
static inline. - Updated the version string to
1.3.0.
Starting from 1.3.0, closecfs() and cfs::closecfs() use different console devices depending on the platform.
| Platform | Console Device |
|---|---|
| Windows | CON |
| Linux / macOS / other Unix-like systems | /dev/tty |
This allows standard stream restoration to work outside Windows, including normal terminal environments on macOS and Linux.
Cross-platform standard stream restoration is designed for restoring the system terminal.
It should work in normal terminal environments, including terminals such as CLion Terminal.
Some IDE-managed run consoles may not provide a real terminal device. In those environments, stream restoration may not work as expected.
Since C standards earlier than C99 are rarely used today, cfs.h now stops compilation when used in C mode below C99.
If you need to use a C standard older than C99, use an older cfstream version, such as V1.2.0.
Release date:
2026-05-17
Tag:
V1.2.0
Major update.
This version introduced official C language support.
- Added C language support.
- Changed the original C++ header extension from
.hto.hpp. - Added
cfs.hppfor C++ projects. - Added
cfs.hfor C projects. - Added support for passing
NULLtocfs()/cfs::cfs()to skip redirecting a specific stream. - Improved language and version detection.
- Improved safety-related behavior.
Before 1.2.0, cfstream used:
cfs.h
as the C++ header.
Starting from 1.2.0, the headers were separated:
| Header | Language | Purpose |
|---|---|---|
cfs.hpp |
C++ | C++ interface |
cfs.h |
C | C interface |
Starting from 1.2.0, users can pass NULL to skip redirecting one side.
Example:
cfs::cfs("test.in", NULL);This redirects only input.
cfs::cfs(NULL, "test.out");This redirects only output.
The same idea is also available in the C version:
cfs("test.in", NULL);
cfs(NULL, "test.out");This version still restored standard streams using the Windows console device CON.
For macOS and Linux support when restoring standard streams, use V1.3.0 or later.
Release date:
2026-05-01
Tag:
V1.1.0
Feature and safety update.
- Added a function to get the version number.
- Added the internal version string.
- Added safety-related improvements.
- Added protection against reopening
cppfswhile file streams are already open. - Updated the version string to
1.1.0.
This version introduced:
cfs::getversion()The function returns the cfstream version string.
Example:
std::cout << cfs::getversion() << std::endl;This version added a check before opening independent C++ file streams.
If cfs::cin or cfs::cout is already open, cppfs() prints an error message:
Error-from-cfs Already open cppfs,please close first!
In this version, cfstream was still a C++-only header and still used cfs.h.
Standard stream restoration was still Windows-only.
Release date:
2026-04-27
Tag:
V1.0.0
Initial release.
The first version provided a lightweight C++ header for file input and output helpers.
It included:
cfs::cfs()cfs::cppfs()cfs::closecfs()cfs::closecppfs()cfs::cincfs::cout
The first version used:
cfs.h
as a C++ header.
The first version only supported Windows for standard stream restoration.
It restored standard streams using:
CON