873 Commits

Author SHA1 Message Date
Lukas Fleischer
6636232bc7 doc/Makefile.am: Fix "--without-asciidoc"
Do not try to distribute man page and manual files if documentation
generation is disabled.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-20 19:01:30 +02:00
Lukas Fleischer
9c3a8a5a49 src/llist.c: Use stable insertion algorithm
Ensure the relative order of elements with equal keys is maintained when
inserting into a sorted list.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-20 19:01:30 +02:00
Lukas Fleischer
b2645847a0 Fix whitespace issues
Strip trailing whitespaces in all source files.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-09 21:37:22 +02:00
Lukas Fleischer
4e6e3a9c97 src/utils.c: Make bell() static
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-07 09:33:50 +02:00
Lukas Fleischer
3cd5c1d738 Release 2.9.0.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:48:24 +02:00
Lukas Fleischer
ee369c596f build-aux/git-version-gen: Ignore timestamps.
Do not declare the working tree dirty if only a timestamp has changed.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:46:34 +02:00
Lukas Fleischer
c61a63a46d Add version information to distribution tarball.
We somehow forgot this when adding Git version string support in commit
c5e4187590f37e9524a8e3fcb2bccb20f2e8b4eb.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:25:13 +02:00
Lukas Fleischer
f3e3020104 README: Add missing translators.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:25:13 +02:00
Lukas Fleischer
79deaaac35 Translation updates from Transifex.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-24 11:25:07 +02:00
Lukas Fleischer
6d2b7bd497 .tx/config: Add EOL character to the last line.
Be a little more consistent here.

Also, transifex-client will automatically add a newline character to the
last line of its config file unless it is already there.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-18 20:37:03 +02:00
Lukas Fleischer
0f03e80d03 Add missing llist header files to "_SOURCES".
We forgot to add those to the "_SOURCES" variable in commit
0eb1da8dd7fa3ae9d95e12df6058fb41a5ec1c11 and
d668963e2056027526374098efe2869a0d389b92. Spotted by `make distcheck`.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-05-17 10:16:32 +02:00
Lukas Fleischer
35ade5bf96 Add iCalendar keywords TODO entry.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 07:52:47 +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
c9db3b7db7 TODO overhaul.
* Use AsciiDoc style formatting.

* Fix some wording. Use "we" instead of "I" and "us" instead of "me".

* Update mail addresses.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:51:27 +02:00
Lukas Fleischer
bd0be4237c README overhaul.
* Use AsciiDoc style formatting.

* Remove outdated information on the "ChangeLog" file (removed that in
  commit b9fa5bdbb17f507ba756fe38a14d5993e522bb6c).

* Replace references to language specific manual files by
  "doc/manual.html".

* Update author roles.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:51:05 +02:00
Lukas Fleischer
79353a625c Ignore daemon lock file if the daemon process died.
Do this in a fashion similar to what was done in commit
6ff95238766656c5ea9d5c65c35d3aef93499f60.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:38 +02:00
Lukas Fleischer
ddd0cb21fa Be a bit more fail-safe in "build-aux/git-version-gen".
The existence of a ".git" directory is not a sufficient condition to be
sure we are in a Git repository. Only overwrite the version information
file if `git describe` returns a non-empty string.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:38 +02:00
Lukas Fleischer
621b335179 Return -1 in io_file_is_empty() if file cannot be accessed.
Ensure files don't appear as empty if fopen() fails (e.g. on temporary
EACCES failures).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:38 +02:00
Lukas Fleischer
371f20e631 Documentation Makefile overhaul.
* Add documentation input and output files to distribution tarballs.

* Use a more generic rule to generate man pages instead of the hardcoded
  "calcurse.1" target.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:38 +02:00
Lukas Fleischer
c5e4187590 Add Git version string support.
Introduce a script to auto-generate version strings. Use `git describe`
to create descriptive version strings when building from a Git checkout,
use ".version" files for release tarballs.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:37 +02:00
Lukas Fleischer
cbd66b13b1 Use "event" structure when iterating over events in app_arg().
Regression introduced in commit
5b174ba5d46c256f41c1cfb952d46f49a088db8a.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:37 +02:00
Lukas Fleischer
20c84c3003 Add comments to linked list functions.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:37 +02:00
Lukas Fleischer
112fbe00a4 llist.c: Nullify pointers after free()'ing.
* Set all data members to "NULL" in llist_free_inner() after freeing
  them. Altough we normally shouldn't continue working with a list that
  already went through llist_free_inner(), this will protect against
  dangling pointer bugs in case anyone will ever come up with the idea
  of doing so.

* Set list head to "NULL" in llist_free(), basically to put the list
  into an initialized state.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-22 02:47:36 +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
0ad23c7a8f Remove "next" member from "recur_apoint" structure.
Field seems to be unused. Verify using following spatch:

----
@@ struct recur_apoint *rapt; @@

* rapt->next
----

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-19 11:42:36 +02:00
Lukas Fleischer
9fab24818a Use generic lists for recurring apointments and events.
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>
2011-04-19 11:42:35 +02:00
Lukas Fleischer
2438470fd3 Add recur_apoint_inday() and recur_event_inday().
To be used with llist_fn_match_t callbacks later.

