Rename interaction functions

Rename all interaction functions for the sake of consistency and add a
"interact_" prefix. Also, mark day_erase_item() static since it is not
used anywhere else.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2012-06-26 13:11:31 +02:00
parent 9ed7494f5e
commit 8a85aaafa5
3 changed files with 30 additions and 31 deletions

View File

@ -233,13 +233,13 @@ int main(int argc, char **argv)
break; break;
case KEY_GENERIC_ADD_APPT: case KEY_GENERIC_ADD_APPT:
apoint_add(); interact_day_item_add();
inday = do_storage(1); inday = do_storage(1);
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA); wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
break; break;
case KEY_GENERIC_ADD_TODO: case KEY_GENERIC_ADD_TODO:
todo_new_item(); interact_todo_add();
if (todo_hilt() == 0 && todo_nb() == 1) if (todo_hilt() == 0 && todo_nb() == 1)
todo_hilt_increase(1); todo_hilt_increase(1);
wins_update(FLAG_TOD | FLAG_STA); wins_update(FLAG_TOD | FLAG_STA);
@ -248,12 +248,12 @@ int main(int argc, char **argv)
case KEY_ADD_ITEM: case KEY_ADD_ITEM:
switch (wins_slctd()) { switch (wins_slctd()) {
case APP: case APP:
apoint_add(); interact_day_item_add();
inday = do_storage(0); inday = do_storage(0);
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA); wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
break; break;
case TOD: case TOD:
todo_new_item(); interact_todo_add();
if (todo_hilt() == 0 && todo_nb() == 1) if (todo_hilt() == 0 && todo_nb() == 1)
todo_hilt_increase(1); todo_hilt_increase(1);
wins_update(FLAG_TOD | FLAG_STA); wins_update(FLAG_TOD | FLAG_STA);
@ -265,22 +265,22 @@ int main(int argc, char **argv)
case KEY_EDIT_ITEM: case KEY_EDIT_ITEM:
if (wins_slctd() == APP && apoint_hilt() != 0) { if (wins_slctd() == APP && apoint_hilt() != 0) {
day_edit_item(); interact_day_item_edit();
inday = do_storage(0); inday = do_storage(0);
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA); wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
} else if (wins_slctd() == TOD && todo_hilt() != 0) { } else if (wins_slctd() == TOD && todo_hilt() != 0) {
todo_edit_item(); interact_todo_edit();
wins_update(FLAG_TOD | FLAG_STA); wins_update(FLAG_TOD | FLAG_STA);
} }
break; break;
case KEY_DEL_ITEM: case KEY_DEL_ITEM:
if (wins_slctd() == APP && apoint_hilt() != 0) { if (wins_slctd() == APP && apoint_hilt() != 0) {
apoint_delete(&inday.nb_events, &inday.nb_apoints); interact_day_item_delete(&inday.nb_events, &inday.nb_apoints);
inday = do_storage(0); inday = do_storage(0);
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA); wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
} else if (wins_slctd() == TOD && todo_hilt() != 0) { } else if (wins_slctd() == TOD && todo_hilt() != 0) {
todo_delete(); interact_todo_delete();
wins_update(FLAG_TOD | FLAG_STA); wins_update(FLAG_TOD | FLAG_STA);
} }
break; break;
@ -304,7 +304,7 @@ int main(int argc, char **argv)
case KEY_REPEAT_ITEM: case KEY_REPEAT_ITEM:
if (wins_slctd() == APP && apoint_hilt() != 0) if (wins_slctd() == APP && apoint_hilt() != 0)
recur_repeat_item(); interact_day_item_repeat();
inday = do_storage(0); inday = do_storage(0);
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA); wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
break; break;
@ -322,9 +322,9 @@ int main(int argc, char **argv)
case KEY_PIPE_ITEM: case KEY_PIPE_ITEM:
if (wins_slctd() == APP && apoint_hilt() != 0) if (wins_slctd() == APP && apoint_hilt() != 0)
day_pipe_item(); interact_day_item_pipe();
else if (wins_slctd() == TOD && todo_hilt() != 0) else if (wins_slctd() == TOD && todo_hilt() != 0)
todo_pipe_item(); interact_todo_pipe();
wins_update(FLAG_ALL); wins_update(FLAG_ALL);
break; break;

View File

