write_xid.c 449 B

12345678910111213141516171819202122232425
  1. #include <grass/glocale.h>
  2. #include "cairodriver.h"
  3. void cairo_write_xid(void)
  4. {
  5. #if CAIRO_HAS_XLIB_XRENDER_SURFACE
  6. FILE *fp;
  7. char buf[64];
  8. fp = fopen(ca.file_name, "w");
  9. if (!fp)
  10. G_fatal_error(_("Unable to open output file <%s>"), ca.file_name);
  11. sprintf(buf, "0x%08lx\n", (unsigned long) ca.win);
  12. if (fputs(buf, fp) < 0)
  13. G_fatal_error(_("Unable to write output file <%s>"), ca.file_name);
  14. fclose(fp);
  15. #endif
  16. }