summaryrefslogtreecommitdiffstats
path: root/src/io.c
Commit message (Collapse)AuthorAgeFilesLines
* Format "DURATION" field properly on ical exportJérôme Pinot2011-12-161-1/+5
| | | | | | | | | | | | Use days/hours/minutes/seconds instead of seconds in the DURATION field. It fixes interaction with other softwares like phpicalendar. Lukas: Remove use of dur-week. RFC 5545 states that you cannot use this in conjunction with dur-day. Also, fix formatting and use proper constants. Signed-off-by: Jerome Pinot <ngc891@gmail.com> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* src/io.c: Avoid use of memcpy()Lukas Fleischer2011-11-111-2/+4
| | | | | | | | Use strncpy() and a proper limit, which ensures we never read more characters than the buffer can hold. Also, ensure we always null-terminate strings here. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* src/io.c: Null-terminate the ical_readline() bufferLukas Fleischer2011-11-111-0/+1
| | | | | | | Ensure we always return with a null-terminated buffer, even if we read more than BUFSIZ characters. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Cleanup joinable threads on terminationLukas Fleischer2011-10-041-1/+4
| | | | | | | Always invoke pthread_join() when we blow up a thread via pthread_cancel() (avoid zombie threads). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* src/io.c: Update todo item count on iCal importLukas Fleischer2011-10-041-0/+3
| | | | | | | Update the number of todo items when importing an iCal file to prevent some items from being inaccessible. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* src/io.c: iCal content line folding correctnessLukas Fleischer2011-08-261-112/+69
| | | | | | | | | | | | | | | | | | | This is a rather invasive change that introduces correct line folding to our iCal parser. From now on, ical_readline() should be used instead of fgets() to read lines from an iCal file as it unfolds lines automatically. We also need to use shared buffers as each ical_readline() invocation eats up the first part of the next line and stores it in the "lstore" buffer. Subsequent ical_readline() invocations copy the contents of this buffer and append continuation lines. We currently use a single buffer pair that is allocated in io_import_data() and pass it to all subroutines. ical_readline_init() needs to be called once for every buffer pair. It reads the first part of the current line and writes to "lstore", clearing the target buffer at the same time. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* io.c: Accept resource parameters in iCal importLukas Fleischer2011-07-281-2/+2
| | | | | | | | | Remove colons from the "SUMMARY:" and "DURATION:" search patterns in ical_read_event() to allow for additional parameters (such as language parameters, cf. RFC 5545). Reported-by: Andraž 'ruskie' Levstik <ruskie@codemages.net> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Honor "TMPDIR" environment variableLukas Fleischer2011-07-091-2/+4
| | | | | | | | | Replace all hardcoded paths referring to "/tmp" with a new function that honors the "TMPDIR" environment variable as well as P_tmpdir and uses "/tmp" as a fallback. Thanks-to: Erik Saule <esaule@bmi.osu.edu> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Update copyright notices in source files, documentation and "COPYING".Lukas Fleischer2011-04-221-1/+1
| | | | | | | | | * Update copyright dates (use 2004-2011 as date range everywhere). * Change copyright holder from "Frederic Culot" to "calcurse Development Team". Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Return -1 in io_file_is_empty() if file cannot be accessed.Lukas Fleischer2011-04-221-1/+1
| | | | | | | Ensure files don't appear as empty if fopen() fails (e.g. on temporary EACCES failures). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Use generic lists for recurring item exceptions.Lukas Fleischer2011-04-221-53/+50
| | | | | | | | | Rename "days" structure to "excp" which seems to be a better name here. Use generic linked lists of excp structures instead of using the "days" structure which again contains a linked list implementation. Do some cleanups and invocation fixes. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Use generic lists for recurring apointments and events.Lukas Fleischer2011-04-191-58/+67
| | | | | | | | Use them instead of "recur_apoint_list" and "next" pointers in "recur_event" type variables. Includes some code simplifications and cleanups. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Use generic lists for todo items.Lukas Fleischer2011-04-191-14/+17
| | | | | | | Use the new generic list implementation instead of "next" pointers in todo items. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Use generic lists for events.Lukas Fleischer2011-04-191-10/+16
| | | | | | | Use the new generic list implementation instead of those insane "next" pointers in events. Includes some cleanups. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Use generic lists for appointments.Lukas Fleischer2011-04-191-18/+25
| | | | | | | Use the new generic list implementation instead of "apoint_list" everywhere. Simplify stuff and drop unused variables as well. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Fix io_file_is_empty() behaviour when file starts with a newline.Lukas Fleischer2011-04-121-1/+1
| | | | | | | Read second byte if the first byte is a newline character to ensure the file doesn't contain any further data. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Drop empty notes after editing.Lukas Fleischer2011-04-121-0/+25
| | | | | | | | | Keeping empty notes doesn't make sense here. Also, there doesn't seem to be a simple way to erase notes yet. This will make calcurse delete any notes that are empty (meaning that they are either 0-byte files or contain nothing but a newline character) when returning from the editor. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Compare pointers to "NULL" instead of "0".Lukas Fleischer2011-04-051-25/+25
| | | | | | "bad_zero.cocci" spatch from http://coccinelle.lip6.fr/impact_linux.php. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* ignore the lock file if the pointed process is dead.Erik Saule2011-03-291-8/+24
| | | | | | Lukas: Small formatting and logic changes. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Overall indentation fixes.Lukas Fleischer2011-03-141-274/+274
| | | | | | | Use spaces instead of tabs for source code indentation only, strip trailing whitespaces from lines. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Update website links to match the new URL.Lukas Fleischer2011-03-041-1/+1
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Update mail addresses to match the new mailing lists.Lukas Fleischer2011-03-041-1/+1
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Simplify str_toupper() in "utils.c".Lukas Fleischer2011-03-041-22/+21
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Remove CVS "$Id" headers.Lukas Fleischer2011-03-031-2/+0
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Fixed file permissions.Lukas Fleischer2011-03-031-0/+0
|
* Avoid concurrent screen refreshes.Frederic Culot2010-03-211-6/+6
|
* More work on sidebar customization.Frederic Culot2010-03-211-1/+6
|
* All headers gathered into a single one. Typedefs suppressed.Frederic Culot2010-03-201-93/+78
|
* Check for data directory availability added (thanks Brandon for reporting ↵Frederic Culot2009-11-011-6/+9
| | | | this bug).
* Code to save the calendar default view in the configuration file.Frederic Culot2009-10-281-1/+5
|
* Memory leak fixed in ical_read_note.Frederic Culot2009-08-091-1/+2
|
* Save and restore daemon configuration options.Frederic Culot2009-08-011-2/+13
|
* bugfixesFrederic Culot2009-07-291-5/+6
|
* io_file_exist(): new functionFrederic Culot2009-07-271-5/+21
|
* --status flag addedFrederic Culot2009-07-261-1/+26
|
* More work on implementing calcurse daemon.Frederic Culot2009-07-261-17/+30
|
* Incorrect duration format when exporting to ical (thanks Chris for reporting ↵Frederic Culot2009-07-231-3/+3
| | | | it).
* Functions added to implement a logging mechanism for calcurse daemon.Frederic Culot2009-07-231-2/+32
|
* Make use of erase_note() whenever possible.Frederic Culot2009-07-191-15/+19
|
* Fixed a bug related to memory management (a free on a null pointer causes an ↵Frederic Culot2009-07-151-3/+5
| | | | abort now, which induces side effects on file import).
* New wrappers around memory functions.Frederic Culot2009-07-121-2/+2
|
* stdbool header removed, unsigned type used insteadFrederic Culot2009-07-121-2/+2
|
* Switch to BSD license.Frederic Culot2009-07-051-14/+26
|
* Support for ical import of events which spans over several days added ↵Frederic Culot2009-07-051-6/+25
| | | | (thanks Andreas for reporting the bug).
* Simplified the way data are loaded and saved.Frederic Culot2009-06-281-177/+200
|
* Do not export completed tasks.Frederic Culot2009-06-271-1/+7
|
* bugfix: missing 'T' letter in ical export DURATION field (thanks cuz for ↵Frederic Culot2009-06-231-3/+3
| | | | reporting it)
* Exit directly to avoid lock removal by another instanceFrederic Culot2009-06-211-2/+2
|
* Basic lock mechanism implemented to avoid having two calcurse instances ↵Frederic Culot2009-06-211-3/+50
| | | | running at the same time.
* Fixes gcc 'format-scurity' issue (thanks Francois Boulogne for reporting this)Frederic Culot2009-06-011-8/+9
|