~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to lib/g3d/g3derror.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
 
16
 
/*!
17
 
 * \brief 
18
 
 *
19
 
 *  This function ignores the error.
20
 
 *
21
 
 *  \param 
22
 
 *  \return void
23
 
 */
24
 
 
25
 
void G3d_skipError(const char *msg)
26
 
{
27
 
}
28
 
 
29
 
 
30
 
/*!
31
 
 * \brief 
32
 
 *
33
 
 *  This function prints the
34
 
 * error message <em>msg</em> to <em>stderr</em> and returns.
35
 
 *
36
 
 *  \param 
37
 
 *  \return void
38
 
 */
39
 
 
40
 
void G3d_printError(const char *msg)
41
 
{
42
 
    fprintf(stderr, "ERROR: ");
43
 
    fprintf(stderr, msg);
44
 
    fprintf(stderr, "\n");
45
 
}
46
 
 
47
 
 
48
 
/*!
49
 
 * \brief 
50
 
 *
51
 
 *  This function prints the
52
 
 * error message <em>msg</em>, and terminates the program with an error status.
53
 
 *
54
 
 *  \param 
55
 
 *  \return void
56
 
 */
57
 
 
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
 
}