[英]How to find out where a C struct is declared?
I am trying to add logging to the web proxy Polipo and as part of this need to log the url request in the following function following line :我正在尝试将日志记录添加到 Web 代理 Polipo,作为其中的一部分,需要在以下函数中记录 url 请求:
httpClientRequest(HTTPRequestPtr request, AtomPtr url)
From compilation I see that AtomPtr is a struct of type _Atom
but I cannot find where this is defined so that I can reference the text of the url in a log statement.从编译中我看到 AtomPtr 是
_Atom
类型的结构,但我找不到它的定义位置,以便我可以在日志语句中引用 url 的文本。 What is the canonical method of looking up struct definitions in C code?在 C 代码中查找结构定义的规范方法是什么?
Unfortunately, as far as I know, you cannot do this from the source code in C.不幸的是,据我所知,你不能从 C 的源代码中做到这一点。
If you are working on Linux, and if your sources are all in the src/
directory:如果您在 Linux 上工作,并且您的源代码都在
src/
目录中:
$ find src/ -name ".*\.h" | xargs grep -e "struct _Atom"
如果你在 Linux 上工作,那么 grep 当前目录中的struct关键字以查看它在文件中的定义。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.