HOPS
HOPS class reference
adhoc_flag.h
Go to the documentation of this file.
1 #ifndef ADHOC_FLAG_H_
2 #define ADHOC_FLAG_H_
3 
4 /*
5  * Machinery to support adhoc_flag() capability.
6  *
7  * Everything hides behind one function, adhoc_flag()
8  * which should be invoked only when adhoc_flag_file[s] are
9  * defined. The #define'd statement is for efficiency if not.
10  */
11 
12 /* struct type_param defined in param_struct.h */
13 extern void adhoc_flag(struct type_param *pp,
14  int datum_flag, int fr, int ap, int *uflag, int *lflag);
15 
16 #include "hops_config.h"
17 /* this should be defined in hops_config.h */
18 #ifndef HAVE_HSEARCH_R
19 #define HAVE_HSEARCH_R 0
20 #endif /* HAVE_HSEARCH_R */
21 
22 /* disable the capability for testing */
23 #ifndef USE_ADHOC_FLAG
24 #define USE_ADHOC_FLAG HAVE_HSEARCH_R
25 #endif /* USE_ADHOC_FLAG */
26 #if USE_ADHOC_FLAG
27 /*#warning "Ad Hoc Flagging enabled"*/
28 #define ADHOC_FLAG(PP, DF, FR, AP, PU, PL) do { \
29  static int once = 1; \
30  if (once) { \
31  if ((PP)->ah_flag_files[0][0]) \
32  msg("AHF(%s)",1,(PP)->ah_flag_files[0]);\
33  if ((PP)->ah_flag_files[1][0]) \
34  msg("AHF(%s)",1,(PP)->ah_flag_files[1]);\
35  once = 0; \
36  } \
37  if ((PP)->ah_flag_files[0][0] || \
38  (PP)->ah_flag_files[1][0]) \
39  adhoc_flag(PP, DF, FR, AP, PU, PL); \
40  else \
41  *(PU) = *(PL) = DF; \
42  } while(0)
43 #else /* USE_ADHOC_FLAG */
44 /*#warning "Ad Hoc Flagging disabled"*/
45 #define ADHOC_FLAG(PP, DF, FR, AP, PU, PL) do { \
46  *(PU) = *(PL) = DF; } while(0)
47 #endif /* USE_ADHOC_FLAG */
48 
49 /*
50  * eof
51  */
52 
53 #endif
void adhoc_flag(struct type_param *pp, int datum_flag, int fr, int ap, int *uflag, int *lflag)
Definition: param_struct.h:13