Metropoli BBS
VIEWER: apledix.c MODE: TEXT (ASCII)
/*Copyright (C) 1992, 1995 by Thomas Glen Smith.  All Rights Reserved.*/
/* apledix APL2 V1.0.0 *************************************************
* Called by aplediv to allocate a new apled element.                   *
***********************************************************************/
#define INCLUDES APLCB+APLED+APLFUNCI+APLMEM+APLTOKEN
#include "includes.h"
Apled apledix(e,olded,tokhdr,tokcnt,stmtno,flag)
Apledst e;			/* Edit common area.				*/
Apled olded;			/* Previous tail of list.			*/
Apltoken tokhdr;		/* Ptr to block of tokens for stmt.	*/
int tokcnt; 			/* Count of tokens in this statement.	*/
double stmtno; 		/* Current statement number.			*/
int flag;		/* 1 = yes, free of tokhdr tokens when apled is freed.	*/
{
	Enqueue;
	Apled newed;

	if (NULL == (newed = malloc(sizeof(struct apled))))
		return(NULL); /* out of memory - aplerr already set */
	newed->apledst = stmtno;
	newed->apledtm = flag;
	newed->apledcn = tokcnt;
	newed->apledhd = tokhdr;
	newed->apledch = NULL;
	enqueue(e,olded,newed); /* add to list */
	return(newed);
}
[ RETURN TO DIRECTORY ]