Chinaunix首页 | 论坛 | 博客
  • 博客访问: 916292
  • 博文数量: 177
  • 博客积分: 8613
  • 博客等级: 中将
  • 技术积分: 2835
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-12 04:16
文章分类
文章存档

2012年(12)

2011年(24)

2010年(24)

2009年(75)

2008年(42)

我的朋友

分类:

2009-10-19 22:56:51

今天从小文件开始看起:
《Wheel-size.h》
#define WHEEL_SIZE 5
//定义一个叫做WHEEL_SIZE的宏,其值为5
《lbracket.c》
#define LBRACKET 1
#include "test.c"
//定义一个LBRACKET的宏,其值为1
//包含进来一个test.c的c源文件
《false.c》
#define EXIT_STATUS EXIT_FAILURE
#include "true.c"
//定义宏EXIT_STATUS,其值为 : EXIT_FAILURE
//包含进一个c源文件: true.c


《ls-ls.c》
#include "ls.h" // 包含头文件ls.h
int ls_mode = LS_LS; //这个c文件里面定义的整型变量ls_mode值为 LS_LS,同样,这个宏是在ls.h里定义的:
// #define LS_LS 1 ,所以,这个c文件里面ls_mode的初始值为1

《ls-dir.c》
#include "ls.h" // 包含头文件ls.h
int ls_mode = LS_MULTI_COL;//定义整型变量ls_mode的初始值为: LS_MULTI_COL,这个宏的定义地方是ls.h:
/* This is for the `dir' program.  */
//#define LS_MULTI_COL 2

《ls-vdir.c》
#include "ls.h" // 包含了一个头文件 ls.h
int ls_mode = LS_LONG_FORMAT; // 定义一个整型变量 ls_mode ,值为:LS_LONG_FORMAT  ,这个值是在ls.h定义的,其值为:
/* This is for the `vdir' program.  */
//#define LS_LONG_FORMAT 3  所以ls_mode的值为3

《ls.h》
/* This is for the `ls' program.  */
#define LS_LS 1

/* This is for the `dir' program.  */
#define LS_MULTI_COL 2

/* This is for the `vdir' program.  */
#define LS_LONG_FORMAT 3

extern int ls_mode;
//这个头文件定义了三个宏和一个外部整型变量。

《cp-hash.h》
void hash_init (void); // 函数原型声明,函数返回类型为void,参数是void
void forget_all (void);//函数原型声明,函数返回类型为void,参数是void
void forget_created (ino_t ino, dev_t dev);
//函数原型声明,返回void类型,函数接受的形参一个是ino_t类型,一个是dev_t类型
char *remember_copied (const char *node, ino_t ino, dev_t dev);
//函数原型声明,返回执行字符的指针,接受的形参为: 字符指针常量,ino_t类型,dev_t类型
bool remember_created (char const *file);
// 函数原型声明,返回布尔类型,接受的形参为一个字符指针常量。
char *src_to_dest_lookup (ino_t ino, dev_t dev);
//也是个函数原型声明,返回指向字符的指针类型,接受的形参为ino_t类型,dev_t类型
阅读(386) | 评论(0) | 转发(0) |
0

上一篇:开始通读coreutils

下一篇:sync.c

给主人留下些什么吧!~~