GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_numeric_prompt_create.c Lines: 10 10 100.0 %
Date: 2026-03-06 19:21:09 Branches: 14 14 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
/**   Numeric 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_widget.h"
29
#include "gx_numeric_prompt.h"
30
#include "gx_system.h"
31
32
/* Bring in externs for caller checking code.  */
33
GX_CALLER_CHECKING_EXTERNS
34
35
/**************************************************************************/
36
/*                                                                        */
37
/*  FUNCTION                                               RELEASE        */
38
/*                                                                        */
39
/*    _gxe_numeric_prompt_create                          PORTABLE C      */
40
/*                                                           6.1          */
41
/*  AUTHOR                                                                */
42
/*                                                                        */
43
/*    Kenneth Maxwell, Microsoft Corporation                              */
44
/*                                                                        */
45
/*  DESCRIPTION                                                           */
46
/*                                                                        */
47
/*    This function checks errors in numeric prompt create function.      */
48
/*                                                                        */
49
/*  INPUT                                                                 */
50
/*                                                                        */
51
/*    prompt                                Numeric prompt control block  */
52
/*    name                                  Name of numeric prompt        */
53
/*    parent                                Parent widget control block   */
54
/*    text_id                               Resource string id            */
55
/*    style                                 Style of numeric prompt       */
56
/*    prompt_id                             Application-defined ID of     */
57
/*                                            Numeric prompt.             */
58
/*    size                                  Numeric prompt size           */
59
/*    control_block_size                    The size of the widget control*/
60
/*                                            structure in bytes          */
61
/*                                                                        */
62
/*  OUTPUT                                                                */
63
/*                                                                        */
64
/*    status                                Completion status             */
65
/*                                                                        */
66
/*  CALLS                                                                 */
67
/*                                                                        */
68
/*   _gx_numeric_prompt_create              Actual numeric prompt create  */
69
/*                                            call                        */
70
/*                                                                        */
71
/*  CALLED BY                                                             */
72
/*                                                                        */
73
/*    Application Code                                                    */
74
/*                                                                        */
75
/**************************************************************************/
76
1697
UINT  _gxe_numeric_prompt_create(GX_NUMERIC_PROMPT *prompt, GX_CONST GX_CHAR *name, GX_WIDGET *parent,
77
                                GX_RESOURCE_ID text_id, ULONG style, USHORT prompt_id, GX_CONST GX_RECTANGLE *size,
78
                                UINT control_block_size)
79
{
80
81
UINT status;
82
83
    /* Check for appropriate caller.  */
84

1697
    GX_INIT_AND_THREADS_CALLER_CHECKING
85
86
    /* Check error for valid pointer. */
87

1695
    if ((prompt == GX_NULL) || (size == GX_NULL))
88
    {
89
2
        return(GX_PTR_ERROR);
90
    }
91
92
    /* Check for widget already created.  */
93
1693
    if (prompt -> gx_widget_type != 0)
94
    {
95
1
        return(GX_ALREADY_CREATED);
96
    }
97
98
1692
    if (control_block_size != sizeof(GX_NUMERIC_PROMPT))
99
    {
100
1
        return(GX_INVALID_SIZE);
101
    }
102
103
    /* Call actual number prompt create. */
104
1691
    status = _gx_numeric_prompt_create(prompt, name, parent, text_id, style, prompt_id, size);
105
106
1691
    return(status);
107
}
108