GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_display_string_table_get.c Lines: 16 16 100.0 %
Date: 2024-12-05 08:52:37 Branches: 20 20 100.0 %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 *
4
 * This program and the accompanying materials are made available under the
5
 * terms of the MIT License which is available at
6
 * https://opensource.org/licenses/MIT.
7
 *
8
 * SPDX-License-Identifier: MIT
9
 **************************************************************************/
10
11
12
/**************************************************************************/
13
/**************************************************************************/
14
/**                                                                       */
15
/** GUIX Component                                                        */
16
/**                                                                       */
17
/**   Display Management (Display)                                        */
18
/**                                                                       */
19
/**************************************************************************/
20
21
#define GX_SOURCE_CODE
22
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_display.h"
28
29
/* Bring in externs for caller checking code.  */
30
GX_CALLER_CHECKING_EXTERNS
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gxe_display_string_table_get                       PORTABLE C      */
36
/*                                                           6.1          */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Kenneth Maxwell, Microsoft Corporation                              */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This function checks for errors in the display string table get     */
44
/*    function call                                                       */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    display                               Pointer to display instance.  */
49
/*    language                              The language the string       */
50
/*                                            table is associated with    */
51
/*    get_table                             Pointer to string table       */
52
/*    get_size                              Number of strings in table    */
53
/*                                                                        */
54
/*  OUTPUT                                                                */
55
/*                                                                        */
56
/*    status                                Completion status             */
57
/*                                                                        */
58
/*  CALLS                                                                 */
59
/*                                                                        */
60
/*    _gx_display_string_table_get         Actual display string table    */
61
/*                                            get routine                 */
62
/*                                                                        */
63
/*  CALLED BY                                                             */
64
/*                                                                        */
65
/*    Application Code                                                    */
66
/*                                                                        */
67
/*  RELEASE HISTORY                                                       */
68
/*                                                                        */
69
/*    DATE              NAME                      DESCRIPTION             */
70
/*                                                                        */
71
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
72
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
73
/*                                            resulting in version 6.1    */
74
/*                                                                        */
75
/**************************************************************************/
76
#if defined(GX_ENABLE_DEPRECATED_STRING_API)
77
11
UINT _gxe_display_string_table_get(GX_DISPLAY *display, GX_UBYTE language, GX_CHAR ***put_table, UINT *put_size)
78
{
79
UINT status;
80
81
    /* Check for appropriate caller.  */
82

11
    GX_INIT_AND_THREADS_CALLER_CHECKING
83
84
9
    if (display == GX_NULL)
85
    {
86
3
        return GX_PTR_ERROR;
87
    }
88
89
6
    if (language >= display -> gx_display_language_table_size)
90
    {
91
2
        return GX_NOT_FOUND;
92
    }
93
94
    /* Call actual string table get function */
95
4
    status = _gx_display_string_table_get(display, language,
96
                                          put_table, put_size);
97
4
    return status;
98
}
99
#endif
100
101
/**************************************************************************/
102
/*                                                                        */
103
/*  FUNCTION                                               RELEASE        */
104
/*                                                                        */
105
/*    _gxe_display_string_table_get_ext                   PORTABLE C      */
106
/*                                                           6.1          */
107
/*  AUTHOR                                                                */
108
/*                                                                        */
109
/*    Kenneth Maxwell, Microsoft Corporation                              */
110
/*                                                                        */
111
/*  DESCRIPTION                                                           */
112
/*                                                                        */
113
/*    This function checks for errors in the display string table get     */
114
/*    function call                                                       */
115
/*                                                                        */
116
/*  INPUT                                                                 */
117
/*                                                                        */
118
/*    display                               Pointer to display instance.  */
119
/*    language                              The language the string       */
120
/*                                            table is associated with    */
121
/*    get_table                             Pointer to string table       */
122
/*    get_size                              Number of strings in table    */
123
/*                                                                        */
124
/*  OUTPUT                                                                */
125
/*                                                                        */
126
/*    status                                Completion status             */
127
/*                                                                        */
128
/*  CALLS                                                                 */
129
/*                                                                        */
130
/*    _gx_display_string_table_get         Actual display string table    */
131
/*                                            get routine                 */
132
/*                                                                        */
133
/*  CALLED BY                                                             */
134
/*                                                                        */
135
/*    Application Code                                                    */
136
/*                                                                        */
137
/*  RELEASE HISTORY                                                       */
138
/*                                                                        */
139
/*    DATE              NAME                      DESCRIPTION             */
140
/*                                                                        */
141
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
142
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
143
/*                                            resulting in version 6.1    */
144
/*                                                                        */
145
/**************************************************************************/
146
7
UINT _gxe_display_string_table_get_ext(GX_DISPLAY *display, GX_UBYTE language, GX_STRING **put_table, UINT *put_size)
147
{
148
UINT status;
149
150
    /* Check for appropriate caller.  */
151

7
    GX_INIT_AND_THREADS_CALLER_CHECKING
152
153
5
    if (display == GX_NULL)
154
    {
155
1
        return GX_PTR_ERROR;
156
    }
157
158
4
    if (language >= display -> gx_display_language_table_size)
159
    {
160
1
        return GX_NOT_FOUND;
161
    }
162
163
    /* Call actual string table get function */
164
3
    status = _gx_display_string_table_get_ext(display, language,
165
                                              put_table, put_size);
166
3
    return status;
167
}
168