GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: fxe_file_write_notify_set.c Lines: 6 6 100.0 %
Date: 2026-03-06 18:49:02 Branches: 8 8 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
/** FileX Component                                                       */
17
/**                                                                       */
18
/**   File                                                                */
19
/**                                                                       */
20
/**************************************************************************/
21
/**************************************************************************/
22
23
#define FX_SOURCE_CODE
24
25
26
/* Include necessary system files.  */
27
28
#include "fx_api.h"
29
#include "fx_file.h"
30
31
32
FX_CALLER_CHECKING_EXTERNS
33
34
35
/**************************************************************************/
36
/*                                                                        */
37
/*  FUNCTION                                               RELEASE        */
38
/*                                                                        */
39
/*    _fxe_file_write_notify_set                          PORTABLE C      */
40
/*                                                           6.1          */
41
/*  AUTHOR                                                                */
42
/*                                                                        */
43
/*    William E. Lamie, Microsoft Corporation                             */
44
/*                                                                        */
45
/*  DESCRIPTION                                                           */
46
/*                                                                        */
47
/*    This function checks for errors in the file write notify set.       */
48
/*                                                                        */
49
/*  INPUT                                                                 */
50
/*                                                                        */
51
/*    file_ptr                              File control block pointer    */
52
/*    file_write_notify                     Notify function called when   */
53
/*                                            file is written to          */
54
/*                                                                        */
55
/*  OUTPUT                                                                */
56
/*                                                                        */
57
/*    FX_PTR_ERROR                          media_ptr is NULL             */
58
/*    status                                Actual completion status      */
59
/*                                                                        */
60
/*  CALLS                                                                 */
61
/*                                                                        */
62
/*    _fx_file_write_notify                 Actual file write notify set  */
63
/*                                                                        */
64
/*  CALLED BY                                                             */
65
/*                                                                        */
66
/*    Application Code                                                    */
67
/*                                                                        */
68
/**************************************************************************/
69
545
UINT  _fxe_file_write_notify_set(FX_FILE *file_ptr, VOID (*file_write_notify)(FX_FILE *file))
70
{
71
UINT status;
72
73
    /* Check for invalid input pointers.  */
74
545
    if (file_ptr == FX_NULL)
75
    {
76
136
        return(FX_PTR_ERROR);
77
    }
78
79
    /* Check for a valid caller.  */
80

409
    FX_CALLER_CHECKING_CODE
81
82
    /* Call actual file write notify set service.  */
83
1
    status =  _fx_file_write_notify_set(file_ptr, file_write_notify);
84
85
    /* Return status.  */
86
1
    return(status);
87
}
88