syslog-ng source
logrotate.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025 Alexander Zikulnig
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 LOGROTATE_H_INCLUDED
24 #define LOGROTATE_H_INCLUDED
25 
26 #include "syslog-ng.h"
27 #include <logproto/logproto.h>
28 #include "messages.h"
29 
30 typedef enum
31 {
34 
35 typedef struct _LogRotateOptions
36 {
37  gboolean enable;
38  gsize size;
40  gboolean pending;
42 
43 gboolean logrotate_is_enabled(LogRotateOptions *logrotate_options);
44 gboolean logrotate_is_required(LogRotateOptions *logrotate_options, const gsize filesize);
45 gboolean logrotate_is_pending(LogRotateOptions *logrotate_options);
46 void logrotate_options_defaults(LogRotateOptions *logrotate_options);
47 LogRotateStatus logrotate_do_rotate(LogRotateOptions *logrotate_options, const gchar *filename);
48 
49 #endif
LogRotateStatus
Definition: logrotate.h:31
@ LR_SUCCESS
Definition: logrotate.h:32
@ LR_ERROR
Definition: logrotate.h:32
LogRotateStatus logrotate_do_rotate(LogRotateOptions *logrotate_options, const gchar *filename)
Definition: logrotate.c:146
gboolean logrotate_is_required(LogRotateOptions *logrotate_options, const gsize filesize)
Definition: logrotate.c:47
gboolean logrotate_is_enabled(LogRotateOptions *logrotate_options)
Definition: logrotate.c:42
void logrotate_options_defaults(LogRotateOptions *logrotate_options)
Definition: logrotate.c:34
gboolean logrotate_is_pending(LogRotateOptions *logrotate_options)
Definition: logrotate.c:52
Definition: logrotate.h:36
gboolean pending
Definition: logrotate.h:40
gboolean enable
Definition: logrotate.h:37
gsize size
Definition: logrotate.h:38
gsize max_rotations
Definition: logrotate.h:39