Debian Codegraph @

src/import/oci-util.h

raw
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3
4 #include "basic-forward.h"
5
6 bool oci_image_is_valid(const char *n);
7 int oci_registry_is_valid(const char *n);
8 bool oci_tag_is_valid(const char *n);
9
10 int oci_ref_parse(const char *ref, char **ret_registry, char **ret_image, char **ret_tag);
11
12 static inline int oci_ref_valid(const char *ref) {
13 int r;
14 r = oci_ref_parse(ref, NULL, NULL, NULL);
15 if (r == -EINVAL)
16 return false;
17 if (r < 0)
18 return r;
19 return true;
20 }
21
22 int oci_ref_normalize(char **protocol, char **registry, char **image, char **tag);
23
24 char* oci_digest_string(const struct iovec *iovec);
25
26 int oci_make_manifest_url(const char *protocol, const char *repository, const char *image, const char *tag, char **ret);
27 int oci_make_blob_url(const char *protocol, const char *repository, const char *image, const struct iovec *digest, char **ret);
28
29 Architecture go_arch_from_string(const char *s);
30
31 char* urlescape(const char *s);