summaryrefslogtreecommitdiffstats
path: root/src/args.c
Commit message (Collapse)AuthorAgeFilesLines
* Make use of the NULL macroLukas Fleischer2011-11-021-16/+16
| | | | | | | | | | | | | | | Use this constant everywhere when referring to a null pointer instead of casting 0 to various types of pointers. Created using following semantic patch: @@ type type; @@ - (type *)0 + NULL Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Do not cast unused return values to voidLukas Fleischer2011-11-021-13/+13
| | | | | | | | | | | | | | | | | | | | A small style fix that removes all remaining "(void)" casts. Using these isn't encouraged in GNU coding guidelines and doesn't serve a certain purpose, except for satisfying a few static code analysis tools. We already nuked some of these in previous patches, but this semantic patch should fix what's left: @@ identifier func; @@ - (void)func ( + func ( ...); Long lines were re-formatted manually. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Avoid use of printf()/fprintf()Lukas Fleischer2011-11-021-1/+1
| | | | | | | | | | | | | | | | Use one of the following functions where appropriate: * puts() (whenever we print hard coded strings to stdout) * fputs() (whenever we print hard coded strings to a stream) * putchar() (whenever we print a single character to stdout) * fputc() (whenever we print a single character to a stream) * strncpy() (whenever we copy hard coded strings to a buffer) This removes the overhead introduced by the format string parser and reduces the number of false positive C-format strings spotted by xgettext(1)'s heuristics. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Avoid unnecessary start time calculationsLukas Fleischer2011-10-211-1/+3
| | | | | | | | | | | | | | Rename recur_*_inday() to recur_*_find_occurrence() and use the new functions whenever we actually care about the start time of an occurrence. Reintroduce recur_*_inday() as wrappers to recur_*_find_occurrence() and pass NULL as start time buffer (which means "skip start time calculation"). Keep using these when we only want to know if a recurrent item belongs to a specific day but do not care about the actual start time. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Use LLIST_{,TS}_FIND_FOREACH_CONT where appropriateLukas Fleischer2011-10-061-1/+1
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add command line argument to run the GC manuallyLukas Fleischer2011-10-051-2/+21
| | | | | | | | Adds a "-g" option that allows for running the garbage collector for note files manually. This is useful for users that do not use note files at all or rarely edit/remove them. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Merge branch 'maint'Lukas Fleischer2011-09-061-3/+9
|\ | | | | | | | | Conflicts: src/io.c
| * Rework indentation code in print_notefile()Lukas Fleischer2011-08-261-3/+9
| | | | | | | | | | | | | | Do not use snprintf() here as printf() behaviour is undefined if the destination pointer is used as a parameter. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Merge branch 'maint'Lukas Fleischer2011-07-301-52/+78
|\|
| * Fix sort order in app_arg()Lukas Fleischer2011-07-301-52/+78
| | | | | | | | | | | | | | | | | | | | | | | | We used to iterate over the list of regular appointments and the list of recurrent appointments in separate loops, thus leading to recurrent appointments being printed first and regular appointments being printed afterwards, regardless of their start and end times. Merge these loops to coerce precedence of the start time. There's still a fair bit of hackery in here - we will fix that later. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | src/args.c: Mark various constant strings constLukas Fleischer2011-07-281-4/+4
| | | | | | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Remove superfluous buffer variable from version_arg()Lukas Fleischer2011-07-281-4/+1
| | | | | | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Remove superfluous buffer variable from help_arg()Lukas Fleischer2011-07-281-4/+1
| | | | | | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Merge branch 'maint'Lukas Fleischer2011-07-281-0/+2
|\|
| * Invoke vars_init() before importing data with "-i"Lukas Fleischer2011-07-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | We forgot to call vars_init() when importing an item using the "-i" command line argument, which led to the pager configuration variable being unset and hence the pager invocation (triggered to show the log in case there are any errors during import) failing. Fix this by calling vars_init() before io_import_data(). Reported-by: Andraž 'ruskie' Levstik <ruskie@codemages.net> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* | Declare foreground and background variables globalLukas Fleischer2011-07-211-2/+2
|/ | | | | | Removes the need to pass the terminal's default background color round. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Update copyright notices in source files, documentation and "COPYING".Lukas Fleischer2011-04-221-2/+2
| | | | | | | | | * 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>
* Use "event" structure when iterating over events in app_arg().Lukas Fleischer2011-04-221-1/+1
| | | | | | | Regression introduced in commit 5b174ba5d46c256f41c1cfb952d46f49a088db8a. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Use generic lists for recurring apointments and events.Lukas Fleischer2011-04-191-56/+48
| | | | | | | | 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-9/+10
| | | | | | | 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-21/+18
| | | | | | | 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-28/+26
| | | | | | | 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>
* Compare pointers to "NULL" instead of "0".Lukas Fleischer2011-04-051-5/+5
| | | | | | "bad_zero.cocci" spatch from http://coccinelle.lip6.fr/impact_linux.php. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Remove dead assignments spotted by clang-analyzer.Lukas Fleischer2011-04-031-5/+4
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Overall indentation fixes.Lukas Fleischer2011-03-141-260/+260
| | | | | | | 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-3/+3
| | | | 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
|
* Make parse_date accept several short forms.Lukas Fleischer2011-01-111-3/+3
| | | | | | | | | Short forms are only accepted in interactive mode (e.g. when using the "Go to" function, editing a recurrent item's end date, and so on). Samples: "1/1/30" for "01/01/2030", "26" for the 26th of the currently selected month/year or "3/1" for Mar 01 (or Jan 03, depending on the date format) of the currently selected year.
* Copyright updated.Frederic Culot2010-05-261-2/+2
|
* All headers gathered into a single one. Typedefs suppressed.Frederic Culot2010-03-201-35/+22
|
* Also check for notes directory.Frederic Culot2009-11-011-1/+2
|
* Check for data directory availability added (thanks Brandon for reporting ↵Frederic Culot2009-11-011-1/+2
| | | | this bug).
* Help on --status flag addedFrederic Culot2009-08-021-2/+4
|
* --status flag addedFrederic Culot2009-07-261-2/+53
|
* Check for file presence added (thanks again Chris for reporting it).Frederic Culot2009-07-261-1/+7
|
* Dates are now written properly again when using the '-r' flag (thanks Chris ↵Frederic Culot2009-07-151-4/+10
| | | | again for your report).
* bugfix: import and export todo items again!Frederic Culot2009-07-121-1/+7
|
* stdbool header removed, unsigned type used insteadFrederic Culot2009-07-121-6/+6
|
* Switch to BSD license.Frederic Culot2009-07-051-14/+26
|
* Support added for regex-based searches. Many thanks Erik for providing the ↵Frederic Culot2009-07-051-16/+63
| | | | patch.
* Simplified the way data are loaded and saved.Frederic Culot2009-06-281-24/+19
|
* Help updated for the -t command line flag.Frederic Culot2009-06-281-2/+4
|
* Ability to flag todo items as completed.Frederic Culot2009-06-261-23/+50
|
* Do not print todo items twice if the -d and -t flags are given (thanks Timo ↵Frederic Culot2009-06-261-3/+2
| | | | for reporting this bug).
* Make the argument given to -r or -s flags optional.Frederic Culot2009-06-231-4/+4
|
* Copyright date updatedFrederic Culot2009-06-201-2/+2
|
* bugfix: load keys even in non-interactive mode to avoid the loss of ↵Frederic Culot2009-01-241-15/+12
| | | | user-configured key bindings
* more code cleanupFrederic Culot2009-01-031-3/+4
|