GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_prompt_text_get.c Lines: 14 14 100.0 %
Date: 2026-03-06 19:21:09 Branches: 8 8 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
/**   Prompt Management (Prompt)                                          */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_system.h"
29
#include "gx_prompt.h"
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gxe_prompt_text_get                                PORTABLE C      */
36
/*                                                           6.1          */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Kenneth Maxwell, Microsoft Corporation                              */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This function checks errors in the prompt text get function.        */
44
/*                                                                        */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    prompt                          Pointer to prompt widget            */
49
/*                                      control block                     */
50
/*    return_text                     Pointer to destination for text     */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    status                          Completion status                   */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*    _gx_prompt_text_get             The actual function                 */
59
/*                                                                        */
60
/*  CALLED BY                                                             */
61
/*                                                                        */
62
/*    Application Code                                                    */
63
/*                                                                        */
64
/**************************************************************************/
65
#if defined(GX_ENABLE_DEPRECATED_STRING_API)
66
5
UINT _gxe_prompt_text_get(GX_PROMPT *prompt, GX_CONST GX_CHAR **return_text)
67
{
68
UINT status;
69
70
    /* Check error for valid pointer. */
71
5
    if (prompt == GX_NULL)
72
    {
73
2
        return(GX_PTR_ERROR);
74
    }
75
76
    /* Check for invalid widget.  */
77
3
    if (prompt -> gx_widget_type == 0)
78
    {
79
1
        return(GX_INVALID_WIDGET);
80
    }
81
82
    /* Call the actual function.  */
83
2
    status = _gx_prompt_text_get(prompt, return_text);
84
85
    /* Return completion status.  */
86
2
    return(status);
87
}
88
#endif
89
90
/**************************************************************************/
91
/*                                                                        */
92
/*  FUNCTION                                               RELEASE        */
93
/*                                                                        */
94
/*    _gxe_prompt_text_get_ext                            PORTABLE C      */
95
/*                                                           6.1          */
96
/*  AUTHOR                                                                */
97
/*                                                                        */
98
/*    Kenneth Maxwell, Microsoft Corporation                              */
99
/*                                                                        */
100
/*  DESCRIPTION                                                           */
101
/*                                                                        */
102
/*    This function checks errors in the prompt text get function.        */
103
/*                                                                        */
104
/*                                                                        */
105
/*  INPUT                                                                 */
106
/*                                                                        */
107
/*    prompt                          Pointer to prompt widget            */
108
/*                                      control block                     */
109
/*    return_text                     Pointer to destination for text     */
110
/*                                                                        */
111
/*  OUTPUT                                                                */
112
/*                                                                        */
113
/*    status                          Completion status                   */
114
/*                                                                        */
115
/*  CALLS                                                                 */
116
/*                                                                        */
117
/*    _gx_prompt_text_get_ext         The actual function                 */
118
/*                                                                        */
119
/*  CALLED BY                                                             */
120
/*                                                                        */
121
/*    Application Code                                                    */
122
/*                                                                        */
123
/**************************************************************************/
124
6
UINT _gxe_prompt_text_get_ext(GX_PROMPT *prompt, GX_STRING *return_text)
125
{
126
UINT status;
127
128
    /* Check error for valid pointer. */
129
6
    if (prompt == GX_NULL)
130
    {
131
2
        return(GX_PTR_ERROR);
132
    }
133
134
    /* Check for invalid widget.  */
135
4
    if (prompt -> gx_widget_type == 0)
136
    {
137
1
        return(GX_INVALID_WIDGET);
138
    }
139
140
    /* Call the actual function.  */
141
3
    status = _gx_prompt_text_get_ext(prompt, return_text);
142
143
    /* Return completion status.  */
144
3
    return(status);
145
}
146