
/* ###--------------------------------------------------------------### */
/* 									*/
/* file		: syf_beh_addbegen.c					*/
/* date		: Feb  3 1992						*/
/* version	: v2							*/
/* authors	: P. BAZARGAN						*/
/* content	: contains a specific function used to create a		*/
/*		  behaviour data structure				*/
/*									*/
/* ###--------------------------------------------------------------### */

#include MUT_H 
#include LOG_H 
#include BEH_H 

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

struct syf_begen *syf_beh_addbegen (lastbegen, name, type, value)

struct syf_begen   *lastbegen;	/* pointer on the last begen structure	*/
char           *name;		/* generic's name			*/
void           *value;		/* generic's value			*/
unsigned char  type;		/* generic's type 			*/

  {

  struct syf_begen *ptgen;

  name         = namealloc (name);
  
  ptgen        = (struct syf_begen *) mbkalloc (sizeof(struct syf_begen));
  ptgen->NAME  = name;
  ptgen->TYPE  = type;
  ptgen->VALUE = value;
  ptgen->NEXT  = lastbegen;

  return (ptgen);
  }
