Coverage Report

Created: 2025-07-09 06:39

/src/systemd/src/basic/iovec-wrapper.h
Line
Count
Source (jump to first uncovered line)
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2
#pragma once
3
4
#include "forward.h"
5
6
struct iovec_wrapper {
7
        struct iovec *iovec;
8
        size_t count;
9
};
10
11
struct iovec_wrapper *iovw_new(void);
12
struct iovec_wrapper *iovw_free(struct iovec_wrapper *iovw);
13
struct iovec_wrapper *iovw_free_free(struct iovec_wrapper *iovw);
14
15
DEFINE_TRIVIAL_CLEANUP_FUNC(struct iovec_wrapper*, iovw_free_free);
16
17
void iovw_done_free(struct iovec_wrapper *iovw);
18
void iovw_done(struct iovec_wrapper *iovw);
19
20
int iovw_put(struct iovec_wrapper *iovw, void *data, size_t len);
21
0
static inline int iovw_consume(struct iovec_wrapper *iovw, void *data, size_t len) {
22
        /* Move data into iovw or free on error */
23
0
        int r;
24
25
0
        r = iovw_put(iovw, data, len);
26
0
        if (r < 0)
27
0
                free(data);
28
29
0
        return r;
30
0
}
Unexecuted instantiation: journald-native.c:iovw_consume
Unexecuted instantiation: journal-remote-parse.c:iovw_consume
Unexecuted instantiation: journal-remote-write.c:iovw_consume
Unexecuted instantiation: journal-remote.c:iovw_consume
Unexecuted instantiation: fuzz-journal-remote.c:iovw_consume
Unexecuted instantiation: journal-importer.c:iovw_consume
Unexecuted instantiation: iovec-wrapper.c:iovw_consume
31
32
937k
static inline bool iovw_isempty(const struct iovec_wrapper *iovw) {
33
937k
        return !iovw || iovw->count == 0;
34
937k
}
Unexecuted instantiation: journald-native.c:iovw_isempty
Unexecuted instantiation: journal-remote-parse.c:iovw_isempty
journal-remote-write.c:iovw_isempty
Line
Count
Source
32
937k
static inline bool iovw_isempty(const struct iovec_wrapper *iovw) {
33
937k
        return !iovw || iovw->count == 0;
34
937k
}
Unexecuted instantiation: journal-remote.c:iovw_isempty
Unexecuted instantiation: fuzz-journal-remote.c:iovw_isempty
Unexecuted instantiation: journal-importer.c:iovw_isempty
Unexecuted instantiation: iovec-wrapper.c:iovw_isempty
35
36
int iovw_put_string_field(struct iovec_wrapper *iovw, const char *field, const char *value);
37
int iovw_put_string_field_free(struct iovec_wrapper *iovw, const char *field, char *value);
38
void iovw_rebase(struct iovec_wrapper *iovw, void *old, void *new);
39
size_t iovw_size(const struct iovec_wrapper *iovw);
40
int iovw_append(struct iovec_wrapper *target, const struct iovec_wrapper *source);