2 Star 2 Fork 1

觉皇/bsdiff_embeded

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vfile.c 1021 Bytes
一键复制 编辑 原始数据 按行查看 历史
觉皇 提交于 2023-11-18 09:54 +08:00 . 首次提交
/*
* vfile.c
*
* Created on: 2023419
* Author: hello
*/
#include "vfile.h"
vfile* vfopen(const char* fname, const char* mode)
{
#ifdef USE_C_STD_LIB
return fopen(fname, mode);
#else
return NULL;
#endif
}
size_t vfwrite(const void *buf, size_t size, size_t count, vfile* vf)
{
#ifdef USE_C_STD_LIB
return fwrite(buf, size, count, vf);
#else
return NULL;
#endif
}
size_t vfread(void* buf, size_t size, size_t count, vfile* vf)
{
#ifdef USE_C_STD_LIB
return fread(buf, size, count, vf);
#else
return NULL;
#endif
}
int vfseek(vfile* vf, long offset, int origin)
{
#ifdef USE_C_STD_LIB
return fseek(vf, offset, origin);
#else
return 0;
#endif
}
int vfclose(vfile* vf)
{
#ifdef USE_C_STD_LIB
return fclose(vf);
#else
return 0;
#endif
}
uint32_t vfsize(const char* fname)
{
#ifdef USE_C_STD_LIB
struct stat s;
if(stat(fname, &s) == 0)
return s.st_size;
return 0;
#else
return NULL;
#endif
}
long vftell(vfile* vf)
{
#ifdef USE_C_STD_LIB
return ftell(vf);
#else
return NULL;
#endif
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/jhembed/bsdiff_embeded.git
git@gitee.com:jhembed/bsdiff_embeded.git
jhembed
bsdiff_embeded
bsdiff_embeded
main

搜索帮助