Commit 2a5c48d4 authored by Michael Meeks's avatar Michael Meeks

Update to new Bonobo seek enumeration.

parent e777d7fc
1999-08-16 Michael Meeks <michael@imaginator.com>
* gnome-stream-ole.c (real_seek): Expanded, and fixed for
new Bonobo seek type.
* ms-ole.c (ms_ole_lseek): Implemented MsOleSeekEnd
* ms-ole.h: Expanded seek enum.
1999-08-15 Michael Meeks <michael@imaginator.com>
* ms-ole.c (ms_ole_path_decode): Stop it trying to 'enter' streams :-)
......
......@@ -77,20 +77,18 @@ real_read (GnomeStream *stream, CORBA_long count,
}
static CORBA_long
real_seek (GnomeStream *stream, CORBA_long offset, CORBA_long whence,
real_seek (GnomeStream *stream, CORBA_long offset, GNOME_Stream_SeekType whence,
CORBA_Environment *ev)
{
GnomeStreamOLE *stream_ole = GNOME_STREAM_OLE (stream);
MsOleSeek type;
if (whence == SEEK_SET)
if (whence == GNOME_Stream_SEEK_SET)
type = MsOleSeekSet;
else if (whence == SEEK_CUR)
else if (whence == GNOME_Stream_SEEK_CUR)
type = MsOleSeekCur;
else {
g_warning ("FIXME: Seek type unimplemented");
return -1;
}
else
type = MsOleSeekEnd;
return stream_ole->file->lseek (stream_ole->file, offset, whence);
}
......
......@@ -1521,8 +1521,10 @@ ms_ole_lseek (MsOleStream *s, MsOleSPos bytes, MsOleSeek type)
newpos = s->position;
if (type == MsOleSeekSet)
newpos = bytes;
else
else if (type == MsOleSeekCur)
newpos += bytes;
else
newpos = s->size - bytes;
if (newpos > s->size || newpos < 0) {
g_warning ("Invalid seek");
......
......@@ -43,7 +43,7 @@ typedef struct _MsOle MsOle;
typedef struct _MsOleStream MsOleStream;
typedef struct _MsOleDirectory MsOleDirectory;
typedef enum { MsOleSeekSet, MsOleSeekCur } MsOleSeek;
typedef enum { MsOleSeekSet, MsOleSeekCur, MsOleSeekEnd } MsOleSeek;
#ifdef G_HAVE_GINT64
typedef guint32 MsOlePos;
typedef gint32 MsOleSPos;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment