BOOL OnUserTypeDefinition()
{
	Type *t;
	t = PopUserType();
	PushUserType(t);
	if(t != NULL)
		return TRUE;
	else 
		return FALSE;
}
static int ReadDir (lua_State * L)
{
	struct dirent * entry = readdir(D(L));

	if (entry != 0)
	{
		PushUserType(L, entry, "struct dirent");

		return 1;
	}

	return 0;
}
static int OpenDir (lua_State * L)
{
	DIR * dir = opendir(S(L, 1));

	if (dir != 0)
	{
		PushUserType(L, dir, "DIR");

		return 1;
	}

	return 0;
}
static int LoadPicture (lua_State * L)
{
	Picture_h picture;

	if (LoadPicture(S(L, 1), F(L, 2), F(L, 3), F(L, 4), F(L, 5), picture) != 0)
	{
		PushUserType(L, picture, "Picture");

		return 1;
	}

	return 0;
}
static int LoadFont (lua_State * L)
{
	Font_h font;

	if (LoadFont(S(L, 1), I(L, 2), font) != 0)
	{
		PushUserType(L, font, "Font");

		return 1;
	}

	return 0;
}
static int LoadTextImage (lua_State * L)
{
	SDL_Color color;

	color.r = U8(L, 3);
	color.g = U8(L, 4);
	color.b = U8(L, 5);

	TextImage_h textImage;

	if (LoadTextImage(UT(L, 1), S(L, 2), color, textImage) != 0)
	{
		PushUserType(L, textImage, "TextImage");

		return 1;
	}

	return 0;
}