libalpm
Arch Linux Package Manager Library
diskspace.h
Go to the documentation of this file.
1/*
2 * diskspace.h
3 *
4 * Copyright (c) 2010-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef ALPM_DISKSPACE_H
21#define ALPM_DISKSPACE_H
22
23#if defined(HAVE_SYS_MOUNT_H)
24#include <sys/mount.h>
25#endif
26#if defined(HAVE_SYS_STATVFS_H)
27#include <sys/statvfs.h>
28#endif
29#if defined(HAVE_SYS_TYPES_H)
30#include <sys/types.h>
31#endif
32
33#include "alpm.h"
34
37 USED_INSTALL = (1 << 1),
38};
39
45
46typedef struct _alpm_mountpoint_t {
47 /* mount point information */
48 char *mount_dir;
50 /* storage for additional disk usage calculations */
51 blkcnt_t blocks_needed;
56 FSSTATSTYPE fsp;
58
59int _alpm_check_diskspace(alpm_handle_t *handle);
60int _alpm_check_downloadspace(alpm_handle_t *handle, const char *cachedir,
61 size_t num_files, const off_t *file_sizes);
62
63#endif /* ALPM_DISKSPACE_H */
char * mount_dir
Definition diskspace.h:48
FSSTATSTYPE fsp
Definition diskspace.h:56
blkcnt_t max_blocks_needed
Definition diskspace.h:52
int read_only
Definition diskspace.h:54
enum mount_used_level used
Definition diskspace.h:53
size_t mount_dir_len
Definition diskspace.h:49
blkcnt_t blocks_needed
Definition diskspace.h:51
mount_fsinfo
Definition diskspace.h:40
@ MOUNT_FSINFO_UNLOADED
Definition diskspace.h:41
@ MOUNT_FSINFO_LOADED
Definition diskspace.h:42
@ MOUNT_FSINFO_FAIL
Definition diskspace.h:43
mount_used_level
Definition diskspace.h:35
@ USED_REMOVE
Definition diskspace.h:36
@ USED_INSTALL
Definition diskspace.h:37
enum mount_fsinfo fsinfo_loaded
Definition diskspace.h:55
Definition diskspace.h:46