Yet Another eXchange Tool  0.9.0
instr.h
Go to the documentation of this file.
1 
12 /*
13  * Keywords:
14  * Maintainer: Moritz Hanke <hanke@dkrz.de>
15  * Thomas Jahns <jahns@dkrz.de>
16  * URL: https://doc.redmine.dkrz.de/yaxt/html/
17  *
18  * Redistribution and use in source and binary forms, with or without
19  * modification, are permitted provided that the following conditions are
20  * met:
21  *
22  * Redistributions of source code must retain the above copyright notice,
23  * this list of conditions and the following disclaimer.
24  *
25  * Redistributions in binary form must reproduce the above copyright
26  * notice, this list of conditions and the following disclaimer in the
27  * documentation and/or other materials provided with the distribution.
28  *
29  * Neither the name of the DKRZ GmbH nor the names of its contributors
30  * may be used to endorse or promote products derived from this software
31  * without specific prior written permission.
32  *
33  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
34  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
35  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
36  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
37  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
38  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
39  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
40  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
41  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
42  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
43  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44  */
45 #ifndef SCT_INSTR_H_INCLUDED
46 #define SCT_INSTR_H_INCLUDED
47 
48 #ifdef HAVE_CONFIG_H
49 #include <config.h>
50 #endif
51 
52 #ifdef INSTR_WITH_SCT
53 
54 #include "sct.h"
55 #define INSTR_INIT(N,CS) sct_init(N,CS)
56 #define INSTR_DEF(T,S) static struct { int it; const char *s; } T = { -1, S };
57 #define INSTR_SET(T,V) if(!T) T = sct_new_timer(T,V)
58 #define INSTR_START(T) if(T.it<0) T.it = sct_new_timer(T.s); sct_start(T.it)
59 #define INSTR_STOP(T) sct_stop(T.it)
60 #define INSTR_REPORT(A,B,C) sct_report(A,B,C)
61 #define INSTR_FINALIZE()
62 
63 #else
64 
65 #define INSTR_INIT(N,CS)
66 #define INSTR_DEF(T,S)
67 #define INSTR_SET(T,V)
68 #define INSTR_START(T)
69 #define INSTR_STOP(T)
70 #define INSTR_FINALIZE()
71 
72 #endif
73 
74 #endif /* SCT_INSTR_H_INCLUDED */
75 
76 /*
77  * Local Variables:
78  * c-basic-offset: 2
79  * coding: utf-8
80  * indent-tabs-mode: nil
81  * show-trailing-whitespace: t
82  * require-trailing-newline: t
83  * End:
84  */