GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_widget_string_get.c Lines: 16 16 100.0 %
Date: 2026-03-06 19:21:09 Branches: 24 24 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
/**   Widget Management (Widget)                                          */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_widget.h"
28
29
/* Bring in externs for caller checking code.  */
30
GX_CALLER_CHECKING_EXTERNS
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gxe_widget_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 widget_string_get call.          */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    widget                                called widget control block   */
49
/*    string_id                             String resource ID            */
50
/*    return_string                         Pointer to string             */
51
/*                                            destination pointer         */
52
/*                                                                        */
53
/*  OUTPUT                                                                */
54
/*                                                                        */
55
/*    status                                Completion status             */
56
/*                                                                        */
57
/*  CALLS                                                                 */
58
/*                                                                        */
59
/*    _gx_widget_string_get                 Actual widget string get      */
60
/*                                            call                        */
61
/*                                                                        */
62
/*  CALLED BY                                                             */
63
/*                                                                        */
64
/*    Application Code                                                    */
65
/*                                                                        */
66
/**************************************************************************/
67
#if defined(GX_ENABLE_DEPRECATED_STRING_API)
68
11
UINT  _gxe_widget_string_get(GX_WIDGET *widget, GX_RESOURCE_ID resource_id, GX_CONST GX_CHAR **return_string)
69
{
70
UINT status;
71
72
    /* Check for appropriate caller.  */
73

11
    GX_INIT_AND_THREADS_CALLER_CHECKING
74
75
    /* Check for invalid pointer.  */
76

9
    if (return_string == GX_NULL || widget == GX_NULL)
77
    {
78
2
        return(GX_PTR_ERROR);
79
    }
80
81
    /* Check for invalid widget.*/
82
7
    if (widget -> gx_widget_type == 0)
83
    {
84
1
        return(GX_INVALID_WIDGET);
85
    }
86
87
    /* Call actual system pixelmap get.  */
88
6
    status = _gx_widget_string_get(widget, resource_id, return_string);
89
90
    /* Return status.  */
91
6
    return(status);
92
}
93
#endif
94
95
/**************************************************************************/
96
/*                                                                        */
97
/*  FUNCTION                                               RELEASE        */
98
/*                                                                        */
99
/*    _gxe_widget_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 widget_string_get_ext call.      */
108
/*                                                                        */
109
/*  INPUT                                                                 */
110
/*                                                                        */
111
/*    widget                                called widget control block   */
112
/*    string_id                             String resource ID            */
113
/*    return_string                         Pointer to string             */
114
/*                                            destination pointer         */
115
/*                                                                        */
116
/*  OUTPUT                                                                */
117
/*                                                                        */
118
/*    status                                Completion status             */
119
/*                                                                        */
120
/*  CALLS                                                                 */
121
/*                                                                        */
122
/*    _gx_widget_string_get_ext             Actual widget string get      */
123
/*                                            call                        */
124
/*                                                                        */
125
/*  CALLED BY                                                             */
126
/*                                                                        */
127
/*    Application Code                                                    */
128
/*                                                                        */
129
/**************************************************************************/
130
110
UINT    _gxe_widget_string_get_ext(GX_WIDGET *widget, GX_RESOURCE_ID string_id, GX_STRING *return_string)
131
{
132
UINT status;
133
134
    /* Check for appropriate caller.  */
135

110
    GX_INIT_AND_THREADS_CALLER_CHECKING
136
137
    /* Check for invalid pointer.  */
138

108
    if (return_string == GX_NULL || widget == GX_NULL)
139
    {
140
2
        return(GX_PTR_ERROR);
141
    }
142
143
    /* Check for invalid widget.*/
144
106
    if (widget -> gx_widget_type == 0)
145
    {
146
1
        return(GX_INVALID_WIDGET);
147
    }
148
149
    /* Call actual system pixelmap get.  */
150
105
    status = _gx_widget_string_get_ext(widget, string_id, return_string);
151
152
    /* Return status.  */
153
105
    return(status);
154
}
155