This file is indexed.

/usr/include/syslog-ng/messages.h is in syslog-ng-dev 3.5.3-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
 98
 99
100
101
/*
 * Copyright (c) 2002-2012 BalaBit IT Ltd, Budapest, Hungary
 * Copyright (c) 1998-2012 Balázs Scheidler
 *
 * This library 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 2.1 of the License, or (at your option) any later version.
 *
 * This library 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 this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * As an additional exemption you are allowed to compile & link against the
 * OpenSSL libraries as published by the OpenSSL project. See the file
 * COPYING for details.
 *
 */
  
#ifndef MESSAGES_H_INCLUDED
#define MESSAGES_H_INCLUDED

#include "syslog-ng.h"
#include <evtlog.h>

extern int debug_flag;
extern int verbose_flag;
extern int trace_flag;
extern int log_stderr;

typedef void (*MsgPostFunc)(LogMessage *msg);

void msg_set_context(LogMessage *msg);
EVTREC *msg_event_create(gint prio, const char *desc, EVTTAG *tag1, ...);
void msg_event_free(EVTREC *e);
void msg_event_send(EVTREC *e);
void msg_event_suppress_recursions_and_send(EVTREC *e);


void msg_set_post_func(MsgPostFunc func);
void msg_init(gboolean interactive);
void msg_deinit(void);

void msg_add_option_group(GOptionContext *ctx);

/* fatal->warning goes out to the console during startup, notice and below
 * comes goes to the log even during startup */
#define msg_fatal(desc, tag1, tags...)    msg_event_suppress_recursions_and_send(msg_event_create(EVT_PRI_CRIT, desc, tag1, ##tags ))
#define msg_error(desc, tag1, tags...)    msg_event_suppress_recursions_and_send(msg_event_create(EVT_PRI_ERR, desc, tag1, ##tags ))
#define msg_warning(desc, tag1, tags...)  msg_event_suppress_recursions_and_send(msg_event_create(EVT_PRI_WARNING, desc, tag1, ##tags ))
#define msg_notice(desc, tag1, tags...)   msg_event_suppress_recursions_and_send(msg_event_create(EVT_PRI_NOTICE, desc, tag1, ##tags ))
#define msg_info(desc, tag1, tags...)     msg_event_suppress_recursions_and_send(msg_event_create(EVT_PRI_INFO, desc, tag1, ##tags ))

/* just like msg_info, but prepends the message with a timestamp -- useful in interactive
 * tools with long running time to provide some feedback */
#define msg_progress(desc, tag1, tags...) 					  \
        do { 									  \
          time_t t;								  \
          char *timestamp, *newdesc; 						  \
                                                                                  \
          t = time(0); 							          \
          timestamp = ctime(&t); 						  \
          timestamp[strlen(timestamp) - 1] = 0; 				  \
          newdesc = g_strdup_printf("[%s] %s", timestamp, desc); 		  \
          msg_event_send(msg_event_create(EVT_PRI_INFO, newdesc, tag1, ##tags )); \
          g_free(newdesc); 							  \
        } while (0)

#define msg_verbose(desc, tag1, tags...)                                          \
	do {                                                                      \
	  if (G_UNLIKELY(verbose_flag))                                           \
	    msg_info(desc, tag1, ##tags );                                        \
	} while (0)

#define msg_debug(desc, tag1, tags...) 						  \
	do { 									  \
	  if (G_UNLIKELY(debug_flag))             				  \
	    msg_event_suppress_recursions_and_send(                               \
	          msg_event_create(EVT_PRI_DEBUG, desc, tag1, ##tags ));          \
	} while (0)

#if ENABLE_DEBUG
#define msg_trace(desc, tag1, tags...) 						  \
	do { 									  \
	  if (G_UNLIKELY(trace_flag))            				  \
            msg_event_suppress_recursions_and_send(                               \
                  msg_event_create(EVT_PRI_DEBUG, desc, tag1, ##tags ));          \
	} while (0)
#else
#define msg_trace(desc, tag1, tags...)
#endif

void msg_post_message(LogMessage *msg);


#endif