
/* ###--------------------------------------------------------------### */
/* 									*/
/* file		: beh_addbereg.c					*/
/* date		: Sep  3 1993						*/
/* version	: v106							*/
/* authors	: Pirouz BAZARGAN SABET					*/
/* content	: low-level function					*/
/*									*/
/* ###--------------------------------------------------------------### */

#include <stdio.h>
#include MUT_H
#include LOG_H
#include BEH_H

/* ###--------------------------------------------------------------### */
/* function	: beh_addbereg						*/
/* description	: create a BEREG structure at the top the list		*/
/* called func.	: namealloc, mbkalloc					*/
/* ###--------------------------------------------------------------### */

struct bereg *beh_addbereg (lastbereg, name, biabl, binode)

struct bereg  *lastbereg;	/* pointer on the last bereg structure	*/
char          *name;		/* register's name			*/
struct biabl  *biabl;		/* register's drivers (ABL)		*/
struct binode *binode;		/* register's drivers (BDD)		*/

  {
  struct bereg *ptreg;

  name          = namealloc (name);

  ptreg         = (struct bereg *) mbkalloc (sizeof(struct bereg));
  ptreg->NAME   = name;
  ptreg->BIABL  = biabl;
  ptreg->BINODE = binode;
  ptreg->NEXT   = lastbereg;

  return (ptreg);
  }
