寻找snprintf()的C源代码 [英] Looking for C source code for snprintf()

查看:600
本文介绍了寻找snprintf()的C源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将snprintf()移植到另一个不完全支持GLibC的平台上.

I need to port snprintf() to another platform that does not fully support GLibC.

我正在寻找Glibc 2.14源代码中的基础声明.我遵循许多函数调用,但是卡在vfprintf()上.然后,它似乎调用_IO_vfprintf(),但我找不到该定义.可能是宏混淆了事物.

I am looking for the underlying declaration in the Glibc 2.14 source code. I follow many function calls, but get stuck on vfprintf(). It then seems to call _IO_vfprintf(), but I cannot find the definition. Probably a macro is obfuscating things.

我需要看一下真正的C代码,它扫描格式字符串并计算如果输入缓冲区足够大的话它将写入的字节数.

I need to see the real C code that scans the format string and calculates the number of bytes it would write if input buffer was large enough.

我也尝试在newlib 1.19.0中进行查找,但是我被卡在_svfprintf_r()上.我在任何地方都找不到定义.

I also tried looking in newlib 1.19.0, but I got stuck on _svfprintf_r(). I cannot find the definition anywhere.

有人可以将我指向snprintf()的另一个定义吗?

Can someone point me to either definition or another one for snprintf()?

推荐答案

http://www.ijs他们称.si/software/snprintf/是snprintf的可移植实现,包括vsnprintf.c,asnprintf,vasnprintf,asprintf,vasprintf .也许可以帮上忙.

http://www.ijs.si/software/snprintf/ has what they claim is a portable implementation of snprintf, including vsnprintf.c, asnprintf, vasnprintf, asprintf, vasprintf. Perhaps it can help.

这篇关于寻找snprintf()的C源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