How to return nil error surface?

Gerhard Heift <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CACeaM889sGPVjKmL878=Fq7UfKd-NE5UghfLX6HOKaKJc-rL1A@mail.gmail.com>
Hello,

I have implemented a function to load an image from a jpeg file. Now I
want to implement the error handling inside this function. I had a
look inside of cairo_image_surface_create_from_png, which returns a
private static surface for errors such as FILE_NOT_FOUND. Is it
possible for me to return such an error surface, too?

iI want to do something like this:

cairo_surface_t * surface_from_jpeg(const char *file) {
  FILE *infile;
  infile = fopen(file, "rb");
  if (infile == NULL) {
    if (errno == ENOENT) {
      return cairo_surface_nil_with_error(CAIRO_STATUS_FILE_NOT_FOUND);
    }
  }
  /* ... */
}

Thanks,
  Gerhard
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.