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 /** FileX Component */
16 /** */
17 /** File */
18 /** */
19 /**************************************************************************/
20 /**************************************************************************/
21
22 #define FX_SOURCE_CODE
23
24
25 /* Include necessary system files. */
26
27 #include "fx_api.h"
28 #include "fx_file.h"
29
30
31 /**************************************************************************/
32 /* */
33 /* FUNCTION RELEASE */
34 /* */
35 /* _fx_file_relative_seek PORTABLE C */
36 /* 6.1 */
37 /* AUTHOR */
38 /* */
39 /* William E. Lamie, Microsoft Corporation */
40 /* */
41 /* DESCRIPTION */
42 /* */
43 /* This function positions the internal file pointers to the specified */
44 /* byte relative offset such that the next read or write operation is */
45 /* performed there. */
46 /* */
47 /* INPUT */
48 /* */
49 /* file_ptr File control block pointer */
50 /* byte_offset Byte offset of the seek */
51 /* seek_from Direction for relative seek, */
52 /* legal values are: */
53 /* */
54 /* FX_SEEK_BEGIN */
55 /* FX_SEEK_END */
56 /* FX_SEEK_FORWARD */
57 /* FX_SEEK_BACK */
58 /* */
59 /* OUTPUT */
60 /* */
61 /* return status */
62 /* */
63 /* CALLS */
64 /* */
65 /* _fx_file_extended_relative_seek Seek to specified position */
66 /* */
67 /* CALLED BY */
68 /* */
69 /* Application Code */
70 /* */
71 /* RELEASE HISTORY */
72 /* */
73 /* DATE NAME DESCRIPTION */
74 /* */
75 /* 05-19-2020 William E. Lamie Initial Version 6.0 */
76 /* 09-30-2020 William E. Lamie Modified comment(s), and */
77 /* Added conditional to */
78 /* disable one line function, */
79 /* resulting in version 6.1 */
80 /* */
81 /**************************************************************************/
82 #ifndef FX_DISABLE_ONE_LINE_FUNCTION
_fx_file_relative_seek(FX_FILE * file_ptr,ULONG byte_offset,UINT seek_from)83 UINT _fx_file_relative_seek(FX_FILE *file_ptr, ULONG byte_offset, UINT seek_from)
84 {
85
86 return(_fx_file_extended_relative_seek(file_ptr, (ULONG64)byte_offset, seek_from));
87 }
88 #endif /* FX_DISABLE_ONE_LINE_FUNCTION */
89
90