Escript  Revision_4320
error.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2010-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15 
16 
17 /************************************************************************************/
18 
19 /* Functions for C error handling (and timing)*/
20 
21 /************************************************************************************/
22 
23 
24 #ifndef INC_ESYS_ERROR
25 #define INC_ESYS_ERROR
26 
27 #include "system_dep.h"
28 #include "types.h"
29 
30 #ifdef _OPENMP
31 #include <omp.h>
32 #endif
33 
34 #include <stdio.h> /* For FILENAME_MAX */
35 #define LenString_MAX FILENAME_MAX*2
36 #define LenErrorMsg_MAX LenString_MAX
37 
38 /************************************************************************************/
39 
40 typedef enum {
58 
59 /* interfaces */
60 
61 
63 double Esys_timer(void);
64 
66 bool_t Esys_checkPtr(void*);
67 
69 void Esys_resetError(void);
70 
72 void Esys_setError(Esys_ErrorCodeType err,__const char* msg);
73 
75 bool_t Esys_noError(void);
76 
79 
81 char* Esys_getErrorMessage(void);
82 
83 #ifndef _OPENMP
84 int serial_get_max_threads(void);
85 int serial_get_thread_num(void);
86 
87 /* Nasty hack to get 3.2 out */
88 #define omp_get_max_threads serial_get_max_threads
89 #define omp_get_thread_num serial_get_thread_num
90 #endif
91 
92 
93 #endif /* #ifndef INC_PASO */