/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "alloc-util.h"
#include "analyze.h"
#include "analyze-pcrs.h"
#include "fileio.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "alloc-util.h"
#include "analyze.h"
#include "analyze-srk.h"
#include "fileio.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "alloc-util.h"
#include "iovec-util.h"
#include "string-util.h"
return true;
}
+struct iovec* iovec_make_string(struct iovec *iovec, const char *s) {
+ assert(iovec);
+
+ *iovec = IOVEC_MAKE(s, strlen_ptr(s));
+ return iovec;
+}
+
+void iovec_done_erase(struct iovec *iovec) {
+ assert(iovec);
+
+ iovec->iov_base = erase_and_free(iovec->iov_base);
+ iovec->iov_len = 0;
+}
+
char* set_iovec_string_field(struct iovec *iovec, size_t *n_iovec, const char *field, const char *value) {
char *x;
free(iovec);
}
+int iovec_memcmp(const struct iovec *a, const struct iovec *b) {
+
+ if (a == b)
+ return 0;
+
+ return memcmp_nn(a ? a->iov_base : NULL,
+ a ? a->iov_len : 0,
+ b ? b->iov_base : NULL,
+ b ? b->iov_len : 0);
+}
+
+struct iovec* iovec_memdup(const struct iovec *source, struct iovec *ret) {
+ assert(ret);
+
+ if (!iovec_is_set(source))
+ *ret = (struct iovec) {};
+ else {
+ void *p = memdup(source->iov_base, source->iov_len);
+ if (!p)
+ return NULL;
+
+ *ret = IOVEC_MAKE(p, source->iov_len);
+ }
+
+ return ret;
+}
+
struct iovec* iovec_append(struct iovec *iovec, const struct iovec *append) {
assert(iovec_is_valid(iovec));
#include <sys/types.h>
#include <sys/uio.h>
-#include "alloc-util.h"
#include "iovec-util-fundamental.h"
#include "macro.h"
bool iovec_increment(struct iovec *iovec, size_t n, size_t k) _nonnull_if_nonzero_(1, 2);
-static inline struct iovec* iovec_make_string(struct iovec *iovec, const char *s) {
- assert(iovec);
- /* We don't use strlen_ptr() here, because we don't want to include string-util.h for now */
- *iovec = IOVEC_MAKE(s, s ? strlen(s) : 0);
- return iovec;
-}
+struct iovec* iovec_make_string(struct iovec *iovec, const char *s);
#define IOVEC_MAKE_STRING(s) \
*iovec_make_string(&(struct iovec) {}, s)
.iov_len = STRLEN(s), \
}
-static inline void iovec_done_erase(struct iovec *iovec) {
- assert(iovec);
-
- iovec->iov_base = erase_and_free(iovec->iov_base);
- iovec->iov_len = 0;
-}
+void iovec_done_erase(struct iovec *iovec);
char* set_iovec_string_field(struct iovec *iovec, size_t *n_iovec, const char *field, const char *value);
char* set_iovec_string_field_free(struct iovec *iovec, size_t *n_iovec, const char *field, char *value);
void iovec_array_free(struct iovec *iovec, size_t n_iovec) _nonnull_if_nonzero_(1, 2);
-static inline int iovec_memcmp(const struct iovec *a, const struct iovec *b) {
-
- if (a == b)
- return 0;
-
- return memcmp_nn(a ? a->iov_base : NULL,
- a ? a->iov_len : 0,
- b ? b->iov_base : NULL,
- b ? b->iov_len : 0);
-}
-
-static inline struct iovec* iovec_memdup(const struct iovec *source, struct iovec *ret) {
- assert(ret);
-
- if (!iovec_is_set(source))
- *ret = (struct iovec) {};
- else {
- void *p = memdup(source->iov_base, source->iov_len);
- if (!p)
- return NULL;
-
- *ret = IOVEC_MAKE(p, source->iov_len);
- }
+int iovec_memcmp(const struct iovec *a, const struct iovec *b) _pure_;
- return ret;
-}
+struct iovec* iovec_memdup(const struct iovec *source, struct iovec *ret);
struct iovec* iovec_append(struct iovec *iovec, const struct iovec *append);
#include <threads.h>
+#include "alloc-util.h"
#include "env-util.h"
#include "iovec-util.h"
#include "log.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "alloc-util.h"
#include "bootctl.h"
#include "bootctl-install.h"
#include "bootctl-random-seed.h"
#include <uchar.h>
#include <unistd.h>
+#include "alloc-util.h"
#include "bootctl.h"
#include "bootctl-set-efivar.h"
#include "efi-loader.h"
#include <sys/mman.h>
#include <unistd.h>
+#include "alloc-util.h"
#include "bootctl.h"
#include "bootctl-status.h"
#include "bootctl-util.h"
#include <sys/mman.h>
+#include "alloc-util.h"
#include "bootctl.h"
#include "bootctl-util.h"
#include "errno-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "alloc-util.h"
#include "cryptsetup-keyfile.h"
#include "fileio.h"
#include "log.h"
#include <libcryptsetup.h>
#include <string.h>
+#include "alloc-util.h"
#include "cryptsetup-token.h"
#include "cryptsetup-token-util.h"
#include "hexdecoct.h"
#include <errno.h>
#include <libcryptsetup.h>
+#include "alloc-util.h"
#include "cryptsetup-token.h"
#include "cryptsetup-token-util.h"
#include "hexdecoct.h"
#include <libcryptsetup.h>
+#include "alloc-util.h"
#include "cryptsetup-token-util.h"
#include "hexdecoct.h"
#include "json-util.h"
#include <fido.h>
#endif
+#include "alloc-util.h"
#include "ask-password-api.h"
#include "errno-util.h"
#include "fido2-util.h"
#include <openssl/pem.h>
+#include "alloc-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "json-util.h"
#include <netinet/icmp6.h>
+#include "alloc-util.h"
#include "icmp6-packet.h"
#include "icmp6-util.h"
#include "in-addr-util.h"
#include <linux/ipv6.h>
#include <netinet/icmp6.h>
+#include "alloc-util.h"
#include "dns-domain.h"
#include "dns-resolver-internal.h"
#include "ether-addr-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "alloc-util.h"
#include "dhcp-server-lease-internal.h"
#include "fd-util.h"
#include "fs-util.h"
#include "sd-netlink.h"
+#include "alloc-util.h"
#include "iovec-util.h"
#include "log.h"
#include "netlink-internal.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "af-list.h"
+#include "alloc-util.h"
#include "daemon-util.h"
#include "fd-util.h"
#include "fileio.h"
#include <openssl/err.h>
#include <openssl/x509v3.h>
+#include "alloc-util.h"
#include "io-util.h"
#include "openssl-util.h"
#include "resolved-dns-server.h"
#include <fnmatch.h>
#include <unistd.h>
+#include "alloc-util.h"
#include "bootspec.h"
#include "bootspec-fundamental.h"
#include "chase.h"
#include "sd-json.h"
#include "sd-varlink.h"
+#include "alloc-util.h"
#include "blockdev-util.h"
#include "capability-util.h"
#include "chattr-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "alloc-util.h"
#include "fido2-util.h"
#include "fileio.h"
#include "libfido2-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "alloc-util.h"
#include "env-file.h"
#include "fd-util.h"
#include "fileio.h"
#include "ask-password-api.h"
#include "iovec-util.h"
-#include "macro.h"
+#include "memory-util.h"
#include "sha256.h"
typedef enum CertificateSourceType {
#include <fcntl.h>
+#include "alloc-util.h"
#include "ask-password-api.h"
#include "dlfcn-util.h"
#include "env-util.h"