• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

saitoha / libsixel / 22260341992

21 Feb 2026 04:37PM UTC coverage: 83.606% (+0.2%) from 83.377%
22260341992

Pull #219

github

web-flow
Merge 8e40641da into 0f4b52676
Pull Request #219: loader: introduce component adapter and route backend calls

26143 of 50418 branches covered (51.85%)

169 of 185 new or added lines in 3 files covered. (91.35%)

5 existing lines in 2 files now uncovered.

46378 of 55472 relevant lines covered (83.61%)

4076346.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/src/loader-component.c
1
/*
2
 * SPDX-License-Identifier: MIT
3
 *
4
 * Copyright (c) 2025 libsixel developers. See `AUTHORS`.
5
 *
6
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7
 * of this software and associated documentation files (the "Software"), to deal
8
 * in the Software without restriction, including without limitation the rights
9
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
 * copies of the Software, and to permit persons to whom the Software is
11
 * furnished to do so, subject to the following conditions:
12
 *
13
 * The above copyright notice and this permission notice shall be included
14
 * in all copies or substantial portions of the Software.
15
 *
16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
 * SOFTWARE.
23
 */
24

25
#include "loader-component.h"
26

27
void
NEW
28
sixel_loader_component_ref(sixel_loader_component_t *component)
×
29
{
NEW
30
    if (component == NULL || component->vtbl == NULL ||
×
NEW
31
        component->vtbl->ref == NULL) {
×
32
        return;
33
    }
34

NEW
35
    component->vtbl->ref(component);
×
36
}
37

38
void
39
sixel_loader_component_unref(sixel_loader_component_t *component)
14,186✔
40
{
41
    if (component == NULL || component->vtbl == NULL ||
14,186!
42
        component->vtbl->unref == NULL) {
14,186!
43
        return;
44
    }
45

46
    component->vtbl->unref(component);
14,186✔
47
}
6,968✔
48

49
SIXELSTATUS
50
sixel_loader_component_setopt(sixel_loader_component_t *component,
85,116✔
51
                              int option,
52
                              void const *value)
53
{
54
    if (component == NULL || component->vtbl == NULL ||
85,116!
55
        component->vtbl->setopt == NULL) {
85,116!
56
        return SIXEL_BAD_ARGUMENT;
57
    }
58

59
    return component->vtbl->setopt(component, option, value);
85,116✔
60
}
41,808✔
61

62
SIXELSTATUS
63
sixel_loader_component_load(sixel_loader_component_t *component,
14,186✔
64
                            sixel_chunk_t const *chunk,
65
                            sixel_load_image_function fn_load,
66
                            void *context)
67
{
68
    if (component == NULL || component->vtbl == NULL ||
14,186!
69
        component->vtbl->load == NULL) {
14,186!
70
        return SIXEL_BAD_ARGUMENT;
71
    }
72

73
    return component->vtbl->load(component, chunk, fn_load, context);
14,186✔
74
}
6,968✔
75

76
char const *
77
sixel_loader_component_get_name(sixel_loader_component_t const *component)
28,372✔
78
{
79
    if (component == NULL || component->vtbl == NULL ||
28,372!
80
        component->vtbl->name == NULL) {
28,372!
81
        return NULL;
82
    }
83

84
    return component->vtbl->name(component);
28,372✔
85
}
13,936✔
86

87
/* emacs Local Variables:      */
88
/* emacs mode: c               */
89
/* emacs tab-width: 4          */
90
/* emacs indent-tabs-mode: nil */
91
/* emacs c-basic-offset: 4     */
92
/* emacs End:                  */
93
/* vim: set expandtab ts=4 sts=4 sw=4 : */
94
/* EOF */
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc