make source 中的 floc 和 RETSIGTYPE
floc and RETSIGTYPE in make source
下面这个 C 的摘录中关键字 floc
和 RETSIGTYPE
来自哪里 code?
struct commands
{
floc fileinfo; /* Where commands were defined. */
char *commands; /* Commands text. */
char **command_lines; /* Commands chopped up into lines. */
unsigned char *lines_flags; /* One set of flag bits for each line. */
unsigned short ncommand_lines;/* Number of command lines. */
char recipe_prefix; /* Recipe prefix for this command set. */
unsigned int any_recurse:1; /* Nonzero if any 'lines_flags' elt has */
/* the COMMANDS_RECURSE bit set. */
};
/* ... */
RETSIGTYPE fatal_error_signal (int sig);
这是 make 存储库中的文件之一。我想知道:既然这个.h
文件不包含任何其他头文件,它们怎么能在这里使用?
您要求的符号按以下方式定义:
#ifndef RETSIGTYPE
# define RETSIGTYPE void
#endif
/* Specify the location of elements read from makefiles. */
typedef struct
{
const char *filenm;
unsigned long lineno;
unsigned long offset;
} floc;
两个定义都包含在文件 makeint.h
.
中
为什么在 commands.h
中这些符号是 "visible" 即使它不包含任何头文件只是因为每个 *.c
包含它的文件(例如 commands.c
) 包括 makeint.h
以及 在 之前。
如何在类似情况下找到答案
我不是您链接的项目的专家。我只是
- 使用
git clone git://git.savannah.gnu.org/make.git
克隆了项目
- 使用良好的源代码浏览器创建了一个项目(我使用了 SourceInsight)
- 搜索了您要的符号并跳转到它们的定义
下面这个 C 的摘录中关键字 floc
和 RETSIGTYPE
来自哪里 code?
struct commands
{
floc fileinfo; /* Where commands were defined. */
char *commands; /* Commands text. */
char **command_lines; /* Commands chopped up into lines. */
unsigned char *lines_flags; /* One set of flag bits for each line. */
unsigned short ncommand_lines;/* Number of command lines. */
char recipe_prefix; /* Recipe prefix for this command set. */
unsigned int any_recurse:1; /* Nonzero if any 'lines_flags' elt has */
/* the COMMANDS_RECURSE bit set. */
};
/* ... */
RETSIGTYPE fatal_error_signal (int sig);
这是 make 存储库中的文件之一。我想知道:既然这个.h
文件不包含任何其他头文件,它们怎么能在这里使用?
您要求的符号按以下方式定义:
#ifndef RETSIGTYPE
# define RETSIGTYPE void
#endif
/* Specify the location of elements read from makefiles. */
typedef struct
{
const char *filenm;
unsigned long lineno;
unsigned long offset;
} floc;
两个定义都包含在文件 makeint.h
.
为什么在 commands.h
中这些符号是 "visible" 即使它不包含任何头文件只是因为每个 *.c
包含它的文件(例如 commands.c
) 包括 makeint.h
以及 在 之前。
如何在类似情况下找到答案
我不是您链接的项目的专家。我只是
- 使用
git clone git://git.savannah.gnu.org/make.git
克隆了项目
- 使用良好的源代码浏览器创建了一个项目(我使用了 SourceInsight)
- 搜索了您要的符号并跳转到它们的定义