1 /* 2 * Copyright (c) 2009-2013 Balabit 3 * Copyright (c) 2009 Marton Illes 4 * Copyright (c) 2009-2013 Balázs Scheidler 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2.1 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 * 20 * As an additional exemption you are allowed to compile & link against the 21 * OpenSSL libraries as published by the OpenSSL project. See the file 22 * COPYING for details. 23 * 24 */ 25 26 #ifndef TAGS_H_INCLUDED 27 #define TAGS_H_INCLUDED 28 29 #include "syslog-ng.h" 30 31 typedef guint16 LogTagId; 32 33 /* this is limited by the LogMessage structure, where a guint8 stores the 34 * number of 32 bit ints, used to store the tags as a bitfield. 256 * 32 = 35 * 8192. 36 */ 37 38 #if GLIB_SIZEOF_LONG == 4 39 #define LOG_TAGS_MAX 8192 40 #else 41 #define LOG_TAGS_MAX 16384 42 #endif 43 44 LogTagId log_tags_get_by_name(const gchar *name); 45 const gchar *log_tags_get_by_id(LogTagId id); 46 47 void log_tags_reinit_stats(void); 48 void log_tags_global_init(void); 49 void log_tags_global_deinit(void); 50 51 void log_tags_inc_counter(LogTagId id); 52 void log_tags_dec_counter(LogTagId id); 53 54 #endif 55