Re: libole2 (was Re: commit -- POW - Beginning the Binary ...)


Subject: Re: libole2 (was Re: commit -- POW - Beginning the Binary ...)
From: Dom Lachowicz (dominicl@seas.upenn.edu)
Date: Thu Mar 30 2000 - 18:45:55 CST


Kevin Vajk wrote:

> Based on a quick tour of the code...
>
> Making libole2 independent of glib doesn't look too difficult, but
> making it run on non-UNIX systems will be non-trivial. (For example,
> they use file descriptors and stuff like mmap() and stat().)
>
> - Kevin Vajk
> <kvajk@ricochet.net>

Yeah, but look at what they've done - wrapped every call they need.
Porting to another system should be as easy as coding one of these
wrapping functions(how hard is it to binary write a stream or return a
file's size??).

static int
close_wrap (int fd)
{
 return close (fd);
}

static ssize_t
write_wrap (int fd, const void *buf, size_t count)
{
 return write (fd, buf, count);
}

static int
getfilesize_wrap (int fd, guint32 *size)
{
 struct stat st;

 if (fstat (fd, &st))
  return -1;

 *size = st.st_size;
 return 0;
}



This archive was generated by hypermail 2b25 : Thu Mar 30 2000 - 18:45:58 CST