GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: fx_file_truncate_release.c Lines: 2 2 100.0 %
Date: 2024-01-10 21:53:23 Branches: 0 0 - %

Line Branch Exec Source
1
/**************************************************************************/
2
/*                                                                        */
3
/*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4
/*                                                                        */
5
/*       This software is licensed under the Microsoft Software License   */
6
/*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7
/*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8
/*       and in the root directory of this software.                      */
9
/*                                                                        */
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
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _fx_file_truncate_release                           PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    William E. Lamie, Microsoft Corporation                             */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function sets the file to the specified size, if smaller than  */
45
/*    the current file size.  If the new file size is less than the       */
46
/*    current file read/write position, the internal file pointers will   */
47
/*    also be modified.  Any unused clusters are released back to the     */
48
/*    media.                                                              */
49
/*                                                                        */
50
/*  INPUT                                                                 */
51
/*                                                                        */
52
/*    file_ptr                              File control block pointer    */
53
/*    size                                  New size of the file in bytes */
54
/*                                                                        */
55
/*  OUTPUT                                                                */
56
/*                                                                        */
57
/*    return status                                                       */
58
/*                                                                        */
59
/*  CALLS                                                                 */
60
/*                                                                        */
61
/*    _fx_file_extended_truncate_release    Truncate the file size and    */
62
/*                                            released unused clusters    */
63
/*                                                                        */
64
/*  CALLED BY                                                             */
65
/*                                                                        */
66
/*    Application Code                                                    */
67
/*                                                                        */
68
/*  RELEASE HISTORY                                                       */
69
/*                                                                        */
70
/*    DATE              NAME                      DESCRIPTION             */
71
/*                                                                        */
72
/*  05-19-2020     William E. Lamie         Initial Version 6.0           */
73
/*  09-30-2020     William E. Lamie         Modified comment(s), and      */
74
/*                                            Added conditional to        */
75
/*                                            disable one line function,  */
76
/*                                            resulting in version 6.1    */
77
/*                                                                        */
78
/**************************************************************************/
79
#ifndef FX_DISABLE_ONE_LINE_FUNCTION
80
2
UINT  _fx_file_truncate_release(FX_FILE *file_ptr, ULONG size)
81
{
82
83
2
    return(_fx_file_extended_truncate_release(file_ptr, (ULONG64)size));
84
}
85
#endif /* FX_DISABLE_ONE_LINE_FUNCTION */
86