#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <io.h>
//定义BSIZE为32*1M
#define BSIZE (32*1024*1024)
char buf[BSIZE];
int convertchar(char *buf, int bufsize);
int resumechar(char *buf, int bufsize);
int write_file(const char *fout, const char *buf, int bufsize);
int read_file(const char *fin, char *buf, int bufsize, int flag);
int p_buf(const char *buf, int n);
char *input_fname(char * in_fn, int fn_size);
void p_help(void);
int main(int argc, char *argv[])
{
char buf_sw[256], in_fn[256];
int read_n = 0;
p_help();
while(printf("\ninput cmd>"),gets(buf_sw))
{
switch(buf_sw[0])
{
case 'c':
printf("please input file(be converted) path...\n");
read_n = read_file(input_fname(in_fn, 256), buf, BSIZE, 0);
if(read_n < 0)
{
printf("read fail!\n");
break;
}
printf("begin convert file...\n");
//简单的 转换,加密文档
if(convertchar(buf, read_n))
{
printf("convert fail!\n");
break;
}
printf("convert file ok!\n");
printf("save