All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
exfile.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
15  */
16 #ifndef _FR_EXFILE_H
17 #define _FR_EXFILE_H
18 /**
19  * $Id: f820f161d115600712077517c92adf3ffcb90099 $
20  *
21  * @file include/exfile.h
22  * @brief API for managing concurrent file access.
23  *
24  * @copyright 2014 The FreeRADIUS server project
25  */
26 RCSIDH(exfile_h, "$Id: f820f161d115600712077517c92adf3ffcb90099 $")
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 
33 /*
34  * Multiple threads logging to one or more files.
35  */
36 typedef struct exfile_t exfile_t;
37 
38 exfile_t *exfile_init(TALLOC_CTX *ctx, uint32_t entries, uint32_t idle, bool locking);
39 int exfile_open(exfile_t *lf, char const *filename, mode_t permissions, bool append);
40 int exfile_close(exfile_t *lf, int fd);
41 int exfile_unlock(exfile_t *lf, int fd);
42 
43 #ifdef __cplusplus
44 }
45 #endif
46 #endif /* _FR_EXFILE_H */
bool locking
Definition: exfile.c:49
#define RCSIDH(h, id)
Definition: build.h:136
exfile_entry_t * entries
Definition: exfile.c:48
int exfile_open(exfile_t *lf, char const *filename, mode_t permissions, bool append)
Open a new log file, or maybe an existing one.
Definition: exfile.c:142
int exfile_close(exfile_t *lf, int fd)
Close the log file.
Definition: exfile.c:356
int exfile_unlock(exfile_t *lf, int fd)
Definition: exfile.c:382
exfile_t * exfile_init(TALLOC_CTX *ctx, uint32_t entries, uint32_t idle, bool locking)
Initialize a way for multiple threads to log to one or more files.
Definition: exfile.c:100