libtime++: Date and time calculation
ctime_util_warning.c
Go to the documentation of this file.
1 /* this is <ctime_util_warning.c>
2  * ----------------------------------------------------------------------------
3  *
4  * Copyright 06/08/2000 by Thomas Forbriger (IfG Stuttgart)
5  *
6  * ----
7  * libtime is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20  * ----
21  *
22  * C language specific warning handler
23  *
24  * REVISIONS and CHANGES
25  * 06/08/2000 V1.0 Thomas Forbriger
26  * 09/08/2000 V1.1 both are WARNINGs not ERRORs
27  * 14/12/2007 V1.2 use the Fortran integer type defined in libtime.h
28  * see there
29  * 17/12/2007 V1.3 introduced typedef timeint
30  *
31  * ============================================================================
32  */
33 
34 #include <libtime.h>
35 #include <stdio.h>
36 
37 /*
38  * Fortran calling convention:
39  */
40 int time_util_warning__(char *caller, char *text,
41  ftnlen caller_len, ftnlen text_len)
42 {
43  int i;
44  fputs("WARNING (", stderr);
45  for (i=0; i<caller_len; i++) { fputc((int)*(caller++), stderr); }
46  fputs("): ",stderr);
47  for (i=0; i<text_len; i++) { fputc((int)*(text++), stderr); }
48  fputc('\n', stderr);
49  return 0;
50 } /* time_util_warning__ */
51 
52 int time_util_warning_n__(char *caller, char *text, timeint *n,
53  ftnlen caller_len, ftnlen text_len)
54 {
55  integer i;
56  fputs("WARNING (", stderr);
57  for (i=0; i<caller_len; i++) { fputc((int)*(caller++), stderr); }
58  fputs("): ",stderr);
59  for (i=0; i<text_len; i++) { fputc((int)*(text++), stderr); }
60  i=(int)*n;
61  fprintf(stderr," %d\n",i);
62  return 0;
63 } /* time_util_warning_n__ */
64 
65 /* ----- END OF ctime_util_warning.c ----- */
int time_util_warning__(char *caller, char *text, ftnlen caller_len, ftnlen text_len)
int time_util_warning_n__(char *caller, char *text, timeint *n, ftnlen caller_len, ftnlen text_len)
long int integer
Definition: libtime.h:64
integer timeint
Definition: libtime.h:77
long int ftnlen
Definition: libtime.h:67