GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_display_string_table_get.c Lines: 16 16 100.0 %
Date: 2026-03-06 19:21:09 Branches: 12 12 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
/**   System Management (System)                                          */
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
/**************************************************************************/
31
/*                                                                        */
32
/*  FUNCTION                                               RELEASE        */
33
/*                                                                        */
34
/*    _gx_display_string_table_get                        PORTABLE C      */
35
/*                                                           6.1          */
36
/*  AUTHOR                                                                */
37
/*                                                                        */
38
/*    Kenneth Maxwell, Microsoft Corporation                              */
39
/*                                                                        */
40
/*  DESCRIPTION  (Deprecated)                                             */
41
/*                                                                        */
42
/*    This function returns a pointer to the display string table.        */
43
/*                                                                        */
44
/*  INPUT                                                                 */
45
/*                                                                        */
46
/*    display                               Pointer to display instance.  */
47
/*    language                              The language the string       */
48
/*                                            table is associated with    */
49
/*    get_table                             Pointer to string table       */
50
/*    get_size                              Number of strings in table    */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    status                                Completion status             */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*    None                                                                */
59
/*                                                                        */
60
/*  CALLED BY                                                             */
61
/*                                                                        */
62
/*    Application Code                                                    */
63
/*                                                                        */
64
/**************************************************************************/
65
#if defined(GX_ENABLE_DEPRECATED_STRING_API)
66
5
UINT _gx_display_string_table_get(GX_DISPLAY *display, GX_UBYTE language, GX_CHAR ***put_table, UINT *put_size)
67
{
68
5
    if(put_table)
69
    {
70
4
        if(display -> gx_display_language_table_deprecated)
71
        {
72
2
            *put_table = (GX_CHAR **)display -> gx_display_language_table_deprecated[language];
73
        }
74
        else
75
        {
76
2
            *put_table = GX_NULL;
77
        }
78
    }
79
80
5
    if(put_size)
81
    {
82
4
        *put_size = display -> gx_display_string_table_size;
83
    }
84
85
5
    return GX_SUCCESS;
86
}
87
#endif
88
89
/**************************************************************************/
90
/*                                                                        */
91
/*  FUNCTION                                               RELEASE        */
92
/*                                                                        */
93
/*    _gx_display_string_table_get_ext                    PORTABLE C      */
94
/*                                                           6.1          */
95
/*  AUTHOR                                                                */
96
/*                                                                        */
97
/*    Kenneth Maxwell, Microsoft Corporation                              */
98
/*                                                                        */
99
/*  DESCRIPTION                                                           */
100
/*                                                                        */
101
/*    This function returns a pointer to the display string table.        */
102
/*                                                                        */
103
/*  INPUT                                                                 */
104
/*                                                                        */
105
/*    display                               Pointer to display instance.  */
106
/*    language                              The language the string       */
107
/*                                            table is associated with    */
108
/*    put_table                             Pointer to string table       */
109
/*    put_size                              Number of strings in table    */
110
/*                                                                        */
111
/*  OUTPUT                                                                */
112
/*                                                                        */
113
/*    status                                Completion status             */
114
/*                                                                        */
115
/*  CALLS                                                                 */
116
/*                                                                        */
117
/*    None                                                                */
118
/*                                                                        */
119
/*  CALLED BY                                                             */
120
/*                                                                        */
121
/*    Application Code                                                    */
122
/*                                                                        */
123
/**************************************************************************/
124
3
UINT _gx_display_string_table_get_ext(GX_DISPLAY *display, GX_UBYTE language, GX_STRING **put_table, UINT *put_size)
125
{
126
3
    if (put_table)
127
    {
128
2
        if (display -> gx_display_language_table)
129
        {
130
1
            *put_table = (GX_STRING *) display -> gx_display_language_table[language];
131
        }
132
        else
133
        {
134
1
            *put_table = GX_NULL;
135
        }
136
    }
137
3
    if (put_size)
138
    {
139
2
        *put_size = display -> gx_display_string_table_size;
140
    }
141
3
    return GX_SUCCESS;
142
}
143
144