summaryrefslogtreecommitdiffstats
path: root/src/io.c
Commit message (Collapse)AuthorAgeFilesLines
* Add a copy file routineLukas Fleischer2011-10-051-0/+33
| | | | | | | | Add io_file_cp() which can be used to copy an existing source file to another location. We will need this for our new hash-based note file names. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Merge branch 'maint'Lukas Fleischer2011-09-061-112/+69
|\ | | | | | | | | Conflicts: src/io.c
| * 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>
* | Add configuration option to notify all appointmentsLukas Fleischer2011-07-311-0/+4
| | | | | | | | | | | | | | | | If "notify-all" is enabled, all non-flagged appointments will be notified (instead of flagged ones). This is useful for users that want to be notified of everything. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Merge branch 'maint'Lukas Fleischer2011-07-281-2/+2
|\|
| * 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>
* | Use gettext plural featuresLukas Fleischer2011-07-241-6/+8
| | | | | | | | | | | | | | | | Make use of the plural features of gettext to handle plural forms correctly instead of using the plural form even if the singular form should be used. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Split stats messages in io_import_data()Lukas Fleischer2011-07-241-10/+12
| | | | | | | | | | | | | | | | Use separate format strings for separate values. This is useful in case we want to output similar stats somewhere else and is a preparation for supporting plural forms. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Use single-line configuration settings by defaultLukas Fleischer2011-07-151-22/+23
| | | | | | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Skip indentation and comments in io_extract_data()Lukas Fleischer2011-07-151-1/+2
| | | | | | | | | | | | | | | | We actually only use this function to parse configuration data. Currently, this probably is the best way to do some common preprocessing. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Remove artificial delay when saving dataLukas Fleischer2011-07-141-3/+0
| | | | | | | | | | | | | | | | This doesn't contribute to functionality or usability in any way. Keep the progress bar option but only show bars as long as the actual save operation is in progress. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Merge branch 'maint'Lukas Fleischer2011-07-101-2/+4
|\|
| * 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>
* | Refactor out todo item serializationLukas Fleischer2011-07-021-4/+1
|/ | | | | | | | Add a todo_write() function that allows one to serialize todo items and write serialized data to an output stream in a fashion similar to apoint_write() and event_write(). 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).