@ -712,16 +712,15 @@ void ical_import_data(FILE *, FILE *, unsigned *, unsigned *, unsigned *,
void ical_export_data(FILE *); void ical_export_data(FILE *);
/* interaction.c */ /* interaction.c */
void apoint_add(void); void interact_day_item_add(void);
void apoint_delete(unsigned *, unsigned *); void interact_day_item_delete(unsigned *, unsigned *);
void day_edit_item(void); void interact_day_item_edit(void);
int day_erase_item(long, int, enum eraseflg); void interact_day_item_pipe(void);
void day_pipe_item(void); void interact_day_item_repeat(void);
void recur_repeat_item(void); void interact_todo_add(void);
void todo_new_item(void); void interact_todo_delete(void);
void todo_delete(void); void interact_todo_edit(void);
void todo_edit_item(void); void interact_todo_pipe(void);
void todo_pipe_item(void);
/* io.c */ /* io.c */
unsigned io_fprintln(const char *, const char *, ...); unsigned io_fprintln(const char *, const char *, ...);

View File

@ -268,7 +268,7 @@ static void update_rept(struct rpt **rpt, const long start)
} }
/* Edit an already existing item. */ /* Edit an already existing item. */
void day_edit_item(void) void interact_day_item_edit(void)
{ {
struct day_item *p; struct day_item *p;
struct recur_event *re; struct recur_event *re;
@ -366,7 +366,7 @@ void day_edit_item(void)
* recurrent appointments and appointments) and then to test the * recurrent appointments and appointments) and then to test the
* type of the item to be deleted. * type of the item to be deleted.
*/ */
int day_erase_item(long date, int item_number, enum eraseflg flag) static int day_erase_item(long date, int item_number, enum eraseflg flag)
{ {
struct day_item *p; struct day_item *p;
@ -437,7 +437,7 @@ int day_erase_item(long date, int item_number, enum eraseflg flag)
} }
/* Pipe an appointment or event to an external program. */ /* Pipe an appointment or event to an external program. */
void day_pipe_item(void) void interact_day_item_pipe(void)
{ {
char cmd[BUFSIZ] = ""; char cmd[BUFSIZ] = "";
char const *arg[] = { cmd, NULL }; char const *arg[] = { cmd, NULL };
@ -481,7 +481,7 @@ void day_pipe_item(void)
* Add an item in either the appointment or the event list, * Add an item in either the appointment or the event list,
* depending if the start time is entered or not. * depending if the start time is entered or not.
*/ */
void apoint_add(void) void interact_day_item_add(void)
{ {
#define LTIME 6 #define LTIME 6
#define LDUR 12 #define LDUR 12
@ -574,7 +574,7 @@ void apoint_add(void)
} }
/* Delete an item from the appointment list. */ /* Delete an item from the appointment list. */
void apoint_delete(unsigned *nb_events, unsigned *nb_apoints) void interact_day_item_delete(unsigned *nb_events, unsigned *nb_apoints)
{ {
const char *del_app_str = _("Do you really want to delete this item ?"); const char *del_app_str = _("Do you really want to delete this item ?");
long date; long date;
@ -622,7 +622,7 @@ void apoint_delete(unsigned *nb_events, unsigned *nb_apoints)
} }
/* Request user to enter a new todo item. */ /* Request user to enter a new todo item. */
void todo_new_item(void) void interact_todo_add(void)
{ {
int ch = 0; int ch = 0;
const char *mesg = _("Enter the new ToDo item : "); const char *mesg = _("Enter the new ToDo item : ");
@ -642,7 +642,7 @@ void todo_new_item(void)
} }
/* Delete an item from the ToDo list. */ /* Delete an item from the ToDo list. */
void todo_delete(void) void interact_todo_delete(void)
{ {
const char *del_todo_str = _("Do you really want to delete this task ?"); const char *del_todo_str = _("Do you really want to delete this task ?");
const char *erase_warning = const char *erase_warning =
@ -685,7 +685,7 @@ void todo_delete(void)
} }
/* Edit the description of an already existing todo item. */ /* Edit the description of an already existing todo item. */
void todo_edit_item(void) void interact_todo_edit(void)
{ {
struct todo *i; struct todo *i;
const char *mesg = _("Enter the new ToDo description :"); const char *mesg = _("Enter the new ToDo description :");
@ -696,7 +696,7 @@ void todo_edit_item(void)
} }
/* Pipe a todo item to an external program. */ /* Pipe a todo item to an external program. */
void todo_pipe_item(void) void interact_todo_pipe(void)
{ {
char cmd[BUFSIZ] = ""; char cmd[BUFSIZ] = "";
char const *arg[] = { cmd, NULL }; char const *arg[] = { cmd, NULL };
@ -730,7 +730,7 @@ void todo_pipe_item(void)
* o repetition end date * o repetition end date
* and then delete the selected item to recreate it as a recurrent one * and then delete the selected item to recreate it as a recurrent one
*/ */
void recur_repeat_item(void) void interact_day_item_repeat(void)
{ {
struct tm *lt; struct tm *lt;
time_t t; time_t t;