Metropoli BBS
VIEWER: avladdsb.c MODE: TEXT (ASCII)
/*Copyright (C) 1992, 1995 by Thomas Glen Smith.  All Rights Reserved.*/
/* avladdsb APL2 V1.0.0 ************************************************
* Called by avladd to add a node to a binary tree. Newname is already  *
* copied.                                                              *
***********************************************************************/
#define INCLUDES APLMEM+STRING+TREE
#include "includes.h"
Avlnode avladdsb(parmhdr,newname,leaf)
Avlnode *parmhdr;
char *newname;
void *leaf;
{
	Avltree;
	Avlnode p;

	p = malloc(sizeof(struct avlnode));
	if (p == NULL) return(NULL); /* out of memory */
	p->avlname = newname;
	p->avlleaf = leaf;
	if (NULL != avltree(parmhdr,p)) {
		free(p);
		return(NULL); /* bug somewhere! */
	}
	return(p);
}
[ RETURN TO DIRECTORY ]