I feel a bit ill adding those functions. This definitely is a hack.
Ultimately, there should be some generic recur_item_inday() function
that accepts both recurring apointments and events (or some wrapper
structure) instead of parameter galeere. This is not the right place to
fix that tho.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-19 11:42:35 +02:00
Lukas Fleischer
153c638d1d Use generic lists for generic day items.
Use the new generic list implementation instead of "next" pointers in
day_item type variables. Includes some cleanups and fixes.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-19 11:42:35 +02:00
Lukas Fleischer
bf431d6cd9 Use generic lists for todo items.
Use the new generic list implementation instead of "next" pointers in
todo items.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-19 11:42:34 +02:00
Lukas Fleischer
6f883c0f3f Use generic lists for events.
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>
2011-04-19 11:42:34 +02:00
Lukas Fleischer
1de34587ab Remove "next" member from "apoint" structure.
Field seems to be unused. Verify using following spatch:

----
@@ struct apoint *apt; @@

* apt->next
----

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-19 11:42:34 +02:00
Lukas Fleischer
77ef3fe76e Use generic lists for appointments.
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>
2011-04-19 11:42:33 +02:00
Lukas Fleischer
d668963e20 Add macros to use for thread-safe linked lists.
Add LLIST_TS_* macros in a fashion similar to the already existing
LLIST_* macros. Unlike the non-thread-safe version, these include
LLIST_TS_LOCK and LLIST_TS_UNLOCK which can be used to lock (and unlock)
a list (hence the thread-safety).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-19 11:42:33 +02:00
Lukas Fleischer
612204a60a Add macros for linked list operations.
Mostly in preparation to the pending thread-safe list macros. This way,
we have a similar interface to thead-safe and non-thread-safe lists.

This also adds LLIST_FOREACH and LLIST_FIND_FOREACH macros which can be
used as shortcuts when iterating over all list items or a subset of list
items that is accepted by a callback function.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-19 11:42:33 +02:00
Lukas Fleischer
0eb1da8dd7 Add linked lists implementation.
As discussed on the mailing lists, the various linked list
implementations we currently use at a dozen of different places in the
calcurse source tree are inconvenient and should be replaced by a single
generic solution.

This is a first approach to introduce such a generic implemetation. It
provides following functions:

* llist_init(): Initialize a list.

* llist_free_inner(): Loop through a list and free all items.

* llist_free(): Free the list itself (but not the individual items).

* llist_first(): Get the first item of a list.

* llist_nth(): Get the nth item of a list.

* llist_next(): Get the successor of a list item.

* llist_find_first(): Find an item using a callback function.

* llist_find_next(): Find the next match using a callback function.

* llist_find_nth(): Find the nth item in a list (using a callback).

* llist_get_data(): Get a pointer to the actual data of a list item.

* llist_add(): Add an item at the end of a list.

* llist_add_sorted(): Add an item to a sorted list (using a comparison
                      callback function).

* llist_remove(): Remove an item from a list.

Linked lists are stored in "llist_t" structures, list items are to be
stored in "llist_item_t" structs.

All of the llist_*() functions either expect a pointer to a llist_t
structure (in case the function operates on the list itself) or a
pointer to a llist_item_t (llist_*_next() and llist_get_data()).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-19 11:42:32 +02:00
Lukas Fleischer
7758a41851 Use mem_free() instead of xfree() in check_time().
xfree() should never be used directly and only be called by one of the
mem_*() wrappers.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-17 20:42:47 +02:00
Lukas Fleischer
cc49f1e262 Fix io_file_is_empty() behaviour when file starts with a newline.
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>
2011-04-12 18:31:48 +02:00
Lukas Fleischer
57b62a1e49 Use do-while loops when reading start time and duration in apoint_add().
Using do-while loops seems more appropriate here as "item_time" hasn't
even been read when either of the loops are entered. Spotted by
clang-analyzer.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-12 12:02:39 +02:00
Lukas Fleischer
3a4431e568 Fix null pointer dereference in parse_date().
Passing a date in format "mm-dd-yy" where short forms are not allowed
would lead to a null pointer dereference here. This one fixes that.
Spotted by clang-analyzer.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-12 12:02:39 +02:00
Lukas Fleischer
5fc6d92866 Remove some more dead assignments spotted by clang-analyzer.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-12 12:02:38 +02:00
Lukas Fleischer
b4a2fa4435 Declare exit_calcurse() "noreturn".
Functions that never return should be declared "noreturn" to tell the
compiler this fact. Also, clang-analyzer will detect this attribute and
take it into account when running scan-build.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-12 12:02:37 +02:00
Lukas Fleischer
b9c1969126 Drop empty notes after editing.
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>
2011-04-12 12:02:23 +02:00
Lukas Fleischer
1140feaabf Update and cleanup ".gitignore".
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-11 10:56:14 +02:00
Lukas Fleischer
df972cd45d Add more detailed instructions on tx push usage to documentation.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-11 10:50:43 +02:00
Lukas Fleischer
5f462f04ed Add base transifex-client configuration file.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-11 10:05:47 +02:00
Lukas Fleischer
ba651cf0a0 Use HTTPs for tx(1) samples in the documentation.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-11 10:01:05 +02:00
Lukas Fleischer
09231785f2 Update portable object files.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-10 18:02:33 +02:00
Lukas Fleischer
76b61faa67 Update "calcurse.pot".
Renegerate the catalog file with our new xgettext options. Drop line
numbers.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-10 18:00:18 +02:00
Lukas Fleischer
ad293b6a2e Add "--no-location" to xgettext options.
Disable line numbers in portable object files. They are not very useful
and generate a lot of junk on every update, hiding the actual changes.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-10 17:57:33 +02:00
Lukas Fleischer
af8b868a15 Fix Transifex resource slug in documentation.
The slug of the "calcurse.pot" resource has been changed from
"calcurse-pot" to "calcursepot" for consistency reasons. Update the
documentation where necessary.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-04-10 17:34:16 +02:00