ITK Function Reference
(V10000.1.0.60_20160308.00)
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
ai
sample_err.h
Go to the documentation of this file.
1
/*==============================================================================
2
Copyright (c) 2003-2005 UGS Corporation
3
Unpublished - All Rights Reserved
4
==============================================================================*/
5
6
/* */
7
8
#ifndef SAMPLE_ERR_H_INCLUDED
9
#define SAMPLE_ERR_H_INCLUDED
10
11
#include <
pom/pom/pom_errors.h
>
12
#include <
itk/mem.h
>
13
#include <
tc/tc_startup.h
>
14
#include <
tc/emh.h
>
15
16
#define CALL(x) { \
17
int stat; \
18
char *err_string; \
19
if( (stat = (x)) != ITK_ok) \
20
{ \
21
EMH_ask_error_text (stat, &err_string); \
22
printf ("ERROR: %d ERROR MSG: %s.\n", stat, err_string); \
23
printf ("Function: %s FILE: %s LINE: %d\n",#x, __FILE__, __LINE__); \
24
MEM_free (err_string); \
25
return (stat); \
26
} \
27
}
28
29
#define DO(x) { \
30
int stat; \
31
char *err_string; \
32
if( (stat = (x)) != POM_ok) \
33
{ \
34
EMH_ask_error_text (stat, &err_string); \
35
printf ("ERROR: %d ERROR MSG: %s.\n", stat, err_string); \
36
printf ("Function: %s FILE: %s LINE: %d\n",#x, __FILE__, __LINE__); \
37
MEM_free (err_string); \
38
} \
39
}
40
41
#define CALLRNULL(x) { \
42
int stat; \
43
char *err_string; \
44
if( (stat = (x)) != ITK_ok) \
45
{ \
46
EMH_ask_error_text (stat, &err_string); \
47
printf ("ERROR: %d ERROR MSG: %s.\n", stat, err_string); \
48
printf ("Function: %s FILE: %s LINE: %d\n",#x, __FILE__, __LINE__); \
49
MEM_free (err_string); \
50
return ((char *)NULL); \
51
} \
52
}
53
54
#endif