summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xChangeLog5
-rwxr-xr-xconfigure.ac8
-rwxr-xr-xsrc/apoint.c10
-rwxr-xr-xsrc/args.c12
-rwxr-xr-xsrc/calcurse.c74
-rwxr-xr-xsrc/calendar.c14
-rwxr-xr-xsrc/calendar.h37
-rwxr-xr-xsrc/custom.c16
-rwxr-xr-xsrc/day.c10
-rwxr-xr-xsrc/day.h4
-rwxr-xr-xsrc/io.c4
-rwxr-xr-xsrc/io.h4
-rwxr-xr-xsrc/todo.c12
-rwxr-xr-xsrc/utils.c10
-rwxr-xr-xsrc/utils.h6
-rwxr-xr-xsrc/vars.c14
-rwxr-xr-xsrc/vars.h15
-rwxr-xr-xsrc/wins.c4
18 files changed, 131 insertions, 128 deletions
diff --git a/ChangeLog b/ChangeLog
index 61509cc..7edc0bd 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-12 Frederic Culot <frederic@culot.org>
+
+ * configure.ac
+ * src/var.h: sdtbool header removed, unsigned type use instead
+
2009-07-11 Frederic Culot <frederic@culot.org>
* === Released 2.6 ===
diff --git a/configure.ac b/configure.ac
index f9288a2..925eee2 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $calcurse: configure.ac,v 1.32 2009/07/05 17:16:15 culot Exp $
+# $calcurse: configure.ac,v 1.33 2009/07/12 16:21:58 culot Exp $
#-------------------------------------------------------------------------------
# Init
@@ -21,9 +21,9 @@ AC_PROG_CC
# Checks for header files
#-------------------------------------------------------------------------------
AC_HEADER_STDC
-AC_CHECK_HEADERS([ctype.h getopt.h locale.h math.h signal.h stdbool.h stdio.h \
- stdlib.h string.h sys/stat.h sys/types.h sys/wait.h time.h \
- unistd.h errno.h limits.h regex.h])
+AC_CHECK_HEADERS([ctype.h getopt.h locale.h math.h signal.h stdio.h stdlib.h \
+ string.h sys/stat.h sys/types.h sys/wait.h time.h unistd.h \
+ errno.h limits.h regex.h])
#-------------------------------------------------------------------------------
# Checks for system libs
#-------------------------------------------------------------------------------
diff --git a/src/apoint.c b/src/apoint.c
index be300ab..4a8d3ef 100755
--- a/src/apoint.c
+++ b/src/apoint.c
@@ -1,4 +1,4 @@
-/* $calcurse: apoint.c,v 1.35 2009/07/05 20:33:13 culot Exp $ */
+/* $calcurse: apoint.c,v 1.36 2009/07/12 16:21:58 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -296,7 +296,7 @@ apoint_delete (conf_t *conf, unsigned *nb_events, unsigned *nb_apoints)
char *del_app_str = _("Do you really want to delete this item ?");
long date;
int nb_items = *nb_apoints + *nb_events;
- bool go_for_deletion = false;
+ unsigned go_for_deletion = 0;
int to_be_removed = 0;
int answer = 0;
int deleted_item_type = 0;
@@ -308,7 +308,7 @@ apoint_delete (conf_t *conf, unsigned *nb_events, unsigned *nb_apoints)
status_mesg (del_app_str, choices);
answer = wgetch (win[STA].p);
if ((answer == 'y') && (nb_items != 0))
- go_for_deletion = true;
+ go_for_deletion = 1;
else
{
wins_erase_status_bar ();
@@ -316,7 +316,7 @@ apoint_delete (conf_t *conf, unsigned *nb_events, unsigned *nb_apoints)
}
}
else if (nb_items != 0)
- go_for_deletion = true;
+ go_for_deletion = 1;
if (go_for_deletion)
{
@@ -769,7 +769,7 @@ apoint_update_panel (int which_pan)
float ratio = ((float) app_length) / ((float) apad.length);
int sbar_length = (int) (ratio * app_length);
int highend = (int) (ratio * apad.first_onscreen);
- bool hilt_bar = (which_pan == APP) ? true : false;
+ unsigned hilt_bar = (which_pan == APP) ? 1 : 0;
int sbar_top = highend + title_lines + 1;
if ((sbar_top + sbar_length) > win[APP].h - 1)
diff --git a/src/args.c b/src/args.c
index 1341a83..5c8889c 100755
--- a/src/args.c
+++ b/src/args.c
@@ -1,4 +1,4 @@
-/* $calcurse: args.c,v 1.53 2009/07/05 20:33:14 culot Exp $ */
+/* $calcurse: args.c,v 1.54 2009/07/12 16:21:58 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -334,7 +334,7 @@ app_arg (int add_line, date_t *day, long date, int print_note, conf_t *conf,
recur_apoint_llist_node_t *ra;
apoint_llist_node_t *i;
long today;
- bool print_date = true;
+ unsigned print_date = 1;
int app_found = 0;
char apoint_start_time[100];
char apoint_end_time[100];
@@ -366,7 +366,7 @@ app_arg (int add_line, date_t *day, long date, int print_note, conf_t *conf,
if (print_date)
{
arg_print_date (today, conf);
- print_date = false;
+ print_date = 0;
}
fputs (" * ", stdout);
fputs (re->mesg, stdout);
@@ -392,7 +392,7 @@ app_arg (int add_line, date_t *day, long date, int print_note, conf_t *conf,
if (print_date)
{
arg_print_date (today, conf);
- print_date = false;
+ print_date = 0;
}
fputs (" * ", stdout);
fputs (j->mesg, stdout);
@@ -421,7 +421,7 @@ app_arg (int add_line, date_t *day, long date, int print_note, conf_t *conf,
if (print_date)
{
arg_print_date (today, conf);
- print_date = false;
+ print_date = 0;
}
apoint_sec2str (apoint_recur_s2apoint_s (ra), RECUR_APPT, today,
apoint_start_time, apoint_end_time);
@@ -455,7 +455,7 @@ app_arg (int add_line, date_t *day, long date, int print_note, conf_t *conf,
if (print_date)
{
arg_print_date (today, conf);
- print_date = false;
+ print_date = 0;
}
apoint_sec2str (i, APPT, today, apoint_start_time, apoint_end_time);
fputs (" - ", stdout);
diff --git a/src/calcurse.c b/src/calcurse.c
index 540e2da..972d5f0 100755
--- a/src/calcurse.c
+++ b/src/calcurse.c
@@ -1,4 +1,4 @@
-/* $calcurse: calcurse.c,v 1.81 2009/07/05 20:33:15 culot Exp $ */
+/* $calcurse: calcurse.c,v 1.82 2009/07/12 16:21:59 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -74,9 +74,9 @@ main (int argc, char **argv)
int sav_hilt_tod = 0;
int cut_item = 0;
struct sigaction sigact;
- bool do_storage = false;
- bool do_update = true;
- bool day_changed = false;
+ unsigned do_storage = 0;
+ unsigned do_update = 1;
+ unsigned day_changed = 0;
char *no_color_support =
_("Sorry, colors are not supported by your terminal\n"
"(Press [ENTER] to continue)");
@@ -116,7 +116,7 @@ main (int argc, char **argv)
/* Check if terminal supports color. */
if (has_colors ())
{
- colorize = true;
+ colorize = 1;
background = COLOR_BLACK;
foreground = COLOR_WHITE;
start_color ();
@@ -143,7 +143,7 @@ main (int argc, char **argv)
}
else
{
- colorize = false;
+ colorize = 0;
background = COLOR_BLACK;
}
@@ -181,17 +181,17 @@ main (int argc, char **argv)
{
int key;
- do_update = true;
+ do_update = 1;
key = keys_getch (win[STA].p);
switch (key)
{
case ERR:
- do_update = false;
+ do_update = 0;
break;
case KEY_GENERIC_REDRAW:
case KEY_RESIZE:
- do_update = false;
+ do_update = 0;
wins_reset ();
break;
@@ -246,8 +246,8 @@ main (int argc, char **argv)
calendar_goto_today ();
else
calendar_change_day (conf.input_datefmt);
- do_storage = true;
- day_changed = true;
+ do_storage = 1;
+ day_changed = 1;
break;
case KEY_VIEW_ITEM:
@@ -270,7 +270,7 @@ main (int argc, char **argv)
custom_color_config ();
else
{
- colorize = false;
+ colorize = 0;
wins_erase_status_bar ();
mvwprintw (win[STA].p, 0, 0, _(no_color_support));
wgetch (win[STA].p);
@@ -295,7 +295,7 @@ main (int argc, char **argv)
}
wins_reset ();
wins_update ();
- do_storage = true;
+ do_storage = 1;
wins_erase_status_bar ();
custom_config_bar ();
}
@@ -304,7 +304,7 @@ main (int argc, char **argv)
case KEY_GENERIC_ADD_APPT:
apoint_add ();
- do_storage = true;
+ do_storage = 1;
break;
case KEY_GENERIC_ADD_TODO:
@@ -318,7 +318,7 @@ main (int argc, char **argv)
{
case APP:
apoint_add ();
- do_storage = true;
+ do_storage = 1;
break;
case TOD:
todo_new_item ();
@@ -335,7 +335,7 @@ main (int argc, char **argv)
day_edit_item (&conf);
else if (wins_slctd () == TOD && todo_hilt () != 0)
todo_edit_item ();
- do_storage = true;
+ do_storage = 1;
break;
case KEY_DEL_ITEM:
@@ -343,14 +343,14 @@ main (int argc, char **argv)
apoint_delete (&conf, &inday.nb_events, &inday.nb_apoints);
else if (wins_slctd () == TOD && todo_hilt () != 0)
todo_delete (&conf);
- do_storage = true;
+ do_storage = 1;
break;
case KEY_GENERIC_CUT:
if (wins_slctd () == APP && apoint_hilt () != 0)
{
cut_item = apoint_cut (&inday.nb_events, &inday.nb_apoints);
- do_storage = true;
+ do_storage = 1;
}
break;
@@ -359,14 +359,14 @@ main (int argc, char **argv)
{
apoint_paste (&inday.nb_events, &inday.nb_apoints, cut_item);
cut_item = 0;
- do_storage = true;
+ do_storage = 1;
}
break;
case KEY_REPEAT_ITEM:
if (wins_slctd () == APP && apoint_hilt () != 0)
recur_repeat_item (&conf);
- do_storage = true;
+ do_storage = 1;
break;
case KEY_FLAG_ITEM:
@@ -374,7 +374,7 @@ main (int argc, char **argv)
apoint_switch_notify ();
else if (wins_slctd () == TOD && todo_hilt () != 0)
todo_flag ();
- do_storage = true;
+ do_storage = 1;
break;
case KEY_RAISE_PRIORITY:
@@ -394,7 +394,7 @@ main (int argc, char **argv)
day_edit_note (conf.editor);
else if (wins_slctd () == TOD && todo_hilt () != 0)
todo_edit_note (conf.editor);
- do_storage = true;
+ do_storage = 1;
break;
case KEY_VIEW_NOTE:
@@ -416,7 +416,7 @@ main (int argc, char **argv)
case KEY_GENERIC_IMPORT:
wins_erase_status_bar ();
io_import_data (IO_IMPORT_ICAL, &conf, NULL);
- do_storage = true;
+ do_storage = 1;
break;
case KEY_GENERIC_EXPORT:
@@ -437,7 +437,7 @@ main (int argc, char **argv)
}
wins_reset ();
wins_update ();
- do_storage = true;
+ do_storage = 1;
wins_erase_status_bar ();
io_export_bar ();
}
@@ -448,8 +448,8 @@ main (int argc, char **argv)
case KEY_MOVE_RIGHT:
if (wins_slctd () == CAL || key == KEY_GENERIC_NEXT_DAY)
{
- do_storage = true;
- day_changed = true;
+ do_storage = 1;
+ day_changed = 1;
calendar_move (RIGHT);
}
break;
@@ -458,8 +458,8 @@ main (int argc, char **argv)
case KEY_MOVE_LEFT:
if (wins_slctd () == CAL || key == KEY_GENERIC_PREV_DAY)
{
- do_storage = true;
- day_changed = true;
+ do_storage = 1;
+ day_changed = 1;
calendar_move (LEFT);
}
break;
@@ -468,8 +468,8 @@ main (int argc, char **argv)
case KEY_MOVE_UP:
if (wins_slctd () == CAL || key == KEY_GENERIC_PREV_WEEK)
{
- do_storage = true;
- day_changed = true;
+ do_storage = 1;
+ day_changed = 1;
calendar_move (UP);
}
else if ((wins_slctd () == APP) && (apoint_hilt () > 1))
@@ -489,8 +489,8 @@ main (int argc, char **argv)
case KEY_MOVE_DOWN:
if (wins_slctd () == CAL || key == KEY_GENERIC_NEXT_WEEK)
{
- do_storage = true;
- day_changed = true;
+ do_storage = 1;
+ day_changed = 1;
calendar_move (DOWN);
}
else if ((wins_slctd () == APP) &&
@@ -510,8 +510,8 @@ main (int argc, char **argv)
case KEY_START_OF_WEEK:
if (wins_slctd () == CAL)
{
- do_storage = true;
- day_changed = true;
+ do_storage = 1;
+ day_changed = 1;
calendar_move (WEEK_START);
}
break;
@@ -519,8 +519,8 @@ main (int argc, char **argv)
case KEY_END_OF_WEEK:
if (wins_slctd () == CAL)
{
- do_storage = true;
- day_changed = true;
+ do_storage = 1;
+ day_changed = 1;
calendar_move (WEEK_END);
}
break;
@@ -546,7 +546,7 @@ main (int argc, char **argv)
break;
default:
- do_update = false;
+ do_update = 0;
break;
}
diff --git a/src/calendar.c b/src/calendar.c
index a1c5975..c626888 100755
--- a/src/calendar.c
+++ b/src/calendar.c
@@ -1,4 +1,4 @@
-/* $calcurse: calendar.c,v 1.24 2009/07/05 20:33:15 culot Exp $ */
+/* $calcurse: calendar.c,v 1.25 2009/07/12 16:21:59 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -69,7 +69,7 @@
#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
static date_t today, slctd_day;
-static bool week_begins_on_monday;
+static unsigned week_begins_on_monday;
static pthread_mutex_t date_thread_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_t calendar_t_date;
@@ -132,14 +132,14 @@ calendar_set_first_day_of_week (wday_e first_day)
switch (first_day)
{
case SUNDAY:
- week_begins_on_monday = false;
+ week_begins_on_monday = 0;
break;
case MONDAY:
- week_begins_on_monday = true;
+ week_begins_on_monday = 1;
break;
default:
ERROR_MSG (_("ERROR setting first day of week"));
- week_begins_on_monday = false;
+ week_begins_on_monday = 0;
/* NOTREACHED */
}
}
@@ -151,8 +151,8 @@ calendar_change_first_day_of_week (void)
week_begins_on_monday = !week_begins_on_monday;
}
-/* Return true if week begins on monday, false otherwise. */
-bool
+/* Return 1 if week begins on monday, 0 otherwise. */
+unsigned
calendar_week_begins_on_monday (void)
{
return (week_begins_on_monday);
diff --git a/src/calendar.h b/src/calendar.h
index cdd84cd..406eed6 100755
--- a/src/calendar.h
+++ b/src/calendar.h
@@ -1,4 +1,4 @@
-/* $calcurse: calendar.h,v 1.14 2009/07/05 20:33:16 culot Exp $ */
+/* $calcurse: calendar.h,v 1.15 2009/07/12 16:21:59 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -53,7 +53,6 @@
#error "Missing ncurses header. Aborting..."
#endif
-#include <stdbool.h>
#include <time.h>
#define CALHEIGHT 12
@@ -103,22 +102,22 @@ typedef enum
}
move_t;
-void calendar_start_date_thread (void);
-void calendar_stop_date_thread (void);
-void calendar_set_current_date (void);
-void calendar_set_first_day_of_week (wday_e);
-void calendar_change_first_day_of_week (void);
-bool calendar_week_begins_on_monday (void);
-void calendar_store_current_date (date_t *);
-void calendar_init_slctd_day (void);
-date_t *calendar_get_slctd_day (void);
-long calendar_get_slctd_day_sec (void);
-void calendar_update_panel (WINDOW *);
-void calendar_goto_today (void);
-void calendar_change_day (int);
-void calendar_move (move_t);
-long calendar_start_of_year (void);
-long calendar_end_of_year (void);
-char *calendar_get_pom (time_t);
+void calendar_start_date_thread (void);
+void calendar_stop_date_thread (void);
+void calendar_set_current_date (void);
+void calendar_set_first_day_of_week (wday_e);
+void calendar_change_first_day_of_week (void);
+unsigned calendar_week_begins_on_monday (void);
+void calendar_store_current_date (date_t *);
+void calendar_init_slctd_day (void);
+date_t *calendar_get_slctd_day (void);
+long calendar_get_slctd_day_sec (void);
+void calendar_update_panel (WINDOW *);
+void calendar_goto_today (void);
+void calendar_change_day (int);
+void calendar_move (move_t);
+long calendar_start_of_year (void);
+long calendar_end_of_year (void);
+char *calendar_get_pom (time_t);
#endif /* CALCURSE_CALENDAR_H */
diff --git a/src/custom.c b/src/custom.c
index 9bb9002..810679c 100755
--- a/src/custom.c
+++ b/src/custom.c
@@ -1,4 +1,4 @@
-/* $calcurse: custom.c,v 1.39 2009/07/05 20:33:17 culot Exp $ */
+/* $calcurse: custom.c,v 1.40 2009/07/12 16:22:00 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -55,17 +55,17 @@
static struct attribute_s attr;
-static bool
+static unsigned
fill_config_var (char *string)
{
if (strncmp (string, "yes", 3) == 0)
- return (true);
+ return 1;
else if (strncmp (string, "no", 2) == 0)
- return (false);
+ return 0;
else
{
EXIT (_("wrong configuration variable format."));
- return false;
+ return 0;
}
}
@@ -129,7 +129,7 @@ custom_load_color (char *color, int background)
switch (color_num)
{
case 0:
- colorize = false;
+ colorize = 0;
break;
case 1:
init_pair (COLR_CUSTOM, COLOR_RED, background);
@@ -774,7 +774,7 @@ custom_color_config (void)
break;
case KEY_GENERIC_SELECT:
- colorize = true;
+ colorize = 1;
need_reset = 1;
theme_changed = 1;
if (cursor > NBUSERCOLORS)
@@ -804,7 +804,7 @@ custom_color_config (void)
break;
case KEY_GENERIC_CANCEL:
- colorize = false;
+ colorize = 0;
need_reset = 1;
break;
}
diff --git a/src/day.c b/src/day.c
index 65a4fa2..d936372 100755
--- a/src/day.c
+++ b/src/day.c
@@ -1,4 +1,4 @@
-/* $calcurse: day.c,v 1.49 2009/07/05 20:33:18 culot Exp $ */
+/* $calcurse: day.c,v 1.50 2009/07/12 16:22:00 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -295,7 +295,7 @@ day_store_items (long date, unsigned *pnb_events, unsigned *pnb_apoints)
* day. This is useful to speed up the appointment panel update.
*/
day_items_nb_t *
-day_process_storage (date_t *slctd_date, bool day_changed,
+day_process_storage (date_t *slctd_date, unsigned day_changed,
day_items_nb_t *inday)
{
long date;
@@ -408,7 +408,7 @@ day_write_pad (long date, int width, int length, int incolor)
apoint_llist_node_t a;
int line, item_number, max_pos, recur;
const int x_pos = 0;
- bool draw_line = false;
+ unsigned draw_line = 0;
line = item_number = 0;
max_pos = length;
@@ -431,7 +431,7 @@ day_write_pad (long date, int width, int length, int incolor)
display_item (item_number - incolor, p->mesg, recur,
(p->note != NULL) ? 1 : 0, width - 7, line, x_pos);
line++;
- draw_line = true;
+ draw_line = 1;
}
else
{
@@ -440,7 +440,7 @@ day_write_pad (long date, int width, int length, int incolor)
{
wmove (apad.ptrwin, line, 0);
whline (apad.ptrwin, 0, width);
- draw_line = false;
+ draw_line = 0;
}
/* Last print the appointments for current day. */
item_number++;
diff --git a/src/day.h b/src/day.h
index 2604a4f..e2db0a5 100755
--- a/src/day.h
+++ b/src/day.h
@@ -1,4 +1,4 @@
-/* $calcurse: day.h,v 1.23 2009/07/05 20:33:18 culot Exp $ */
+/* $calcurse: day.h,v 1.24 2009/07/12 16:22:00 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -80,7 +80,7 @@ struct day_saved_item_s
};
void day_free_list (void);
-day_items_nb_t *day_process_storage (date_t *, bool, day_items_nb_t *);
+day_items_nb_t *day_process_storage (date_t *, unsigned, day_items_nb_t *);
void day_write_pad (long, int, int, int);
void day_popup_item (void);
int day_check_if_item (date_t);
diff --git a/src/io.c b/src/io.c
index 46f5641..732c15c 100755
--- a/src/io.c
+++ b/src/io.c
@@ -1,4 +1,4 @@
-/* $calcurse: io.c,v 1.66 2009/07/05 20:33:20 culot Exp $ */
+/* $calcurse: io.c,v 1.67 2009/07/12 16:22:00 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -1522,7 +1522,7 @@ io_check_data_files (void)
/* Draw the startup screen */
void
-io_startup_screen (bool skip_dialogs, int no_data_file)
+io_startup_screen (unsigned skip_dialogs, int no_data_file)
{
char *welcome_mesg =
_("Welcome to Calcurse. Missing data files were created.");
diff --git a/src/io.h b/src/io.h
index 32286ab..a0b9d8f 100755
--- a/src/io.h
+++ b/src/io.h
@@ -1,4 +1,4 @@
-/* $calcurse: io.h,v 1.21 2009/07/05 20:33:21 culot Exp $ */
+/* $calcurse: io.h,v 1.22 2009/07/12 16:22:01 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -75,7 +75,7 @@ void io_load_todo (void);
void io_load_keys (char *);
void io_check_file (char *, int *);
int io_check_data_files (void);
-void io_startup_screen (bool, int);
+void io_startup_screen (unsigned, int);
void io_export_data (export_type_t, conf_t *);
void io_export_bar (void);
void io_import_data (import_type_t, conf_t *, char *);
diff --git a/src/todo.c b/src/todo.c
index e027685..b2dbd5e 100755
--- a/src/todo.c
+++ b/src/todo.c
@@ -1,4 +1,4 @@
-/* $calcurse: todo.c,v 1.33 2009/07/05 20:33:24 culot Exp $ */
+/* $calcurse: todo.c,v 1.34 2009/07/12 16:22:01 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -277,7 +277,7 @@ todo_delete (conf_t *conf)
_("This item has a note attached to it. "
"Delete (t)odo or just its (n)ote ?");
char *erase_choice = _("[t/n] ");
- bool go_for_todo_del = false;
+ unsigned go_for_todo_del = 0;
int answer, has_note;
if (conf->confirm_delete)
@@ -286,7 +286,7 @@ todo_delete (conf_t *conf)
answer = wgetch (win[STA].p);
if ((answer == 'y') && (todos > 0))
{
- go_for_todo_del = true;
+ go_for_todo_del = 1;
}
else
{
@@ -295,9 +295,9 @@ todo_delete (conf_t *conf)
}
}
else if (todos > 0)
- go_for_todo_del = true;
+ go_for_todo_del = 1;
- if (go_for_todo_del == false)
+ if (go_for_todo_del == 0)
{
wins_erase_status_bar ();
return;
@@ -483,7 +483,7 @@ todo_update_panel (int which_pan)
float ratio = ((float) max_items) / ((float) todos);
int sbar_length = (int) (ratio * (max_items + 1));
int highend = (int) (ratio * first);
- bool hilt_bar = (which_pan == TOD) ? true : false;
+ unsigned hilt_bar = (which_pan == TOD) ? 1 : 0;
int sbar_top = highend + title_lines;
if ((sbar_top + sbar_length) > win[TOD].h - 1)
diff --git a/src/utils.c b/src/utils.c
index 35fad59..66ee6d5 100755
--- a/src/utils.c
+++ b/src/utils.c
@@ -1,4 +1,4 @@
-/* $calcurse: utils.c,v 1.74 2009/07/05 20:33:25 culot Exp $ */
+/* $calcurse: utils.c,v 1.75 2009/07/12 16:22:01 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -690,7 +690,7 @@ check_time (char *string)
*/
void
draw_scrollbar (WINDOW *win, int y, int x, int length,
- int bar_top, int bar_bottom, bool hilt)
+ int bar_top, int bar_bottom, unsigned hilt)
{
mvwvline (win, bar_top, x, ACS_VLINE, bar_bottom - bar_top);
if (hilt)
@@ -779,17 +779,17 @@ mystrtol (const char *str)
/* Print the given option value with appropriate color. */
void
-print_bool_option_incolor (WINDOW *win, bool option, int pos_y, int pos_x)
+print_bool_option_incolor (WINDOW *win, unsigned option, int pos_y, int pos_x)
{
int color = 0;
char option_value[BUFSIZ] = "";
- if (option == true)
+ if (option == 1)
{
color = ATTR_TRUE;
strncpy (option_value, _("yes"), BUFSIZ);
}
- else if (option == false)
+ else if (option == 0)
{
color = ATTR_FALSE;
strncpy (option_value, _("no"), BUFSIZ);
diff --git a/src/utils.h b/src/utils.h
index 52ba6b7..59ce4c4 100755
--- a/src/utils.h
+++ b/src/utils.h
@@ -1,4 +1,4 @@
-/* $calcurse: utils.h,v 1.45 2009/07/05 20:33:25 culot Exp $ */
+/* $calcurse: utils.h,v 1.46 2009/07/12 16:22:02 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -145,12 +145,12 @@ long update_time_in_date (long, unsigned, unsigned);
long get_sec_date (date_t);
long min2sec (unsigned);
int check_time (char *);
-void draw_scrollbar (WINDOW *, int, int, int, int, int, bool);
+void draw_scrollbar (WINDOW *, int, int, int, int, int, unsigned);
void item_in_popup (char *, char *, char *, char *);
long get_today (void);
long now (void);
long mystrtol (const char *);
-void print_bool_option_incolor (WINDOW *, bool, int, int);
+void print_bool_option_incolor (WINDOW *, unsigned, int, int);
char *new_tempfile (const char *, int);
void erase_note (char **, erase_flag_e);
int parse_date (char *, int, int *, int *, int *);
diff --git a/src/vars.c b/src/vars.c
index 3620382..7120ae1 100755
--- a/src/vars.c
+++ b/src/vars.c
@@ -1,4 +1,4 @@
-/* $calcurse: vars.c,v 1.16 2009/07/05 20:33:25 culot Exp $ */
+/* $calcurse: vars.c,v 1.17 2009/07/12 16:22:02 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -53,7 +53,7 @@
int col = 0, row = 0;
/* variable to tell if the terminal supports color */
-bool colorize = false;
+unsigned colorize = 0;
/*
* To tell if curses interface was launched already or not (in that case
@@ -121,12 +121,12 @@ vars_init (conf_t *conf)
char *ed, *pg;
/* Variables for user configuration */
- conf->confirm_quit = true;
- conf->confirm_delete = true;
- conf->auto_save = true;
+ conf->confirm_quit = 1;
+ conf->confirm_delete = 1;
+ conf->auto_save = 1;
conf->periodic_save = 0;
- conf->skip_system_dialogs = false;
- conf->skip_progress_bar = false;
+ conf->skip_system_dialogs = 0;
+ conf->skip_progress_bar = 0;
(void)strncpy (conf->output_datefmt, "%D", 3);
conf->input_datefmt = 1;
diff --git a/src/vars.h b/src/vars.h
index 3c28e78..1f220e8 100755
--- a/src/vars.h
+++ b/src/vars.h
@@ -1,4 +1,4 @@
-/* $calcurse: vars.h,v 1.33 2009/07/05 20:33:26 culot Exp $ */
+/* $calcurse: vars.h,v 1.34 2009/07/12 16:22:02 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -54,7 +54,6 @@
#endif
#include <pthread.h>
-#include <stdbool.h>
#define DIR_NAME ".calcurse/"
#define TODO_PATH_NAME "todo"
@@ -135,12 +134,12 @@ struct nbar_s
/* General configuration variables */
typedef struct
{
- bool auto_save;
+ unsigned auto_save;
unsigned periodic_save;
- bool confirm_quit;
- bool confirm_delete;
- bool skip_system_dialogs;
- bool skip_progress_bar;
+ unsigned confirm_quit;
+ unsigned confirm_delete;
+ unsigned skip_system_dialogs;
+ unsigned skip_progress_bar;
char *editor;
char *pager;
char output_datefmt[BUFSIZ]; /* format for displaying date */
@@ -149,7 +148,7 @@ typedef struct
conf_t;
extern int col, row;
-extern bool colorize;
+extern unsigned colorize;
extern ui_mode_e ui_mode;
extern int days[12];
extern char *monthnames[12];
diff --git a/src/wins.c b/src/wins.c
index fbc35e7..c469bb0 100755
--- a/src/wins.c
+++ b/src/wins.c
@@ -1,4 +1,4 @@
-/* $calcurse: wins.c,v 1.25 2009/07/05 20:33:26 culot Exp $ */
+/* $calcurse: wins.c,v 1.26 2009/07/12 16:22:03 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -175,7 +175,7 @@ wins_scrollwin_display (scrollwin_t *sw)
if ((sbar_top + sbar_length) > sw->win.h - 1)
sbar_length = sw->win.h - sbar_top;
draw_scrollbar (sw->win.p, sbar_top, sw->win.w + sw->win.x - 2,
- sbar_length, sw->pad.y + 1, sw->win.h - 1, true);
+ sbar_length, sw->pad.y + 1, sw->win.h - 1, 1);
}
wmove (win[STA].p, 0, 0);
wnoutrefresh (sw->win.p);