]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - VtoyTool/BabyISO/biso_plat_linux.c
1.1.07 release
[Ventoy.git] / VtoyTool / BabyISO / biso_plat_linux.c
1 /******************************************************************************
2 * biso_plat_linux.c
3 *
4 * Copyright (c) 2020, longpanda <admin@ventoy.net>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21
22 #ifdef __cplusplus
23 extern "C"{
24 #endif /* __cplusplus */
25
26 #include <limits.h>
27 #include <sys/stat.h>
28 #include <sys/types.h>
29 #include <utime.h>
30 #include <unistd.h>
31
32 #include "biso.h"
33 #include "biso_list.h"
34 #include "biso_util.h"
35 #include "biso_plat.h"
36
37 UINT64 vtoydm_get_file_size(const char *pcFileName);
38 BISO_FILE_S * vtoydm_open_file(const char *pcFileName);
39 void vtoydm_close_file(BISO_FILE_S *pstFile);
40 INT64 vtoydm_seek_file(BISO_FILE_S *pstFile, INT64 i64Offset, INT iFromWhere);
41 UINT64 vtoydm_read_file
42 (
43 BISO_FILE_S *pstFile,
44 UINT uiBlkSize,
45 UINT uiBlkNum,
46 VOID *pBuf
47 );
48
49
50 UINT64 BISO_PLAT_GetFileSize(IN CONST CHAR *pcFileName)
51 {
52 return vtoydm_get_file_size(pcFileName);
53 }
54
55 BISO_FILE_S * BISO_PLAT_OpenExistFile(IN CONST CHAR *pcFileName)
56 {
57 return vtoydm_open_file(pcFileName);
58 }
59
60 VOID BISO_PLAT_CloseFile(IN BISO_FILE_S *pstFile)
61 {
62 return vtoydm_close_file(pstFile);
63 }
64
65 INT64 BISO_PLAT_SeekFile(BISO_FILE_S *pstFile, INT64 i64Offset, INT iFromWhere)
66 {
67 return vtoydm_seek_file(pstFile, i64Offset, iFromWhere);
68 }
69
70 UINT64 BISO_PLAT_ReadFile
71 (
72 IN BISO_FILE_S *pstFile,
73 IN UINT uiBlkSize,
74 IN UINT uiBlkNum,
75 OUT VOID *pBuf
76 )
77 {
78 return vtoydm_read_file(pstFile, uiBlkSize, uiBlkNum, pBuf);
79 }
80
81 #ifdef __cplusplus
82 }
83 #endif /* __cplusplus */
84