
/* ###--------------------------------------------------------------### */
/* 									*/
/* file		: beh_addbefig.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_addbefig						*/
/* description	: create an empty BEFIG structure at the top of the list*/
/*		  The BEH_HEDFIG list is not modified.			*/
/* called func.	: namealloc, mbkalloc					*/
/* ###--------------------------------------------------------------### */

struct befig *beh_addbefig (lastbefig, name)

struct befig *lastbefig;	/* pointer on the last befig structure	*/
char         *name;		/* figure's name			*/

  {
  struct befig *ptfig;

  name          = namealloc (name);

  ptfig         = (struct befig *) mbkalloc (sizeof(struct befig));
  ptfig->NAME   = name;
  ptfig->BEREG  = NULL;
  ptfig->BEMSG  = NULL;
  ptfig->BERIN  = NULL;
  ptfig->BEOUT  = NULL;
  ptfig->BEBUS  = NULL;
  ptfig->BEAUX  = NULL;
  ptfig->BEDLY  = NULL;
  ptfig->BEBUX  = NULL;
  ptfig->BEPOR  = NULL;
  ptfig->CIRCUI = NULL;
  ptfig->USER   = NULL;
  ptfig->BEGEN  = NULL;
  ptfig->ERRFLG = 0;
  ptfig->TYPE   = 0;
  ptfig->NEXT   = lastbefig;

  return (ptfig);
  }
