Index: functions.c
===================================================================
--- functions.c	(revision 65b21736092356a35d24e53dc2e6b92e13174131)
+++ functions.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -13,5 +13,5 @@
 #include "owl.h"
 
-char *owl_function_command(char *cmdbuff)
+char *owl_function_command(const char *cmdbuff)
 {
   owl_function_debugmsg("executing command: %s", cmdbuff);
@@ -20,5 +20,5 @@
 }
 
-char *owl_function_command_argv(char **argv, int argc)
+char *owl_function_command_argv(const char *const *argv, int argc)
 {
   return owl_cmddict_execute_argv(owl_global_get_cmddict(&g),
@@ -27,5 +27,5 @@
 }
 
-void owl_function_command_norv(char *cmdbuff)
+void owl_function_command_norv(const char *cmdbuff)
 {
   char *rv;
@@ -34,10 +34,10 @@
 }
 
-void owl_function_command_alias(char *alias_from, char *alias_to)
+void owl_function_command_alias(const char *alias_from, const char *alias_to)
 {
   owl_cmddict_add_alias(owl_global_get_cmddict(&g), alias_from, alias_to);
 }
 
-owl_cmd *owl_function_get_cmd(char *name)
+owl_cmd *owl_function_get_cmd(const char *name)
 {
   return owl_cmddict_find(owl_global_get_cmddict(&g), name);
@@ -60,5 +60,5 @@
 }
 
-void owl_function_show_view(char *viewname)
+void owl_function_show_view(const char *viewname)
 {
   owl_view *v;
@@ -92,6 +92,6 @@
 }
 
-char *owl_function_style_describe(char *name) {
-  char *desc;
+char *owl_function_style_describe(const char *name) {
+  const char *desc;
   char *s;
   owl_style *style;
@@ -108,5 +108,5 @@
 }
 
-char *owl_function_cmd_describe(char *name)
+char *owl_function_cmd_describe(const char *name)
 {
   owl_cmd *cmd = owl_cmddict_find(owl_global_get_cmddict(&g), name);
@@ -115,5 +115,5 @@
 }
 
-void owl_function_show_command(char *name)
+void owl_function_show_command(const char *name)
 {
   owl_function_help_for_command(name);
@@ -122,5 +122,5 @@
 void owl_function_show_license()
 {
-  char *text;
+  const char *text;
 
   text=""
@@ -168,5 +168,5 @@
 void owl_function_show_quickstart()
 {
-    char *message =
+    const char *message =
     "Move between messages with the arrow keys, and press 'r' to reply.\n"
     "For more info, press 'h' or visit http://barnowl.mit.edu/\n\n"
@@ -199,5 +199,5 @@
  * and redisplay if necessary.
  */
-void owl_function_adminmsg(char *header, char *body)
+void owl_function_adminmsg(const char *header, const char *body)
 {
   owl_message *m;
@@ -226,5 +226,5 @@
  * that.
  */
-owl_message *owl_function_make_outgoing_zephyr(char *body, char *zwriteline, char *zsig)
+owl_message *owl_function_make_outgoing_zephyr(const char *body, const char *zwriteline, const char *zsig)
 {
   owl_message *m;
@@ -247,5 +247,5 @@
  * owl_global_messagequeue_addmsg() for that .
  */
-owl_message *owl_function_make_outgoing_aim(char *body, char *to)
+owl_message *owl_function_make_outgoing_aim(const char *body, const char *to)
 {
   owl_message *m;
@@ -268,5 +268,5 @@
  * owl_global_messagequeue_addmsg() for that.
  */
-owl_message *owl_function_make_outgoing_loopback(char *body)
+owl_message *owl_function_make_outgoing_loopback(const char *body)
 {
   owl_message *m;
@@ -280,5 +280,5 @@
 }
 
-void owl_function_zwrite_setup(char *line)
+void owl_function_zwrite_setup(const char *line)
 {
   owl_editwin *e;
@@ -325,5 +325,5 @@
 }
 
-void owl_function_aimwrite_setup(char *line)
+void owl_function_aimwrite_setup(const char *line)
 {
   owl_editwin *e;
@@ -389,8 +389,8 @@
  * the message is expected to be set from the zwrite line itself
  */
-void owl_function_zwrite(char *line, char *msg)
+void owl_function_zwrite(const char *line, const char *msg)
 {
   owl_zwrite z;
-  char *mymsg;
+  const char *mymsg;
   owl_message *m;
 
@@ -429,8 +429,8 @@
  * the message is expected to be set from the zwrite line itself
  */
-void owl_function_zcrypt(char *line, char *msg)
+void owl_function_zcrypt(const char *line, const char *msg)
 {
   owl_zwrite z;
-  char *mymsg;
+  const char *mymsg;
   char *cryptmsg;
   owl_message *m;
@@ -498,8 +498,8 @@
 }
 
-void owl_function_aimwrite(char *line, char *msg)
+void owl_function_aimwrite(const char *line, const char *msg)
 {
   int ret;
-  char *to;
+  const char *to;
   char *format_msg;
   owl_message *m;
@@ -531,5 +531,5 @@
 }
 
-void owl_function_send_aimawymsg(char *to, char *msg)
+void owl_function_send_aimawymsg(const char *to, const char *msg)
 {
   int ret;
@@ -563,5 +563,5 @@
 }
 
-void owl_function_loopwrite(char *msg)
+void owl_function_loopwrite(const char *msg)
 {
   owl_message *min, *mout;
@@ -590,5 +590,5 @@
  * If last_if_none, will stop at the last message in the view
  * if no matching messages are found.  */
-void owl_function_nextmsg_full(char *filter, int skip_deleted, int last_if_none)
+void owl_function_nextmsg_full(const char *filter, int skip_deleted, int last_if_none)
 {
   int curmsg, i, viewsize, found;
@@ -643,5 +643,5 @@
 }
 
-void owl_function_prevmsg_full(char *filter, int skip_deleted, int first_if_none)
+void owl_function_prevmsg_full(const char *filter, int skip_deleted, int first_if_none)
 {
   int curmsg, i, viewsize, found;
@@ -881,8 +881,8 @@
  * only, no error message is printed.
  */
-void owl_function_loadsubs(char *file)
+void owl_function_loadsubs(const char *file)
 {
   int ret, ret2;
-  char *foo;
+  const char *foo;
   char *path;
 
@@ -914,5 +914,5 @@
 }
 
-void owl_function_loadloginsubs(char *file)
+void owl_function_loadloginsubs(const char *file)
 {
   int ret;
@@ -934,5 +934,5 @@
 }
 
-void owl_function_aimlogin(char *user, char *passwd) {
+void owl_function_aimlogin(const char *user, const char *passwd) {
   int ret;
 
@@ -1236,5 +1236,5 @@
 }
 
-void owl_function_debugmsg(char *fmt, ...)
+void owl_function_debugmsg(const char *fmt, ...)
 {
   FILE *file;
@@ -1271,5 +1271,5 @@
 }
 
-int owl_function_subscribe(char *class, char *inst, char *recip)
+int owl_function_subscribe(const char *class, const char *inst, const char *recip)
 {
   int ret;
@@ -1284,5 +1284,5 @@
 }
 
-void owl_function_unsubscribe(char *class, char *inst, char *recip)
+void owl_function_unsubscribe(const char *class, const char *inst, const char *recip)
 {
   int ret;
@@ -1326,5 +1326,5 @@
 }
 
-void owl_function_popless_text(char *text)
+void owl_function_popless_text(const char *text)
 {
   owl_popwin *pw;
@@ -1360,5 +1360,5 @@
 }
 
-void owl_function_popless_file(char *filename)
+void owl_function_popless_file(const char *filename)
 {
   owl_fmtext fm;
@@ -1665,5 +1665,5 @@
 void owl_function_printallvars()
 {
-  char *name;
+  const char *name;
   char var[LINE];
   owl_list varnames;
@@ -1695,5 +1695,5 @@
   owl_fmtext fm;  
   int i, numvarnames;
-  char *varname;
+  const char *varname;
 
   owl_fmtext_init_null(&fm);
@@ -1713,5 +1713,5 @@
 }
 
-void owl_function_show_variable(char *name)
+void owl_function_show_variable(const char *name)
 {
   owl_fmtext fm;  
@@ -1939,5 +1939,5 @@
 }
 
-void owl_function_zlocate(int argc, char **argv, int auth)
+void owl_function_zlocate(int argc, const char *const *argv, int auth)
 {
   owl_fmtext fm;
@@ -1958,5 +1958,5 @@
 }
 
-void owl_function_start_command(char *line)
+void owl_function_start_command(const char *line)
 {
   owl_editwin *tw;
@@ -1977,5 +1977,5 @@
 }
 
-void owl_function_start_question(char *line)
+void owl_function_start_question(const char *line)
 {
   owl_editwin *tw;
@@ -1994,5 +1994,5 @@
 }
 
-void owl_function_start_password(char *line)
+void owl_function_start_password(const char *line)
 {
   owl_editwin *tw;
@@ -2012,5 +2012,5 @@
 }
 
-char *owl_function_exec(int argc, char **argv, char *buff, int type)
+char *owl_function_exec(int argc, const char *const *argv, const char *buff, int type)
 {
   /* if type == 1 display in a popup
@@ -2019,5 +2019,5 @@
    * else display in a popup
    */
-  char *redirect = " 2>&1 < /dev/null";
+  const char *redirect = " 2>&1 < /dev/null";
   char *newbuff;
   char *out, buff2[1024];
@@ -2067,5 +2067,5 @@
 }
 
-char *owl_function_perl(int argc, char **argv, char *buff, int type)
+char *owl_function_perl(int argc, const char *const *argv, const char *buff, int type)
 {
   /* if type == 1 display in a popup
@@ -2104,5 +2104,5 @@
  * should have the pointer.
  */
-void owl_function_change_currentview_filter(char *filtname)
+void owl_function_change_currentview_filter(const char *filtname)
 {
   owl_view *v;
@@ -2152,5 +2152,5 @@
  * with a new definition.
  */
-void owl_function_create_filter(int argc, char **argv)
+void owl_function_create_filter(int argc, const char *const *argv)
 {
   owl_filter *f;
@@ -2244,9 +2244,9 @@
  * Returns the name of the negated filter, which the caller must free.
  */
-char *owl_function_create_negative_filter(char *filtername)
+char *owl_function_create_negative_filter(const char *filtername)
 {
   char *newname;
   owl_filter *tmpfilt;
-  char *argv[5];
+  const char *argv[5];
 
   owl_function_debugmsg("owl_function_create_negative_filter");
@@ -2300,5 +2300,5 @@
 }
 
-void owl_function_show_filter(char *name)
+void owl_function_show_filter(const char *name)
 {
   owl_filter *f;
@@ -2348,5 +2348,5 @@
  * name of the filter, which the caller must free.
  */
-char *owl_function_classinstfilt(char *c, char *i) 
+char *owl_function_classinstfilt(const char *c, const char *i) 
 {
   owl_filter *f;
@@ -2426,5 +2426,5 @@
  * the filter, which the caller must free.
  */
-char *owl_function_zuserfilt(char *user)
+char *owl_function_zuserfilt(const char *user)
 {
   owl_filter *f;
@@ -2473,5 +2473,5 @@
  * Returns the name of the filter, which the caller must free.
  */
-char *owl_function_aimuserfilt(char *user)
+char *owl_function_aimuserfilt(const char *user)
 {
   owl_filter *f;
@@ -2509,5 +2509,5 @@
 }
 
-char *owl_function_typefilt(char *type)
+char *owl_function_typefilt(const char *type)
 {
   owl_filter *f;
@@ -2582,5 +2582,5 @@
   owl_message *m;
   char *zperson, *filtname=NULL;
-  char *argv[1];
+  const char *argv[1];
   
   v=owl_global_get_current_view(&g);
@@ -2653,5 +2653,5 @@
   owl_view *v;
   owl_message *m;
-  char *cmdprefix, *mclass, *minst;
+  const char *cmdprefix, *mclass, *minst;
   char *cmd;
   
@@ -2702,7 +2702,7 @@
  * be 'color'
  */
-void owl_function_color_current_filter(char *fgcolor, char *bgcolor)
-{
-  char *name;
+void owl_function_color_current_filter(const char *fgcolor, const char *bgcolor)
+{
+  const char *name;
 
   name=owl_view_get_filtname(owl_global_get_current_view(&g));
@@ -2714,5 +2714,5 @@
  * the "all" filter, return -2.  Return 0 on success
  */
-int owl_function_color_filter(char *filtname, char *fgcolor, char *bgcolor)
+int owl_function_color_filter(const char *filtname, const char *fgcolor, const char *bgcolor)
 {
   owl_filter *f;
@@ -2797,5 +2797,5 @@
  *   if direction==1 then unpunt
  */
-void owl_function_zpunt(char *class, char *inst, char *recip, int direction)
+void owl_function_zpunt(const char *class, const char *inst, const char *recip, int direction)
 {
   char *puntexpr, *classexpr, *instexpr, *recipexpr;
@@ -2844,5 +2844,5 @@
 }
 
-void owl_function_punt(char *filter, int direction)
+void owl_function_punt(const char *filter, int direction)
 {
   owl_filter *f;
@@ -2890,5 +2890,5 @@
 }
 
-void owl_function_activate_keymap(char *keymap)
+void owl_function_activate_keymap(const char *keymap)
 {
   if (!owl_keyhandler_activate(owl_global_get_keyhandler(&g), keymap)) {
@@ -2904,5 +2904,5 @@
   owl_keyhandler *kh;
   int i, numkm;
-  char *kmname;
+  const char *kmname;
 
   kh = owl_global_get_keyhandler(&g);
@@ -2928,5 +2928,5 @@
 }
 
-char *owl_function_keymap_summary(char *name)
+char *owl_function_keymap_summary(const char *name)
 {
   owl_keymap *km 
@@ -2937,5 +2937,5 @@
 
 /* TODO: implement for real */
-void owl_function_show_keymap(char *name)
+void owl_function_show_keymap(const char *name)
 {
   owl_fmtext fm;
@@ -2953,5 +2953,5 @@
 }
 
-void owl_function_help_for_command(char *cmdname)
+void owl_function_help_for_command(const char *cmdname)
 {
   owl_fmtext fm;
@@ -2963,5 +2963,5 @@
 }
 
-void owl_function_search_start(char *string, int direction)
+void owl_function_search_start(const char *string, int direction)
 {
   /* direction is OWL_DIRECTION_DOWNWARDS or OWL_DIRECTION_UPWARDS or
@@ -3059,5 +3059,5 @@
 /* strips formatting from ztext and returns the unformatted text. 
  * caller is responsible for freeing. */
-char *owl_function_ztext_stylestrip(char *zt)
+char *owl_function_ztext_stylestrip(const char *zt)
 {
   owl_fmtext fm;
@@ -3072,5 +3072,5 @@
 
 /* Popup a buddylisting.  If filename is NULL use the default .anyone */
-void owl_function_buddylist(int aim, int zephyr, char *filename)
+void owl_function_buddylist(int aim, int zephyr, const char *filename)
 {
   int i, j, idle;
@@ -3083,5 +3083,5 @@
   int x;
   owl_list anyone;
-  char *user;
+  const char *user;
   char *tmp;
   ZLocations_t location[200];
@@ -3189,5 +3189,5 @@
 
 /* Dump messages in the current view to the file 'filename'. */
-void owl_function_dump(char *filename) 
+void owl_function_dump(const char *filename) 
 {
   int i, j, count;
@@ -3299,8 +3299,8 @@
  * startupfile.
  */
-void owl_function_addstartup(char *buff)
+void owl_function_addstartup(const char *buff)
 {
   FILE *file;
-  char *filename;
+  const char *filename;
 
   filename=owl_global_get_startupfile(&g);
@@ -3321,7 +3321,7 @@
 
 /* Remove the specified command from the startup file. */
-void owl_function_delstartup(char *buff)
-{
-  char *filename;
+void owl_function_delstartup(const char *buff)
+{
+  const char *filename;
   filename=owl_global_get_startupfile(&g);
   owl_util_file_deleteline(filename, buff, 1);
@@ -3331,5 +3331,5 @@
  * is NULL, use the default owl startup commands file.
  */
-void owl_function_source(char *filename)
+void owl_function_source(const char *filename)
 {
   char *path;
@@ -3360,5 +3360,5 @@
 }
 
-void owl_function_change_style(owl_view *v, char *stylename)
+void owl_function_change_style(owl_view *v, const char *stylename)
 {
   owl_style *s;
@@ -3394,9 +3394,9 @@
 }
 
-void owl_function_error(char *fmt, ...)
+void owl_function_error(const char *fmt, ...)
 {
   va_list ap;
   char *buff;
-  char *nl;
+  const char *nl;
 
   va_start(ap, fmt);
@@ -3416,5 +3416,5 @@
 }
 
-void owl_function_log_err(char *string)
+void owl_function_log_err(const char *string)
 {
   char *date;
@@ -3444,5 +3444,5 @@
 }
 
-void owl_function_makemsg(char *fmt, ...)
+void owl_function_makemsg(const char *fmt, ...)
 {
   va_list ap;
@@ -3474,5 +3474,5 @@
   owl_message *m;
   owl_zbuddylist *zbl;
-  char *user;
+  const char *user;
   ZLocations_t location[200];
   int numlocs, ret;
@@ -3525,5 +3525,5 @@
 }
 
-void owl_function_aimsearch_results(char *email, owl_list *namelist)
+void owl_function_aimsearch_results(const char *email, owl_list *namelist)
 {
   owl_fmtext fm;
