GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_string_scroll_wheel_string_id_list_set.c Lines: 10 10 100.0 %
Date: 2024-12-05 08:52:37 Branches: 14 14 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
/**   String Scroll Wheel Management (Scroll Wheel)                       */
18
/**                                                                       */
19
/**************************************************************************/
20
21
#define GX_SOURCE_CODE
22
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_scroll_wheel.h"
28
29
GX_CALLER_CHECKING_EXTERNS
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gxe_string_scroll_wheel_string_id_list_set         PORTABLE C      */
36
/*                                                           6.1          */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Kenneth Maxwell, Microsoft Corporation                              */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This function checks for errors in string scroll wheel string id    */
44
/*    list set call.                                                      */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    wheel                                 Scroll wheel control block    */
49
/*    string_id_list                        String id list to be set      */
50
/*    id_count                              The number of string ids      */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    status                                Completion status             */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*    _gx_string_scroll_wheel_string_id_list_set                          */
59
/*                                          Actual string scroll wheel    */
60
/*                                            string id set call          */
61
/*                                                                        */
62
/*  CALLED BY                                                             */
63
/*                                                                        */
64
/*    Application Code                                                    */
65
/*                                                                        */
66
/*  RELEASE HISTORY                                                       */
67
/*                                                                        */
68
/*    DATE              NAME                      DESCRIPTION             */
69
/*                                                                        */
70
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
71
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
72
/*                                            resulting in version 6.1    */
73
/*                                                                        */
74
/**************************************************************************/
75
196
UINT  _gxe_string_scroll_wheel_string_id_list_set(GX_STRING_SCROLL_WHEEL *wheel,
76
                                                  GX_CONST GX_RESOURCE_ID *string_id_list,
77
                                                  INT id_count)
78
{
79
UINT status;
80
81
    /* Check for appropriate caller.  */
82

196
    GX_INIT_AND_THREADS_CALLER_CHECKING
83
84
    /* Check for invalid pointer. */
85

194
    if ((wheel == GX_NULL) || (string_id_list == GX_NULL))
86
    {
87
2
        return GX_PTR_ERROR;
88
    }
89
90
    /* Check for invalid widget. */
91
192
    if (wheel -> gx_widget_type == 0)
92
    {
93
1
        return(GX_INVALID_WIDGET);
94
    }
95
96
    /* Check for invalid value. */
97
191
    if (id_count <= 0)
98
    {
99
1
        return(GX_INVALID_VALUE);
100
    }
101
102
190
    status = _gx_string_scroll_wheel_string_id_list_set(wheel, string_id_list, id_count);
103
104
190
    return status;
105
}
106