116 Commits

Author SHA1 Message Date
Lukas Fleischer
44bc9605d6 Avoid use of printf()/fprintf()
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>
2011-11-02 18:31:10 +01:00
Lukas Fleischer
2bf0249338 Avoid unnecessary start time calculations
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>
2011-10-21 08:58:54 +02:00
Lukas Fleischer
b0a6e1d448 Pass item durations to recur_item_inday()
Having item's durations eventually allows for better parsing of
recurrent appointments as we might be interested in how many days are
covered by a multi-day appointment.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-10-21 08:58:53 +02:00
Lukas Fleischer
3aefd00f6a Cleanup joinable threads on termination
Always invoke pthread_join() when we blow up a thread via
pthread_cancel() (avoid zombie threads).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-10-04 12:26:42 +02:00
Lukas Fleischer
45417bc6f0 Add configuration option to notify all appointments
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>
2011-07-31 03:23:32 +02:00
Lukas Fleischer
1a849cfb8e Fix notify_check_repeated()
Remove the "current_time" check from the first if condition. As "greater
than" relations (">") have higher precedence than assignments ("=") in
C, this caused "real_app_time" to always be one or zero which definitely
isn't what we want here. Reading further down, it turns out that we
don't even need this comparison here, so we should be fine removing it.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-29 20:38:59 +02:00
Lukas Fleischer
5a5c6d2604 Add "force" parameter to notify_check_next_app()
This allows to force notify_check_next_app() to update the notification
appointment, even if start times are equal (e.g. if the item description
was changed).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-29 20:28:30 +02:00
Lukas Fleischer
fec37db06b Avoid redundant redraws on resize
Use a global flag to record whether the terminal was resized instead of
redrawing everything each time a KEY_RESIZE is read.

Add some additional checks to help_write_pad() as invalid actions may be
passed now due to using signals instead of virtual key presses.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-28 18:22:43 +02:00
Lukas Fleischer
38865b8e48 Update copyright notices in source files, documentation and "COPYING".
* 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>
2011-04-22 07:26:05 +02:00
Lukas Fleischer
fb5f9d0155 Use generic lists for recurring item exceptions.
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>
2011-04-22 02:47:36 +02:00
Lukas Fleischer
5b12c236cf Remove dead assignments spotted by clang-analyzer.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-03 22:09:00 +02:00
Lukas Fleischer
9c9fd5da15 Overall indentation fixes.
Use spaces instead of tabs for source code indentation only, strip
trailing whitespaces from lines.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-03-14 19:03:53 +01:00
Lukas Fleischer
c22dcaf6be Update website links to match the new URL.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-03-04 11:07:49 +01:00
Lukas Fleischer
73e9649387 Update mail addresses to match the new mailing lists.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-03-04 11:07:40 +01:00
Lukas Fleischer
91c9cac898 Remove CVS "$Id" headers.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-03-03 16:19:45 +01:00
Lukas Fleischer
56b9cbcb84 Fixed file permissions. 2011-03-03 12:21:16 +01:00
Frederic Culot
6892b59622 Avoid concurrent screen refreshes. 2010-03-21 10:17:03 +00:00
Frederic Culot
a8cb1c92ef All headers gathered into a single one. Typedefs suppressed. 2010-03-20 10:54:41 +00:00
Frederic Culot
7542f4a711 Avoid a segfault when txt_max_len becomes too small. Reported by Thorsten, thanks. 2010-02-14 17:29:16 +00:00
Frederic Culot
ccd4b4c411 Do not send notifications when running in background mode if user did not flag its appointment. 2009-08-17 10:04:38 +00:00
Frederic Culot
8ba49be856 Possible deadlock fixed, thanks Henrik for reporting it. 2009-08-13 17:30:42 +00:00
Frederic Culot
3c9d6c13cc notify_thread_app rewritten 2009-08-09 15:34:56 +00:00
Frederic Culot
a0117296b4 Notification configuration menu rewritten to handle scrolling. 2009-08-02 09:30:01 +00:00
Frederic Culot
f1403e99bb Improved how the daemon checks for appointments to remind. 2009-08-01 20:29:49 +00:00
Frederic Culot
71d6cfda92 More work on implementing the daemon. 2009-08-01 13:31:20 +00:00
Frederic Culot
b55cad85da Beginning of work on implementing calcurse daemon. 2009-07-20 19:45:26 +00:00
Frederic Culot
976159fa56 calcurse version removed from menu titles 2009-07-12 17:55:13 +00:00
Frederic Culot
27b25548a4 Switch to BSD license. 2009-07-05 20:33:13 +00:00
Frederic Culot
bff0d973a4 Fixed a memory leak caused by a wrong usage of the notify_app structure 2009-06-21 15:19:21 +00:00
Frederic Culot
bc44508a10 Free memory associated with structure used for appointments notification. 2009-06-21 14:42:49 +00:00
Frederic Culot
d8861f877e bugfix: avoid possible segfault if notify_stop_main_thread is called before thread was launched (thanks Jan for reporting this) 2009-01-22 18:11:56 +00:00
Frederic Culot
936b6fe373 more code cleanup 2009-01-03 21:32:10 +00:00
Frederic Culot
bf3bce0ab2 code cleanup 2009-01-02 22:28:53 +00:00
Frederic Culot
5352496984 Added wrappers around libc's memory management functions, to easily debug memory usage 2008-12-28 13:13:58 +00:00
Frederic Culot
d59b0e15ab memory leak due to wrong thread usage fixed 2008-12-18 20:38:51 +00:00
Frederic Culot
53db22a380 code cleanup 2008-12-12 20:44:50 +00:00
Frederic Culot
639058740a Checks added while loading key bindings configuration. 2008-12-07 09:20:38 +00:00
Frederic Culot
eb88eaecb3 Building configuration menu to assign keybindings 2008-11-23 20:38:55 +00:00
Frederic Culot
9d4899110a More work on implementing user-definable keybindings 2008-11-16 17:42:53 +00:00
Frederic Culot
cb3919c59f no need to allocate tmp_app on heap in notify_thread_app 2008-04-20 13:49:39 +00:00
Frederic Culot
2341c90003 some memory leaks fixed using valgrind and some minor code cleanup 2008-04-19 21:04:47 +00:00
Frederic Culot
efd782699b Yet another style for source code. GNU style now used (I am fed up with tabs...) 2008-04-12 21:14:03 +00:00
Frederic Culot
52340fa0e1 memory leak fixed in notify_thread_app()
check for limits.h header added
asprintf() call replaced in wins_launch_external() as it is not
fully portable
2008-02-10 16:29:50 +00:00
Frederic Culot
478b2762e6 Ability to attach notes to todo items added 2007-12-30 16:27:58 +00:00
Frederic Culot
15ea040780 notify_config_bar() updated to handle window resizing 2007-10-21 13:41:51 +00:00
Frederic Culot
788ba6fc5c bugfix: do not stop thread in notify_config_bar() if it was not started before 2007-10-16 19:14:40 +00:00
Frederic Culot
e069c1788c bugfix: extract_aptsfile() modified so that notify->apts_file is never set
to null
2007-08-19 13:16:45 +00:00
Frederic Culot
470ea56514 notify_init_bar() updated to use static win variable 2007-08-15 15:33:01 +00:00
Frederic Culot
ff60394c8e error handling while in ncurses mode improved 2007-08-04 14:34:03 +00:00
Frederic Culot
2767b1f0e9 compiler warnings fixed 2007-07-29 20:59:09 +00:00