void MD5Init PROTO_LIST ((MD5_CTX *)) 如何理解???

在 rfc 1321中,有这样的代码

MD5.H头文件如下
/* MD5.H - header file for MD5C.C */
/* MD5 context. */
typedef struct {
UINT4 state[4]; /* state (ABCD) */
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
unsigned char buffer[64]; /* input buffer */
} MD5_CTX;

void MD5Init PROTO_LIST ((MD5_CTX *));
void MD5Update PROTO_LIST ((MD5_CTX *, unsigned char *, unsigned int));
void MD5Final PROTO_LIST((unsigned char [16], MD5_CTX *));


其中PROTO_LIST在global.h(也在rfc 1321中)中定义为 :

/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
  returns an empty list.
 */
#if PROTOTYPES
#define PROTO_LIST(list) list
#else
#define PROTO_LIST(list) ()
#endif

如何理解这几句代码:
void MD5Init PROTO_LIST ((MD5_CTX *));
void MD5Update PROTO_LIST ((MD5_CTX *, unsigned char *, unsigned int));
void MD5Final PROTO_LIST((unsigned char [16], MD5_CTX *));

答:函数声名中形参可以省略 。即如果定义了PROTOTYPES,那么函数声明中就有形参,否则没有。

posted @ 2012-06-06 09:31  ijustwanttorun  阅读(1113)  评论(0)    收藏  举报