| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use tcsetattr() to disable canonical mode in press_any_key() before
waiting for a key press. This makes sure that input is available
immediately (instead of line by line). Also, disable echoing until a key
is pressed.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This allows for specifying multiple command line parameters to be passed
on to the command in a way similar to fork_exec(). This is useful if we
want to wrap editor or pager invocations in a shell.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When asking the user to choose between multiple alternatives, properly
handle resize events.
Note that we would also need to do so in getstring()...
Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| | |
Use snprintf(3) instead of sprintf(3) and fix a missing i18n tag.
Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Introduce a new `status_ask_bool()` function, and use it where
applicable.
This greatly reduces code duplication, and will allow handling special
events (resize, user escape) much more uniformely.
Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We need a simpler version, based on the previously defined
`status_ask_choice()` function, that asks to choose amongst a number
of alternatives that can simply enumerated, without needing to bind
keys on them.
Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This function allows the user to choose between various alternatives,
each one being associated to a given key.
This will allow a great deal of factorisation, which will make it
easier to handle special events (like resizing, user escape...) in an
uniform manner.
The cool part of the approach taken here is that it allows full i18n
(i.e. the key bound to an alternative can be different depending on
the language), at the expense of a somewhat less readable code on the
caller side.
Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add the "const" keyword to parameters and variables that are never
modified. Most of these were spotted by "-Wwrite-strings".
We cast the second parameter to execvp() explicitly as it expects a
"char *const[]" where it should expect a "const char *const[]"
(according to the documentation, this is due to compatibility reasons).
This should be changed once we come up with a better solution.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Don't restrict ranges when entering durations. We now accept duration
like "+1d42h600m". This might not seem very logical, but it's
perfectly valid, and being able to enter "+36h" is useful when you
don't want to do the maths yourself.
Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add "default" and "epoch" extended formats for dates. "default" is the
same as "%H:%M", "epoch" prints the number of seconds since January 1,
1970.
Also, change the semantics of "%(start)" to return dates in default
format (same format that "%(startstr)" used to use before this patch).
The old "%(start)" behavior can be emulated by using "%(start:epoch)".
The same applies to "%(end)" and "%(endstr)".
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| | |
Add support for appending a strftime()-style format string to "%(start)"
and "%(end)".
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Extended formats can be specified by adding custom format strings to the
end of a long format specifier, separated by a colon (":"). This feature
is currently unused. Extended format support for several format
specifiers will be added in following patches.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Adds following long format specifiers for each short format specifier:
* s: (start)
* S: (startstr)
* d: (duration)
* e: (end)
* E: (endstr)
* m: (message)
* n: (noteid)
* N: (note)
* p: (priority)
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| | |
Move the format specifier parser to a separate function. This is done in
preparation for supporting long format specifiers.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| | |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| | |
Fixes a couple of warnings seen with GCC 4.7.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| | |
Translated strings returned by gettext() are statically allocated and
shouldn't be modified.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| | |
Add 2012 to the copyright range for all source and documentation files.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Translated strings returned by gettext() are statically allocated.
There's no need to copy them to a buffer, we can use the pointers
returned by gettext() instead.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
strncmp() isn't intended to be a secure strcmp() replacement, it is
designed to be used if you want to compare the first n characters of two
strings. Since we always compare character pointers with string
literals, switch to using strcmp() everywhere.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove some redundant wnoutrefresh() invocations. There's no need to
copy a window to the virtual screen unless doupdate() is invoked
immediately afterwards.
This reduces flicker when browsing in the calendar panel.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* "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>
|
| |
| |
| |
| | |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| | |
We support all simple escape sequences listed in the ANSI C standard,
plus "\0" to allow for printing null characters.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| | |
This allows using "%%" to print the '%' character.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Move print_notefile() from "src/args.c" to "src/utils.c".
* Add a "%N" format specifier to print_*(). This invokes
print_notefile() and prints the content of an item's note file.
* src/args.c: Use the new format specifier instead of print_notefile()
everywhere.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This goes in line with the other commits adding print_*() support.
Following format specifiers are allowed:
* p: Print the priority of the item
* m: Print the description of the item
* n: Print the name of the note file belonging to the item
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add print_recur_apoint() and print_recur_event() helper functions to
print recurrent items to stdout and use them everywhere. Currently,
these are only wrapper functions to print_apoint() and print_event()
that create temporary, non-recurrent items.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a flexible helper function print_event() and use it whenever we
print events to stdout. This reduces the number of copy-pasted code and
eventually allows for specifying custom format strings.
Following format specifiers are supported:
* m: Print the description of the item
* n: Print the name of the note file belonging to the item
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a flexible helper function print_apoint() and use it whenever we
print appointments to stdout. This reduces the number of copy-pasted
code and eventually allows for specifying custom format strings.
Following format specifiers are supported:
* s: Print the start time of the appointment as UNIX time stamp
* S: Print the start time of the appointment using the "hh:mm" format
* d: Print the duration of the appointment in seconds
* e: Print the end time of the appointment as UNIX time stamp
* E: Print the end time of the appointment using the "hh:mm" format
* m: Print the description of the item
* n: Print the name of the note file belonging to the item
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
No reason to use "return (x);" here. Refer to the GNU coding guidelines
for details. Created using following semantic patch:
@@
expression expr;
@@
- return (expr);
+ return expr;
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add support for "1d23h42m"-like duration strings to parse_duration().
Also, switch to using a deterministic finite automaton to parse duration
strings, as things tend to get unclear.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| | |
Now that parse_time() and parse_duration() do all the validation work,
this isn't used (nor needed) any longer.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
These helpers can be used in a fashion similar to parse_date(). In
addition to check_time(), parse_time() and parse_duration() support
short forms such as "23:" (instead of "23:00") and ":45" (instead of
"00:45").
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| | |
We don't mess about with the date string here, so it should be declared
const.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now that we use hash-based note file names, note files should never be
unlinked as a note file might be shared.
Also, remove the ERASE_FORCE_KEEP_NOTE flag that no longer makes any
sense.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Add new note_edit() and note_view() helper functions. Use these
instead of copy-pasted code in *_note_edit().
* Move all note-related functions (note_edit(), note_view(),
note_erase()) to a new source file "note.c".
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
Displays "Press any key to continue..." in shell terminal mode and waits
for a key stroke.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| | |
Can be used to execute an external program in a shell.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| | |
Can be used to wait for the termination of a child process.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
| |
| |
| |
| |
| |
| |
| | |
Can be used to execute an external program. Provides the possibility to
optionally create a pipe to the new process.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|/
|
|
|
|
|
| |
Move getstring() related stuff into a separate file as a first step on
our way to UTF-8 support for line editing helpers.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
| |
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
|
| |
* 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>
|