diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/args.c | 12 | ||||
-rwxr-xr-x | src/args.h | 8 | ||||
-rwxr-xr-x | src/calcurse.c | 63 | ||||
-rwxr-xr-x | src/calendar.c | 9 | ||||
-rwxr-xr-x | src/calendar.h | 14 | ||||
-rwxr-xr-x | src/day.c | 25 | ||||
-rwxr-xr-x | src/day.h | 10 | ||||
-rwxr-xr-x | src/help.c | 11 | ||||
-rwxr-xr-x | src/help.h | 6 | ||||
-rwxr-xr-x | src/io.h | 19 | ||||
-rwxr-xr-x | src/recur.c | 15 | ||||
-rwxr-xr-x | src/recur.h | 4 | ||||
-rwxr-xr-x | src/todo.c | 27 | ||||
-rwxr-xr-x | src/todo.h | 8 |
14 files changed, 119 insertions, 112 deletions
@@ -1,4 +1,4 @@ -/* $calcurse: args.c,v 1.14 2007/01/16 11:11:47 culot Exp $ */ +/* $calcurse: args.c,v 1.15 2007/03/10 15:54:25 culot Exp $ */ /* * Calcurse - text-based organizer @@ -50,7 +50,7 @@ * Parse the command-line arguments and call the appropriate * routines to handle those arguments. Also initialize the data paths. */ -int parse_args(int argc, char **argv, int colr) +int parse_args(int argc, char **argv) { int ch, add_line = 0; int unknown_flag = 0, app_found = 0; @@ -154,10 +154,10 @@ int parse_args(int argc, char **argv, int colr) io_init(cfile); no_file = check_data_files(); if (dflag || aflag || nflag) - load_app(colr); + load_app(); } if (tflag) { - todo_arg(tnum, colr); + todo_arg(tnum); non_interactive = 1; } if (nflag) { @@ -240,13 +240,13 @@ void help_arg() * Print todo list and exit. If a priority number is given (say not equal to * zero), then only todo items that have this priority will be displayed. */ -void todo_arg(int priority, int colr) +void todo_arg(int priority) { struct todo_s *i; int nb_tod, title = 1; char priority_str[MAX_LENGTH] = ""; - nb_tod = load_todo(colr); + nb_tod = load_todo(); for (i = todolist; i != 0; i = i->next) { if (priority == 0 || i->id == priority) { if (title) { @@ -1,8 +1,8 @@ -/* $calcurse: args.h,v 1.4 2006/12/15 15:33:05 culot Exp $ */ +/* $calcurse: args.h,v 1.5 2007/03/10 15:54:25 culot Exp $ */ /* * Calcurse - text-based organizer - * Copyright (c) 2004-2006 Frederic Culot + * Copyright (c) 2004-2007 Frederic Culot * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,10 +29,10 @@ void usage(); void usage_try(); -int parse_args(int argc, char **argv, int colr); +int parse_args(int argc, char **argv); void version_arg(); void help_arg(); -void todo_arg(int priority, int colr); +void todo_arg(int priority); void next_arg(void); int app_arg(int add_line, int year, int month, int day, long date); void date_arg(char *ddate, int add_line); diff --git a/src/calcurse.c b/src/calcurse.c index 3e59d19..40b1241 100755 --- a/src/calcurse.c +++ b/src/calcurse.c @@ -1,4 +1,4 @@ -/* $calcurse: calcurse.c,v 1.37 2007/03/04 16:14:31 culot Exp $ */ +/* $calcurse: calcurse.c,v 1.38 2007/03/10 15:54:24 culot Exp $ */ /* * Calcurse - text-based organizer @@ -76,7 +76,7 @@ int first_todo_onscreen = 1; char *saved_t_mesg; /* Variables for user configuration */ -int colr = 1, layout = 1; +int layout = 1; int no_data_file = 1; int really_quit = 0; bool confirm_quit; @@ -147,7 +147,7 @@ int main(int argc, char **argv) * Begin by parsing and handling command line arguments. * The data path is also initialized here. */ - non_interactive = parse_args(argc, argv, colr); + non_interactive = parse_args(argc, argv); if (non_interactive) return EXIT_SUCCESS; @@ -201,14 +201,14 @@ int main(int argc, char **argv) */ no_data_file = check_data_files(); load_conf(background); - nb_tod = load_todo(colr); + nb_tod = load_todo(); load_app(); notify_catch_children(); if (notify_bar()) notify_start_main_thread(); get_screen_config(); reinit_wins(); - startup_screen(skip_system_dialogs, no_data_file, colr); + startup_screen(skip_system_dialogs, no_data_file); store_day(year, month, day, day_changed); update_windows(CALENDAR); @@ -273,8 +273,8 @@ int main(int argc, char **argv) case 'g': /* Goto function */ erase_window_part(swin, 0, 0, nc_bar, nl_bar); get_date(); - goto_day(colr, day, month, year, - &sel_day, &sel_month, &sel_year); + goto_day(day, month, year, &sel_day, &sel_month, + &sel_year); do_storage = true; day_changed = true; break; @@ -312,7 +312,7 @@ int main(int argc, char **argv) break; case 'L': case 'l': - layout = layout_config(layout, colr); + layout = layout_config(layout); break; case 'G': case 'g': @@ -336,7 +336,7 @@ int main(int argc, char **argv) break; case CTRL('T'): /* Add a todo, whatever panel selected */ - nb_tod = todo_new_item(nb_tod, colr); + nb_tod = todo_new_item(nb_tod); if (hilt_tod == 0 && nb_tod == 1) hilt_tod++; break; @@ -347,7 +347,7 @@ int main(int argc, char **argv) add_item(); do_storage = true; } else if (which_pan == TODO) { - nb_tod = todo_new_item(nb_tod, colr); + nb_tod = todo_new_item(nb_tod); if (hilt_tod == 0 && nb_tod == 1) hilt_tod++; } @@ -357,9 +357,9 @@ int main(int argc, char **argv) case 'e': /* Edit an existing item */ if (which_pan == APPOINTMENT && hilt_app != 0) day_edit_item(sel_year, sel_month, sel_day, - hilt_app, colr); + hilt_app); else if (which_pan == TODO && hilt_tod != 0) - todo_edit_item(hilt_tod, colr); + todo_edit_item(hilt_tod); do_storage = true; break; @@ -373,7 +373,7 @@ int main(int argc, char **argv) case 'r': if (which_pan == APPOINTMENT && hilt_app != 0) recur_repeat_item(sel_year, sel_month, - sel_day, hilt_app, colr); + sel_day, hilt_app); do_storage = true; break; @@ -398,16 +398,15 @@ int main(int argc, char **argv) break; case '?': /* Online help system */ - status_bar(which_pan, colr, nc_bar, nl_bar); - help_screen(which_pan, colr); + status_bar(which_pan, nc_bar, nl_bar); + help_screen(which_pan); break; case 'S': case 's': /* Save function */ - save_cal(auto_save, confirm_quit, - confirm_delete, skip_system_dialogs, - skip_progress_bar, week_begins_on_monday, - colr, layout); + save_cal(auto_save, confirm_quit, confirm_delete, + skip_system_dialogs, skip_progress_bar, + week_begins_on_monday, layout); break; case (261): /* right arrow */ @@ -533,11 +532,9 @@ int main(int argc, char **argv) case ('Q'): /* Quit calcurse :-( */ case ('q'): if (auto_save) - save_cal(auto_save,confirm_quit, - confirm_delete, skip_system_dialogs, - skip_progress_bar, - week_begins_on_monday, - colr, layout); + save_cal(auto_save,confirm_quit, confirm_delete, + skip_system_dialogs, skip_progress_bar, + week_begins_on_monday, layout); if (confirm_quit) { status_mesg(_(quit_message), choices); ch = wgetch(swin); @@ -659,7 +656,7 @@ update_windows(int surrounded_window) update_cal_panel(cwin, nl_cal, nc_cal, sel_month, sel_year, sel_day, day, month, year, week_begins_on_monday); - status_bar(surrounded_window, colr, nc_bar, nl_bar); + status_bar(surrounded_window, nc_bar, nl_bar); if (notify_bar()) notify_update_bar(); wmove(swin, 0, 0); @@ -892,7 +889,7 @@ config_notify_bar(void) pthread_mutex_lock(&nbar->mutex); strncpy(buf, nbar->datefmt, strlen(nbar->datefmt) + 1); pthread_mutex_unlock(&nbar->mutex); - if (updatestring(swin, colr, &buf, 0, 1) == 0) { + if (updatestring(swin, &buf, 0, 1) == 0) { pthread_mutex_lock(&nbar->mutex); strncpy(nbar->datefmt, buf, strlen(buf) + 1); pthread_mutex_unlock(&nbar->mutex); @@ -904,7 +901,7 @@ config_notify_bar(void) pthread_mutex_lock(&nbar->mutex); strncpy(buf, nbar->timefmt, strlen(nbar->timefmt) + 1); pthread_mutex_unlock(&nbar->mutex); - if (updatestring(swin, colr, &buf, 0, 1) == 0) { + if (updatestring(swin, &buf, 0, 1) == 0) { pthread_mutex_lock(&nbar->mutex); strncpy(nbar->timefmt, buf, strlen(buf) + 1); pthread_mutex_unlock(&nbar->mutex); @@ -916,7 +913,7 @@ config_notify_bar(void) pthread_mutex_lock(&nbar->mutex); printf(buf, "%d", nbar->cntdwn); pthread_mutex_unlock(&nbar->mutex); - if (updatestring(swin, colr, &buf, 0, 1) == 0 && + if (updatestring(swin, &buf, 0, 1) == 0 && is_all_digit(buf) && atoi(buf) >= 0 && atoi(buf) <= DAYINSEC) { pthread_mutex_lock(&nbar->mutex); @@ -930,7 +927,7 @@ config_notify_bar(void) pthread_mutex_lock(&nbar->mutex); strncpy(buf, nbar->cmd, strlen(nbar->cmd) + 1); pthread_mutex_unlock(&nbar->mutex); - if (updatestring(swin, colr, &buf, 0, 1) == 0) { + if (updatestring(swin, &buf, 0, 1) == 0) { pthread_mutex_lock(&nbar->mutex); strncpy(nbar->cmd, buf, strlen(buf) + 1); pthread_mutex_unlock(&nbar->mutex); @@ -1219,7 +1216,7 @@ void add_item(void) /* Get the starting time */ while (check_time(item_time) != 1) { status_mesg(mesg_1, ""); - if (getstring(swin, colr, item_time, LTIME, 0, 1) != + if (getstring(swin, item_time, LTIME, 0, 1) != GETSTRING_ESC) { if (strlen(item_time) == 0){ is_appointment = 0; @@ -1241,7 +1238,7 @@ void add_item(void) item_time[0] = '\0'; while (check_time(item_time) == 0) { status_mesg(mesg_2, ""); - if (getstring(swin, colr, item_time, LTIME, 0, 1) != + if (getstring(swin, item_time, LTIME, 0, 1) != GETSTRING_VALID) return; //nothing entered, cancel adding of event else if (check_time(item_time) == 0) { @@ -1269,7 +1266,7 @@ void add_item(void) Id = 1; status_mesg(mesg_3, ""); - if (getstring(swin, colr, item_mesg, MAX_LENGTH, 0, 1) == + if (getstring(swin, item_mesg, MAX_LENGTH, 0, 1) == GETSTRING_VALID) { if (is_appointment) { apoint_start = date2sec(sel_year, sel_month, sel_day, @@ -1349,7 +1346,7 @@ void update_app_panel(int year, int month, int day) title_xpos = nc_app - (strlen(_(monthnames[sel_month - 1])) + 11); if (sel_day < 10) title_xpos++; date = date2sec(year, month, day, 0, 0); - day_write_pad(date, app_width, app_length, hilt_app, colr); + day_write_pad(date, app_width, app_length, hilt_app); /* Print current date in the top right window corner. */ erase_window_part(awin, 1, title_lines, nc_app - 2, nl_app - 2); diff --git a/src/calendar.c b/src/calendar.c index 7a4c406..5d127bd 100755 --- a/src/calendar.c +++ b/src/calendar.c @@ -1,4 +1,4 @@ -/* $calcurse: calendar.c,v 1.6 2007/01/16 07:50:59 culot Exp $ */ +/* $calcurse: calendar.c,v 1.7 2007/03/10 15:54:59 culot Exp $ */ /* * Calcurse - text-based organizer @@ -182,8 +182,8 @@ long ymd_to_scalar(unsigned annee, unsigned mois, unsigned jour) * sel_day, sel_month and sel_year represent the day given back. */ void -goto_day(int colr, int day, int month, int year, - int *sel_day, int *sel_month, int *sel_year) +goto_day(int day, int month, int year, int *sel_day, int *sel_month, + int *sel_year) { #define LDAY 11 char selected_day[LDAY] = ""; @@ -195,8 +195,7 @@ goto_day(int colr, int day, int month, int year, while (wrong_day) { status_mesg(request_date, ""); - if (getstring(swin, colr, selected_day, LDAY, 0, 1) == - GETSTRING_ESC) + if (getstring(swin, selected_day, LDAY, 0, 1) == GETSTRING_ESC) return; else { if (strlen(selected_day) == 0) { diff --git a/src/calendar.h b/src/calendar.h index a8cb3ea..e65551f 100755 --- a/src/calendar.h +++ b/src/calendar.h @@ -1,8 +1,8 @@ -/* $calcurse: calendar.h,v 1.1 2006/07/31 21:00:02 culot Exp $ */ +/* $calcurse: calendar.h,v 1.2 2007/03/10 15:54:59 culot Exp $ */ /* * Calcurse - text-based organizer - * Copyright (c) 2004-2006 Frederic Culot + * Copyright (c) 2004-2007 Frederic Culot * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,13 +29,11 @@ #include <stdbool.h> -void update_cal_panel(WINDOW *cwin, int nl_cal, - int nc_cal, int sel_month, int sel_year, int sel_day, - int day, int month, int year, - bool monday_first); +void update_cal_panel(WINDOW *cwin, int nl_cal, int nc_cal, int sel_month, + int sel_year, int sel_day, int day, int month, int year, bool monday_first); int isBissextile(unsigned); long ymd_to_scalar(unsigned, unsigned, unsigned); -void goto_day(int colr, int day, int month, int year, - int *sel_day, int *sel_month, int *sel_year); +void goto_day(int day, int month, int year, int *sel_day, int *sel_month, + int *sel_year); #endif /* CALCURSE_CALENDAR_H */ @@ -1,4 +1,4 @@ -/* $calcurse: day.c,v 1.19 2007/02/25 19:32:53 culot Exp $ */ +/* $calcurse: day.c,v 1.20 2007/03/10 15:55:25 culot Exp $ */ /* * Calcurse - text-based organizer @@ -258,7 +258,8 @@ struct day_item_s *day_add_apoint(int type, char *mesg, long start, long dur, * structure (pointed by day_saved_item), to be later displayed in a * popup window if requested. */ -void day_write_pad(long date, int width, int length, int incolor, int colr) +void +day_write_pad(long date, int width, int length, int incolor) { struct day_item_s *p; int line, item_number, max_pos, recur; @@ -396,7 +397,8 @@ void day_popup_item(void) } /* Edit an already existing item. */ -void day_edit_item(int year, int month, int day, int item_num, int colr) +void +day_edit_item(int year, int month, int day, int item_num) { #define STRT '1' #define END '2' @@ -479,7 +481,7 @@ void day_edit_item(int year, int month, int day, int item_num, int colr) switch (ch) { case STRT: while (!valid_date) { - timestr = day_edit_time(p->start, colr); + timestr = day_edit_time(p->start); sscanf(timestr, "%u:%u", &hr, &mn); free(timestr); newtime = update_time_in_date(p->start, hr, mn); @@ -496,7 +498,7 @@ void day_edit_item(int year, int month, int day, int item_num, int colr) case END: while (!valid_date) { timestr = day_edit_time( - p->start + p->appt_dur, colr); + p->start + p->appt_dur); sscanf(timestr, "%u:%u", &hr, &mn); free(timestr); newtime = update_time_in_date( @@ -512,7 +514,7 @@ void day_edit_item(int year, int month, int day, int item_num, int colr) break; case DESC: status_mesg(mesg_desc, ""); - updatestring(swin, colr, &p->mesg, 0, 1); + updatestring(swin, &p->mesg, 0, 1); break; case REPT: while ( (ch != 'D') && (ch != 'W') && (ch != 'M') @@ -520,7 +522,7 @@ void day_edit_item(int year, int month, int day, int item_num, int colr) status_mesg(mesg_type_1, mesg_type_2); typestr = (char *) malloc(sizeof(char)); *typestr = recur_def2char(rpt->type); - cancel = updatestring(swin, colr, &typestr, 0, 1); + cancel = updatestring(swin, &typestr, 0, 1); ch = toupper(*typestr); free(typestr); if (cancel) @@ -530,7 +532,7 @@ void day_edit_item(int year, int month, int day, int item_num, int colr) status_mesg(mesg_freq_1, ""); freqstr = (char *) malloc(MAX_LENGTH); snprintf(freqstr, MAX_LENGTH, "%d", rpt->freq); - cancel = updatestring(swin, colr, &freqstr, 0, 1); + cancel = updatestring(swin, &freqstr, 0, 1); newfreq = atoi(freqstr); free(freqstr); if (cancel) @@ -545,7 +547,7 @@ void day_edit_item(int year, int month, int day, int item_num, int colr) while (!date_entered) { status_mesg(mesg_until_1, ""); timestr = date_sec2date_str(rpt->until); - cancel = updatestring(swin, colr, ×tr, 0, 1); + cancel = updatestring(swin, ×tr, 0, 1); if (cancel) { free(timestr); return; @@ -608,7 +610,8 @@ void day_edit_item(int year, int month, int day, int item_num, int colr) } /* Request the user to enter a new time. */ -char *day_edit_time(long time, int colr) { +char * +day_edit_time(long time) { char *timestr; char *msg_time = _("Enter the new time ([hh:mm] or [h:mm]) : "); char *enter_str = _("Press [Enter] to continue"); @@ -618,7 +621,7 @@ char *day_edit_time(long time, int colr) { while (1) { status_mesg(msg_time, ""); timestr = date_sec2hour_str(time); - updatestring(swin, colr, ×tr, 0, 1); + updatestring(swin, ×tr, 0, 1); if (check_time(timestr) != 1 || strlen(timestr) == 0) { status_mesg(fmt_msg, enter_str); wgetch(swin); @@ -1,4 +1,4 @@ -/* $calcurse: day.h,v 1.9 2007/02/24 17:38:16 culot Exp $ */ +/* $calcurse: day.h,v 1.10 2007/03/10 15:55:25 culot Exp $ */ /* * Calcurse - text-based organizer @@ -64,13 +64,13 @@ int day_store_recur_apoints(long date); int day_store_apoints(long date); struct day_item_s *day_add_event(int type, char *mesg, long day, int id); struct day_item_s *day_add_apoint(int type, char *mesg, long start, long dur, - char state, int real_pos); -void day_write_pad(long date, int width, int length, int incolor, int colr); + char state, int real_pos); +void day_write_pad(long date, int width, int length, int incolor); apoint_llist_node_t *day_item_s2apoint_s(struct day_item_s *p); void day_popup_item(void); int day_check_if_item(int year, int month, int day); -void day_edit_item(int year, int month, int day, int item_num, int colr); -char *day_edit_time(long time, int colr); +void day_edit_item(int year, int month, int day, int item_num); +char *day_edit_time(long time); int day_erase_item(long date, int item_number, int force_erase); struct day_item_s *day_get_item(int item_number); int day_item_nb(long date, int day_num, int type); @@ -1,4 +1,4 @@ -/* $calcurse: help.c,v 1.13 2007/01/16 11:11:47 culot Exp $ */ +/* $calcurse: help.c,v 1.14 2007/03/10 15:55:25 culot Exp $ */ /* * Calcurse - text-based organizer @@ -43,7 +43,8 @@ * Write the desired help text inside the help pad, and return the number * of lines that were written. * */ -int write_help_pad(WINDOW *win, char *title, char *text, int pad_width) +int +write_help_pad(WINDOW *win, char *title, char *text, int pad_width) { int nl_title = 0; int nl_text = 0; @@ -58,7 +59,8 @@ int write_help_pad(WINDOW *win, char *title, char *text, int pad_width) return nl_text + nl_title; } -int get_help_lines(char *text) +int +get_help_lines(char *text) { int i; int nl = 0; @@ -70,7 +72,8 @@ int get_help_lines(char *text) } /* Draws the help screen */ -void help_screen(int which_pan, int colr) +void +help_screen(int which_pan) { WINDOW *help_win = NULL; WINDOW *help_pad = NULL; @@ -1,8 +1,8 @@ -/* $calcurse: help.h,v 1.1 2006/07/31 21:00:03 culot Exp $ */ +/* $calcurse: help.h,v 1.2 2007/03/10 15:55:25 culot Exp $ */ /* * Calcurse - text-based organizer - * Copyright (c) 2004-2006 Frederic Culot + * Copyright (c) 2004-2007 Frederic Culot * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,6 +36,6 @@ typedef struct { int write_help_pad(WINDOW *win, char *title, char *text, int pad_width); int get_help_lines(char *text); -void help_screen(int which_pan, int colr); +void help_screen(int which_pan); #endif /* CALCURSE_HELP_H */ @@ -1,8 +1,8 @@ -/* $calcurse: io.h,v 1.1 2006/07/31 21:00:03 culot Exp $ */ +/* $calcurse: io.h,v 1.2 2007/03/10 15:56:56 culot Exp $ */ /* * Calcurse - text-based organizer - * Copyright (c) 2004-2006 Frederic Culot + * Copyright (c) 2004-2007 Frederic Culot * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,14 +29,13 @@ void io_init(char *cfile); void extract_data(char *dst_data, const char *org, int len); -void save_cal(bool auto_save, bool confirm_quit, - bool confirm_delete, bool skip_system_dialogs, - bool skip_progress_bar, bool week_begins_on_monday, - int colr, int layout); -void load_app(); -int load_todo(int colr); -int check_data_files(); -void startup_screen(bool skip_dialogs, int no_data_file, int colr); +void save_cal(bool auto_save, bool confirm_quit, bool confirm_delete, + bool skip_system_dialogs, bool skip_progress_bar, + bool week_begins_on_monday, int layout); +void load_app(void); +int load_todo(void); +int check_data_files(void); +void startup_screen(bool skip_dialogs, int no_data_file); void progress_bar(bool save, int progress); #endif /* CALCURSE_IO_H */ diff --git a/src/recur.c b/src/recur.c index c23899f..d985fc7 100755 --- a/src/recur.c +++ b/src/recur.c @@ -1,4 +1,4 @@ -/* $calcurse: recur.c,v 1.21 2007/02/25 19:31:08 culot Exp $ */ +/* $calcurse: recur.c,v 1.22 2007/03/10 15:55:25 culot Exp $ */ /* * Calcurse - text-based organizer @@ -520,8 +520,10 @@ void recur_apoint_erase(long start, unsigned num, unsigned delete_whole) * o repetition end date * and then delete the selected item to recreate it as a recurrent one */ -void recur_repeat_item(int sel_year, int sel_month, int sel_day, - int item_nb, int colr) { +void +recur_repeat_item(int sel_year, int sel_month, int sel_day, + int item_nb) +{ struct tm *lt; time_t t; int ch = 0; @@ -572,8 +574,8 @@ void recur_repeat_item(int sel_year, int sel_month, int sel_day, while (freq == 0) { status_mesg(mesg_freq_1, ""); - if (getstring(swin, colr, user_input, MAX_LENGTH, 0, 1) == - GETSTRING_VALID) { + if (getstring(swin, user_input, MAX_LENGTH, 0, 1) == + GETSTRING_VALID) { freq = atoi(user_input); if (freq == 0) { status_mesg(mesg_wrong_freq, wrong_type_2); @@ -586,8 +588,7 @@ void recur_repeat_item(int sel_year, int sel_month, int sel_day, while (!date_entered) { status_mesg(mesg_until_1, ""); - if (getstring(swin, colr, user_input, 11, 0, 1) == - GETSTRING_VALID) { + if (getstring(swin, user_input, 11, 0, 1) == GETSTRING_VALID) { if (strlen(user_input) == 1 && strncmp(user_input, "0", 1) == 0 ) { until = 0; diff --git a/src/recur.h b/src/recur.h index fd58c89..d973315 100755 --- a/src/recur.h +++ b/src/recur.h @@ -1,4 +1,4 @@ -/* $calcurse: recur.h,v 1.9 2007/02/24 17:35:49 culot Exp $ */ +/* $calcurse: recur.h,v 1.10 2007/03/10 15:55:25 culot Exp $ */ /* * Calcurse - text-based organizer @@ -96,7 +96,7 @@ unsigned recur_item_inday(long item_start, struct days_s *item_exc, void recur_event_erase(long start, unsigned num, unsigned delete_whole); void recur_apoint_erase(long start, unsigned num, unsigned delete_whole); void recur_repeat_item(int sel_year, int sel_month, int sel_day, - int item_nb, int colr); + int item_nb); struct days_s *recur_exc_scan(FILE *data_file); struct notify_app_s *recur_apoint_check_next(struct notify_app_s *app, long start, long day); @@ -1,4 +1,4 @@ -/* $calcurse: todo.c,v 1.9 2007/01/16 07:52:29 culot Exp $ */ +/* $calcurse: todo.c,v 1.10 2007/03/10 15:54:59 culot Exp $ */ /* * Calcurse - text-based organizer @@ -36,7 +36,8 @@ struct todo_s *todolist; /* Request user to enter a new todo item. */ -int todo_new_item(int total, int colr) +int +todo_new_item(int total) { int ch = 0; char *mesg = _("Enter the new ToDo item : "); @@ -45,7 +46,7 @@ int todo_new_item(int total, int colr) char todo_input[MAX_LENGTH] = ""; status_mesg(mesg, ""); - if (getstring(swin, colr, todo_input, MAX_LENGTH, 0, 1) == + if (getstring(swin, todo_input, MAX_LENGTH, 0, 1) == GETSTRING_VALID) { while ( (ch < '1') || (ch > '9') ) { status_mesg(mesg_id, ""); @@ -59,7 +60,8 @@ int todo_new_item(int total, int colr) } /* Add an item in the todo linked list. */ -struct todo_s *todo_add(char *mesg, int id) +struct todo_s * +todo_add(char *mesg, int id) { struct todo_s *o, **i; o = (struct todo_s *) malloc(sizeof(struct todo_s)); @@ -79,7 +81,8 @@ struct todo_s *todo_add(char *mesg, int id) } /* Delete an item from the todo linked list. */ -void todo_delete_bynum(unsigned num) +void +todo_delete_bynum(unsigned num) { unsigned n; struct todo_s *i, **iptr; @@ -102,7 +105,8 @@ void todo_delete_bynum(unsigned num) } /* Returns a structure containing the selected item. */ -struct todo_s *todo_get_item(int item_number) +struct todo_s * +todo_get_item(int item_number) { struct todo_s *o; int i; @@ -118,7 +122,8 @@ struct todo_s *todo_get_item(int item_number) * Returns the position into the linked list corresponding to the * given todo_s item. */ -int todo_get_position(struct todo_s *i) +int +todo_get_position(struct todo_s *i) { struct todo_s *o; int n = 1, found = 0; @@ -140,7 +145,8 @@ int todo_get_position(struct todo_s *i) } /* Change an item priority by pressing '+' or '-' inside TODO panel. */ -int todo_chg_priority(int action, int item_num) +int +todo_chg_priority(int action, int item_num) { struct todo_s *backup; char backup_mesg[MAX_LENGTH]; @@ -169,12 +175,13 @@ int todo_chg_priority(int action, int item_num) } /* Edit the description of an already existing todo item. */ -void todo_edit_item(int item_num, int colr) +void +todo_edit_item(int item_num) { struct todo_s *i; char *mesg = _("Enter the new ToDo description :"); status_mesg(mesg, ""); i = todo_get_item(item_num); - updatestring(swin, colr, &i->mesg, 0, 1); + updatestring(swin, &i->mesg, 0, 1); } @@ -1,8 +1,8 @@ -/* $calcurse: todo.h,v 1.4 2006/11/02 13:43:56 culot Exp $ */ +/* $calcurse: todo.h,v 1.5 2007/03/10 15:54:59 culot Exp $ */ /* * Calcurse - text-based organizer - * Copyright (c) 2004-2006 Frederic Culot + * Copyright (c) 2004-2007 Frederic Culot * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,12 +35,12 @@ struct todo_s { extern struct todo_s *todolist; -int todo_new_item(int total, int colr); +int todo_new_item(int total); struct todo_s *todo_add(char *mesg, int id); void todo_delete_bynum(unsigned num); struct todo_s *todo_get_item(int item_number); int todo_get_position(struct todo_s *i); int todo_chg_priority(int action, int item_num); -void todo_edit_item(int item_num, int colr); +void todo_edit_item(int item_num); #endif /* CALCURSE_TODO_H */ |