tin  2.6.1
About: TIN is a threaded NNTP and spool based UseNet newsreader.
  Fossies Dox: tin-2.6.1.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

trace.c
Go to the documentation of this file.
1/*
2 * Project : tin - a Usenet reader
3 * Module : trace.c
4 * Author : Thomas Dickey <dickey@invisible-island.net>
5 * Created : 1997-03-22
6 * Updated : 2021-02-23
7 * Notes : debugging support via TRACE macro.
8 *
9 * Copyright (c) 1997-2022 Thomas Dickey <dickey@invisible-island.net>
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 *
16 * 1. Redistributions of source code must retain the above copyright notice,
17 * this list of conditions and the following disclaimer.
18 *
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * 3. Neither the name of the copyright holder nor the names of its
24 * contributors may be used to endorse or promote products derived from
25 * this software without specific prior written permission.
26 *
27 * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40
41#ifndef TIN_H
42# include "tin.h"
43#endif /* !TIN_H */
44#ifndef TCURSES_H
45# include "tcurses.h"
46#endif /* !TCURSES_H */
47#ifndef included_trace_h
48# include "trace.h"
49#endif /* !included_trace_h */
50
51#ifndef HAVE__TRACEF
52void
54 const char *fmt,
55 ...)
56{
57 static FILE *fp;
58 va_list ap;
59
60 if (!fp)
61 fp = fopen("trace.out", "w");
62 if (!fp)
63 abort();
64
65 va_start(ap, fmt);
66 if (fmt != 0) {
67 vfprintf(fp, fmt, ap);
68 fputc('\n', fp);
69 (void)fflush(fp);
70 } else {
71 (void)fclose(fp);
72 (void)fflush(stdout);
73 (void)fflush(stderr);
74 }
75 va_end(ap);
76}
77
78
79char *
80_nc_visbuf(const char *s)
81{
82 return (char *) s;
83}
84#endif /* !HAVE__TRACEF */
85
86char *
88 int ch)
89{
90 static char result[2];
91 result[0] = (char) ch;
92 return result;
93}
char * tin_tracechar(int ch)
Definition: trace.c:87
void _tracef(const char *fmt,...)
Definition: trace.c:53
char * _nc_visbuf(const char *s)
Definition: trace.c:80