ARB
Main Page
Namespaces
Classes
Files
File List
File Members
TREEGEN
defines.c
Go to the documentation of this file.
1
#include "
defines.h
"
2
#include <stdlib.h>
3
#include <stdarg.h>
4
5
#define MAXERRLEN 500
6
7
void
error
(
cstr
message
) {
8
fprintf(stderr,
"Error: %s\n"
, message);
9
exit(1);
10
}
11
void
warning
(
cstr
message
) {
12
fprintf(stderr,
"Warning: %s\n"
, message);
13
}
14
void
errorf
(
cstr
format
, ...) {
15
char
errBuf[
MAXERRLEN
];
16
va_list argptr;
17
18
va_start
(argptr, format);
19
vsprintf(errBuf, format, argptr);
20
va_end
(argptr);
21
22
error
(errBuf);
23
}
24
void
warningf
(
cstr
format
, ...) {
25
char
warnBuf[
MAXERRLEN
];
26
va_list argptr;
27
28
va_start
(argptr, format);
29
vsprintf(warnBuf, format, argptr);
30
va_end
(argptr);
31
32
warning
(warnBuf);
33
}
34
void
def_outOfMemory
(
cstr
source,
int
lineno) {
35
errorf
(
"Out of memory (in %s, #%i)"
, source, lineno);
36
}
37
void
def_assert
(
cstr
whatFailed,
cstr
source,
int
lineno,
int
cnt) {
38
errorf
(
"Assertion (%s) failed in %s (Line: %i ; Pass: %i)\n"
,
39
whatFailed, source, lineno, cnt);
40
}
format
AliDataPtr format(AliDataPtr data, const size_t wanted_len, GB_ERROR &error)
Definition:
insdel.cxx:615
warningf
void warningf(cstr format,...)
Definition:
defines.c:24
errorf
void errorf(cstr format,...)
Definition:
defines.c:14
defines.h
message
void message(char *errortext)
error
void error(cstr message)
Definition:
defines.c:7
va_end
va_end(argPtr)
def_outOfMemory
void def_outOfMemory(cstr source, int lineno)
Definition:
defines.c:34
va_start
va_start(argPtr, format)
def_assert
void def_assert(cstr whatFailed, cstr source, int lineno, int cnt)
Definition:
defines.c:37
cstr
const char * cstr
Definition:
defines.h:21
MAXERRLEN
#define MAXERRLEN
Definition:
defines.c:5
warning
void warning(cstr message)
Definition:
defines.c:11
Generated by
1.8.8