fx_file_relative_seek.c
| 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 | /**************************************************************************/ | ||
| 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 | /**************************************************************************/ | ||
| 73 | #ifndef FX_DISABLE_ONE_LINE_FUNCTION | ||
| 74 | 3201862 | UINT _fx_file_relative_seek(FX_FILE *file_ptr, ULONG byte_offset, UINT seek_from) | |
| 75 | { | ||
| 76 | |||
| 77 | 3201862 | return(_fx_file_extended_relative_seek(file_ptr, (ULONG64)byte_offset, seek_from)); | |
| 78 | } | ||
| 79 | #endif /* FX_DISABLE_ONE_LINE_FUNCTION */ | ||
| 80 | |||
| 81 |