GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_display_string_table_get.c Lines: 16 16 100.0 %
Date: 2026-03-06 19:21:09 Branches: 20 20 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
/**   Display Management (Display)                                        */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_display.h"
29
30
/* Bring in externs for caller checking code.  */
31
GX_CALLER_CHECKING_EXTERNS
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gxe_display_string_table_get                       PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function checks for errors in the display string table get     */
45
/*    function call                                                       */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    display                               Pointer to display instance.  */
50
/*    language                              The language the string       */
51
/*                                            table is associated with    */
52
/*    get_table                             Pointer to string table       */
53
/*    get_size                              Number of strings in table    */
54
/*                                                                        */
55
/*  OUTPUT                                                                */
56
/*                                                                        */
57
/*    status                                Completion status             */
58
/*                                                                        */
59
/*  CALLS                                                                 */
60
/*                                                                        */
61
/*    _gx_display_string_table_get         Actual display string table    */
62
/*                                            get routine                 */
63
/*                                                                        */
64
/*  CALLED BY                                                             */
65
/*                                                                        */
66
/*    Application Code                                                    */
67
/*                                                                        */
68
/**************************************************************************/
69
#if defined(GX_ENABLE_DEPRECATED_STRING_API)
70
11
UINT _gxe_display_string_table_get(GX_DISPLAY *display, GX_UBYTE language, GX_CHAR ***put_table, UINT *put_size)
71
{
72
UINT status;
73
74
    /* Check for appropriate caller.  */
75

11
    GX_INIT_AND_THREADS_CALLER_CHECKING
76
77
9
    if (display == GX_NULL)
78
    {
79
3
        return GX_PTR_ERROR;
80
    }
81
82
6
    if (language >= display -> gx_display_language_table_size)
83
    {
84
2
        return GX_NOT_FOUND;
85
    }
86
87
    /* Call actual string table get function */
88
4
    status = _gx_display_string_table_get(display, language,
89
                                          put_table, put_size);
90
4
    return status;
91
}
92
#endif
93
94
/**************************************************************************/
95
/*                                                                        */
96
/*  FUNCTION                                               RELEASE        */
97
/*                                                                        */
98
/*    _gxe_display_string_table_get_ext                   PORTABLE C      */
99
/*                                                           6.1          */
100
/*  AUTHOR                                                                */
101
/*                                                                        */
102
/*    Kenneth Maxwell, Microsoft Corporation                              */
103
/*                                                                        */
104
/*  DESCRIPTION                                                           */
105
/*                                                                        */
106
/*    This function checks for errors in the display string table get     */
107
/*    function call                                                       */
108
/*                                                                        */
109
/*  INPUT                                                                 */
110
/*                                                                        */
111
/*    display                               Pointer to display instance.  */
112
/*    language                              The language the string       */
113
/*                                            table is associated with    */
114
/*    get_table                             Pointer to string table       */
115
/*    get_size                              Number of strings in table    */
116
/*                                                                        */
117
/*  OUTPUT                                                                */
118
/*                                                                        */
119
/*    status                                Completion status             */
120
/*                                                                        */
121
/*  CALLS                                                                 */
122
/*                                                                        */
123
/*    _gx_display_string_table_get         Actual display string table    */
124
/*                                            get routine                 */
125
/*                                                                        */
126
/*  CALLED BY                                                             */
127
/*                                                                        */
128
/*    Application Code                                                    */
129
/*                                                                        */
130
/**************************************************************************/
131
7
UINT _gxe_display_string_table_get_ext(GX_DISPLAY *display, GX_UBYTE language, GX_STRING **put_table, UINT *put_size)
132
{
133
UINT status;
134
135
    /* Check for appropriate caller.  */
136

7
    GX_INIT_AND_THREADS_CALLER_CHECKING
137
138
5
    if (display == GX_NULL)
139
    {
140
1
        return GX_PTR_ERROR;
141
    }
142
143
4
    if (language >= display -> gx_display_language_table_size)
144
    {
145
1
        return GX_NOT_FOUND;
146
    }
147
148
    /* Call actual string table get function */
149
3
    status = _gx_display_string_table_get_ext(display, language,
150
                                              put_table, put_size);
151
3
    return status;
152
}
153