Where can I browse the sourcecode for libc online (like doxygen)

前端 未结 6 1101
遥遥无期
遥遥无期 2020-12-24 06:47

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 suitab

相关标签:
6条回答
  • 2020-12-24 07:00

    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! :)

    0 讨论(0)
  • 2020-12-24 07:01

    You can also get actual Doxygen-generated docs from http://fossies.org/dox/glibc.

    0 讨论(0)
  • 2020-12-24 07:02

    You can try http://code.woboq.org/userspace/glibc/

    It has nice navigation/hilighting similar to an IDE.

    0 讨论(0)
  • 2020-12-24 07:11

    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:

    1. Redundant, POSIX already documents almost everything thats exposed, as well as man and info pages.
    2. Too much work initially
    3. More work for maintainers

    As far as the kernel goes, Linux does use a system very similar to Doxygen called Kerneldoc.

    0 讨论(0)
  • 2020-12-24 07:14

    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.

    0 讨论(0)
  • 2020-12-24 07:17

    You should check if your distribution is using the vanilla GLIBC or the EGLIBC fork (Debian and Ubuntu have switched to EGLIBC EDIT: 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.

    0 讨论(0)
提交回复
热议问题