/*- * Copyright (c) 1983 The Regents of the University of California. * All rights reserved. * * %sccs.include.redist.c% * * @(#)struct.h 5.2 (Berkeley) 04/03/91 */ #ifndef _STRUCT_H_ #define _STRUCT_H_ /* Offset of the field in the structure. */ #define fldoff(name, field) \ ((int)&(((struct name *)0)->field)) /* Size of the field in the structure. */ #define fldsiz(name, field) \ (sizeof(((struct name *)0)->field)) /* Address of the structure from a field. */ #define strbase(name, addr, field) \ ((struct name *)((char *)(addr) - fldoff(name, field))) #endif /* !_STRUCT_H_ */