syslog-ng source
nvhandle-descriptors.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Balabit
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * As an additional exemption you are allowed to compile & link against the
19  * OpenSSL libraries as published by the OpenSSL project. See the file
20  * COPYING for details.
21  *
22  */
23 
24 #ifndef NVHANDLE_DESCRIPTORS_H_INCLUDED
25 #define NVHANDLE_DESCRIPTORS_H_INCLUDED
26 
27 #include "syslog-ng.h"
28 
29 typedef struct _NVHandleDesc NVHandleDesc;
31 {
32  gchar *name;
33  guint16 flags;
34  guint8 name_len;
35 };
36 
37 typedef struct
38 {
39  NVHandleDesc *data;
40  guint len;
42  GPtrArray *old_buffers;
44 
45 #define NVHANDLE_DESC_ARRAY_INITIAL_SIZE 256
46 
47 NVHandleDescArray *nvhandle_desc_array_new(guint reserved_size);
49 void nvhandle_desc_array_append(NVHandleDescArray *self, NVHandleDesc *desc);
50 #define nvhandle_desc_array_index(self, i) (((NVHandleDesc*) (self)->data) [(i)])
51 
52 /* Does not free *self*. */
53 void nvhandle_desc_free(NVHandleDesc *self);
54 
55 #endif
void nvhandle_desc_array_append(NVHandleDescArray *self, NVHandleDesc *desc)
Definition: nvhandle-descriptors.c:67
void nvhandle_desc_array_free(NVHandleDescArray *self)
Definition: nvhandle-descriptors.c:40
NVHandleDescArray * nvhandle_desc_array_new(guint reserved_size)
Definition: nvhandle-descriptors.c:30
void nvhandle_desc_free(NVHandleDesc *self)
Definition: nvhandle-descriptors.c:77
Definition: nvhandle-descriptors.h:38
NVHandleDesc * data
Definition: nvhandle-descriptors.h:39
GPtrArray * old_buffers
Definition: nvhandle-descriptors.h:42
guint allocated_len
Definition: nvhandle-descriptors.h:41
guint len
Definition: nvhandle-descriptors.h:40
Definition: nvhandle-descriptors.h:31
gchar * name
Definition: nvhandle-descriptors.h:32
guint8 name_len
Definition: nvhandle-descriptors.h:34
guint16 flags
Definition: nvhandle-descriptors.h:33