]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/import-util.h
77b17d91f3c66c47829bb226294f4984668bd5ec
[thirdparty/systemd.git] / src / shared / import-util.h
1 #pragma once
2
3 /***
4 This file is part of systemd.
5
6 Copyright 2015 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 ***/
21
22 #include <stdbool.h>
23
24 #include "macro.h"
25
26 typedef enum ImportVerify {
27 IMPORT_VERIFY_NO,
28 IMPORT_VERIFY_CHECKSUM,
29 IMPORT_VERIFY_SIGNATURE,
30 _IMPORT_VERIFY_MAX,
31 _IMPORT_VERIFY_INVALID = -1,
32 } ImportVerify;
33
34 int import_url_last_component(const char *url, char **ret);
35 int import_url_change_last_component(const char *url, const char *suffix, char **ret);
36
37 const char* import_verify_to_string(ImportVerify v) _const_;
38 ImportVerify import_verify_from_string(const char *s) _pure_;
39
40 int tar_strip_suffixes(const char *name, char **ret);
41 int raw_strip_suffixes(const char *name, char **ret);
42
43 int import_assign_pool_quota_and_warn(const char *path);