syslog-ng source
varbindlist-scanner.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 
23 #ifndef VARBINDLIST_SCANNER_H_INCLUDED
24 #define VARBINDLIST_SCANNER_H_INCLUDED
25 
27 
28 typedef struct _VarBindListScanner VarBindListScanner;
29 
31 {
32  KVScanner super;
33  GString *varbind_type;
34 };
35 
36 static inline void
37 varbindlist_scanner_input(VarBindListScanner *self, const gchar *input)
38 {
39  kv_scanner_input(&self->super, input);
40 }
41 
42 static inline const gchar *
43 varbindlist_scanner_get_current_key(VarBindListScanner *self)
44 {
45  return kv_scanner_get_current_key(&self->super);
46 }
47 
48 static inline const gchar *
49 varbindlist_scanner_get_current_type(VarBindListScanner *self)
50 {
51  return self->varbind_type->str;
52 }
53 
54 static inline const gchar *
55 varbindlist_scanner_get_current_value(VarBindListScanner *self)
56 {
57  return kv_scanner_get_current_value(&self->super);
58 }
59 
60 gboolean varbindlist_scanner_scan_next(VarBindListScanner *self);
61 VarBindListScanner *varbindlist_scanner_new(void);
62 
63 void varbindlist_scanner_init(VarBindListScanner *self);
64 void varbindlist_scanner_deinit(VarBindListScanner *self);
65 
66 static inline void
67 varbindlist_scanner_free(VarBindListScanner *self)
68 {
70  g_free(self);
71 }
72 
73 #endif
#define self
Definition: rcptid.c:38
Definition: varbindlist-scanner.h:31
GString * varbind_type
Definition: varbindlist-scanner.h:33
KVScanner super
Definition: varbindlist-scanner.h:32
gboolean varbindlist_scanner_scan_next(VarBindListScanner *self)
Definition: varbindlist-scanner.c:91
void varbindlist_scanner_deinit(VarBindListScanner *self)
Definition: varbindlist-scanner.c:84
void varbindlist_scanner_init(VarBindListScanner *self)
Definition: varbindlist-scanner.c:72
VarBindListScanner * varbindlist_scanner_new(void)
Definition: varbindlist-scanner.c:97