📄 l_text.cpp
字号:
/*
程序:VC 4.2
功能:
调用TEXT打包后所生成的程序;
*/
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include "L_TEXT.H"
#include "TOOLS.H"
void CText_apply::Text_open (char * compress_name )
{
Ctools_Onefish Tools;
char index_name[32];
//Tools.file_length (comperss_name);
//FILE * compress_file; //压缩文件;
//FILE * index_file; //索引文件;
if ((compress_file=fopen (compress_name,"rb"))==NULL)//打开文本文件;
{
printf ("ERROR:%s no find !!!",compress_name);
exit (1);
}
else
{
printf ("Compress File is %s !!! \n",compress_name);
}
Tools.file_change (compress_name,"edx",index_name);
if ((index_file=fopen (index_name,"rb"))==NULL)//打开文本文件;
{
printf ("ERROR:%s no find !!!",compress_name);
exit (1);
}
else
{
printf ("Index File is %s !!! \n",index_name);
}
/*
int file_size=Tools.file_length (index_name);
if ((index_buf=new char [file_size])==NULL)
{
printf ("ERROR:Memory out !!!");
exit (2);
}
fread (index_buf,1,file_size,index_file);
*/
}
void CText_apply::Text_use (char * string_point,short number)
{
char * string_backup;
fseek(index_file,number*4,SEEK_SET);
fread (&string,sizeof (string),1,index_file);
fseek(compress_file,string.string_index,SEEK_SET);
fread (string_point,string.string_length,1,compress_file);
string_backup=string_point;
for (int i = 0;i<string.string_length;i++)
{
(*string_backup)^=70;
string_backup++;
}
}
void CText_apply::Text_close ( void )
{
fclose (compress_file);
fclose (index_file);
}
/*
void main (void)
{//这个程序用来测试TEXT打包后的程序(默认打包文件名为WIN95.TXT);
CText_apply Text;
char test [200];
memset (test,0,200);
Text.Text_open ("test.ext");
for (int i =0; i <17;i++)
{
Text.Text_use (test,i);
printf ("string: %s \n",test);
}
Text.Text_close ();
getch ();
}
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -