2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2000-02-25 00:11:26 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2000-02-25 00:11:26 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2000-02-25 00:11:26 +08:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2000-02-25 00:11:26 +08:00
|
|
|
*/
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2001-07-04 02:38:56 +08:00
|
|
|
#include "config.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2013-10-09 03:22:14 +08:00
|
|
|
#include <gio/gio.h>
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-07-04 02:38:56 +08:00
|
|
|
#include "core/core-types.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-07-04 02:38:56 +08:00
|
|
|
#include "xcf-private.h"
|
|
|
|
#include "xcf-seek.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2014-10-16 05:21:34 +08:00
|
|
|
|
2002-12-20 14:26:34 +08:00
|
|
|
gboolean
|
2003-09-10 18:40:57 +08:00
|
|
|
xcf_seek_pos (XcfInfo *info,
|
2017-03-23 18:44:41 +08:00
|
|
|
goffset pos,
|
2006-04-12 20:49:29 +08:00
|
|
|
GError **error)
|
2001-07-04 02:38:56 +08:00
|
|
|
{
|
|
|
|
if (info->cp != pos)
|
|
|
|
{
|
2013-10-09 03:22:14 +08:00
|
|
|
GError *my_error = NULL;
|
|
|
|
|
2001-07-04 02:38:56 +08:00
|
|
|
info->cp = pos;
|
2002-12-20 14:26:34 +08:00
|
|
|
|
2013-10-09 03:22:14 +08:00
|
|
|
if (! g_seekable_seek (info->seekable, info->cp, G_SEEK_SET,
|
|
|
|
NULL, &my_error))
|
|
|
|
{
|
|
|
|
g_propagate_prefixed_error (error, my_error,
|
|
|
|
_("Could not seek in XCF file: "));
|
2002-12-20 14:26:34 +08:00
|
|
|
return FALSE;
|
|
|
|
}
|
2013-10-09 03:22:14 +08:00
|
|
|
|
|
|
|
g_assert (info->cp == g_seekable_tell (info->seekable));
|
2001-07-04 02:38:56 +08:00
|
|
|
}
|
2002-12-20 14:26:34 +08:00
|
|
|
|
2003-09-10 18:40:57 +08:00
|
|
|
return TRUE;
|
2001-07-04 02:38:56 +08:00
|
|
|
}
|