GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_display_string_get.c Lines: 12 12 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
/**   System Management (System)                                          */
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
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gxe_display_string_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 display_string_get call.         */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    string_id                             String resource ID            */
49
/*    return_string                         Pointer to return string      */
50
/*                                            pointer                     */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    status                                Completion status             */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*    _gx_system_string_get                 Actual system string get call */
59
/*                                                                        */
60
/*  CALLED BY                                                             */
61
/*                                                                        */
62
/*    Application Code                                                    */
63
/*                                                                        */
64
/*  RELEASE HISTORY                                                       */
65
/*                                                                        */
66
/*    DATE              NAME                      DESCRIPTION             */
67
/*                                                                        */
68
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
69
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
70
/*                                            resulting in version 6.1    */
71
/*                                                                        */
72
/**************************************************************************/
73
#if defined(GX_ENABLE_DEPRECATED_STRING_API)
74
14
UINT  _gxe_display_string_get(GX_DISPLAY *display, GX_RESOURCE_ID string_id, GX_CONST GX_CHAR **return_string)
75
{
76
UINT status;
77
78
    /* Check for invalid caller.  */
79

14
    GX_INIT_AND_THREADS_CALLER_CHECKING
80
81
    /* Check for invalid pointer.  */
82

12
    if (display == GX_NULL || return_string == GX_NULL)
83
    {
84
5
        return(GX_PTR_ERROR);
85
    }
86
87
    /* Call actual system string get.  */
88
7
    status = _gx_display_string_get(display, string_id, return_string);
89
90
    /* Return status.  */
91
7
    return(status);
92
}
93
#endif
94
95
/**************************************************************************/
96
/*                                                                        */
97
/*  FUNCTION                                               RELEASE        */
98
/*                                                                        */
99
/*    _gxe_display_string_get_ext                         PORTABLE C      */
100
/*                                                           6.1          */
101
/*  AUTHOR                                                                */
102
/*                                                                        */
103
/*    Kenneth Maxwell, Microsoft Corporation                              */
104
/*                                                                        */
105
/*  DESCRIPTION                                                           */
106
/*                                                                        */
107
/*    This function checks for errors in display_string_get call.         */
108
/*                                                                        */
109
/*  INPUT                                                                 */
110
/*                                                                        */
111
/*    string_id                             String resource ID            */
112
/*    return_string                         Pointer to return string      */
113
/*                                            pointer                     */
114
/*                                                                        */
115
/*  OUTPUT                                                                */
116
/*                                                                        */
117
/*    status                                Completion status             */
118
/*                                                                        */
119
/*  CALLS                                                                 */
120
/*                                                                        */
121
/*    _gx_system_string_get                 Actual system string get call */
122
/*                                                                        */
123
/*  CALLED BY                                                             */
124
/*                                                                        */
125
/*    Application Code                                                    */
126
/*                                                                        */
127
/*  RELEASE HISTORY                                                       */
128
/*                                                                        */
129
/*    DATE              NAME                      DESCRIPTION             */
130
/*                                                                        */
131
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
132
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
133
/*                                            resulting in version 6.1    */
134
/*                                                                        */
135
/**************************************************************************/
136
369
UINT  _gxe_display_string_get_ext(GX_DISPLAY *display, GX_RESOURCE_ID string_id, GX_STRING *return_string)
137
{
138
UINT status;
139
140
    /* Check for invalid caller.  */
141

369
    GX_INIT_AND_THREADS_CALLER_CHECKING
142
143
    /* Check for invalid pointer.  */
144

367
    if (display == GX_NULL || return_string == GX_NULL)
145
    {
146
2
        return(GX_PTR_ERROR);
147
    }
148
149
    /* Call actual system string get.  */
150
365
    status = _gx_display_string_get_ext(display, string_id, return_string);
151
152
    /* Return status.  */
153
365
    return(status);
154
}
155