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