syslog-ng source
collection-comparator.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 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 #ifndef MODULES_AFFILE_COLLECTION_COMPARATOR_H_
23 #define MODULES_AFFILE_COLLECTION_COMPARATOR_H_
24 
25 #include "syslog-ng.h"
26 
27 typedef struct _CollectionComparatorEntry
28 {
29  gint64 key[2];
30  gchar *value;
31  guint8 flag;
33 
34 typedef struct _CollectionComparator CollectionComparator;
35 
36 typedef void (*cc_callback)(CollectionComparatorEntry *entry, gpointer user_data);
37 
38 guint hash_collection_comparator_entry(const void *data);
39 gboolean equal_collection_comparator_entry(const void *a, const void *b);
40 void free_collection_comparator_entry(gpointer s);
41 
42 CollectionComparator *collection_comparator_new(void);
43 void collection_comparator_free(CollectionComparator *self);
44 void collection_comparator_start(CollectionComparator *self);
45 void collection_comparator_stop(CollectionComparator *self);
46 void collection_comparator_add_value(CollectionComparator *self, const gint64 key[2], const gchar *value);
47 void collection_comparator_add_initial_value(CollectionComparator *self, const gint64 key[2], const gchar *value);
48 
49 void collection_comporator_set_callbacks(CollectionComparator *self, cc_callback handle_new, cc_callback handle_delete,
50  gpointer user_data);
51 
52 
53 #endif /* MODULES_AFFILE_COLLECTION_COMPARATOR_H_ */
CollectionComparator * collection_comparator_new(void)
Definition: collection-comparator.c:78
guint hash_collection_comparator_entry(const void *data)
Definition: collection-comparator.c:43
void free_collection_comparator_entry(gpointer s)
Definition: collection-comparator.c:62
void collection_comparator_add_value(CollectionComparator *self, const gint64 key[2], const gchar *value)
Definition: collection-comparator.c:97
void(* cc_callback)(CollectionComparatorEntry *entry, gpointer user_data)
Definition: collection-comparator.h:36
void collection_comparator_stop(CollectionComparator *self)
Definition: collection-comparator.c:175
void collection_comporator_set_callbacks(CollectionComparator *self, cc_callback handle_new, cc_callback handle_delete, gpointer user_data)
Definition: collection-comparator.c:187
gboolean equal_collection_comparator_entry(const void *a, const void *b)
Definition: collection-comparator.c:54
void collection_comparator_start(CollectionComparator *self)
Definition: collection-comparator.c:86
void collection_comparator_add_initial_value(CollectionComparator *self, const gint64 key[2], const gchar *value)
Definition: collection-comparator.c:118
void collection_comparator_free(CollectionComparator *self)
Definition: collection-comparator.c:70
Definition: collection-comparator.h:28
guint8 flag
Definition: collection-comparator.h:31
gchar * value
Definition: collection-comparator.h:30
Definition: collection-comparator.c:30
GString * value
Definition: test_decode.c:28
struct tm key
Definition: cache.c:63