Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Strict Endianness

简体中文/Simplified Chinese

Strict Endianness,让程序(而非机器)决定文件的端序。

Strict Endianness 是一个 C 库,用于在读取和写入二进制数据时指定端序。它支持大端序(Big Endian)和小端序(Little Endian),并且可以在运行时动态选择端序。

Strict Endianness 的主要功能包括:

  • 读取和写入二进制数据时指定端序
  • 支持大端序和小端序
  • 在运行时动态选择端序
  • 提供简单的 API 来处理不同端序的数据

Strict Endianness 包含以下函数:

  • sf_write_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: 写入指定端序的数据
  • sf_read_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: 读取指定端序的数据
  • sf_open: 打开文件并指定端序
  • sf_close: 关闭文件
  • sf_set_buffer: 设置缓冲区大小
  • _sf_raw_read: 辅助原始读
  • sf_seek: 定位文件指针
  • sf_tell: 获取当前文件指针位置
  • sf_align: 对齐数据
  • sf_write_string: 写入字符串
  • sf_read_string: 读取字符串
  • strict_flush: 刷新缓冲区
  • sm_open: 打开内存缓冲区
  • sm_close: 关闭内存缓冲区
  • sm_write_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: 写入内存缓冲区
  • sm_read_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: 读取内存缓冲区
  • sm_seek: 定位内存缓冲区指针
  • sm_write_string: 写入字符串到内存缓冲区

兼容的 C/C++ 编译器和标准

Strict Endianness 兼容以下 C/C++ 编译器:

  • GCC
  • Clang
  • MSVC

Strict Endianness 兼容以下 C/C++ 标准:

  • C99
  • C11
  • C17
  • C23
  • C++98
  • C++03
  • C++11
  • C++14
  • C++17
  • C++20
  • C++23
  • 此外,接下来的 C/C++ 标准也将继续兼容 Strict Endianness。

English

Strict Endianness allows the program (not the machine) to determine the endianness of files.

Strict Endianness is a C library for specifying endianness when reading and writing binary data. It supports both big-endian and little-endian formats and allows dynamic selection of endianness at runtime.

The main features of Strict Endianness include:

  • Specifying endianness when reading and writing binary data
  • Support for both big-endian and little-endian formats
  • Dynamic selection of endianness at runtime
  • Providing a simple API for handling data with different endianness

Strict Endianness includes the following functions:

  • sf_write_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: Write data with specified endianness
  • sf_read_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: Read data with specified endianness
  • sf_open: Open a file and specify endianness
  • sf_close: Close a file
  • sf_set_buffer: Set buffer size
  • _sf_raw_read: Helper for raw reading
  • sf_seek: Seek file pointer
  • sf_tell: Get current file pointer position
  • sf_align: Align data
  • sf_write_string: Write a string
  • sf_read_string: Read a string
  • strict_flush: Flush the buffer
  • sm_open: Open a memory buffer
  • sm_close: Close a memory buffer
  • sm_write_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: Write to memory buffer
  • sm_read_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: Read from memory buffer
  • sm_seek: Seek memory buffer pointer
  • sm_write_string: Write a string to memory buffer

Compatible C/C++ Compilers and Standards

Strict Endianness is compatible with the following C/C++ compilers:

  • GCC
  • Clang
  • MSVC

Strict Endianness is compatible with the following C/C++ standards:

  • C99
  • C11
  • C17
  • C23
  • C++98
  • C++03
  • C++11
  • C++14
  • C++17
  • C++20
  • C++23
  • Additionally, future C/C++ standards will continue to be compatible with Strict Endianness.

About

Strict Endianness,让程序(而非机器)决定文件的端序。

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages