/***********************************************************************\

    Filename: zalloc.c

\***********************************************************************/

#include <prodos.h>
#include <memory.h>
#include "proxlib.h"
#include "driver.h"

char *zalloc(id, size)
int id;
unsigned size;
{
char **temp;

    temp = (char **) D_NEEDHANDLEID((long) size, 0x4010, id);
	asm { bcs bogus }
	return *temp;
bogus:
	return 0L;
}

/* free a pointer, but only if it is not null */

void nzfree(ptr)
char *ptr;
{
    if (ptr)
        DisposeHandle(FindHandle((char *) ptr));
}
