/*Copyright (C) 1992, 1995 by Thomas Glen Smith. All Rights Reserved.*/
/* functrst APL2 V1.0.0 ************************************************
* Called to from funcexec to initialize trace and stop vectors. *
***********************************************************************/
#define INCLUDES APLCB+APLCHDEF+APLMEM+APLTOKEN+STRING+TREE
#include "includes.h"
Aplcb functrst(ch,name)
char *ch; /* "s" if stop vector wanted, "t" if trace vector wanted. */
char *name; /* function name */
{
Codechar; Temp; Treenode; Vectin;
char control[100];
Avlnode p;
Aplcb cb;
control[0] = *ch; /* move in "s" or "t" */
control[1] = *codechar(DELTA); /* followed by DELTA */
strcpy(&control[2],name); /* append function name */
if (NULL == (p = treenode(control)) || NULL == (cb = p->avlleaf) ||
cb->aplcount == 0 || cb->aplrank > 1 ||
0 == cb->aplflags & APLINT+APLNUMB)
return(NULL); /* no vector */
if (!(cb->aplflags & APLINT))
cb = temp(vectin(cb)); /* make sure we got integer vector */
return(cb); /* got vector */
}