From 8a85aaafa5905297398605eb890b00d22416eeb5 Mon Sep 17 00:00:00 2001
From: Lukas Fleischer <calcurse@cryptocrack.de>
Date: Tue, 26 Jun 2012 13:11:31 +0200
Subject: 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>
---
 src/calcurse.c    | 22 +++++++++++-----------
 src/calcurse.h    | 19 +++++++++----------
 src/interaction.c | 20 ++++++++++----------
 3 files changed, 30 insertions(+), 31 deletions(-)

(limited to 'src')

diff --git a/src/calcurse.c b/src/calcurse.c
index 8a796ff..43d00fc 100644
--- a/src/calcurse.c
+++ b/src/calcurse.c
@@ -233,13 +233,13 @@ int main(int argc, char **argv)
       break;
 
     case KEY_GENERIC_ADD_APPT:
-      apoint_add();
+      interact_day_item_add();
       inday = do_storage(1);
       wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
       break;
 
     case KEY_GENERIC_ADD_TODO:
-      todo_new_item();
+      interact_todo_add();
       if (todo_hilt() == 0 && todo_nb() == 1)
         todo_hilt_increase(1);
       wins_update(FLAG_TOD | FLAG_STA);
@@ -248,12 +248,12 @@ int main(int argc, char **argv)
     case KEY_ADD_ITEM:
       switch (wins_slctd()) {
       case APP:
-        apoint_add();
+        interact_day_item_add();
         inday = do_storage(0);
         wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
         break;
       case TOD:
-        todo_new_item();
+        interact_todo_add();
         if (todo_hilt() == 0 && todo_nb() == 1)
           todo_hilt_increase(1);
         wins_update(FLAG_TOD | FLAG_STA);
@@ -265,22 +265,22 @@ int main(int argc, char **argv)
 
     case KEY_EDIT_ITEM:
       if (wins_slctd() == APP && apoint_hilt() != 0) {
-        day_edit_item();
+        interact_day_item_edit();
         inday = do_storage(0);
         wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
       } else if (wins_slctd() == TOD && todo_hilt() != 0) {
-        todo_edit_item();
+        interact_todo_edit();
         wins_update(FLAG_TOD | FLAG_STA);
       }
       break;
 
     case KEY_DEL_ITEM:
       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);
         wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
       } else if (wins_slctd() == TOD && todo_hilt() != 0) {
-        todo_delete();
+        interact_todo_delete();
         wins_update(FLAG_TOD | FLAG_STA);
       }
       break;
@@ -304,7 +304,7 @@ int main(int argc, char **argv)
 
     case KEY_REPEAT_ITEM:
       if (wins_slctd() == APP && apoint_hilt() != 0)
-        recur_repeat_item();
+        interact_day_item_repeat();
       inday = do_storage(0);
       wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
       break;
@@ -322,9 +322,9 @@ int main(int argc, char **argv)
 
     case KEY_PIPE_ITEM:
       if (wins_slctd() == APP && apoint_hilt() != 0)
-        day_pipe_item();
+        interact_day_item_pipe();
       else if (wins_slctd() == TOD && todo_hilt() != 0)
-        todo_pipe_item();
+        interact_todo_pipe();
       wins_update(FLAG_ALL);
       break;
 
diff --git a/src/calcurse.h b/src/calcurse.h
index fab6cab..8afb7f4 100644
--- a/src/calcurse.h
+++ b/src/calcurse.h
@@ -712,16 +712,15 @@ void ical_import_data(FILE *, FILE *, unsigned *, unsigned *, unsigned *,
 void ical_export_data(FILE *);
 
 /* interaction.c */
-void apoint_add(void);
-void apoint_delete(unsigned *, unsigned *);
-void day_edit_item(void);
-int day_erase_item(long, int, enum eraseflg);
-void day_pipe_item(void);
-void recur_repeat_item(void);
-void todo_new_item(void);
-void todo_delete(void);
-void todo_edit_item(void);
-void todo_pipe_item(void);
+void interact_day_item_add(void);
+void interact_day_item_delete(unsigned *, unsigned *);
+void interact_day_item_edit(void);
+void interact_day_item_pipe(void);
+void interact_day_item_repeat(void);
+void interact_todo_add(void);
+void interact_todo_delete(void);
+void interact_todo_edit(void);
+void interact_todo_pipe(void);
 
 /* io.c */
 unsigned io_fprintln(const char *, const char *, ...);
diff --git a/src/interaction.c b/src/interaction.c
index ab4bde0..b90d61f 100644
--- a/src/interaction.c
+++ b/src/interaction.c
@@ -268,7 +268,7 @@ static void update_rept(struct rpt **rpt, const long start)
 }
 
 /* Edit an already existing item. */
-void day_edit_item(void)
+void interact_day_item_edit(void)
 {
   struct day_item *p;
   struct recur_event *re;
@@ -366,7 +366,7 @@ void day_edit_item(void)
  * recurrent appointments and appointments) and then to test the
  * 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;
 
@@ -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. */
-void day_pipe_item(void)
+void interact_day_item_pipe(void)
 {
   char cmd[BUFSIZ] = "";
   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,
  * depending if the start time is entered or not.
  */
-void apoint_add(void)
+void interact_day_item_add(void)
 {
 #define LTIME 6
 #define LDUR 12
@@ -574,7 +574,7 @@ void apoint_add(void)
 }
 
 /* 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 ?");
   long date;
@@ -622,7 +622,7 @@ void apoint_delete(unsigned *nb_events, unsigned *nb_apoints)
 }
 
 /* Request user to enter a new todo item. */
-void todo_new_item(void)
+void interact_todo_add(void)
 {
   int ch = 0;
   const char *mesg = _("Enter the new ToDo item : ");
@@ -642,7 +642,7 @@ void todo_new_item(void)
 }
 
 /* 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 *erase_warning =
@@ -685,7 +685,7 @@ void todo_delete(void)
 }
 
 /* Edit the description of an already existing todo item. */
-void todo_edit_item(void)
+void interact_todo_edit(void)
 {
   struct todo *i;
   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. */
-void todo_pipe_item(void)
+void interact_todo_pipe(void)
 {
   char cmd[BUFSIZ] = "";
   char const *arg[] = { cmd, NULL };
@@ -730,7 +730,7 @@ void todo_pipe_item(void)
  *	o repetition end date
  * 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;
   time_t t;
-- 
cgit v1.2.3-70-g09d2