Show HN: Uprintf:一个适用于 C 语言的通用 stb 风格 printf 实现(无操作系统)

1作者: Forgret9 个月前
我一直对嵌入式和内核开发中缺少真正便携、无依赖的 printf 感到很沮丧。大多数解决方案要么过于臃肿,要么缺少关键功能。 所以我构建了 Uprintf。它是一个单头文件库,从裸机到桌面,为您提供完整的 printf 功能(标志、宽度、精度、浮点数,甚至自定义说明符),且没有任何依赖或 #ifdef 地狱。 主要特点: · 单个头文件,无依赖,无动态分配 · 完全标准支持: %d, %x, %f, %.*s 等 · 可通过自定义格式处理程序扩展(为您的项目添加 %T) · 可配置:禁用浮点数,设置区域设置等 · MIT 许可。 GitHub:<a href="https://github.com/Ferki-git-creator/Uprintf" rel="nofollow">https://github.com/Ferki-git-creator/Uprintf</a> 欢迎您的反馈和贡献!
查看原文
I&#x27;ve been frustrated by the lack of a truly portable, no-dependency printf for embedded and kernel development. Most solutions are either too bloated or missing key features. So I built Uprintf. It&#x27;s a single-header library that gives you full printf (flags, width, precision, floats, even custom specifiers) from bare metal to desktop, with zero dependencies or #ifdef hell. Key features: · One header file, no dependencies, no dynamic allocation · Full standard support: %d, %x, %f, %.*s, etc. · Extensible with custom format handlers (add %T for your project) · Configurable: disable floats, set locale, etc. · MIT Licensed. GitHub: <a href="https:&#x2F;&#x2F;github.com&#x2F;Ferki-git-creator&#x2F;Uprintf" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Ferki-git-creator&#x2F;Uprintf</a> I&#x27;d love your feedback and contributions!