| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "basic-forward.h" |
| 5 |
#include "stat-util.h" |
| 6 |
|
| 7 |
#define FILESYSTEM_MAGIC_MAX 10 |
| 8 |
|
| 9 |
typedef enum FilesystemGroups { |
| 10 |
/* Please leave BASIC_API first and KNOWN last, but sort the rest alphabetically */ |
| 11 |
FILESYSTEM_SET_BASIC_API, |
| 12 |
FILESYSTEM_SET_ANONYMOUS, |
| 13 |
FILESYSTEM_SET_APPLICATION, |
| 14 |
FILESYSTEM_SET_AUXILIARY_API, |
| 15 |
FILESYSTEM_SET_COMMON_BLOCK, |
| 16 |
FILESYSTEM_SET_HISTORICAL_BLOCK, |
| 17 |
FILESYSTEM_SET_NETWORK, |
| 18 |
FILESYSTEM_SET_PRIVILEGED_API, |
| 19 |
FILESYSTEM_SET_SECURITY, |
| 20 |
FILESYSTEM_SET_TEMPORARY, |
| 21 |
FILESYSTEM_SET_KNOWN, |
| 22 |
_FILESYSTEM_SET_MAX, |
| 23 |
_FILESYSTEM_SET_INVALID = -EINVAL, |
| 24 |
} FilesystemGroups; |
| 25 |
|
| 26 |
typedef struct FilesystemSet { |
| 27 |
const char *name; |
| 28 |
const char *help; |
| 29 |
const char *value; |
| 30 |
} FilesystemSet; |
| 31 |
|
| 32 |
extern const FilesystemSet filesystem_sets[]; |
| 33 |
|
| 34 |
const FilesystemSet *filesystem_set_find(const char *name); |
| 35 |
|
| 36 |
const char* fs_type_to_string(statfs_f_type_t magic); |
| 37 |
int fs_type_from_string(const char *name, const statfs_f_type_t **ret); |
| 38 |
bool fs_in_group(const struct statfs *s, enum FilesystemGroups fs_group); |
| 39 |
|
| 40 |
/* gperf prototypes */ |
| 41 |
const struct FilesystemMagic* filesystems_gperf_lookup(const char *str, GPERF_LEN_TYPE length); |