GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
g3derror.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <sys/types.h>
4 #include <unistd.h>
5 #include <time.h>
6 #include <stdarg.h>
7 #include <rpc/types.h>
8 #include <rpc/xdr.h>
9 #include <grass/gis.h>
10 
11 #include "G3d_intern.h"
12 
13 /*---------------------------------------------------------------------------*/
14 
15 
25 void G3d_skipError(const char *msg)
26 {
27 }
28 
29 
40 void G3d_printError(const char *msg)
41 {
42  fprintf(stderr, "ERROR: ");
43  fprintf(stderr, msg);
44  fprintf(stderr, "\n");
45 }
46 
47 
58 void G3d_fatalError(const char *msg, ...)
59 {
60  char buffer[2000]; /* No novels to the error logs, OK? */
61  va_list ap;
62 
63  va_start(ap, msg);
64  vsprintf(buffer, msg, ap);
65  va_end(ap);
66 
67  G_fatal_error("%s", buffer);
68 }
69 
70 void G3d_fatalError_noargs(const char *msg)
71 {
72  G_fatal_error("%s", msg);
73 }
74 
75 void G3d_error(const char *msg, ...)
76 {
77  char buffer[2000]; /* No novels to the error logs, OK? */
78  va_list ap;
79 
80  va_start(ap, msg);
81  vsprintf(buffer, msg, ap);
82  va_end(ap);
83 
84  (*g3d_error_fun) (buffer);
85 }
void G3d_error(const char *msg,...)
Definition: g3derror.c:75
void G3d_printError(const char *msg)
This function prints the error message msg to stderr and returns.
Definition: g3derror.c:40
void G3d_fatalError_noargs(const char *)
Definition: g3derror.c:70
void G3d_skipError(const char *msg)
This function ignores the error.
Definition: g3derror.c:25
tuple msg
Definition: wxnviz.py:32
int G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
void G3d_fatalError(const char *,...)
This function prints the error message msg, and terminates the program with an error status...
Definition: g3derror.c:58