summaryrefslogtreecommitdiffstats
path: root/src/vars.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vars.c')
-rw-r--r--src/vars.c56
1 files changed, 33 insertions, 23 deletions
diff --git a/src/vars.c b/src/vars.c
index 84f8b08..dd4cfbc 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2011 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2012 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -48,6 +48,9 @@ int resize = 0;
/* variable to tell if the terminal supports color */
unsigned colorize = 0;
+/* Default background and foreground colors. */
+int foreground, background;
+
/*
* To tell if curses interface was launched already or not (in that case
* calcurse is running in command-line mode).
@@ -55,11 +58,15 @@ unsigned colorize = 0;
*/
enum ui_mode ui_mode = UI_CMDLINE;
+/* Don't save anything if this is set. */
+int read_only = 0;
+
/*
* variables to store calendar names
*/
int days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-char *monthnames[12] = {
+
+const char *monthnames[12] = {
N_("January"),
N_("February"),
N_("March"),
@@ -74,7 +81,7 @@ char *monthnames[12] = {
N_("December")
};
-char *daynames[8] = {
+const char *daynames[8] = {
N_("Sun"),
N_("Mon"),
N_("Tue"),
@@ -99,6 +106,9 @@ char path_cpid[] = "";
char path_dpid[] = "";
char path_dmon_log[] = "";
+/* Variable to store global configuration. */
+struct conf conf;
+
/* Variable to handle pads. */
struct pad apad;
@@ -111,45 +121,45 @@ struct dmon_conf dmon;
/*
* Variables init
*/
-void
-vars_init (struct conf *conf)
+void vars_init(void)
{
- char *ed, *pg;
+ const char *ed, *pg;
/* Variables for user configuration */
- conf->confirm_quit = 1;
- conf->confirm_delete = 1;
- conf->auto_save = 1;
- conf->periodic_save = 0;
- conf->skip_system_dialogs = 0;
- conf->skip_progress_bar = 0;
- (void)strncpy (conf->output_datefmt, "%D", 3);
- conf->input_datefmt = 1;
+ conf.confirm_quit = 1;
+ conf.confirm_delete = 1;
+ conf.auto_save = 1;
+ conf.auto_gc = 0;
+ conf.periodic_save = 0;
+ conf.system_dialogs = 1;
+ conf.progress_bar = 1;
+ strncpy(conf.output_datefmt, "%D", 3);
+ conf.input_datefmt = 1;
/* Default external editor and pager */
- ed = getenv ("VISUAL");
+ ed = getenv("VISUAL");
if (ed == NULL || ed[0] == '\0')
- ed = getenv ("EDITOR");
+ ed = getenv("EDITOR");
if (ed == NULL || ed[0] == '\0')
ed = DEFAULT_EDITOR;
- conf->editor = ed;
+ conf.editor = ed;
- pg = getenv ("PAGER");
+ pg = getenv("PAGER");
if (pg == NULL || pg[0] == '\0')
pg = DEFAULT_PAGER;
- conf->pager = pg;
+ conf.pager = pg;
- wins_set_layout (1);
+ wins_set_layout(1);
- calendar_set_first_day_of_week (MONDAY);
+ calendar_set_first_day_of_week(MONDAY);
/* Pad structure to scroll text inside the appointment panel */
apad.length = 1;
apad.first_onscreen = 0;
/* Attribute definitions for color and non-color terminals */
- custom_init_attr ();
+ custom_init_attr();
/* Start at the current date */
- calendar_init_slctd_day ();
+ calendar_init_slctd_day();
}