GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
common.c
Go to the documentation of this file.
1 
2 #include <grass/gis.h>
3 #include <grass/raster.h>
4 #include <grass/graphics.h>
5 
17 void R_flush(void)
18 {
19  R_stabilize();
20 }
21 
22 void R_pad_perror(const char *msg, int code)
23 {
24  const char *err;
25 
26  switch (code) {
27  case OK:
28  err = "";
29  break;
30  case NO_CUR_PAD:
31  err = "no current pad";
32  break;
33  case NO_PAD:
34  err = "pad not found";
35  break;
36  case NO_MEMORY:
37  err = "out of memory";
38  break;
39  case NO_ITEM:
40  err = "item not found";
41  break;
42  case ILLEGAL:
43  err = "illegal request";
44  break;
45  case DUPLICATE:
46  err = "duplicate name";
47  break;
48  default:
49  err = "unknown error";
50  break;
51  }
52 
53  fprintf(stderr, "%s%s%s\n", msg, *msg ? " : " : "", err);
54 }
55 
56 void R_pad_freelist(char **list, int count)
57 {
58  int i;
59 
60  if (count <= 0)
61  return;
62 
63  for (i = 0; i < count; i++)
64  G_free(list[i]);
65 
66  G_free(list);
67 }
void R_flush(void)
flush graphics
Definition: common.c:17
void G_free(void *buf)
Free allocated memory.
Definition: gis/alloc.c:142
void R_stabilize(void)
Definition: com_io.c:193
void R_pad_perror(const char *msg, int code)
Definition: common.c:22
int count
const char * err
Definition: g3dcolor.c:50
#define NO_MEMORY
Definition: plot.c:386
#define OK
Definition: plot.c:384
void R_pad_freelist(char **list, int count)
Definition: common.c:56
tuple msg
Definition: wxnviz.py:32