GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_single_line_text_input_character_insert.c Lines: 8 8 100.0 %
Date: 2024-12-05 08:52:37 Branches: 10 10 100.0 %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 *
4
 * This program and the accompanying materials are made available under the
5
 * terms of the MIT License which is available at
6
 * https://opensource.org/licenses/MIT.
7
 *
8
 * SPDX-License-Identifier: MIT
9
 **************************************************************************/
10
11
12
/**************************************************************************/
13
/**************************************************************************/
14
/**                                                                       */
15
/** GUIX Component                                                        */
16
/**                                                                       */
17
/**   Text Input Management (Single Line Text Input)                      */
18
/**                                                                       */
19
/**************************************************************************/
20
21
#define GX_SOURCE_CODE
22
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_single_line_text_input.h"
28
29
GX_CALLER_CHECKING_EXTERNS
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gxe_single_line_text_input_character_insert        PORTABLE C      */
36
/*                                                           6.1          */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Kenneth Maxwell, Microsoft Corporation                              */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This function checks for errors in the single line text input       */
44
/*    character insert call.                                              */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    text_input                            Single-line text input widget */
49
/*                                            control block               */
50
/*    insert_str                            Byte string of insert         */
51
/*                                            character                   */
52
/*    insert_size                           String size of insert         */
53
/*                                            character                   */
54
/*                                                                        */
55
/*  OUTPUT                                                                */
56
/*                                                                        */
57
/*    status                                Completion status             */
58
/*                                                                        */
59
/*  CALLS                                                                 */
60
/*                                                                        */
61
/*    _gx_single_line_text_input_character_insert                         */
62
/*                                          Acutal call to the character  */
63
/*                                            insert function             */
64
/*                                                                        */
65
/*  CALLED BY                                                             */
66
/*                                                                        */
67
/*    Application Code                                                    */
68
/*                                                                        */
69
/*  RELEASE HISTORY                                                       */
70
/*                                                                        */
71
/*    DATE              NAME                      DESCRIPTION             */
72
/*                                                                        */
73
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
74
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
75
/*                                            resulting in version 6.1    */
76
/*                                                                        */
77
/**************************************************************************/
78
69
UINT  _gxe_single_line_text_input_character_insert(GX_SINGLE_LINE_TEXT_INPUT *text_input, GX_UBYTE *insert_str, UINT insert_size)
79
{
80
UINT status;
81
82
    /* Check for appropriate caller.  */
83

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