Mac OS X 上的丰富 ctags 问题
我正在尝试使用 Exuberant Ctags 5.8 为 C 标准库生成标签,但是似乎标头未完全解析...例如,当我为 /usr/include/string.h 生成标签时,我得到this:
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /[email protected]/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
NULL /usr/include/string.h /^#define NULL /;" d
_SIZE_T /usr/include/string.h /^#define _SIZE_T$/;" d
_SSIZE_T /usr/include/string.h /^#define _SSIZE_T$/;" d
_STRING_H_ /usr/include/string.h /^#define _STRING_H_$/;" d
size_t /usr/include/string.h /^typedef __darwin_size_t size_t;$/;" t
ssize_t /usr/include/string.h /^typedef __darwin_ssize_t ssize_t;$/;" t
strerror /usr/include/string.h /^char *strerror(int) __DARWIN_ALIAS(strerror);$/;" v
显然,缺少很多函数(strcpy、strlen、strcmp 等。)这是实际头文件的链接:http://pastie.org/private/lvgvtg1lmzaenidg0rvq
我刚刚运行了 ctags /usr/include/string.h
我做错了什么吗?任何帮助将不胜感激...
I'm trying to generate tags for the C Standard Lib using Exuberant Ctags 5.8, however it seems that the headers are not parsed completely... For example, when I generate the tags for /usr/include/string.h, I get this:
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /[email protected]/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
NULL /usr/include/string.h /^#define NULL /;" d
_SIZE_T /usr/include/string.h /^#define _SIZE_T$/;" d
_SSIZE_T /usr/include/string.h /^#define _SSIZE_T$/;" d
_STRING_H_ /usr/include/string.h /^#define _STRING_H_$/;" d
size_t /usr/include/string.h /^typedef __darwin_size_t size_t;$/;" t
ssize_t /usr/include/string.h /^typedef __darwin_ssize_t ssize_t;$/;" t
strerror /usr/include/string.h /^char *strerror(int) __DARWIN_ALIAS(strerror);$/;" v
Obviously, a lot of functions are missing (strcpy, strlen, strcmp, etc..) Here's a link to the actual header file: http://pastie.org/private/lvgvtg1lmzaenidg0rvq
I just ran ctags /usr/include/string.h
Am I doing something wrong? Any help would be appreciated...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信 ctags 默认情况下不包含函数原型,仅包含函数实现。
如果您将其称为
ctags --c-kinds=+px /usr/include/string.h
,那么您是否也可以获得声明?(根据手册页此处,您可以调用
ctags −−list−kinds =c
找出可以让 ctags 输出的内容。)I believe that ctags doesn't include function prototypes by default, only function implementations.
If you call it as
ctags --c-kinds=+px /usr/include/string.h
, does that get you the declarations as well?(According to the manual page here, you can call
ctags −−list−kinds=c
to find out what you can get ctags to output.)我在这里找到了一些相关信息: http:// /www.mail-archive.com/[电子邮件受保护]/msg2103 27.html
值得注意的是:
所以事实证明我必须添加
--c-kinds=+p
标志才能解析函数原型。我不确定为什么它默认不解析原型?I found some relevant information here: http://www.mail-archive.com/[email protected]/msg210327.html
Notably:
So it turns out I have to add the
--c-kinds=+p
flag for it to parse function prototypes. I'm not sure why it doesn't parse prototypes by default?