GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_binres_font_load.c Lines: 4 4 100.0 %
Date: 2026-03-06 19:21:09 Branches: 6 6 100.0 %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 * Copyright (c) 2026-present Eclipse ThreadX contributors
4
 *
5
 * This program and the accompanying materials are made available under the
6
 * terms of the MIT License which is available at
7
 * https://opensource.org/licenses/MIT.
8
 *
9
 * SPDX-License-Identifier: MIT
10
 **************************************************************************/
11
12
13
/**************************************************************************/
14
/**************************************************************************/
15
/**                                                                       */
16
/** GUIX Component                                                        */
17
/**                                                                       */
18
/**   Binres Loader Management (Binres Loader)                            */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_binres_loader.h"
29
#include "gx_system.h"
30
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gxe_binres_font_load                               PORTABLE C      */
37
/*                                                           6.3.0        */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Ting Zhu, Microsoft Corporation                                     */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function checks for errors in binres font load function.       */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    root_address                          Pointer to the binary data    */
49
/*                                            memory                      */
50
/*    font_index                            Resource index of the font    */
51
/*                                            to be loaded                */
52
/*    buffer                                Pointer to the buffer to      */
53
/*                                            store the loaded font       */
54
/*    buffer_size                           Size of the buffer. It will   */
55
/*                                            be overwritten with the     */
56
/*                                            required buffer size if the */
57
/*                                            input buffer size is        */
58
/*                                            insufficient                */
59
/*                                                                        */
60
/*  OUTPUT                                                                */
61
/*                                                                        */
62
/*    status                                Completion status             */
63
/*                                                                        */
64
/*  CALLS                                                                 */
65
/*                                                                        */
66
/*    _gx_binres_font_load                  The actual binres font load   */
67
/*                                            function                    */
68
/*                                                                        */
69
/*  CALLED BY                                                             */
70
/*                                                                        */
71
/*    Application Code                                                    */
72
/*                                                                        */
73
/**************************************************************************/
74
#ifdef GX_BINARY_RESOURCE_SUPPORT
75
11
UINT _gxe_binres_font_load(GX_UBYTE *root_address, UINT font_index, GX_UBYTE *buffer, ULONG *buffer_size)
76
{
77

11
    if (root_address == GX_NULL || buffer == GX_NULL || buffer_size == GX_NULL)
78
    {
79
3
        return GX_PTR_ERROR;
80
    }
81
82
8
    return _gx_binres_font_load(root_address, font_index, buffer, buffer_size);
83
}
84
#endif