dpkg 1.21.11
atomic-file.h
Go to the documentation of this file.
1/*
2 * libdpkg - Debian packaging suite library routines
3 * atomic-file.h - atomic file helper functions
4 *
5 * Copyright © 2011-2014 Guillem Jover <guillem@debian.org>
6 *
7 * This is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef LIBDPKG_ATOMIC_FILE_H
22#define LIBDPKG_ATOMIC_FILE_H
23
24#include <stdio.h>
25
26#include <dpkg/macros.h>
27
29
40};
41
44 char *name;
45 char *name_new;
46 FILE *fp;
47};
48
49struct atomic_file *
50atomic_file_new(const char *filename, enum atomic_file_flags flags);
57
61
62#endif /* LIBDPKG_ATOMIC_FILE_H */
atomic_file_flags
Definition: atomic-file.h:36
void atomic_file_free(struct atomic_file *file)
Definition: atomic-file.c:127
void atomic_file_close(struct atomic_file *file)
Definition: atomic-file.c:84
struct atomic_file * atomic_file_new(const char *filename, enum atomic_file_flags flags)
Definition: atomic-file.c:40
void atomic_file_remove(struct atomic_file *file)
Definition: atomic-file.c:108
void atomic_file_open(struct atomic_file *file)
Definition: atomic-file.c:54
void atomic_file_sync(struct atomic_file *file)
Definition: atomic-file.c:73
void atomic_file_commit(struct atomic_file *file)
Definition: atomic-file.c:117
@ ATOMIC_FILE_MKPATH
Definition: atomic-file.h:39
@ ATOMIC_FILE_NORMAL
Definition: atomic-file.h:37
@ ATOMIC_FILE_BACKUP
Definition: atomic-file.h:38
#define DPKG_BEGIN_DECLS
Definition: macros.h:86
#define DPKG_END_DECLS
Definition: macros.h:87
#define DPKG_BIT(n)
Return the integer value of bit n.
Definition: macros.h:125
Definition: atomic-file.h:42
char * name_new
Definition: atomic-file.h:45
enum atomic_file_flags flags
Definition: atomic-file.h:43
FILE * fp
Definition: atomic-file.h:46
char * name
Definition: atomic-file.h:44
Definition: main.c:133