extsay/extsay.c
changeset 7 ad87c711de84
parent 5 fbfc64c5d6be
child 8 53b0091ecd47
equal deleted inserted replaced
6:c2ad0b151a5e 7:ad87c711de84
    88     return NULL;
    88     return NULL;
    89   }
    89   }
    90 
    90 
    91   msg = load_message_from_file(tmpfile);
    91   msg = load_message_from_file(tmpfile);
    92 
    92 
    93   if (g_unlink(tmpfile) != 0) {
    93   if (g_unlink(tmpfile) != 0)
    94     scr_LogPrint(LPRINT_NORMAL,"Warning, could not remove temp file.");
    94     scr_LogPrint(LPRINT_NORMAL, "Warning, could not remove temp file.");
    95   }
       
    96 
    95 
    97  return msg;
    96   return msg;
    98 }
    97 }
    99 
    98 
   100 static void do_extsay(char *args)
    99 static void do_extsay(char *args)
   101 {
   100 {
   102   char *msg = spawn_editor();
   101   char *msg = spawn_editor();
   110 static void extsay_init(void)
   109 static void extsay_init(void)
   111 {
   110 {
   112   /* Add command */
   111   /* Add command */
   113   cmd_add("extsay", "Use external editor to write a message",
   112   cmd_add("extsay", "Use external editor to write a message",
   114           0, 0, do_extsay, NULL);
   113           0, 0, do_extsay, NULL);
       
   114   scr_LogPrint(LPRINT_NORMAL, "Loading module extsay...\n"
       
   115                "** Be careful, everything is on hold while you run the "
       
   116                "external editor.\n"
       
   117                "** Do not run it for too long!"
       
   118                );
   115 }
   119 }
   116 
   120 
   117 /* Deinitialization */
   121 /* Deinitialization */
   118 static void extsay_uninit(void)
   122 static void extsay_uninit(void)
   119 {
   123 {