1 /* 2 * Copyright (c) 2015 Balabit 3 * Copyright (c) 2015 Balázs Scheidler 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 * 19 * As an additional exemption you are allowed to compile & link against the 20 * OpenSSL libraries as published by the OpenSSL project. See the file 21 * COPYING for details. 22 * 23 */ 24 #ifndef MODULE_CONFIG_H_INCLUDED 25 #define MODULE_CONFIG_H_INCLUDED 1 26 27 #include "syslog-ng.h" 28 29 typedef struct _ModuleConfig ModuleConfig; 30 31 /* This class encapsulates global (e.g. GlobalConfig) level settings for 32 * modules. It can be used to store state that is not related to a specific 33 * LogPipe instance. Such an example is the python block embedded in the 34 * configuration used by the Python module. */ 35 struct _ModuleConfig 36 { 37 /* init/deinit is hooked into configuration init/deinit */ 38 gboolean (*init)(ModuleConfig *s, GlobalConfig *cfg); 39 void (*deinit)(ModuleConfig *s, GlobalConfig *cfg); 40 void (*free_fn)(ModuleConfig *s); 41 }; 42 43 gboolean module_config_init(ModuleConfig *s, GlobalConfig *cfg); 44 void module_config_deinit(ModuleConfig *s, GlobalConfig *cfg); 45 void module_config_free_method(ModuleConfig *s); 46 void module_config_free(ModuleConfig *s); 47 48 #endif 49