GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_system_free_view_get.c Lines: 7 7 100.0 %
Date: 2026-03-06 19:21:09 Branches: 2 2 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
/**   System Management (System)                                          */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_system.h"
29
#include "gx_utility.h"
30
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gx_system_free_view_get                            PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    Grabs a free GX_VIEW from the list of free views, updates free      */
45
/*    view list.                                                          */
46
/*                                                                        */
47
/*                                                                        */
48
/*  INPUT                                                                 */
49
/*                                                                        */
50
/*    None                                                                */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    Returns a pointer to a free GX_VIEW structure                       */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*    _gx_system_error_process              Process a system error        */
59
/*                                                                        */
60
/*  CALLED BY                                                             */
61
/*                                                                        */
62
/*    _gx_system_view_add                   Link a view to window's       */
63
/*                                            view list                   */
64
/*                                                                        */
65
/**************************************************************************/
66
67
7066
GX_VIEW *_gx_system_free_view_get(VOID)
68
{
69
7066
GX_VIEW *retval = GX_NULL;
70
71
7066
    if (_gx_system_free_views)
72
    {
73
7065
        retval = _gx_system_free_views;
74
7065
        _gx_system_free_views = _gx_system_free_views -> gx_view_next;
75
    }
76
    else
77
    {
78
1
        _gx_system_error_process(GX_SYSTEM_OUT_OF_VIEWS);
79
    }
80
7066
    return retval;
81
}
82