GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r72636
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
write_xid.c
Go to the documentation of this file.
1 
2 #include <grass/glocale.h>
3 
4 #include "cairodriver.h"
5 
6 void cairo_write_xid(void)
7 {
8 #if CAIRO_HAS_XLIB_XRENDER_SURFACE
9  FILE *fp;
10  char buf[64];
11 
12  fp = fopen(ca.file_name, "w");
13  if (!fp)
14  G_fatal_error(_("Unable to open output file <%s>"), ca.file_name);
15 
16  sprintf(buf, "0x%08lx\n", (unsigned long) ca.win);
17 
18  if (fputs(buf, fp) < 0)
19  G_fatal_error(_("Unable to write output file <%s>"), ca.file_name);
20 
21  fclose(fp);
22 #endif
23 }
24 
struct cairo_state ca
char * file_name
Definition: cairodriver.h:65
void G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
Definition: gis/error.c:160
fclose(fd)
GRASS cairo display driver - header file.
#define _(str)
Definition: glocale.h:13
void cairo_write_xid(void)
Definition: write_xid.c:6