28 Commits

Author SHA1 Message Date
Jack Nagel
82aa3e3f43 Define _DARWIN_C_SOURCE to get SIGWINCH on OS X
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2014-07-08 13:01:01 +02:00
Lukas Fleischer
694d28eb78 Use tabs instead of spaces for indentation
This completes our switch to the Linux kernel coding style. Note that we
still use deeply nested constructs at some places which need to be fixed
up later.

Converted using the `Lindent` script from the Linux kernel code base,
along with some manual fixes.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-04-14 00:19:01 +02:00
Lukas Fleischer
a7944d335e Update copyright ranges
Add 2013 to the copyright range for all source and documentation files.

Reported-by: Frederic Culot <frederic@culot.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2013-02-04 20:10:14 +01:00
Lukas Fleischer
8ae75f3ca7 Ignore signals during command execution
Disable signal handlers in wins_prepare_external() and reactivate them
in wins_unprepare_external().

Before, it was possible that resizing the window during editor/pager
mode resulted in the calcurse main screen appearing on top.

Addresses BUG#9.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-11-28 21:49:02 +01:00
Lukas Fleischer
6e490e979c src/sigs.c: Define "_BSD_SOURCE" and "__BSD_VISIBLE"
SIGWINCH isn't POSIX-compatible and causes a compile error on several
platforms, such as OpenBSD:

    sigs.c: In function 'generic_hdlr':
    sigs.c:63: error: 'SIGWINCH' undeclared (first use in this function)
    sigs.c:63: error: (Each undeclared identifier is reported only once
    sigs.c:63: error: for each function it appears in.)
    sigs.c: In function 'sigs_init':
    sigs.c:97: error: 'SIGWINCH' undeclared (first use in this function)
    *** Error code 1

Define "_BSD_SOURCE" explicitly in this compilation unit to enforce
definition of the "SIGWINCH" constant. Also, set "__BSD_VISIBLE" to 1
since FreeBSD doesn't honor "_BSD_SOURCE".

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-06-01 11:21:46 +02:00
Lukas Fleischer
cfd8ede2b3 Switch to Linux kernel coding style
Convert our code base to adhere to Linux kernel coding style using
Lindent, with the following exceptions:

* Use spaces, instead of tabs, for indentation.
* Use 2-character indentations (instead of 8 characters).

Rationale: We currently have too much levels of indentation. Using
8-character tabs would make huge code parts unreadable. These need to be
cleaned up before we can switch to 8 characters.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-05-21 10:13:05 +02:00
Lukas Fleischer
c9aff6d213 Update copyright ranges
Add 2012 to the copyright range for all source and documentation files.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-03-26 14:38:16 +02:00
Lukas Fleischer
136e5bc4f7 Fix POSIX compliance
* "WAIT_MYPGRP" isn't POSIX'ish. Relying on this caused compilation
  issues in certain environments (e.g. under Cygwin). As a workaround,
  define "WAIT_MYPGRP" explicitly if it's undefined.

* "P_tmpdir" is an XSI extension. Don't try use it if it isn't
  available.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-02-19 02:41:09 +01:00
Lukas Fleischer
ce3f0ce76f Make use of the NULL macro
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>
2011-11-02 19:33:23 +01:00
Lukas Fleischer
7cc6305588 Do not cast unused return values to void
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>
2011-11-02 18:32:17 +01: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
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
a8cb1c92ef All headers gathered into a single one. Typedefs suppressed. 2010-03-20 10:54:41 +00:00
Frederic Culot
4db3b69b27 Remove calcurse lock file when running in interactive mode and SIGTERM is received. 2009-08-09 15:49:57 +00:00
Frederic Culot
d2c766a137 New way of handling signals. 2009-07-19 16:51:35 +00:00
Frederic Culot
27b25548a4 Switch to BSD license. 2009-07-05 20:33:13 +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
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
120de530e0 proper cvs tag used 2008-02-14 20:16:30 +00:00
Frederic Culot
f3e8775cab Handling of SIGWINCH improved 2007-10-07 17:13:10 +00:00
Frederic Culot
1096c2d29f handling of SIGWINCH added 2007-08-15 15:30:17 +00:00
Frederic Culot
4b987f70ac unuseful headers removed and some functions became static 2007-07-28 13:11:42 +00:00
Frederic Culot
b12150dea5 new source files to store signal handling routines 2007-07-23 19:31:12 +00:00