12 #include "../../misc/coding/coding.h" 13 #include "../../debug.h" 14 #include "../gsmlogo.h" 15 #include "../gsmmisc.h" 19 #ifdef GSM_ENABLE_BACKUP 24 #define chk_fwrite(data, size, count, file) \ 25 if (fwrite(data, size, count, file) != count) goto fail; 27 GSM_Error SaveVNT(
char *FileName, GSM_Backup *backup)
31 unsigned char Buffer[1000];
35 file = fopen(FileName,
"wb");
39 while (backup->Note[i]!=NULL) {
48 sprintf(Buffer,
"%c%c",13,10);
59 GSM_Error LoadVNT(
const char *FileName, GSM_Backup *backup)
78 if (num < GSM_BACKUP_MAX_NOTE) {
80 if (backup->Note[num] == NULL) {
84 backup->Note[num + 1] = NULL;
86 dbgprintf(NULL,
"Increase GSM_BACKUP_MAX_NOTE\n");
91 backup->Note[num]->Location = num + 1;
#define chk_fwrite(data, size, count, file)
GSM_Error GSM_EncodeVNTFile(char *Buffer, const size_t buff_len, size_t *Length, GSM_NoteEntry *Note)
GSM_Error GSM_DecodeVNOTE(char *Buffer, size_t *Pos, GSM_NoteEntry *Note)
GSM_Error GSM_ReadFile(const char *FileName, GSM_File *File)