Metropoli BBS
VIEWER: depth.c MODE: TEXT (ASCII)
/* Copyright (C) 1993 by Thomas Glen Smith.  All Rights Reserved. */
/* depth APL2 V1.0.0 ***************************************************
* Reports levels of nesting, 0 for simple scalars.  For other arrays,  *
* 1 plus the depth of the item with the maximum depth.                 *
***********************************************************************/
#define INCLUDES APLCB
#include "includes.h"
Aplcb depth(rite)
Aplcb rite;
{
     Errinit; Errstop; Depthsub; Getcb;
     extern int aplerr;
     Aplcb out=NULL;

	for(;;) {
	     if (errinit()) break;
	     out = getcb(NULL, 1, APLTEMP+APLINT, 1, NULL);
	     if (aplerr) break;
          *(out->aplptr.aplint) = depthsub(rite);
		rite = NULL; /* Don't free twice. */
		break;
	} /* End for(;;) */
     return(errstop(0, NULL, rite, out));
}
[ RETURN TO DIRECTORY ]