/usr/include/boinc/msg_log.h is in boinc-dev 7.0.24+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | // This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
#ifndef _BOINC_MSG_LOG_H_
#define _BOINC_MSG_LOG_H_
#include <cstdio>
#include <cstdarg>
#ifdef _USING_FCGI_
#include "boinc_fcgi.h"
#endif
// the __attribute((format...)) tags are GCC extensions that let the compiler
// do like-checking on printf-like arguments
//
#if !defined(__GNUC__) && !defined(__attribute__)
#define __attribute__(x) /*nothing*/
#endif
#ifdef _USING_FCGI_
#define __attribute__(x) //nothing
#endif
#undef printf
#undef vprintf
class MSG_LOG {
public:
int debug_level;
char spaces[80];
FILE* output;
int indent_level;
int pid;
MSG_LOG(FILE* output);
virtual ~MSG_LOG(){}
void enter_level(int = 1);
void leave_level() { enter_level(-1); }
MSG_LOG& operator++() { enter_level(); return *this; }
MSG_LOG& operator--() { leave_level(); return *this; }
void printf(int kind, const char* format, ...) __attribute__ ((format (printf, 3, 4)));
void printf_multiline(int kind, const char* str, const char* prefix_format, ...) __attribute__ ((format (printf, 4, 5)));
void printf_file(int kind, const char* filename, const char* prefix_format, ...) __attribute__ ((format (printf, 4, 5)));
void vprintf(int kind, const char* format, va_list va);
void vprintf_multiline(int kind, const char* str, const char* prefix_format, va_list va);
void vprintf_file(int kind, const char* filename, const char* prefix_format, va_list va);
protected:
virtual const char* v_format_kind(int kind) const = 0;
virtual bool v_message_wanted(int kind) const = 0;
};
// automatically ++/--MSG_LOG on scope entry / exit.
// See lib/msg_log.C for commentary
//
#if _MSC_VER >= 1300
#pragma warning(disable: 4512) // assignment operator could not be generated
#endif
class SCOPE_MSG_LOG {
MSG_LOG& messages;
int kind;
public:
SCOPE_MSG_LOG(MSG_LOG& messages_, int kind_) : messages(messages_), kind(kind_)
{ ++messages; }
~SCOPE_MSG_LOG() { --messages; }
SCOPE_MSG_LOG& operator++() { ++messages; return *this; }
SCOPE_MSG_LOG& operator--() { --messages; return *this; }
void printf(const char* format, ...) __attribute__ ((format (printf, 2, 3)));
void printf_multiline(const char* str, const char* prefix_format, ...) __attribute__ ((format (printf, 3, 4)));
void printf_file(const char* filename, const char* prefix_format, ...) __attribute__ ((format (printf, 3, 4)));
};
#if _MSC_VER >= 1300
#pragma warning(default: 4512) // assignment operator could not be generated
#endif
#endif
|