syslog-ng source
str-format.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002-2011 Balabit
3  * Copyright (c) 1998-2011 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 
25 #ifndef STR_FORMAT_H_INCLUDED
26 #define STR_FORMAT_H_INCLUDED
27 
28 #include "syslog-ng.h"
29 
30 gint format_uint32_padded(GString *result, gint field_len, gchar pad_char, gint base, guint32 value);
31 gint format_int32_padded(GString *result, gint field_len, gchar pad_char, gint base, gint32 value);
32 
33 gint format_uint64_padded(GString *result, gint field_len, gchar pad_char, gint base, guint64 value);
34 gint format_int64_padded(GString *result, gint field_len, gchar pad_char, gint base, gint64 value);
35 
36 gint format_uint32_base10_rev(gchar *result, gsize result_len, gint sign, guint32 value);
37 
38 gchar *format_hex_string(gconstpointer str, gsize str_len, gchar *result, gsize result_len);
39 gchar *format_hex_string_with_delimiter(gconstpointer str, gsize str_len, gchar *result, gsize result_len,
40  gchar delimiter);
41 
42 gboolean scan_positive_int(const gchar **buf, gint *left, gint field_width, gint *num);
43 gboolean scan_expect_char(const gchar **buf, gint *left, gchar value);
44 gboolean scan_expect_str(const gchar **buf, gint *left, const gchar *value);
45 
46 #endif
gchar * format_hex_string_with_delimiter(gconstpointer str, gsize str_len, gchar *result, gsize result_len, gchar delimiter)
Definition: str-format.c:265
gint format_uint32_base10_rev(gchar *result, gsize result_len, gint sign, guint32 value)
Definition: str-format.c:150
gboolean scan_expect_char(const gchar **buf, gint *left, gchar value)
Definition: str-format.c:331
gint format_uint32_padded(GString *result, gint field_len, gchar pad_char, gint base, guint32 value)
Definition: str-format.c:253
gboolean scan_positive_int(const gchar **buf, gint *left, gint field_width, gint *num)
Definition: str-format.c:296
gboolean scan_expect_str(const gchar **buf, gint *left, const gchar *value)
Definition: str-format.c:343
gint format_int32_padded(GString *result, gint field_len, gchar pad_char, gint base, gint32 value)
Definition: str-format.c:259
gchar * format_hex_string(gconstpointer str, gsize str_len, gchar *result, gsize result_len)
Definition: str-format.c:288
gint format_int64_padded(GString *result, gint field_len, gchar pad_char, gint base, gint64 value)
Definition: str-format.c:142
gint format_uint64_padded(GString *result, gint field_len, gchar pad_char, gint base, guint64 value)
Definition: str-format.c:136
GString * value
Definition: test_decode.c:28
GString * result
Definition: test_lexer_block.c:34