- 论坛徽章:
- 0
|
这个是minimel.h文件的代码
#ifdef MINIREL_H
#define MINIREL_H
#else
/*
* minirel.h: global defintions
*/
#undef FALSE
#undef TRUE
/*
* boolean type
*/
typedef enum { FALSE = 0, TRUE } bool_t;
#define FALSE 0
#define TRUE 1
/*
* use double for real
*/
typedef double real;
/*
* RECID: unique record identifier
* pagenum: number of page containing record
* recnum: number of record on that page
*/
typedef struct{
unsigned short pagenum;
unsigned short recnum;
} RECID;
/*
* supported types
*/
#define INT_TYPE 'i'
#define REAL_TYPE 'f'
#define STRING_TYPE 'c'
/*
* number of supported types
*/
#define NTYPES 3
/*
* supported operators
*/
#define EQ_OP 0
#define NE_OP 1
#define LT_OP 2
#define LE_OP 3
#define GT_OP 4
#define GE_OP 5
/*
* macros to extract an int, a real, or a RECID
*/
#define get_int(intp, charp) memcpy((char *)(intp), \
(char *)(charp), \
sizeof(int))
#define get_real(realp, charp) memcpy((char *)(realp), \
(char *)(charp), \
sizeof(real))
#define get_recid(recidp, charp) memcpy((char *)(recidp), \
(char *)(charp), \
sizeof(RECID))
/*
* other useful macros
*/
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#define MIN(x, y) ((x) < (y) ? (x) : (y))
/*
* computes the offset of a field in a record (should be in <stddef.h>)
*/
#ifndef offsetof
# define offsetof(type, field) ((size_t)&(((type *)0) -> field))
#endif
#endif /* MINIREL_H */
/*
* $Header: /var/home/mcauliff/cs564/h/RCS/minirel.h,v 1.1 1991/11/18 03:16:50 mcauliff Exp mcauliff $
*
* $Log: minirel.h,v $
* Revision 1.1 1991/11/18 03:16:50 mcauliff
* Initial revision
*
*/
这个因该是正确的,老师给的源程序,我什么都没修改,添了别的文件进这个project,就出错了。 |
|