ack/lang/cem/cemcom.ansi/struct.str

63 lines
1.7 KiB
Plaintext
Raw Normal View History

1989-02-07 11:04:05 +00:00
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
#ifndef STRUCT_H_
#define STRUCT_H_
1994-06-27 08:03:14 +00:00
/* $Id$ */
#include "arith.h"
struct type;
struct idf;
struct field;
1989-02-07 11:04:05 +00:00
/* SELECTOR DESCRIPTOR */
struct sdef { /* for selectors */
struct sdef *next;
int sd_level;
struct idf *sd_idf; /* its name */
struct sdef *sd_sdef; /* the next selector */
struct type *sd_stype; /* the struct it belongs to */
struct type *sd_type; /* its type */
arith sd_offset;
};
/* ALLOCDEF "sdef" 50 */
struct tag { /* for struct-, union- and enum tags */
struct tag *next;
int tg_level;
int tg_busy; /* non-zero during declaration of struct/union pack */
struct type *tg_type;
};
/* ALLOCDEF "tag" 10 */
1989-02-07 11:04:05 +00:00
struct sdef *idf2sdef(register struct idf *idf, struct type *tp);
void add_sel(
register struct type *stp, /* type of the structure */
struct type *tp, /* type of the selector */
register struct idf *idf, /* idf of the selector */
struct sdef ***sdefpp, /* address of hook to selector definition */
arith *szp, /* pointer to struct size upto here */
struct field *fd);
void declare_struct(int fund, register struct idf *idf, struct type **tpp);
void apply_struct(int fund, register struct idf *idf, struct type **tpp);
int is_struct_or_union(register int fund);
#ifndef NOBITFIELD
arith
add_field(
arith *szp, /* size of struct upto here */
register struct field *fd, /* bitfield, containing width */
register struct type **fdtpp, /* type of selector */
struct idf *idf, /* name of selector */
register struct type *stp); /* current struct descriptor */
#endif
#endif