在哪里可以在线浏览 libc 的源代码(例如 doxygen)
有时我想查找stdlib中函数的实现,我已经下载了源代码,但它很乱。
仅仅 grep 并不适合,因为点击次数很多。
有谁知道有文档的网页 doxygen 样式。
Linux 内核也是如此。
谢谢
Sometimes I want to look up the implementations of functions in the stdlib, I've downloaded the sourcecode, but it's quite messy.
Just greping is not really suitable because of the many hits.
Does anyone know a webpage doxygen style that has the documentation.
The same goes for the linux kernel.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您应该检查您的发行版是否使用普通 GLIBC 或 EGLIBC 分支
(Debian 和 Ubuntu 已切换到 EGLIBC编辑:他们在 2014 年左右切换回来)。无论如何,GLIBC 的存储库浏览器位于 http://sourceware.org/git/?p= glibc.git
http://code.woboq.org/userspace/glibc/,下面由 @guruz 发布,是一个不错的选择。
由于同一文件存在多个版本,源代码有点复杂。
You should check if your distribution is using the vanilla GLIBC or the EGLIBC fork
(Debian and Ubuntu have switched to EGLIBCEDIT: they switched back around 2014).Anyway, the repository browser for GLIBC is at http://sourceware.org/git/?p=glibc.git
http://code.woboq.org/userspace/glibc/, posted by @guruz below, is a good alternative.
The source is a bit complicated by the presence of multiple versions of the same files.
libc 文档这个怎么样?也许这个适用于内核?还有谷歌代码搜索; 这里是一个示例搜索。
有关 Google 代码搜索的更多信息 您可以输入如下搜索查询:package:linux-2.6 malloc 查找任何引用linux-2.6 内核中的 malloc。
编辑:Google 代码搜索现已关闭。但是您可以访问 git 存储库 http:// /git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git 并且它也有搜索。
How about this for libc documentation? And perhaps this for the kernel? There is also Google Code search; here is an example search.
More on Google Code Search You can enter search queries like this: package:linux-2.6 malloc for any references to malloc in the linux-2.6 kernel.
Edit: Google Code search is now shut down. But you can access the git repo at http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git and it has search as well.
你可以尝试 http://code.woboq.org/userspace/glibc/
它很好类似于 IDE 的导航/突出显示。
You can try http://code.woboq.org/userspace/glibc/
It has nice navigation/hilighting similar to an IDE.
为了帮助将源代码导航到 glibc,也许可以尝试类似 ctags 或 cscope?
注意:每次看glibc源码我都会变得更笨,所以请小心! :)
To help navigate the source to glibc, perhaps try something like ctags or cscope?
Note: I get dumber every time I look at the glibc source, so please be careful! :)
如果您使用 GNU C (glibc),则函数(超出 GNU 扩展)遵循 POSIX 标准< /a> 就其参数、实现、失败和返回值而言。如果您想深入了解静态成员,则必须查看代码。
每次尝试采用 Doxygen 之类的 glibc 的尝试(我记得)都被拒绝,原因如下:
就内核而言,Linux 确实使用了一个与 Doxygen 非常相似的系统,称为 内核文档。
If you are using GNU C (glibc), the functions (beyond the GNU extensions) follow the POSIX standard as far as their arguments, implementation, failure and return values. If you want to peek under the hood of static members, you'll have to look at the code.
Every push (that I can remember) to try and adopt something like Doxygen for glibc was rejected for the following reasons:
As far as the kernel goes, Linux does use a system very similar to Doxygen called Kerneldoc.
您还可以从 http://fossies.org/dox/ 获取 Doxygen 生成的实际文档glibc。
You can also get actual Doxygen-generated docs from http://fossies.org/dox/glibc.