8 #include "../../misc/coding/coding.h" 9 #include "../../debug.h" 10 #include "../gsmlogo.h" 11 #include "../gsmmisc.h" 15 #ifdef GSM_ENABLE_BACKUP 20 #define chk_fwrite(data, size, count, file) \ 21 if (fwrite(data, size, count, file) != count) goto fail; 23 GSM_Error SaveICS(
const char *FileName, GSM_Backup *backup)
27 unsigned char Buffer[1000];
31 file = fopen(FileName,
"wb");
34 Length=sprintf(Buffer,
"BEGIN:VCALENDAR%c%c",13,10);
35 Length+=sprintf(Buffer+Length,
"VERSION:2.0%c%c",13,10);
39 while (backup->Calendar[i]!=NULL) {
40 sprintf(Buffer,
"%c%c",13,10);
52 while (backup->ToDo[i]!=NULL) {
53 sprintf(Buffer,
"%c%c",13,10);
65 Length=sprintf(Buffer,
"%c%cEND:VCALENDAR%c%c",13,10,13,10);
75 GSM_Error LoadICS(
const char *FileName, GSM_Backup *backup)
GSM_Error GSM_EncodeVCALENDAR(char *Buffer, const size_t buff_len, size_t *Length, GSM_CalendarEntry *note, const gboolean header, const GSM_VCalendarVersion Version)
#define chk_fwrite(data, size, count, file)
GSM_Error GSM_EncodeVTODO(char *Buffer, const size_t buff_len, size_t *Length, const GSM_ToDoEntry *note, const gboolean header, const GSM_VToDoVersion Version)