📄 file.h
字号:
#ifndef _FILE_H__
#define _FILR_H__
/************************************************************************
*OpenF() open a file which name is filename with opentype mode if succeed*
*return the pointer of the file ; if has error then show errormsg and *
*return 0 *
*WriteC() :write a character c to file fp if succeed return 1 ; if has*
*error then show errormsg and return 0 *
*ReadC() read a character from fp and if succeed return the character;*
* if has error then show errormsg and return -1 *
*WriteStrToF(str, fp) write the string str to fp end with \0 *
*WriteLIntToF(a,fp) write the long int a to file fp as the haig bits *
*first order for example 1 writed as 0000 0000 0000 0001; *
*Compress(InFileNames,OutFileName) compress files InFileNames to *
*OutFileName and return The Size of it if filed return 0 *
*CreateFolders(filename) create the folder structure of the filename *
*need for example filename = c:\a\b\c.exe but there is not c:\a\b then *
*it will create the path c:\a\b *
*************************************************************************/
#ifndef _T_FILENAME_NODE_
#define _T_FILENAME_NODE_
typedef struct _T_FileName_Node f_name_node_t, *f_name_node_p;
struct _T_FileName_Node
{
char *Name;
f_name_node_p Next;
};
#endif
#ifndef _T_FILENAME_
#define _T_FILENAME_
typedef struct _T_FileName f_name_t, *f_name_p;
struct _T_FileName
{
f_name_node_p head;
};
#endif
FILE *OpenF(const char *filename,char *opentype,char *errormsg);
int WriteC(char c,FILE *fp,char *errormsg);
int ReadC(FILE *fp); //if read end or error return -1;
int WriteStrToF(char *str,FILE *fp);
int WriteLIntToF(long int a,FILE *fp);
int CreateFolders(const char *FileName);
f_name_t CreateFileName();
f_name_node_p F_N_GoNext(f_name_node_p p);
char *F_N_GetName(f_name_node_p p);
int AddFileName(f_name_p filenamelist,const char *filename);
void FreeFileList(f_name_p names);
char *LinkPath_Name(char *path,char *filename);
void AddFileFromFolder(char* FolderPath,char *FolderName,f_name_p namesp);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -