GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_multi_line_text_input_create.c Lines: 12 12 100.0 %
Date: 2026-03-06 19:21:09 Branches: 18 18 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
/**   Multi Line Text Input Management (Multi Line Text)                  */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_multi_line_text_input.h"
29
#include "gx_multi_line_text_view.h"
30
31
/* Bring in externs for caller checking code.  */
32
GX_CALLER_CHECKING_EXTERNS
33
34
/**************************************************************************/
35
/*                                                                        */
36
/*  FUNCTION                                               RELEASE        */
37
/*                                                                        */
38
/*    _gxe_multi_line_text_input_create                   PORTABLE C      */
39
/*                                                           6.1.3        */
40
/*  AUTHOR                                                                */
41
/*                                                                        */
42
/*    Kenneth Maxwell, Microsoft Corporation                              */
43
/*                                                                        */
44
/*  DESCRIPTION                                                           */
45
/*                                                                        */
46
/*    This function checks for errors in the multi line text input        */
47
/*  create.                                                               */
48
/*                                                                        */
49
/*  INPUT                                                                 */
50
/*                                                                        */
51
/*    text_input_ptr                        Multi Line input control block*/
52
/*    nampe_ptr                             Wigdget name                  */
53
/*    parent                                Parent widget control block   */
54
/*    size                                  Parent widget control block   */
55
/*    input_buffer                          User-supplied input buffer    */
56
/*    buffer_size                           Size of the user-supplied     */
57
/*                                            input buffer                */
58
/*    style                                 The style of the widget border*/
59
/*    Id                                    The ID number of the widget   */
60
/*    text_input_control_block_size         Size of the multi line text   */
61
/*                                            input control block         */
62
/*                                                                        */
63
/*  OUTPUT                                                                */
64
/*                                                                        */
65
/*    status                                Completion status             */
66
/*                                                                        */
67
/*  CALLS                                                                 */
68
/*                                                                        */
69
/*    _gx_multi_line_text_input_create                                    */
70
/*                                                                        */
71
/*  CALLED BY                                                             */
72
/*                                                                        */
73
/*    Application Code                                                    */
74
/*                                                                        */
75
/**************************************************************************/
76
580
UINT  _gxe_multi_line_text_input_create(GX_MULTI_LINE_TEXT_INPUT *text_input_ptr,
77
                                        GX_CONST GX_CHAR *name_ptr,
78
                                        GX_WIDGET *parent,
79
                                        GX_CHAR *input_buffer,
80
                                        UINT buffer_size,
81
                                        ULONG style,
82
                                        USHORT Id,
83
                                        GX_CONST GX_RECTANGLE *size,
84
                                        UINT text_input_control_block_size)
85
{
86
UINT status;
87
88
    /* Check for invalid caller of this function.  */
89

580
    GX_INIT_AND_THREADS_CALLER_CHECKING
90
91
    /* Check for invalid pointer.  */
92

578
    if ((text_input_ptr == GX_NULL) || (size == GX_NULL))
93
    {
94
2
        return(GX_PTR_ERROR);
95
    }
96
97
    /* Check for invalid control block size. */
98
576
    if (text_input_control_block_size != sizeof(GX_MULTI_LINE_TEXT_INPUT))
99
    {
100
1
        return(GX_INVALID_SIZE);
101
    }
102
103
    /* Check for widget already created.  */
104
575
    if (text_input_ptr -> gx_widget_type != 0)
105
    {
106
1
        return(GX_ALREADY_CREATED);
107
    }
108
109
    /* Check for invalid parent widget.  */
110

574
    if (parent && (parent -> gx_widget_type == 0))
111
    {
112
1
        return(GX_INVALID_WIDGET);
113
    }
114
115
    /* Call actual multi line text input create function.  */
116
573
    status = _gx_multi_line_text_input_create(text_input_ptr, name_ptr, parent, input_buffer, buffer_size, style, Id, size);
117
118
    /* Return completion status.  */
119
573
    return(status);
120
}
121