/* * load.c -- load image * (C)Copyright 1999 by Hiroshi Takekawa * This file is part of Enfle. * * Last Modified: Thu Aug 17 22:34:23 2000. * $Id: load.c,v 1.2 2000/08/17 13:41:13 sian Exp $ * * Enfle is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enfle is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "enfle.h" #include "image.h" #include "plugin.h" int load_image(Info *info, Image *p) { int flag; Dlist_data *t; info->format = NULL; p->type = _UNKNOWN; for (t = dlist_gettop(info->pluginlist); t != NULL; t = t->next) { PluginInfo *pinfo = t->data; if (pinfo->type == _Loader) { archive_seek(info->ar, 0, SEEK_SET); flag = (*pinfo->functions.loader.load_image)(info, p); switch (flag) { case PROC_OK: dlist_move_to_top(info->pluginlist, t); /* through */ case PROC_ERROR: return flag; case PROC_NOT: break; default: fprintf(stderr, "load_image: unknown flag %d\n", flag); exit(1); } } } p->image = NULL; return PROC_NOT; }