/*********************************************************************/
/*                  pC++/Sage++  Copyright (C) 1993                  */
/*  Indiana University  University of Oregon  University of Rennes   */
/*********************************************************************/


/****************************************************************
 *								*
 *	 Structure of the dep files generated by parsers	*
 *								*
 ****************************************************************/

/*#include <sys/types.h>
 */
#ifndef MAX_DEP
#include dep.h
#endif

#include "compatible.h"
/*#ifdef NO_u_short
 *#ifndef DEF_USHORT
 *#define DEF_USHORT 1
 */





/*typedef unsigned int u_short;*/
/*#endif
#endif
 */

#define D_MAGIC	0420

struct preamble {		/* structure of preamble of dep file */
        u_short ptrsize;        /* bit length of pointers (32 or 64) phb */
	u_short language;	/* source language type */
	u_short num_blobs;	/* number of blob nodes */
	u_short num_bfnds;	/* number of bif nodes */
	u_short num_llnds;	/* number of low level nodes */
	u_short num_symbs;	/* number of symbol nodes */
	u_short num_types;	/* number of type nodes */
	u_short num_label;	/* number of label nodes */
	u_short num_dep;	/* number of dep nodes */
	u_short num_cmnts;	/* number of comment nodes */
	u_short num_files;	/* number of filename nodes */
	u_short global_bfnd;	/* id of the global bif node */
};


struct locs {
	long llnd;		/* offset of llnd in the dep file */
	long symb;		/* 	     symbol nodes	  */
	long type;		/*	     type nodes		  */
	long labs;		/*	     label nodes	  */
	long cmnt;		/*	     comment nodes	  */
	long file;		/*	     filename nodes	  */
	long deps;		/*	     dep nodes		  */
	long strs;		/*	     string tables	  */
};

struct bf_nd {			/* structure of bif node in dep file */
	u_short id;		/* id of this bif node */
	u_short variant;	/* type of this bif node */
	u_short cp;		/* control parent of this node */
	u_short bf_ptr1;
	u_short cmnt_ptr;
	u_short symbol;
	u_short ll_ptr1;
	u_short ll_ptr2;
	u_short ll_ptr3;
	u_short dep_ptr1;
	u_short dep_ptr2;
	u_short label;
	u_short lbl_ptr;
	u_short g_line;
	u_short l_line;
        u_short decl_specs;
	u_short filename;
};


struct ll_nd {
	u_short id;
	u_short variant;
	u_short type;
};


struct sym_nd {
	u_short id;
	u_short variant;
	u_short type;
	u_short attr;
	u_short next;
	u_short scope;
	u_short ident;
};


struct typ_nd {
	u_short id;
	u_short variant;
	u_short name;
};


struct lab_nd {
	u_short id;
	u_short labtype;
	u_short body;
	u_short name;
	long	stat_no;
};


struct fil_nd {
	u_short id;
	u_short name;
};


struct cmt_nd {
	u_short id;
	u_short type;
	u_short next;
	u_short str;
};


struct dep_nd {
	u_short id;
	u_short type;
	u_short sym;
	u_short from_stmt;
	u_short from_ref;
	u_short to_stmt;
	u_short to_ref;
	u_short from_hook;
	u_short to_hook;
	u_short from_fwd;
	u_short from_back;
	u_short to_fwd;
	u_short to_back;
	u_short dire[MAX_DEP];
};
