GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_single_line_text_input_character_insert.c Lines: 8 8 100.0 %
Date: 2026-03-06 19:21:09 Branches: 10 10 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
/**   Text Input Management (Single Line Text Input)                      */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_single_line_text_input.h"
29
30
GX_CALLER_CHECKING_EXTERNS
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gxe_single_line_text_input_character_insert        PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function checks for errors in the single line text input       */
45
/*    character insert call.                                              */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    text_input                            Single-line text input widget */
50
/*                                            control block               */
51
/*    insert_str                            Byte string of insert         */
52
/*                                            character                   */
53
/*    insert_size                           String size of insert         */
54
/*                                            character                   */
55
/*                                                                        */
56
/*  OUTPUT                                                                */
57
/*                                                                        */
58
/*    status                                Completion status             */
59
/*                                                                        */
60
/*  CALLS                                                                 */
61
/*                                                                        */
62
/*    _gx_single_line_text_input_character_insert                         */
63
/*                                          Acutal call to the character  */
64
/*                                            insert function             */
65
/*                                                                        */
66
/*  CALLED BY                                                             */
67
/*                                                                        */
68
/*    Application Code                                                    */
69
/*                                                                        */
70
/**************************************************************************/
71
69
UINT  _gxe_single_line_text_input_character_insert(GX_SINGLE_LINE_TEXT_INPUT *text_input, GX_UBYTE *insert_str, UINT insert_size)
72
{
73
UINT status;
74
75
    /* Check for appropriate caller.  */
76

69
    GX_INIT_AND_THREADS_CALLER_CHECKING
77
78
    /* Check for invalid input pointers.  */
79
67
    if (text_input == GX_NULL)
80
    {
81
2
        return GX_PTR_ERROR;
82
    }
83
84
65
    if (text_input -> gx_widget_type == 0)
85
    {
86
1
        return GX_INVALID_WIDGET;
87
    }
88
89
    /* Call the actual text input character insert function.  */
90
64
    status = _gx_single_line_text_input_character_insert(text_input, insert_str, insert_size);
91
92
    /* Return completion status.  */
93
64
    return(status);
94
}
95