资源简介
这个是我在http://blog.csdn.net/liukun321/article/details/7270426的博客里提取出来的 得感谢他们
代码片段和文件信息
#include
#include
#include
#define BUFSIZE (8*1024)
#define IMG_SIZE (8*1024)
#define SPL_HEADER_SIZE 16
//#define FILE_PERM (S_IRUSR | S_IWUSR | S_IRGRP \
| S_IWGRP | S_IROTH | S_IWOTH)
#define SPL_HEADER “S5PC110 HEADER “
int main (int argc char *argv[])
{
FILE *fp;
char *Buf *a;
int BufLen;
int nbytes fileLen;
unsigned int checksum count;
int i;
//////////////////////////////////////////////////////////////
if (argc != 3)
{
printf(“Usage: mkbl1 \n“);
return -1;
}
//////////////////////////////////////////////////////////////
BufLen = BUFSIZE;
Buf = (char *)malloc(BufLen);
if (!Buf)
{
printf(“Alloc buffer failed!\n“);
return -1;
}
memset(Buf 0x00 BufLen);
//////////////////////////////////////////////////////////////
fp = fopen(argv[1] “rb“);
if( fp == NULL)
{
printf(“source file open error\n“);
free(Buf);
return -1;
}
fseek(fp 0L SEEK_END);
fileLen = ftell(fp);
- 上一篇:生产安排问题模型的数学建模
- 下一篇:altera PCIE设计指导
评论
共有 条评论