Fmem
A cross-platform library for opening memory-backed libc streams.
Install / Use
/learn @Snaipe/FmemREADME
fmem
A cross-platform library for opening memory-backed libc streams.
This library was written for Criterion to implement stringification functions for user-defined types.
Rationale
C doesn't define any way to open "virtual" streams that write to memory rather than a real file. A lot of libc implementations roll their own nonstandard mechanisms to achieve this, namely open_memstream, or fmemopen. Other implementations provide more generic functions to call users functions for various operations on the file, like funopen or fopencookie. Finally, some implementations support none of these nonstandard functions.
fmem tries in sequence the following implementations:
open_memstream.fopencookie, with growing dynamic buffer.funopen, with growing dynamic buffer.- WinAPI temporary memory-backed file.
When no other mean is available, fmem falls back to tmpfile().
Related Skills
node-connect
346.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
