syslog-ng source
context-info-db.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Balabit
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 2 as published
6  * by the Free Software Foundation, or (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * As an additional exemption you are allowed to compile & link against the
18  * OpenSSL libraries as published by the OpenSSL project. See the file
19  * COPYING for details.
20  *
21  */
22 
23 #ifndef CONTEXTINFODB_H_INCLUDED
24 #define CONTEXTINFODB_H_INCLUDED
25 
26 #include "syslog-ng.h"
28 #include <stdio.h>
29 
30 typedef struct _ContextInfoDB ContextInfoDB;
31 
32 typedef void (*ADD_CONTEXT_INFO_CB) (gpointer arg,
33  const ContextualDataRecord *record);
34 
35 void context_info_db_enable_ordering(ContextInfoDB *self);
36 GList *context_info_db_ordered_selectors(ContextInfoDB *self);
37 void context_info_db_init(ContextInfoDB *self);
38 
39 void context_info_db_purge(ContextInfoDB *self);
40 void context_info_db_index(ContextInfoDB *self);
41 gboolean context_info_db_is_loaded(const ContextInfoDB *self);
42 gboolean context_info_db_is_indexed(const ContextInfoDB *self);
43 
44 void context_info_db_insert(ContextInfoDB *self,
45  const ContextualDataRecord *record);
46 
47 gboolean context_info_db_contains(ContextInfoDB *self,
48  const gchar *selector);
49 
50 gsize context_info_db_number_of_records(ContextInfoDB *self,
51  const gchar *selector);
52 
53 void context_info_db_foreach_record(ContextInfoDB *self,
54  const gchar *selector,
55  ADD_CONTEXT_INFO_CB callback,
56  gpointer arg);
57 
58 GList *context_info_db_get_selectors(ContextInfoDB *self);
59 
60 gboolean context_info_db_import(ContextInfoDB *self, FILE *fp, const gchar *filename,
61  ContextualDataRecordScanner *scanner);
62 
63 
64 ContextInfoDB *context_info_db_new(gboolean ignore_case);
65 ContextInfoDB *context_info_db_ref(ContextInfoDB *self);
66 void context_info_db_unref(ContextInfoDB *self);
67 
68 #endif
gboolean context_info_db_is_indexed(const ContextInfoDB *self)
Definition: context-info-db.c:278
void context_info_db_unref(ContextInfoDB *self)
Definition: context-info-db.c:385
ContextInfoDB * context_info_db_new(gboolean ignore_case)
Definition: context-info-db.c:358
void context_info_db_insert(ContextInfoDB *self, const ContextualDataRecord *record)
Definition: context-info-db.c:221
ContextInfoDB * context_info_db_ref(ContextInfoDB *self)
Definition: context-info-db.c:373
gsize context_info_db_number_of_records(ContextInfoDB *self, const gchar *selector)
Definition: context-info-db.c:243
gboolean context_info_db_is_loaded(const ContextInfoDB *self)
Definition: context-info-db.c:284
void(* ADD_CONTEXT_INFO_CB)(gpointer arg, const ContextualDataRecord *record)
Definition: context-info-db.h:32
GList * context_info_db_ordered_selectors(ContextInfoDB *self)
Definition: context-info-db.c:89
GList * context_info_db_get_selectors(ContextInfoDB *self)
Definition: context-info-db.c:290
void context_info_db_enable_ordering(ContextInfoDB *self)
Definition: context-info-db.c:83
void context_info_db_init(ContextInfoDB *self)
void context_info_db_index(ContextInfoDB *self)
Definition: context-info-db.c:95
void context_info_db_purge(ContextInfoDB *self)
Definition: context-info-db.c:212
gboolean context_info_db_contains(ContextInfoDB *self, const gchar *selector)
Definition: context-info-db.c:233
gboolean context_info_db_import(ContextInfoDB *self, FILE *fp, const gchar *filename, ContextualDataRecordScanner *scanner)
Definition: context-info-db.c:318
void context_info_db_foreach_record(ContextInfoDB *self, const gchar *selector, ADD_CONTEXT_INFO_CB callback, gpointer arg)
Definition: context-info-db.c:258
Definition: contextual-data-record.h:31
Definition: context-info-db.c:34
gboolean ignore_case
Definition: context-info-db.c:41
CSVScanner scanner
Definition: test_csv_scanner.c:31