yaffsfs.c
//yaffsfs_GetHandle
// Grab a handle (when opening a file)
//
yaffsfs_GetHandle
Grab a handle (when opening a file)
yaffsfs_GetHandle Grab a handle ( when opening a file )
static int yaffsfs_GetHandle(void)
{
	int i;
	yaffsfs_Handle *h;
	for(i = 0; i < YAFFSFS_N_HANDLES; i++)
	{
		h = yaffsfs_GetHandlePointer(i);
		if(!h)
		{
		}
		if(!h->inUse)
		{
			memset(h,0,sizeof(yaffsfs_Handle));
			h->inUse=1;
			return i;
		}
	}
	return -1;
}
static int yaffsfs_GetHandle ( void ) { int i ; yaffsfs_Handle * h ; for ( i = 0 ; i < YAFFSFS_N_HANDLES ; i ++ ) { h = yaffsfs_GetHandlePointer ( i ) ; if ( ! h ) { } if ( ! h -> inUse ) { memset ( h , 0 , sizeof ( yaffsfs_Handle ) ) ; h -> inUse = 1 ; return i ; } } return -1 ; }
yaffsfs_GetHandle
Grab a handle (when opening a file)
yaffsfs_GetHandle Grab a handle ( when opening a file )
// todo bug: should never happen