modified: src/planner.c

master
ketrptr 2024-12-17 11:05:26 +01:00
parent 7f487016dc
commit 6bf5d08b9b
1 changed files with 0 additions and 69 deletions

View File

@ -262,72 +262,3 @@ llist *genPlan(llist *head, time_t timeAvail) {
return events_ll; return events_ll;
} }
//
// const char *iCalHeader = "BEGIN:VCALENDAR\r\n"
// "VERSION:2.0\r\n"
// "PRODID:-//hacksw/handcal//NONSGML v1.0//EN\r\n";
// const char *iCalEvent = "BEGIN:VEVENT\r\n"
// "UID:%s%d\r\n"
// "DTSTAMP:%s\r\n"
// "DTSTART:%s\r\n"
// "DTEND:%s\r\n"
// "SUMMARY:%s\r\n"
// "END:VEVENT\r\n";
//
// int exportiCal(llist *events_ll) {
//
// llist *ev_ll = events_ll;
//
// llistPrintE(ev_ll);
//
// printf("%s", iCalHeader);
//
// time_t now = time(NULL);
// struct tm lc;
// localtime_r(&now, &lc);
//
// // gen filename & open for write
// char nameBuf[32];
// strftime(nameBuf, 32 - 12, "%F", &lc);
// strcat(nameBuf, "dayplan.ics");
// FILE *fp = fopen(nameBuf, "w");
// if (fp == NULL) {
// planLog("fopen failed!!", 1);
// return 1;
// }
// // write iCal header to file
// fprintf(fp, "%s", iCalHeader);
//
// // for every event in events_ll create VEVENT str and write to fp
// int count = 0;
// while (ev_ll != NULL) {
// // gen iCal compatible time str
// Event *current = ev_ll->data;
// struct tm startlc;
// struct tm endlc;
// localtime_r(&current->plannedStartTime, &startlc);
// localtime_r(&current->plannedEndTime, &endlc);
// char timeStartBuf[17];
// char timeEndBuf[17];
// char timeStamp[17];
// strftime(timeStamp, 17, "%Y%m%dT%k%M%SZ", &lc);
// printf("%s\n", timeStamp);
// strftime(timeStartBuf, 17, "%Y%m%dT%k%M%SZ", &startlc);
// printf("%s\n", timeStartBuf);
// strftime(timeEndBuf, 17, "%Y%m%dT%k%M%SZ", &endlc);
// printf("%s\n", timeEndBuf);
//
// fprintf(fp, iCalEvent, current->task->name, count, timeStamp,
// timeStartBuf,
// timeEndBuf, current->task->name);
// ev_ll = ev_ll->next;
// count += 1;
// }
//
// // after all events are written end cal with
// // END:VCALENDAR
// fprintf(fp, "END:VCALENDAR\r\n");
// fclose(fp);
//
// return 0;
// }