libtime++: Date and time calculation
cxxtime_util_warning.cc
Go to the documentation of this file.
1 
34 #define TF_CXXTIME_UTIL_WARNING_CC_VERSION \
35  "TF_CXXTIME_UTIL_WARNING_CC V1.0 "
36 
37 #include <libtime++.h>
38 #include <string>
39 #include <iostream>
40 
41 namespace libtime {
42  bool Warning::suppress_normal=false;
43  bool Warning::suppress_year=false;
44  bool Warning::suppress_any=false;
45 } // namespace libtime
46 
47 extern "C" {
48 /*
49  * Fortran calling convention:
50  */
51 int time_util_warning__(char *caller, char *text,
52  time_kernel::ftnlen caller_len,
53  time_kernel::ftnlen text_len)
54 {
55  std::string callerstring, textstring;
56  int i;
58  {
59  for (i=0; i<caller_len; i++) { callerstring += *(caller++); }
60  for (i=0; i<text_len; i++) { textstring += *(text++); }
61  std::string message="ERROR ("+callerstring+"): "+textstring;
62  std::cerr << message << std::endl;
63  }
64  return(0);
65 } /* time_util_warning__ */
66 
67 int time_util_warning_n__(char *caller, char *text,
69  time_kernel::ftnlen caller_len,
70  time_kernel::ftnlen text_len)
71 {
72  std::string callerstring, textstring;
73  int i;
75  {
76  for (i=0; i<caller_len; i++) { callerstring += *(caller++); }
77  for (i=0; i<text_len; i++) { textstring += *(text++); }
78  std::string message="ERROR ("+callerstring+"): "+textstring;
79  i=(int)*n;
80  std::cerr << message << " " << i << std::endl;
81  }
82  return(0);
83 } /* time_util_warning_n__ */
84 
85 } // extern "C"
86 
87 /* ----- END OF cxxtime_util_warning.cc ----- */
static bool suppress_year
Definition: libtime++.h:646
static bool suppress_any
Definition: libtime++.h:647
int time_util_warning__(char *caller, char *text, time_kernel::ftnlen caller_len, time_kernel::ftnlen text_len)
long int integer
Definition: libtime.h:64
static bool suppress_normal
Definition: libtime++.h:645
long int ftnlen
Definition: libtime.h:67
int time_util_warning_n__(char *caller, char *text, time_kernel::integer *n, time_kernel::ftnlen caller_len, time_kernel::ftnlen text_len)