/********************************************************************
 ** FILE SYSTEM THINGY
 **
 ** (c) Spak, Darrell Tam, c9107253@firebird.newcastle.edu.au (1994)
 ** phone (Australia) 049-829-710
 **                    49-829-710
 ** (c) SST 1994
 **
 ** LOWEST LEVEL LITTLE THINGS
 **
 ** TABS to 4
 ********************************************************************/
#include "/snd/everything.h"

/********************************************************************/
	short find_char(unsigned char *start,
				unsigned char search, short maxlen)
/********************************************************************
return: character offset of the "search" character OR -1 if not found
 ********************************************************************/
{
short i;
	for(i = 0; i < maxlen; i++)
		if(*start++ == search) return(i);
	return(-1);
}

/********************************************************************/
				void *DosAlloc(ULONG bytes)
/********************************************************************
 Alloc Memory dos (?) style with the -4(mem) containing alloc length
 ********************************************************************/
{
ULONG *ptr;
    bytes += 4;
    ptr = AllocMem(bytes, MEMF_PUBLIC | MEMF_CLEAR);
    ptr[0] = bytes;
    return(&ptr[1]);
}

/********************************************************************/
					void DosFree(ULONG *ptr)
/********************************************************************
 free Memory dos (?) style with the -4(mem) containing alloc length
 ********************************************************************/
{ if(ptr) { --ptr; FreeMem(ptr, ptr[0]); } }


