Bug 439685 compiler warning in callgrind/main.c
[valgrind.git] / coregrind / pub_core_libcprint.h
blob7d5c0d416f96be0106ce760894e8c7ba9054bf80
2 /*--------------------------------------------------------------------*/
3 /*--- Printing libc stuff. pub_core_libcprint.h ---*/
4 /*--------------------------------------------------------------------*/
6 /*
7 This file is part of Valgrind, a dynamic binary instrumentation
8 framework.
10 Copyright (C) 2000-2017 Julian Seward
11 jseward@acm.org
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, see <http://www.gnu.org/licenses/>.
26 The GNU General Public License is contained in the file COPYING.
29 #ifndef __PUB_CORE_LIBCPRINT_H
30 #define __PUB_CORE_LIBCPRINT_H
32 //--------------------------------------------------------------------
33 // PURPOSE: This module contains all the libc code that is related to
34 // higher-level (ie. higher than DebugLog) printing, eg. VG_(printf)().
35 //--------------------------------------------------------------------
37 #include "pub_tool_libcprint.h"
39 typedef
40 enum {
41 VgLogTo_Fd,
42 VgLogTo_File,
43 VgLogTo_Socket
45 VgLogTo;
47 /* An output file descriptor wrapped up with its type and expanded name. */
48 typedef
49 struct {
50 Int fd;
51 VgLogTo type;
52 HChar *fsname_expanded; // 'fs' stands for file or socket
54 OutputSink;
56 /* And the destinations for normal and XML output. */
57 extern OutputSink VG_(log_output_sink);
58 extern OutputSink VG_(xml_output_sink);
60 /* Initializes normal log and xml sinks (of type fd, file, or socket).
61 Any problem encountered is considered a hard error and causes V. to exit. */
62 extern void VG_(init_log_xml_sinks)(VgLogTo log_to, VgLogTo xml_to,
63 Int /*initial*/log_fd, Int /*initial*/xml_fd);
65 extern void VG_(print_preamble)(Bool logging_to_fd);
67 extern void VG_(logging_atfork_child)(ThreadId tid);
69 /* Get the elapsed wallclock time since startup into buf which has size
70 bufsize. The function will assert if bufsize is not large enough.
71 Upon return, buf will contain the zero-terminated wallclock time as
72 a string. The function also relies on the
73 millisecond timer having been set to zero by an initial read in
74 m_main during startup. */
75 void VG_(elapsed_wallclock_time) ( /*OUT*/HChar* buf, SizeT bufsize );
77 /* Call this if the executable is missing. This function prints an
78 error message, then shuts down the entire system. */
79 __attribute__((noreturn))
80 extern void VG_(err_missing_prog) ( void );
82 /* Similarly - complain and stop if there is some kind of config
83 error. */
84 __attribute__((noreturn))
85 extern void VG_(err_config_error) ( const HChar* format, ... );
87 /* Called by main_process_cmd_line_options to indicate an unrecognised
88 command line option.
89 It shutdowns the system if Clo_Mode is cloE or cloP.*/
90 extern void VG_(fmsg_unknown_option) ( const HChar *opt );
92 #endif // __PUB_CORE_LIBCPRINT_H
94 /*--------------------------------------------------------------------*/
95 /*--- end ---*/
96 /*--------------------------------------------------------------------*/