Index: aim.c
===================================================================
--- aim.c	(revision fa4562c3dde208105e6938363d047e5622012e67)
+++ aim.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -26,5 +26,5 @@
 };
 
-static char *msgerrreasons[] = {
+static const char *msgerrreasons[] = {
 	"Invalid error",
 	"Invalid SNAC",
@@ -136,5 +136,5 @@
 
 
-int owl_aim_login(char *screenname, char *password)
+int owl_aim_login(const char *screenname, const char *password)
 {
   struct owlfaim_priv *priv;
@@ -209,5 +209,5 @@
 
 /* stuff to run once login has been successful */
-void owl_aim_successful_login(char *screenname)
+void owl_aim_successful_login(const char *screenname)
 {
   char *buff;
@@ -248,5 +248,5 @@
 }
 
-void owl_aim_login_error(char *message)
+void owl_aim_login_error(const char *message)
 {
   if (message) {
@@ -261,5 +261,5 @@
 }
 
-int owl_aim_send_im(char *to, char *msg)
+int owl_aim_send_im(const char *to, const char *msg)
 {
   int ret;
@@ -271,5 +271,5 @@
 }
 
-int owl_aim_send_awaymsg(char *to, char *msg)
+int owl_aim_send_awaymsg(const char *to, const char *msg)
 {
   int ret;
@@ -281,5 +281,5 @@
 }
 
-void owl_aim_addbuddy(char *name)
+void owl_aim_addbuddy(const char *name)
 {
 
@@ -295,5 +295,5 @@
 }
 
-void owl_aim_delbuddy(char *name)
+void owl_aim_delbuddy(const char *name)
 {
   aim_ssi_delbuddy(owl_global_get_aimsess(&g), name, "Buddies");
@@ -301,5 +301,5 @@
 }
 
-void owl_aim_search(char *email)
+void owl_aim_search(const char *email)
 {
   int ret;
@@ -314,5 +314,5 @@
 
 
-int owl_aim_set_awaymsg(char *msg)
+int owl_aim_set_awaymsg(const char *msg)
 {
   int len;
@@ -341,5 +341,5 @@
 }
 
-void owl_aim_chat_join(char *name, int exchange)
+void owl_aim_chat_join(const char *name, int exchange)
 {
   int ret;
@@ -347,5 +347,5 @@
   /*
   OscarData *od = g->proto_data;
-  char *name, *exchange;
+  const char *name, *exchange;
   */
 
@@ -392,9 +392,9 @@
 }
 
-void owl_aim_chat_leave(char *chatroom)
-{
-}
-
-int owl_aim_chat_sendmsg(char *chatroom, char *msg)
+void owl_aim_chat_leave(const char *chatroom)
+{
+}
+
+int owl_aim_chat_sendmsg(const char *chatroom, const char *msg)
 {
   return(0);
@@ -402,5 +402,5 @@
 
 /* caller must free the return */
-char *owl_aim_normalize_screenname(char *in)
+char *owl_aim_normalize_screenname(const char *in)
 {
   char *out;
@@ -482,9 +482,9 @@
   struct client_info_s info = CLIENTINFO_AIM_KNOWNGOOD;
     
-  char *key;
-  va_list ap;
-
-  va_start(ap, fr);
-  key = va_arg(ap, char *);
+  const char *key;
+  va_list ap;
+
+  va_start(ap, fr);
+  key = va_arg(ap, const char *);
   va_end(ap);
 
@@ -706,9 +706,9 @@
   va_list ap;
   fu16_t code;
-  char *msg;
+  const char *msg;
   
   va_start(ap, fr);
   code = va_arg(ap, int);
-  msg = va_arg(ap, char *);
+  msg = va_arg(ap, const char *);
   va_end(ap);
   
@@ -740,5 +740,5 @@
   fu16_t change = 0, perms, type;
   int length, str;
-  char *val;
+  const char *val;
   va_list ap;
   
@@ -748,5 +748,5 @@
   type = (fu16_t)va_arg(ap, unsigned int);
   length = va_arg(ap, int);
-  val = va_arg(ap, char *);
+  val = va_arg(ap, const char *);
   str = va_arg(ap, int);
   va_end(ap);
@@ -900,9 +900,9 @@
 static int faimtest_parse_motd(aim_session_t *sess, aim_frame_t *fr, ...)
 {
-  char *msg;
+  const char *msg;
   fu16_t id;
   va_list ap;
   static int codeslen = 5;
-  static char *codes[] = {
+  static const char *codes[] = {
     "Unknown",
     "Mandatory upgrade",
@@ -914,5 +914,5 @@
   va_start(ap, fr);
   id = va_arg(ap, int);
-  msg = va_arg(ap, char *);
+  msg = va_arg(ap, const char *);
   va_end(ap);
 
@@ -1072,5 +1072,5 @@
   va_list ap;
   fu32_t offset, len;
-  char *modname;
+  const char *modname;
   unsigned char *buf;
   int buflen;
@@ -1079,5 +1079,5 @@
   offset = va_arg(ap, fu32_t);
   len = va_arg(ap, fu32_t);
-  modname = va_arg(ap, char *);
+  modname = va_arg(ap, const char *);
   va_end(ap);
   
@@ -1112,6 +1112,6 @@
 {
   aim_userinfo_t *userinfo;
-  char *prof_encoding = NULL;
-  char *prof = NULL;
+  const char *prof_encoding = NULL;
+  const char *prof = NULL;
   fu16_t inforeq = 0;
   owl_buddy *b;
@@ -1120,6 +1120,6 @@
   userinfo = va_arg(ap, aim_userinfo_t *);
   inforeq = (fu16_t)va_arg(ap, unsigned int);
-  prof_encoding = va_arg(ap, char *);
-  prof = va_arg(ap, char *);
+  prof_encoding = va_arg(ap, const char *);
+  prof = va_arg(ap, const char *);
   va_end(ap);
 
@@ -1497,10 +1497,10 @@
 {
   va_list ap;
-  char *destsn;
+  const char *destsn;
   fu16_t reason;
   
   va_start(ap, fr);
   reason = (fu16_t)va_arg(ap, unsigned int);
-  destsn = va_arg(ap, char *);
+  destsn = va_arg(ap, const char *);
   va_end(ap);
   
@@ -1518,10 +1518,10 @@
 {
   va_list ap;
-  char *destsn;
+  const char *destsn;
   fu16_t reason;
   
   va_start(ap, fr);
   reason = (fu16_t)va_arg(ap, unsigned int);
-  destsn = va_arg(ap, char *);
+  destsn = va_arg(ap, const char *);
   va_end(ap);
   
@@ -1534,5 +1534,5 @@
 static int faimtest_parse_misses(aim_session_t *sess, aim_frame_t *fr, ...)
 {
-  static char *missedreasons[] = {
+  static const char *missedreasons[] = {
     "Invalid (0)",
     "Message too large",
@@ -1566,9 +1566,9 @@
   va_list ap;
   fu16_t type;
-  char *sn = NULL;
+  const char *sn = NULL;
   
   va_start(ap, fr);
   type = (fu16_t)va_arg(ap, unsigned int);
-  sn = va_arg(ap, char *);
+  sn = va_arg(ap, const char *);
   va_end(ap);
   
@@ -1580,5 +1580,5 @@
 static int faimtest_parse_ratechange(aim_session_t *sess, aim_frame_t *fr, ...)
 {
-  static char *codes[5] = {
+  static const char *codes[5] = {
     "invalid",
     "change",
@@ -1656,12 +1656,12 @@
 {
   va_list ap;
-  char *address, *SNs;
+  const char *address, *SNs;
   int num, i;
   owl_list list;
   
   va_start(ap, fr);
-  address = va_arg(ap, char *);
+  address = va_arg(ap, const char *);
   num = va_arg(ap, int);
-  SNs = va_arg(ap, char *);
+  SNs = va_arg(ap, const char *);
   va_end(ap);
 
@@ -1681,8 +1681,8 @@
 {
   va_list ap;
-  char *address;
-  
-  va_start(ap, fr);
-  address = va_arg(ap, char *);
+  const char *address;
+  
+  va_start(ap, fr);
+  address = va_arg(ap, const char *);
   va_end(ap);
 
@@ -1696,10 +1696,10 @@
 {
   va_list ap;
-  char *msg, *url;
+  const char *msg, *url;
   fu16_t width, height, delay;
   
   va_start(ap, fr);
-  msg = va_arg(ap, char *);
-  url = va_arg(ap, char *);
+  msg = va_arg(ap, const char *);
+  url = va_arg(ap, const char *);
   width = va_arg(ap, unsigned int);
   height = va_arg(ap, unsigned int);
@@ -1722,9 +1722,9 @@
   va_list ap;
   aim_conn_t *bosconn;
-  char *bosip;
+  const char *bosip;
   fu8_t *cookie;
   
   va_start(ap, fr);
-  bosip = va_arg(ap, char *);
+  bosip = va_arg(ap, const char *);
   cookie = va_arg(ap, fu8_t *);
   va_end(ap);
@@ -1873,7 +1873,7 @@
   aim_userinfo_t *userinfo;
   struct aim_chat_roominfo *roominfo;
-  char *roomname;
+  const char *roomname;
   int usercount;
-  char *roomdesc;
+  const char *roomdesc;
   fu16_t flags, unknown_d2, unknown_d5, maxmsglen, maxvisiblemsglen;
   fu32_t creationtime;
@@ -1885,8 +1885,8 @@
   va_start(ap, fr);
   roominfo = va_arg(ap, struct aim_chat_roominfo *);
-  roomname = va_arg(ap, char *);
+  roomname = va_arg(ap, const char *);
   usercount = va_arg(ap, int);
   userinfo = va_arg(ap, aim_userinfo_t *);
-  roomdesc = va_arg(ap, char *);
+  roomdesc = va_arg(ap, const char *);
   flags = (fu16_t)va_arg(ap, unsigned int);
   creationtime = va_arg(ap, fu32_t);
@@ -1928,10 +1928,10 @@
   va_list ap;
   aim_userinfo_t *userinfo;
-  char *msg;
+  const char *msg;
   char tmpbuf[1152];
   
   va_start(ap, fr);
   userinfo = va_arg(ap, aim_userinfo_t *);	
-  msg = va_arg(ap, char *);
+  msg = va_arg(ap, const char *);
   va_end(ap);
 
Index: buddy.c
===================================================================
--- buddy.c	(revision d43edd2156ec9694ba4cec1c13baba690ce46b19)
+++ buddy.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -1,5 +1,5 @@
 #include "owl.h"
 
-void owl_buddy_create(owl_buddy *b, int proto, char *name)
+void owl_buddy_create(owl_buddy *b, int proto, const char *name)
 {
   b->proto=proto;
@@ -8,5 +8,5 @@
 }
 
-char *owl_buddy_get_name(owl_buddy *b)
+const char *owl_buddy_get_name(owl_buddy *b)
 {
   if (b->name) return(b->name);
Index: buddylist.c
===================================================================
--- buddylist.c	(revision d43edd2156ec9694ba4cec1c13baba690ce46b19)
+++ buddylist.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -8,5 +8,5 @@
 /* add a (logged-in) AIM buddy to the buddy list
  */
-void owl_buddylist_add_aim_buddy(owl_buddylist *bl, char *screenname)
+void owl_buddylist_add_aim_buddy(owl_buddylist *bl, const char *screenname)
 {
   owl_buddy *b;
@@ -19,5 +19,5 @@
 /* remove an AIM buddy from the buddy list
  */
-int owl_buddylist_remove_aim_buddy(owl_buddylist *bl, char *name)
+int owl_buddylist_remove_aim_buddy(owl_buddylist *bl, const char *name)
 {
   int i, j;
@@ -40,5 +40,5 @@
  * logged in.
  */
-void owl_buddylist_oncoming(owl_buddylist *bl, char *screenname)
+void owl_buddylist_oncoming(owl_buddylist *bl, const char *screenname)
 {
   owl_message *m;
@@ -66,5 +66,5 @@
  * has logged out, and sending a message if they were logged in.
  */
-void owl_buddylist_offgoing(owl_buddylist *bl, char *screenname)
+void owl_buddylist_offgoing(owl_buddylist *bl, const char *screenname)
 {
   owl_message *m;
@@ -103,5 +103,5 @@
  * no such buddy is logged in, return NULL.
  */
-owl_buddy *owl_buddylist_get_aim_buddy(owl_buddylist *bl, char *name)
+owl_buddy *owl_buddylist_get_aim_buddy(owl_buddylist *bl, const char *name)
 {
   int i, j;
@@ -119,5 +119,5 @@
  * otherwise return 0
  */
-int owl_buddylist_is_aim_buddy_loggedin(owl_buddylist *bl, char *screenname)
+int owl_buddylist_is_aim_buddy_loggedin(owl_buddylist *bl, const char *screenname)
 {
   owl_buddy *b;
Index: cmd.c
===================================================================
--- cmd.c	(revision fa4562c3dde208105e6938363d047e5622012e67)
+++ cmd.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -38,5 +38,5 @@
 }
 
-owl_cmd *owl_cmddict_find(owl_cmddict *d, char *name) {
+owl_cmd *owl_cmddict_find(owl_cmddict *d, const char *name) {
   return owl_dict_find_element(d, name);
 }
@@ -47,5 +47,5 @@
 
 /* creates a new command alias */
-int owl_cmddict_add_alias(owl_cmddict *cd, char *alias_from, char *alias_to) {
+int owl_cmddict_add_alias(owl_cmddict *cd, const char *alias_from, const char *alias_to) {
   owl_cmd *cmd;
   cmd = owl_malloc(sizeof(owl_cmd));
@@ -65,5 +65,5 @@
 }
 
-char *_owl_cmddict_execute(owl_cmddict *cd, owl_context *ctx, char **argv, int argc, char *buff) {
+char *_owl_cmddict_execute(owl_cmddict *cd, owl_context *ctx, const char *const *argv, int argc, const char *buff) {
   char *retval = NULL;
   owl_cmd *cmd;
@@ -78,5 +78,5 @@
 }
 
-char *owl_cmddict_execute(owl_cmddict *cd, owl_context *ctx, char *cmdbuff) {
+char *owl_cmddict_execute(owl_cmddict *cd, owl_context *ctx, const char *cmdbuff) {
   char **argv;
   int argc;
@@ -103,5 +103,5 @@
 }
 
-char *owl_cmddict_execute_argv(owl_cmddict *cd, owl_context *ctx, char **argv, int argc) {
+char *owl_cmddict_execute_argv(owl_cmddict *cd, owl_context *ctx, const char *const *argv, int argc) {
   char *buff, *ptr;
   int len = 0, i;
@@ -143,5 +143,5 @@
 }
 
-int owl_cmd_create_alias(owl_cmd *cmd, char *name, char *aliased_to) {
+int owl_cmd_create_alias(owl_cmd *cmd, const char *name, const char *aliased_to) {
   memset(cmd, 0, sizeof(owl_cmd));
   cmd->name = owl_strdup(name);
@@ -167,8 +167,8 @@
 }
 
-char *owl_cmd_execute(owl_cmd *cmd, owl_cmddict *cd, owl_context *ctx, int argc, char **argv, char *cmdbuff) {
+char *owl_cmd_execute(owl_cmd *cmd, owl_cmddict *cd, owl_context *ctx, int argc, const char *const *argv, const char *cmdbuff) {
   static int alias_recurse_depth = 0;
   int ival=0;
-  char *cmdbuffargs;
+  const char *cmdbuffargs;
   char *newcmd, *rv=NULL;
 
@@ -206,5 +206,5 @@
 
   if (cmd->cmd_i_fn || cmd->cmd_ctxi_fn) {
-      char *ep = "x";
+      const char *ep = "x";
       if (argc != 2) {
 	owl_function_makemsg("Wrong number of arguments for %s command.", argv[0]);
@@ -238,5 +238,5 @@
 
 /* returns a reference */
-char *owl_cmd_get_summary(owl_cmd *cmd) {
+const char *owl_cmd_get_summary(owl_cmd *cmd) {
   return cmd->summary;
 }
@@ -255,6 +255,6 @@
 
 
-void owl_cmd_get_help(owl_cmddict *d, char *name, owl_fmtext *fm) {
-  char *s;
+void owl_cmd_get_help(owl_cmddict *d, const char *name, owl_fmtext *fm) {
+  const char *s;
   char *indent;
   owl_cmd *cmd;
Index: commands.c
===================================================================
--- commands.c	(revision fa4562c3dde208105e6938363d047e5622012e67)
+++ commands.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -5,5 +5,5 @@
 #include "owl.h"
 
-/* fn is "char *foo(int argc, char **argv, char *buff)" */
+/* fn is "char *foo(int argc, const char *const *argv, const char *buff)" */
 #define OWLCMD_ARGS(name, fn, ctx, summary, usage, description) \
         { name, summary, usage, description, ctx, \
@@ -24,8 +24,8 @@
           actualname, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
 
-/* fn is "char *foo(void *ctx, int argc, char **argv, char *buff)" */
+/* fn is "char *foo(void *ctx, int argc, const char *const *argv, const char *buff)" */
 #define OWLCMD_ARGS_CTX(name, fn, ctx, summary, usage, description) \
         { name, summary, usage, description, ctx, \
-          NULL, NULL, NULL, NULL, ((char*(*)(void*,int,char**,char*))fn), NULL, NULL, NULL }
+          NULL, NULL, NULL, NULL, ((char*(*)(void*,int,const char*const *,const char*))fn), NULL, NULL, NULL }
 
 /* fn is "void foo(void)" */
@@ -1004,5 +1004,5 @@
 }
 
-char *owl_command_help(int argc, char **argv, char *buff)
+char *owl_command_help(int argc, const char *const *argv, const char *buff)
 {
   if (argc!=2) {
@@ -1015,8 +1015,8 @@
 }
 
-char *owl_command_zlist(int argc, char **argv, char *buff)
+char *owl_command_zlist(int argc, const char *const *argv, const char *buff)
 {
   int elapsed=0, timesort=0;
-  char *file=NULL;
+  const char *file=NULL;
 
   argc--;
@@ -1076,5 +1076,5 @@
 }
 
-char *owl_command_aim(int argc, char **argv, char *buff)
+char *owl_command_aim(int argc, const char *const *argv, const char *buff)
 {
   if (argc<2) {
@@ -1096,5 +1096,5 @@
 }
 
-char *owl_command_addbuddy(int argc, char **argv, char *buff)
+char *owl_command_addbuddy(int argc, const char *const *argv, const char *buff)
 {
   if (argc!=3) {
@@ -1124,5 +1124,5 @@
 }
 
-char *owl_command_delbuddy(int argc, char **argv, char *buff)
+char *owl_command_delbuddy(int argc, const char *const *argv, const char *buff)
 {
   if (argc!=3) {
@@ -1148,5 +1148,5 @@
 }
 
-char *owl_command_join(int argc, char **argv, char *buff)
+char *owl_command_join(int argc, const char *const *argv, const char *buff)
 {
   if (argc!=3 && argc!=4) {
@@ -1172,7 +1172,7 @@
 }
 
-char *owl_command_startup(int argc, char **argv, char *buff)
-{
-  char *ptr;
+char *owl_command_startup(int argc, const char *const *argv, const char *buff)
+{
+  const char *ptr;
 
   if (argc<2) {
@@ -1193,7 +1193,7 @@
 }
 
-char *owl_command_unstartup(int argc, char **argv, char *buff)
-{
-  char *ptr;
+char *owl_command_unstartup(int argc, const char *const *argv, const char *buff)
+{
+  const char *ptr;
 
   if (argc<2) {
@@ -1213,5 +1213,5 @@
 }
 
-char *owl_command_dump(int argc, char **argv, char *buff)
+char *owl_command_dump(int argc, const char *const *argv, const char *buff)
 {
   char *filename;
@@ -1227,5 +1227,5 @@
 }
 
-char *owl_command_source(int argc, char **argv, char *buff)
+char *owl_command_source(int argc, const char *const *argv, const char *buff)
 {
   if (argc!=2) {
@@ -1238,5 +1238,5 @@
 }
 
-char *owl_command_next(int argc, char **argv, char *buff)
+char *owl_command_next(int argc, const char *const *argv, const char *buff)
 {
   char *filter=NULL;
@@ -1268,5 +1268,5 @@
 }
 
-char *owl_command_prev(int argc, char **argv, char *buff)
+char *owl_command_prev(int argc, const char *const *argv, const char *buff)
 {
   char *filter=NULL;
@@ -1298,5 +1298,5 @@
 }
 
-char *owl_command_smartnarrow(int argc, char **argv, char *buff)
+char *owl_command_smartnarrow(int argc, const char *const *argv, const char *buff)
 {
   char *filtname = NULL;
@@ -1316,5 +1316,5 @@
 }
 
-char *owl_command_smartfilter(int argc, char **argv, char *buff)
+char *owl_command_smartfilter(int argc, const char *const *argv, const char *buff)
 {
   char *filtname = NULL;
@@ -1372,5 +1372,5 @@
 }
 
-char *owl_command_loadsubs(int argc, char **argv, char *buff)
+char *owl_command_loadsubs(int argc, const char *const *argv, const char *buff)
 {
   if (argc == 2) {
@@ -1386,5 +1386,5 @@
 
 
-char *owl_command_loadloginsubs(int argc, char **argv, char *buff)
+char *owl_command_loadloginsubs(int argc, const char *const *argv, const char *buff)
 {
   if (argc == 2) {
@@ -1404,5 +1404,5 @@
 }
 
-char *owl_command_start_command(int argc, char **argv, char *buff)
+char *owl_command_start_command(int argc, const char *const *argv, const char *buff)
 {
   buff = skiptokens(buff, 1);
@@ -1411,5 +1411,5 @@
 }
 
-char *owl_command_zaway(int argc, char **argv, char *buff)
+char *owl_command_zaway(int argc, const char *const *argv, const char *buff)
 {
   if ((argc==1) ||
@@ -1437,5 +1437,5 @@
 
 
-char *owl_command_aaway(int argc, char **argv, char *buff)
+char *owl_command_aaway(int argc, const char *const *argv, const char *buff)
 {
   if ((argc==1) ||
@@ -1463,5 +1463,5 @@
 
 
-char *owl_command_away(int argc, char **argv, char *buff)
+char *owl_command_away(int argc, const char *const *argv, const char *buff)
 {
   if ((argc==1) ||
@@ -1506,7 +1506,7 @@
 }
 
-char *owl_command_set(int argc, char **argv, char *buff)
-{
-  char *var, *val;
+char *owl_command_set(int argc, const char *const *argv, const char *buff)
+{
+  const char *var, *val;
   int  silent=0;
   int requirebool=0;
@@ -1537,7 +1537,7 @@
 }
 
-char *owl_command_unset(int argc, char **argv, char *buff)
-{
-  char *var, *val;
+char *owl_command_unset(int argc, const char *const *argv, const char *buff)
+{
+  const char *var, *val;
   int  silent=0;
 
@@ -1557,7 +1557,7 @@
 }
 
-char *owl_command_print(int argc, char **argv, char *buff)
-{
-  char *var;
+char *owl_command_print(int argc, const char *const *argv, const char *buff)
+{
+  const char *var;
   char valbuff[1024];
 
@@ -1582,35 +1582,35 @@
 
 
-char *owl_command_exec(int argc, char **argv, char *buff)
+char *owl_command_exec(int argc, const char *const *argv, const char *buff)
 {
   return owl_function_exec(argc, argv, buff, 0);
 }
 
-char *owl_command_pexec(int argc, char **argv, char *buff)
+char *owl_command_pexec(int argc, const char *const *argv, const char *buff)
 {
   return owl_function_exec(argc, argv, buff, 1);
 }
 
-char *owl_command_aexec(int argc, char **argv, char *buff)
+char *owl_command_aexec(int argc, const char *const *argv, const char *buff)
 {
   return owl_function_exec(argc, argv, buff, 2);
 }
 
-char *owl_command_perl(int argc, char **argv, char *buff)
+char *owl_command_perl(int argc, const char *const *argv, const char *buff)
 {
   return owl_function_perl(argc, argv, buff, 0);
 }
 
-char *owl_command_pperl(int argc, char **argv, char *buff)
+char *owl_command_pperl(int argc, const char *const *argv, const char *buff)
 {
   return owl_function_perl(argc, argv, buff, 1);
 }
 
-char *owl_command_aperl(int argc, char **argv, char *buff)
+char *owl_command_aperl(int argc, const char *const *argv, const char *buff)
 {
   return owl_function_perl(argc, argv, buff, 2);
 }
 
-char *owl_command_multi(int argc, char **argv, char *buff)
+char *owl_command_multi(int argc, const char *const *argv, const char *buff)
 {
   char *lastrv = NULL, *newbuff;
@@ -1647,5 +1647,5 @@
 
 
-char *owl_command_alias(int argc, char **argv, char *buff)
+char *owl_command_alias(int argc, const char *const *argv, const char *buff)
 {
   if (argc < 3) {
@@ -1659,5 +1659,5 @@
 
 
-char *owl_command_bindkey(int argc, char **argv, char *buff)
+char *owl_command_bindkey(int argc, const char *const *argv, const char *buff)
 {
   owl_keymap *km;
@@ -1688,5 +1688,5 @@
 }
 
-char *owl_command_debug(int argc, char **argv, char *buff)
+char *owl_command_debug(int argc, const char *const *argv, const char *buff)
 {
   if (argc<2) {
@@ -1704,5 +1704,5 @@
 }
 
-char *owl_command_term(int argc, char **argv, char *buff)
+char *owl_command_term(int argc, const char *const *argv, const char *buff)
 {
   if (argc<2) {
@@ -1721,5 +1721,5 @@
 }
 
-char *owl_command_zlog(int argc, char **argv, char *buff)
+char *owl_command_zlog(int argc, const char *const *argv, const char *buff)
 {
   if ((argc<2) || (argc>3)) {
@@ -1745,7 +1745,7 @@
 }
 
-char *owl_command_subscribe(int argc, char **argv, char *buff)
-{
-  char *class, *instance, *recip="";
+char *owl_command_subscribe(int argc, const char *const *argv, const char *buff)
+{
+  const char *class, *instance, *recip="";
   int temp=0;
   int ret=0;
@@ -1795,7 +1795,7 @@
 
 
-char *owl_command_unsubscribe(int argc, char **argv, char *buff)
-{
-  char *class, *instance, *recip="";
+char *owl_command_unsubscribe(int argc, const char *const *argv, const char *buff)
+{
+  const char *class, *instance, *recip="";
   int temp=0;
 
@@ -1843,5 +1843,5 @@
 }
 
-char *owl_command_echo(int argc, char **argv, char *buff)
+char *owl_command_echo(int argc, const char *const *argv, const char *buff)
 {
   buff = skiptokens(buff, 1);
@@ -1860,5 +1860,5 @@
 }
 
-char *owl_command_zwrite(int argc, char **argv, char *buff)
+char *owl_command_zwrite(int argc, const char *const *argv, const char *buff)
 {
   owl_zwrite z;
@@ -1884,8 +1884,8 @@
 }
 
-char *owl_command_aimwrite(int argc, char **argv, char *buff)
+char *owl_command_aimwrite(int argc, const char *const *argv, const char *buff)
 {
   char *newbuff, *recip;
-  char **myargv;
+  const char *const *myargv;
   int i, j, myargc;
   owl_message *m;
@@ -1964,5 +1964,5 @@
 }
 
-char *owl_command_loopwrite(int argc, char **argv, char *buff)
+char *owl_command_loopwrite(int argc, const char *const *argv, const char *buff)
 {
   owl_function_loopwrite_setup();
@@ -1970,5 +1970,5 @@
 }
 
-char *owl_command_zcrypt(int argc, char **argv, char *buff)
+char *owl_command_zcrypt(int argc, const char *const *argv, const char *buff)
 {
 #ifdef OWL_ENABLE_ZCRYPT
@@ -1998,5 +1998,5 @@
 }
 
-char *owl_command_reply(int argc, char **argv, char *buff)
+char *owl_command_reply(int argc, const char *const *argv, const char *buff)
 {
   int edit=0;
@@ -2024,5 +2024,5 @@
 }
 
-char *owl_command_filter(int argc, char **argv, char *buff)
+char *owl_command_filter(int argc, const char *const *argv, const char *buff)
 {
   owl_function_create_filter(argc, argv);
@@ -2030,5 +2030,5 @@
 }
 
-char *owl_command_zlocate(int argc, char **argv, char *buff)
+char *owl_command_zlocate(int argc, const char *const *argv, const char *buff)
 {
   int auth;
@@ -2064,5 +2064,5 @@
  * view --home
  */
-char *owl_command_view(int argc, char **argv, char *buff)
+char *owl_command_view(int argc, const char *const *argv, const char *buff)
 {
   /* First take the 'view --home' and 'view -r' cases */
@@ -2088,8 +2088,8 @@
   /* Now get 'view -d <expression>' */
   if (argc>=3 && !strcmp(argv[1], "-d")) {
-    char **myargv;
+    const char **myargv;
     int i;
 
-    myargv=owl_malloc((argc*sizeof(char *))+50);
+    myargv=owl_malloc((argc*sizeof(const char *))+50);
     myargv[0]="";
     myargv[1]="owl-dynamic";
@@ -2136,5 +2136,5 @@
       argv++;
     } else if (!strcmp(argv[0], "-r")) {
-      char *foo;
+      const char *foo;
       foo=owl_function_create_negative_filter(owl_view_get_filtname(owl_global_get_current_view(&g)));
       owl_function_change_currentview_filter(foo);
@@ -2156,5 +2156,5 @@
 }
 
-char *owl_command_show(int argc, char **argv, char *buff)
+char *owl_command_show(int argc, const char *const *argv, const char *buff)
 {
   if (argc<2) {
@@ -2213,5 +2213,5 @@
     owl_function_show_quickstart();
   } else if (!strcmp(argv[1], "startup")) {
-    char *filename;
+    const char *filename;
     
     filename=owl_global_get_startupfile(&g);
@@ -2226,5 +2226,5 @@
 }
 
-char *owl_command_viewclass(int argc, char **argv, char *buff)
+char *owl_command_viewclass(int argc, const char *const *argv, const char *buff)
 {
   char *filtname;
@@ -2239,5 +2239,5 @@
 }
 
-char *owl_command_viewuser(int argc, char **argv, char *buff)
+char *owl_command_viewuser(int argc, const char *const *argv, const char *buff)
 {
   char *filtname;
@@ -2258,5 +2258,5 @@
 }
 
-char *owl_command_delete(int argc, char **argv, char *buff)
+char *owl_command_delete(int argc, const char *const *argv, const char *buff)
 {
   int move_after = 1;
@@ -2292,5 +2292,5 @@
 }
 
-char *owl_command_undelete(int argc, char **argv, char *buff)
+char *owl_command_undelete(int argc, const char *const *argv, const char *buff)
 {
   int move_after = 1;
@@ -2326,5 +2326,5 @@
 }
 
-char *owl_command_colorview(int argc, char **argv, char *buff)
+char *owl_command_colorview(int argc, const char *const *argv, const char *buff)
 {
   if (argc < 2 || argc > 3) {
@@ -2336,7 +2336,7 @@
 }
 
-char *owl_command_colorclass(int argc, char **argv, char *buff)
-{
-  char *filtname;
+char *owl_command_colorclass(int argc, const char *const *argv, const char *buff)
+{
+  const char *filtname;
   
   if (argc < 3 || argc > 4) {
@@ -2350,5 +2350,5 @@
 }
 
-char *owl_command_zpunt(int argc, char **argv, char *buff)
+char *owl_command_zpunt(int argc, const char *const *argv, const char *buff)
 {
   owl_command_zpunt_and_zunpunt(argc, argv, 0);
@@ -2356,5 +2356,5 @@
 }
 
-char *owl_command_zunpunt(int argc, char **argv, char *buff)
+char *owl_command_zunpunt(int argc, const char *const *argv, const char *buff)
 {
   owl_command_zpunt_and_zunpunt(argc, argv, 1);
@@ -2362,10 +2362,10 @@
 }
 
-void owl_command_zpunt_and_zunpunt(int argc, char **argv, int type)
+void owl_command_zpunt_and_zunpunt(int argc, const char *const *argv, int type)
 {
   /* if type==0 then zpunt
    * if type==1 then zunpunt
    */
-  char *class, *inst, *recip;
+  const char *class, *inst, *recip;
 
   class="message";
@@ -2399,5 +2399,5 @@
 }
 
-char *owl_command_smartzpunt(int argc, char **argv, char *buff)
+char *owl_command_smartzpunt(int argc, const char *const *argv, const char *buff)
 {
   if (argc == 1) {
@@ -2411,5 +2411,5 @@
 }
 
-char *owl_command_punt(int argc, char **argv, char *buff)
+char *owl_command_punt(int argc, const char *const *argv, const char *buff)
 {
   owl_command_punt_unpunt(argc, argv, buff, 0);
@@ -2417,5 +2417,5 @@
 }
 
-char *owl_command_unpunt(int argc, char **argv, char *buff)
+char *owl_command_unpunt(int argc, const char *const *argv, const char *buff)
 {
   owl_command_punt_unpunt(argc, argv, buff, 1);
@@ -2423,5 +2423,5 @@
 }
 
-void owl_command_punt_unpunt(int argc, char ** argv, char *buff, int unpunt)
+void owl_command_punt_unpunt(int argc, const char *const * argv, const char *buff, int unpunt)
 {
   owl_list * fl;
@@ -2457,7 +2457,7 @@
 
 
-char *owl_command_getview(int argc, char **argv, char *buff)
-{
-  char *filtname;
+char *owl_command_getview(int argc, const char *const *argv, const char *buff)
+{
+  const char *filtname;
   if (argc != 1) {
     owl_function_makemsg("Wrong number of arguments for %s", argv[0]);
@@ -2469,5 +2469,5 @@
 }
 
-char *owl_command_getvar(int argc, char **argv, char *buff)
+char *owl_command_getvar(int argc, const char *const *argv, const char *buff)
 {
   char tmpbuff[1024];
@@ -2483,5 +2483,5 @@
 }
 
-char *owl_command_getfilter(int argc, char **argv, char *buf)
+char *owl_command_getfilter(int argc, const char *const *argv, const char *buf)
 {
   owl_filter *f;
@@ -2497,8 +2497,8 @@
 }
 
-char *owl_command_search(int argc, char **argv, char *buff)
+char *owl_command_search(int argc, const char *const *argv, const char *buff)
 {
   int direction;
-  char *buffstart;
+  const char *buffstart;
 
   direction=OWL_DIRECTION_DOWNWARDS;
@@ -2518,7 +2518,7 @@
 }
 
-char *owl_command_setsearch(int argc, char **argv, char *buff)
-{
-  char *buffstart;
+char *owl_command_setsearch(int argc, const char *const *argv, const char *buff)
+{
+  const char *buffstart;
 
   buffstart=skiptokens(buff, 1);
@@ -2528,5 +2528,5 @@
 }
 
-char *owl_command_aimlogin(int argc, char **argv, char *buff)
+char *owl_command_aimlogin(int argc, const char *const *argv, const char *buff)
 {
   if ((argc<2) || (argc>3)) {
@@ -2549,5 +2549,5 @@
 }
 
-char *owl_command_aimlogout(int argc, char **argv, char *buff)
+char *owl_command_aimlogout(int argc, const char *const *argv, const char *buff)
 {
   /* clear the buddylist */
@@ -2558,7 +2558,7 @@
 }
 
-char *owl_command_getstyle(int argc, char **argv, char *buff)
-{
-  char *stylename;
+char *owl_command_getstyle(int argc, const char *const *argv, const char *buff)
+{
+  const char *stylename;
   if (argc != 1) {
     owl_function_makemsg("Wrong number of arguments for %s", argv[0]);
@@ -2570,5 +2570,5 @@
 }
 
-char *owl_command_error(int argc, char **argv, char *buff)
+char *owl_command_error(int argc, const char *const *argv, const char *buff)
 {
     buff = skiptokens(buff, 1);
@@ -2577,5 +2577,5 @@
 }
 
-char *owl_command_message(int argc, char **argv, char *buff)
+char *owl_command_message(int argc, const char *const *argv, const char *buff)
 {
     buff = skiptokens(buff, 1);
@@ -2588,5 +2588,5 @@
   owl_message *m;
   owl_view *v;
-  char *cmd;
+  const char *cmd;
 
   v = owl_global_get_current_view(&g);
@@ -2622,5 +2622,5 @@
   owl_message *m;
   owl_view *v;
-  char *cmd;
+  const char *cmd;
 
   v = owl_global_get_current_view(&g);
@@ -2680,5 +2680,5 @@
 {
   owl_history *hist;
-  char *ptr;
+  const char *ptr;
 
   hist=owl_editwin_get_history(e);
@@ -2701,5 +2701,5 @@
 {
   owl_history *hist;
-  char *ptr;
+  const char *ptr;
 
   hist=owl_editwin_get_history(e);
@@ -2715,5 +2715,5 @@
 }
 
-char *owl_command_edit_insert_text(owl_editwin *e, int argc, char **argv, char *buff)
+char *owl_command_edit_insert_text(owl_editwin *e, int argc, const char *const *argv, const char *buff)
 {
   buff = skiptokens(buff, 1);
Index: dict.c
===================================================================
--- dict.c	(revision 2b37be24365a6f7a551e5e5fa5d7e57f9a5b7d2f)
+++ dict.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -31,5 +31,5 @@
  * this element would logically go, and stores the index in pos.
  * Returns 1 if found, else 0. */
-int _owl_dict_find_pos(owl_dict *d, char *k, int *pos) {
+int _owl_dict_find_pos(owl_dict *d, const char *k, int *pos) {
   int lo = 0, hi = d->size;
   while (lo < hi) {
@@ -50,5 +50,5 @@
 
 /* returns the value corresponding to key k */
-void *owl_dict_find_element(owl_dict *d, char *k) {
+void *owl_dict_find_element(owl_dict *d, const char *k) {
   int found, pos;
   found = _owl_dict_find_pos(d, k, &pos);
@@ -82,5 +82,5 @@
    Will return -2 if replace=NULL and match was found.
 */
-int owl_dict_insert_element(owl_dict *d, char *k, void *v, void (*free_on_replace)(void *old)) {
+int owl_dict_insert_element(owl_dict *d, const char *k, void *v, void (*free_on_replace)(void *old)) {
   int pos, found;
   char *dupk;
@@ -113,5 +113,5 @@
 /* Doesn't free the value of the element, but does
  * return it so the caller can free it. */
-void *owl_dict_remove_element(owl_dict *d, char *k) {
+void *owl_dict_remove_element(owl_dict *d, const char *k) {
   int i;
   int pos, found;
Index: editwin.c
===================================================================
--- editwin.c	(revision 65b21736092356a35d24e53dc2e6b92e13174131)
+++ editwin.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -45,5 +45,5 @@
 static void oe_restore_excursion(owl_editwin *e, oe_excursion *x);
 static void oe_restore_mark_only(owl_editwin *e, oe_excursion *x);
-static int oe_count_glyphs(char *s);
+static int oe_count_glyphs(const char *s);
 static int oe_char_width(gunichar c, int column);
 static int oe_region_width(owl_editwin *e, int start, int end, int width);
@@ -52,8 +52,8 @@
 static int owl_editwin_limit_maxcols(int v, int maxv);
 static int owl_editwin_check_dotsend(owl_editwin *e);
-static int owl_editwin_is_char_in(owl_editwin *e, char *set);
+static int owl_editwin_is_char_in(owl_editwin *e, const char *set);
 static gunichar owl_editwin_get_char_at_point(owl_editwin *e);
-static int owl_editwin_replace_internal(owl_editwin *e, int replace, char *s);
-static char *oe_copy_buf(owl_editwin *e, char *buf, int len);
+static int owl_editwin_replace_internal(owl_editwin *e, int replace, const char *s);
+static const char *oe_copy_buf(owl_editwin *e, const char *buf, int len);
 static int oe_copy_region(owl_editwin *e);
 static char *oe_chunk(owl_editwin *e, int start, int end);
@@ -71,8 +71,8 @@
 }
 
-static int oe_count_glyphs(char *s)
+static int oe_count_glyphs(const char *s)
 {
   int count = 0;
-  char *p;
+  const char *p;
 
   for(p = s; *p != 0; p = g_utf8_find_next_char(p, NULL))
@@ -175,5 +175,5 @@
 }
 
-void owl_editwin_set_command(owl_editwin *e, char *command)
+void owl_editwin_set_command(owl_editwin *e, const char *command)
 {
   if(e->command) owl_free(e->command);
@@ -181,5 +181,5 @@
 }
 
-char *owl_editwin_get_command(owl_editwin *e)
+const char *owl_editwin_get_command(owl_editwin *e)
 {
   if(e->command) return e->command;
@@ -230,5 +230,5 @@
  * previous text (including locked text) will be overwritten
  */
-void owl_editwin_set_locktext(owl_editwin *e, char *text)
+void owl_editwin_set_locktext(owl_editwin *e, const char *text)
 {
   oe_set_index(e, 0);
@@ -378,8 +378,8 @@
 }
 
-static inline char *oe_next_point(owl_editwin *e, char *p)
-{
-  char *boundary = e->buff + e->bufflen + 1;
-  char *q;
+static inline const char *oe_next_point(owl_editwin *e, const char *p)
+{
+  const char *boundary = e->buff + e->bufflen + 1;
+  const char *q;
 
   q = g_utf8_find_next_char(p, boundary);
@@ -392,7 +392,7 @@
 }
 
-static inline char *oe_prev_point(owl_editwin *e, char *p)
-{
-  char *boundary = e->buff + e->lock;
+static inline const char *oe_prev_point(owl_editwin *e, const char *p)
+{
+  const char *boundary = e->buff + e->lock;
 
   p = g_utf8_find_prev_char(boundary, p);
@@ -422,5 +422,5 @@
   int width = 0, cw;
   gunichar c;
-  char *p;
+  const char *p;
 
   while(1) {
@@ -576,5 +576,5 @@
 }
 
-int owl_editwin_replace_region(owl_editwin *e, char *s)
+int owl_editwin_replace_region(owl_editwin *e, const char *s)
 {
   oe_excursion x;
@@ -594,8 +594,8 @@
 
 /* replace 'replace' characters at the point with s, returning the change in size */
-int owl_editwin_replace(owl_editwin *e, int replace, char *s)
+int owl_editwin_replace(owl_editwin *e, int replace, const char *s)
 {
   int start, end, i;
-  char *p;
+  const char *p;
 
   if (!g_utf8_validate(s, -1, NULL)) {
@@ -615,5 +615,5 @@
 }
 
-static int owl_editwin_replace_internal(owl_editwin *e, int replace, char *s)
+static int owl_editwin_replace_internal(owl_editwin *e, int replace, const char *s)
 {
   int start, end, free, need, size, change;
@@ -694,5 +694,5 @@
 void owl_editwin_transpose_chars(owl_editwin *e)
 {
-  char *middle, *end, *start;
+  const char *middle, *end, *start;
   char *tmp;
 
@@ -728,5 +728,5 @@
  * right
  */
-void owl_editwin_insert_string(owl_editwin *e, char *s)
+void owl_editwin_insert_string(owl_editwin *e, const char *s)
 {
   owl_editwin_replace(e, 0, s);
@@ -751,5 +751,5 @@
 int owl_editwin_point_move(owl_editwin *e, int delta)
 {
-  char *p;
+  const char *p;
   int change, d = 0;
 
@@ -801,7 +801,7 @@
 }
 
-static int owl_editwin_is_char_in(owl_editwin *e, char *set)
-{
-  char *p;
+static int owl_editwin_is_char_in(owl_editwin *e, const char *set)
+{
+  const char *p;
 
   for (p = set; *p != 0; p = g_utf8_find_next_char(p, NULL))
@@ -811,5 +811,5 @@
 }
 
-int owl_editwin_move_if_in(owl_editwin *e, int delta, char *set)
+int owl_editwin_move_if_in(owl_editwin *e, int delta, const char *set)
 {
   int change, distance = 0;
@@ -823,5 +823,5 @@
 }
 
-int owl_editwin_move_if_not_in(owl_editwin *e, int delta, char *set)
+int owl_editwin_move_if_not_in(owl_editwin *e, int delta, const char *set)
 {
   int change, distance = 0;
@@ -1030,5 +1030,5 @@
 }
 
-static char *oe_copy_buf(owl_editwin *e, char *buf, int len)
+static const char *oe_copy_buf(owl_editwin *e, const char *buf, int len)
 {
   char *p;
@@ -1048,5 +1048,5 @@
 static int oe_copy_region(owl_editwin *e)
 {
-  char *p;
+  const char *p;
   int start, end;
 
@@ -1237,5 +1237,5 @@
 static int oe_region_width(owl_editwin *e, int start, int end, int offset)
 {
-  char *p;
+  const char *p;
   int width = offset;
   
@@ -1317,5 +1317,5 @@
 }
 
-char *owl_editwin_get_text(owl_editwin *e)
+const char *owl_editwin_get_text(owl_editwin *e)
 {
   return(e->buff+e->lock);
Index: errqueue.c
===================================================================
--- errqueue.c	(revision ec6ff526f80f4544b68f01e84ccd88c783e54326)
+++ errqueue.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -6,5 +6,5 @@
 }
 
-void owl_errqueue_append_err(owl_errqueue *eq, char *msg)
+void owl_errqueue_append_err(owl_errqueue *eq, const char *msg)
 {
   owl_list_append_element(&(eq->errlist), owl_strdup(msg));
Index: filter.c
===================================================================
--- filter.c	(revision c529ac8bb1d8b29ebbfc9c8c4d856b1a5fa687a8)
+++ filter.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -2,5 +2,5 @@
 #include "owl.h"
 
-int owl_filter_init_fromstring(owl_filter *f, char *name, char *string)
+int owl_filter_init_fromstring(owl_filter *f, const char *name, const char *string)
 {
   char **argv;
@@ -13,5 +13,5 @@
 }
 
-int owl_filter_init(owl_filter *f, char *name, int argc, char **argv)
+int owl_filter_init(owl_filter *f, const char *name, int argc, const char *const *argv)
 {
   f->name=owl_strdup(name);
@@ -56,5 +56,5 @@
 /* A primitive expression is one without any toplevel ``and'' or ``or''s*/
 
-static owl_filterelement * owl_filter_parse_primitive_expression(int argc, char **argv, int *next)
+static owl_filterelement * owl_filter_parse_primitive_expression(int argc, const char *const *argv, int *next)
 {
   owl_filterelement *fe, *op;
@@ -112,5 +112,5 @@
 }
 
-owl_filterelement * owl_filter_parse_expression(int argc, char **argv, int *next)
+owl_filterelement * owl_filter_parse_expression(int argc, const char *const *argv, int *next)
 {
   int i = 0, skip;
@@ -151,5 +151,5 @@
 }
 
-char *owl_filter_get_name(owl_filter *f)
+const char *owl_filter_get_name(owl_filter *f)
 {
   return(f->name);
@@ -270,5 +270,5 @@
 #ifdef OWL_INCLUDE_REG_TESTS
 
-int owl_filter_test_string(char * filt, owl_message *m, int shouldmatch) /* noproto */ {
+int owl_filter_test_string(const char * filt, owl_message *m, int shouldmatch) /* noproto */ {
   owl_filter f;
   int ok;
Index: filterelement.c
===================================================================
--- filterelement.c	(revision 65b21736092356a35d24e53dc2e6b92e13174131)
+++ filterelement.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -1,7 +1,7 @@
 #include "owl.h"
 
-static char * owl_filterelement_get_field(owl_message *m, char * field)
-{
-  char *match;
+static const char * owl_filterelement_get_field(owl_message *m, const char * field)
+{
+  const char *match;
   if (!strcasecmp(field, "class")) {
     match=owl_message_get_class(m);
@@ -60,5 +60,5 @@
 static int owl_filterelement_match_re(owl_filterelement *fe, owl_message *m)
 {
-  char * val = owl_filterelement_get_field(m, fe->field);
+  const char * val = owl_filterelement_get_field(m, fe->field);
   return !owl_regex_compare(&(fe->re), val, NULL, NULL);
 }
@@ -79,5 +79,5 @@
 static int owl_filterelement_match_perl(owl_filterelement *fe, owl_message *m)
 {
-  char *subname;
+  const char *subname;
   char *perlrv;
   int   tf=0;
@@ -137,5 +137,5 @@
 static void owl_filterelement_print_re(owl_filterelement *fe, GString *buf)
 {
-  char *re, *q;
+  const char *re, *q;
   g_string_append(buf, fe->field);
   g_string_append(buf, " ");
@@ -212,5 +212,5 @@
 }
 
-int owl_filterelement_create_re(owl_filterelement *fe, char *field, char *re)
+int owl_filterelement_create_re(owl_filterelement *fe, const char *field, const char *re)
 {
   owl_filterelement_create(fe);
@@ -226,5 +226,5 @@
 }
 
-void owl_filterelement_create_filter(owl_filterelement *fe, char *name)
+void owl_filterelement_create_filter(owl_filterelement *fe, const char *name)
 {
   owl_filterelement_create(fe);
@@ -234,5 +234,5 @@
 }
 
-void owl_filterelement_create_perl(owl_filterelement *fe, char *name)
+void owl_filterelement_create_perl(owl_filterelement *fe, const char *name)
 {
   owl_filterelement_create(fe);
Index: fmtext.c
===================================================================
--- fmtext.c	(revision 65b21736092356a35d24e53dc2e6b92e13174131)
+++ fmtext.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -43,5 +43,5 @@
  * 'color'
  */
-void owl_fmtext_append_attr(owl_fmtext *f, char *text, char attr, short fgcolor, short bgcolor)
+void owl_fmtext_append_attr(owl_fmtext *f, const char *text, char attr, short fgcolor, short bgcolor)
 {
   char attrbuff[6];
@@ -83,5 +83,5 @@
 
 /* Append normal, uncolored text 'text' to 'f' */
-void owl_fmtext_append_normal(owl_fmtext *f, char *text)
+void owl_fmtext_append_normal(owl_fmtext *f, const char *text)
 {
   owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_NONE, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT);
@@ -89,5 +89,5 @@
 
 /* Append normal, uncolored text specified by format string to 'f' */
-void owl_fmtext_appendf_normal(owl_fmtext *f, char *fmt, ...)
+void owl_fmtext_appendf_normal(owl_fmtext *f, const char *fmt, ...)
 {
   va_list ap;
@@ -103,5 +103,5 @@
 
 /* Append normal text 'text' to 'f' with color 'color' */
-void owl_fmtext_append_normal_color(owl_fmtext *f, char *text, int fgcolor, int bgcolor)
+void owl_fmtext_append_normal_color(owl_fmtext *f, const char *text, int fgcolor, int bgcolor)
 {
   owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_NONE, fgcolor, bgcolor);
@@ -109,5 +109,5 @@
 
 /* Append bold text 'text' to 'f' */
-void owl_fmtext_append_bold(owl_fmtext *f, char *text)
+void owl_fmtext_append_bold(owl_fmtext *f, const char *text)
 {
   owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_BOLD, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT);
@@ -115,5 +115,5 @@
 
 /* Append reverse video text 'text' to 'f' */
-void owl_fmtext_append_reverse(owl_fmtext *f, char *text)
+void owl_fmtext_append_reverse(owl_fmtext *f, const char *text)
 {
   owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_REVERSE, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT);
@@ -121,5 +121,5 @@
 
 /* Append reversed and bold, uncolored text 'text' to 'f' */
-void owl_fmtext_append_reversebold(owl_fmtext *f, char *text)
+void owl_fmtext_append_reversebold(owl_fmtext *f, const char *text)
 {
   owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_REVERSE | OWL_FMTEXT_ATTR_BOLD, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT);
@@ -172,5 +172,5 @@
 void _owl_fmtext_scan_attributes(owl_fmtext *f, int start, char *attr, short *fgcolor, short *bgcolor) /*noproto*/
 {
-  char *p;
+  const char *p;
   p = strchr(f->textbuff, OWL_FMTEXT_UC_STARTBYTE_UTF8);
   while (p && p < f->textbuff + start) {
@@ -382,5 +382,5 @@
 int owl_fmtext_truncate_lines(owl_fmtext *in, int aline, int lines, owl_fmtext *out)
 {
-  char *ptr1, *ptr2;
+  const char *ptr1, *ptr2;
   int i, offset;
   
@@ -426,5 +426,5 @@
 void owl_fmtext_truncate_cols(owl_fmtext *in, int acol, int bcol, owl_fmtext *out)
 {
-  char *ptr_s, *ptr_e, *ptr_c, *last;
+  const char *ptr_s, *ptr_e, *ptr_c, *last;
   int col, st, padding, chwidth;
 
@@ -517,5 +517,5 @@
 }
 
-char *owl_fmtext_get_text(owl_fmtext *f)
+const char *owl_fmtext_get_text(owl_fmtext *f)
 {
   return(f->textbuff);
@@ -565,8 +565,8 @@
  * formatting syntax to set appropriate attributes.
  */
-void owl_fmtext_append_ztext(owl_fmtext *f, char *text)
+void owl_fmtext_append_ztext(owl_fmtext *f, const char *text)
 {
   int stacksize, curattrs, curcolor;
-  char *ptr, *txtptr, *tmpptr;
+  const char *ptr, *txtptr, *tmpptr;
   char *buff;
   int attrstack[32], chrstack[32], colorstack[32];
@@ -770,8 +770,8 @@
  * If format_fn is specified, passes it the list element value
  * and it will return a string which this needs to free. */
-void owl_fmtext_append_list(owl_fmtext *f, owl_list *l, char *join_with, char *(format_fn)(char *))
+void owl_fmtext_append_list(owl_fmtext *f, owl_list *l, const char *join_with, char *(format_fn)(const char *))
 {
   int i, size;
-  char *elem;
+  const char *elem;
   char *text;
 
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;
Index: global.c
===================================================================
--- global.c	(revision 65b21736092356a35d24e53dc2e6b92e13174131)
+++ global.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -269,9 +269,9 @@
 /* buffercommand */
 
-void owl_global_set_buffercommand(owl_global *g, char *command) {
+void owl_global_set_buffercommand(owl_global *g, const char *command) {
   owl_editwin_set_command(owl_global_get_typwin(g), command);
 }
 
-char *owl_global_get_buffercommand(owl_global *g) {
+const char *owl_global_get_buffercommand(owl_global *g) {
   return owl_editwin_get_command(owl_global_get_typwin(g));
 }
@@ -351,10 +351,10 @@
 }
 
-char *owl_global_get_homedir(owl_global *g) {
+const char *owl_global_get_homedir(owl_global *g) {
   if (g->homedir) return(g->homedir);
   return("/");
 }
 
-char *owl_global_get_confdir(owl_global *g) {
+const char *owl_global_get_confdir(owl_global *g) {
   if (g->confdir) return(g->confdir);
   return("/");
@@ -364,5 +364,5 @@
  * Setting this also sets startupfile to confdir/startup
  */
-void owl_global_set_confdir(owl_global *g, char *cd) {
+void owl_global_set_confdir(owl_global *g, const char *cd) {
   free(g->confdir);
   g->confdir = owl_strdup(cd);
@@ -371,5 +371,5 @@
 }
 
-char *owl_global_get_startupfile(owl_global *g) {
+const char *owl_global_get_startupfile(owl_global *g) {
   if(g->startupfile) return(g->startupfile);
   return("/");
@@ -534,5 +534,5 @@
 }
 
-char *owl_global_get_hostname(owl_global *g) {
+const char *owl_global_get_hostname(owl_global *g) {
   if (g->thishost) return(g->thishost);
   return("");
@@ -577,5 +577,5 @@
 /* startup args */
 
-void owl_global_set_startupargs(owl_global *g, int argc, char **argv) {
+void owl_global_set_startupargs(owl_global *g, int argc, const char *const *argv) {
   int i, len;
 
@@ -595,5 +595,5 @@
 }
 
-char *owl_global_get_startupargs(owl_global *g) {
+const char *owl_global_get_startupargs(owl_global *g) {
   if (g->startupargs) return(g->startupargs);
   return("");
@@ -616,5 +616,5 @@
 }
 
-owl_filter *owl_global_get_filter(owl_global *g, char *name) {
+owl_filter *owl_global_get_filter(owl_global *g, const char *name) {
   int i, j;
   owl_filter *f;
@@ -634,5 +634,5 @@
 }
 
-void owl_global_remove_filter(owl_global *g, char *name) {
+void owl_global_remove_filter(owl_global *g, const char *name) {
   int i, j;
   owl_filter *f;
@@ -741,5 +741,5 @@
 }
 
-char *owl_global_get_aim_screenname(owl_global *g)
+const char *owl_global_get_aim_screenname(owl_global *g)
 {
   if (owl_global_is_aimloggedin(g)) {
@@ -749,5 +749,5 @@
 }
 
-char *owl_global_get_aim_screenname_for_filters(owl_global *g)
+const char *owl_global_get_aim_screenname_for_filters(owl_global *g)
 {
   if (owl_global_is_aimloggedin(g)) {
@@ -757,8 +757,8 @@
 }
 
-void owl_global_set_aimloggedin(owl_global *g, char *screenname)
+void owl_global_set_aimloggedin(owl_global *g, const char *screenname)
 {
   char *sn_escaped;
-  char *quote;
+  const char *quote;
   g->aim_loggedin=1;
   if (g->aim_screenname) owl_free(g->aim_screenname);
@@ -843,5 +843,5 @@
 /* Return the style with name 'name'.  If it does not exist return
  * NULL */
-owl_style *owl_global_get_style_by_name(owl_global *g, char *name)
+owl_style *owl_global_get_style_by_name(owl_global *g, const char *name)
 {
   return owl_dict_find_element(&(g->styledict), name);
@@ -942,5 +942,5 @@
 }
 
-char * owl_global_intern(owl_global *g, char * string)
+const char * owl_global_intern(owl_global *g, const char * string)
 {
   return owl_obarray_insert(&(g->obarray), string);
Index: help.c
===================================================================
--- help.c	(revision d43edd2156ec9694ba4cec1c13baba690ce46b19)
+++ help.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -5,5 +5,5 @@
 {
   owl_fmtext fm;
-  char *varname;
+  const char *varname;
   owl_list varnames;
   int i, numvarnames;
Index: history.c
===================================================================
--- history.c	(revision d43edd2156ec9694ba4cec1c13baba690ce46b19)
+++ history.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -15,5 +15,5 @@
 }
 
-char *owl_history_get_prev(owl_history *h)
+const char *owl_history_get_prev(owl_history *h)
 {
 
@@ -32,5 +32,5 @@
 }
 
-char *owl_history_get_next(owl_history *h)
+const char *owl_history_get_next(owl_history *h)
 {
   if (!h) return NULL;
@@ -44,5 +44,5 @@
 }
 
-void owl_history_store(owl_history *h, char *line)
+void owl_history_store(owl_history *h, const char *line)
 {
   int size;
Index: keybinding.c
===================================================================
--- keybinding.c	(revision d43edd2156ec9694ba4cec1c13baba690ce46b19)
+++ keybinding.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -12,5 +12,5 @@
 
 /* sets up a new keybinding for a command */
-int owl_keybinding_init(owl_keybinding *kb, char *keyseq, char *command, void (*function_fn)(void), char *desc)
+int owl_keybinding_init(owl_keybinding *kb, const char *keyseq, const char *command, void (*function_fn)(void), const char *desc)
 {
   char **ktokens;
@@ -100,5 +100,5 @@
 }
 
-char *owl_keybinding_get_desc(owl_keybinding *kb)
+const char *owl_keybinding_get_desc(owl_keybinding *kb)
 {
   return kb->desc;
Index: keymap.c
===================================================================
--- keymap.c	(revision 4d86e066c8f1fe00bd18a85523b809ba4c968947)
+++ keymap.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -3,5 +3,5 @@
 
 /* returns 0 on success */
-int owl_keymap_init(owl_keymap *km, char *name, char *desc, void (*default_fn)(owl_input), void (*prealways_fn)(owl_input), void (*postalways_fn)(owl_input))
+int owl_keymap_init(owl_keymap *km, const char *name, const char *desc, void (*default_fn)(owl_input), void (*prealways_fn)(owl_input), void (*postalways_fn)(owl_input))
 {
   if (!name || !desc) return(-1);
@@ -30,5 +30,5 @@
 
 /* creates and adds a key binding */
-int owl_keymap_create_binding(owl_keymap *km, char *keyseq, char *command, void (*function_fn)(void), char *desc)
+int owl_keymap_create_binding(owl_keymap *km, const char *keyseq, const char *command, void (*function_fn)(void), const char *desc)
 {
   owl_keybinding *kb, *curkb;
@@ -103,5 +103,5 @@
     char buff[100];
     owl_cmd *cmd;
-    char *tmpdesc, *desc = "";
+    const char *tmpdesc, *desc = "";
 
     kb = owl_list_get_element(&km->bindings, i);
@@ -149,5 +149,5 @@
 }
 
-owl_keymap *owl_keyhandler_create_and_add_keymap(owl_keyhandler *kh, char *name, char *desc, void (*default_fn)(owl_input), void (*prealways_fn)(owl_input), void (*postalways_fn)(owl_input))
+owl_keymap *owl_keyhandler_create_and_add_keymap(owl_keyhandler *kh, const char *name, const char *desc, void (*default_fn)(owl_input), void (*prealways_fn)(owl_input), void (*postalways_fn)(owl_input))
 {
   owl_keymap *km;
@@ -167,5 +167,5 @@
 }
 
-owl_keymap *owl_keyhandler_get_keymap(owl_keyhandler *kh, char *mapname)
+owl_keymap *owl_keyhandler_get_keymap(owl_keyhandler *kh, const char *mapname)
 {
   return owl_dict_find_element(&kh->keymaps, mapname);
@@ -187,5 +187,5 @@
 /* sets the active keymap, which will also reset any key state.
  * returns the new keymap, or NULL on failure. */
-owl_keymap *owl_keyhandler_activate(owl_keyhandler *kh, char *mapname)
+owl_keymap *owl_keyhandler_activate(owl_keyhandler *kh, const char *mapname)
 {
   owl_keymap *km;
Index: keypress.c
===================================================================
--- keypress.c	(revision 6551eaecc79df626b1b4f16944d1b477caa4db00)
+++ keypress.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -5,5 +5,5 @@
 static struct _owl_keypress_specialmap {
   int   kj;
-  char *ks;
+  const char *ks;
 } specialmap[] = {
 #ifdef KEY_CODE_YES
@@ -175,5 +175,5 @@
 
 /* returns ERR on failure, else a keycode */
-int owl_keypress_fromstring(char *kb)
+int owl_keypress_fromstring(const char *kb)
 {
   struct _owl_keypress_specialmap *sm;
Index: logging.c
===================================================================
--- logging.c	(revision 65b21736092356a35d24e53dc2e6b92e13174131)
+++ logging.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -105,5 +105,5 @@
 }
 
-void owl_log_append(owl_message *m, char *filename) {
+void owl_log_append(owl_message *m, const char *filename) {
     FILE *file;
     file=fopen(filename, "a");
@@ -171,5 +171,5 @@
 
 
-void owl_log_outgoing_zephyr_error(char *to, char *text)
+void owl_log_outgoing_zephyr_error(const char *to, const char *text)
 {
   FILE *file;
@@ -230,5 +230,5 @@
 {
   char filename[MAXPATHLEN], allfilename[MAXPATHLEN], *logpath;
-  char *from=NULL;
+  const char *from=NULL;
   char *frombuff=NULL;
   int len, ch, i, personal;
@@ -243,5 +243,5 @@
   } else if (owl_message_is_type_jabber(m)) {
     /* This needs to be fixed to handle groupchat */
-    char* msgtype = owl_message_get_attribute_value(m,"jtype");
+    const char* msgtype = owl_message_get_attribute_value(m,"jtype");
     if (msgtype && !strcmp(msgtype,"groupchat")) {
       personal = 0;
Index: message.c
===================================================================
--- message.c	(revision 65b21736092356a35d24e53dc2e6b92e13174131)
+++ message.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -55,5 +55,5 @@
  * name already exists, replace the old value with the new value
  */
-void owl_message_set_attribute(owl_message *m, char *attrname, const char *attrvalue)
+void owl_message_set_attribute(owl_message *m, const char *attrname, const char *attrvalue)
 {
   int i, j;
@@ -82,5 +82,5 @@
  * the attribute does not exist
  */
-char *owl_message_get_attribute_value(owl_message *m, char *attrname)
+const char *owl_message_get_attribute_value(owl_message *m, const char *attrname)
 {
   int i, j;
@@ -159,12 +159,12 @@
 }
 
-void owl_message_set_class(owl_message *m, char *class)
+void owl_message_set_class(owl_message *m, const char *class)
 {
   owl_message_set_attribute(m, "class", class);
 }
 
-char *owl_message_get_class(owl_message *m)
-{
-  char *class;
+const char *owl_message_get_class(owl_message *m)
+{
+  const char *class;
 
   class=owl_message_get_attribute_value(m, "class");
@@ -173,12 +173,12 @@
 }
 
-void owl_message_set_instance(owl_message *m, char *inst)
+void owl_message_set_instance(owl_message *m, const char *inst)
 {
   owl_message_set_attribute(m, "instance", inst);
 }
 
-char *owl_message_get_instance(owl_message *m)
-{
-  char *instance;
+const char *owl_message_get_instance(owl_message *m)
+{
+  const char *instance;
 
   instance=owl_message_get_attribute_value(m, "instance");
@@ -187,12 +187,12 @@
 }
 
-void owl_message_set_sender(owl_message *m, char *sender)
+void owl_message_set_sender(owl_message *m, const char *sender)
 {
   owl_message_set_attribute(m, "sender", sender);
 }
 
-char *owl_message_get_sender(owl_message *m)
-{
-  char *sender;
+const char *owl_message_get_sender(owl_message *m)
+{
+  const char *sender;
 
   sender=owl_message_get_attribute_value(m, "sender");
@@ -201,12 +201,12 @@
 }
 
-void owl_message_set_zsig(owl_message *m, char *zsig)
+void owl_message_set_zsig(owl_message *m, const char *zsig)
 {
   owl_message_set_attribute(m, "zsig", zsig);
 }
 
-char *owl_message_get_zsig(owl_message *m)
-{
-  char *zsig;
+const char *owl_message_get_zsig(owl_message *m)
+{
+  const char *zsig;
 
   zsig=owl_message_get_attribute_value(m, "zsig");
@@ -215,14 +215,14 @@
 }
 
-void owl_message_set_recipient(owl_message *m, char *recip)
+void owl_message_set_recipient(owl_message *m, const char *recip)
 {
   owl_message_set_attribute(m, "recipient", recip);
 }
 
-char *owl_message_get_recipient(owl_message *m)
+const char *owl_message_get_recipient(owl_message *m)
 {
   /* this is stupid for outgoing messages, we need to fix it. */
 
-  char *recip;
+  const char *recip;
 
   recip=owl_message_get_attribute_value(m, "recipient");
@@ -236,7 +236,7 @@
 }
 
-char *owl_message_get_realm(owl_message *m)
-{
-  char *realm;
+const char *owl_message_get_realm(owl_message *m)
+{
+  const char *realm;
   
   realm=owl_message_get_attribute_value(m, "realm");
@@ -245,12 +245,12 @@
 }
 
-void owl_message_set_body(owl_message *m, char *body)
+void owl_message_set_body(owl_message *m, const char *body)
 {
   owl_message_set_attribute(m, "body", body);
 }
 
-char *owl_message_get_body(owl_message *m)
-{
-  char *body;
+const char *owl_message_get_body(owl_message *m)
+{
+  const char *body;
 
   body=owl_message_get_attribute_value(m, "body");
@@ -260,12 +260,12 @@
 
 
-void owl_message_set_opcode(owl_message *m, char *opcode)
+void owl_message_set_opcode(owl_message *m, const char *opcode)
 {
   owl_message_set_attribute(m, "opcode", opcode);
 }
 
-char *owl_message_get_opcode(owl_message *m)
-{
-  char *opcode;
+const char *owl_message_get_opcode(owl_message *m)
+{
+  const char *opcode;
 
   opcode=owl_message_get_attribute_value(m, "opcode");
@@ -288,5 +288,5 @@
 int owl_message_is_loginout(owl_message *m)
 {
-  char *res;
+  const char *res;
 
   res=owl_message_get_attribute_value(m, "loginout");
@@ -297,5 +297,5 @@
 int owl_message_is_login(owl_message *m)
 {
-  char *res;
+  const char *res;
 
   res=owl_message_get_attribute_value(m, "loginout");
@@ -308,5 +308,5 @@
 int owl_message_is_logout(owl_message *m)
 {
-  char *res;
+  const char *res;
 
   res=owl_message_get_attribute_value(m, "loginout");
@@ -323,5 +323,5 @@
 int owl_message_is_private(owl_message *m)
 {
-  char *res;
+  const char *res;
 
   res=owl_message_get_attribute_value(m, "isprivate");
@@ -330,5 +330,5 @@
 }
 
-char *owl_message_get_timestr(owl_message *m)
+const char *owl_message_get_timestr(owl_message *m)
 {
   if (m->timestr) return(m->timestr);
@@ -356,11 +356,11 @@
 }
 
-void owl_message_set_type(owl_message *m, char* type)
+void owl_message_set_type(owl_message *m, const char* type)
 {
   owl_message_set_attribute(m, "type", type);
 }
 
-int owl_message_is_type(owl_message *m, char *type) {
-  char * t = owl_message_get_attribute_value(m, "type");
+int owl_message_is_type(owl_message *m, const char *type) {
+  const char * t = owl_message_get_attribute_value(m, "type");
   if(!t) return 0;
   return !strcasecmp(t, type);
@@ -399,5 +399,5 @@
 }
 
-char *owl_message_get_text(owl_message *m)
+const char *owl_message_get_text(owl_message *m)
 {
   owl_message_format(m);
@@ -462,12 +462,12 @@
 }
 
-char *owl_message_get_zwriteline(owl_message *m)
-{
-  char *z = owl_message_get_attribute_value(m, "zwriteline");
+const char *owl_message_get_zwriteline(owl_message *m)
+{
+  const char *z = owl_message_get_attribute_value(m, "zwriteline");
   if (!z) return "";
   return z;
 }
 
-void owl_message_set_zwriteline(owl_message *m, char *line)
+void owl_message_set_zwriteline(owl_message *m, const char *line)
 {
   owl_message_set_attribute(m, "zwriteline", line);
@@ -493,10 +493,10 @@
 #endif
 
-void owl_message_set_hostname(owl_message *m, char *hostname)
+void owl_message_set_hostname(owl_message *m, const char *hostname)
 {
   m->hostname=owl_global_intern(&g, hostname);
 }
 
-char *owl_message_get_hostname(owl_message *m)
+const char *owl_message_get_hostname(owl_message *m)
 {
   return(m->hostname);
@@ -542,5 +542,5 @@
 
 int owl_message_is_answered(owl_message *m) {
-  char *q;
+  const char *q;
   if(!owl_message_is_question(m)) return 0;
   q = owl_message_get_attribute_value(m, "question");
@@ -568,5 +568,5 @@
 char *owl_message_get_cc(owl_message *m)
 {
-  char *cur;
+  const char *cur;
   char *out, *end;
 
@@ -586,5 +586,5 @@
 {
   char *cc, *out, *end, *shortuser, *recip;
-  char *user;
+  const char *user;
 
   cc = owl_message_get_cc(m);
@@ -625,6 +625,6 @@
 }
 
-char *owl_message_get_type(owl_message *m) {
-  char * type = owl_message_get_attribute_value(m, "type");
+const char *owl_message_get_type(owl_message *m) {
+  const char * type = owl_message_get_attribute_value(m, "type");
   if(!type) {
     return "generic";
@@ -633,5 +633,5 @@
 }
 
-char *owl_message_get_direction(owl_message *m) {
+const char *owl_message_get_direction(owl_message *m) {
   switch (m->direction) {
   case OWL_MESSAGE_DIRECTION_IN:
@@ -646,5 +646,5 @@
 }
 
-int owl_message_parse_direction(char *d) {
+int owl_message_parse_direction(const char *d) {
   if(!strcmp(d, "in")) {
     return OWL_MESSAGE_DIRECTION_IN;
@@ -657,5 +657,5 @@
 
 
-char *owl_message_get_login(owl_message *m) {
+const char *owl_message_get_login(owl_message *m) {
   if (owl_message_is_login(m)) {
     return "login";
@@ -668,5 +668,5 @@
 
 
-char *owl_message_get_header(owl_message *m) {
+const char *owl_message_get_header(owl_message *m) {
   return owl_message_get_attribute_value(m, "adminheader");
 }
@@ -688,5 +688,5 @@
  *                 1 it's a login message
  */
-void owl_message_create_aim(owl_message *m, char *sender, char *recipient, char *text, int direction, int loginout)
+void owl_message_create_aim(owl_message *m, const char *sender, const char *recipient, const char *text, int direction, int loginout)
 {
   owl_message_init(m);
@@ -714,5 +714,5 @@
 }
 
-void owl_message_create_admin(owl_message *m, char *header, char *text)
+void owl_message_create_admin(owl_message *m, const char *header, const char *text)
 {
   owl_message_init(m);
@@ -723,5 +723,5 @@
 
 /* caller should set the direction */
-void owl_message_create_loopback(owl_message *m, char *text)
+void owl_message_create_loopback(owl_message *m, const char *text)
 {
   owl_message_init(m);
@@ -737,5 +737,5 @@
 {
   struct hostent *hent;
-  char *ptr;
+  const char *ptr;
   char *tmp, *tmp2;
   int len;
@@ -852,8 +852,8 @@
 
 /* If 'direction' is '0' it is a login message, '1' is a logout message. */
-void owl_message_create_pseudo_zlogin(owl_message *m, int direction, char *user, char *host, char *time, char *tty)
+void owl_message_create_pseudo_zlogin(owl_message *m, int direction, const char *user, const char *host, const char *time, const char *tty)
 {
   char *longuser;
-  char *ptr;
+  const char *ptr;
 
 #ifdef HAVE_LIBZEPHYR
@@ -898,5 +898,5 @@
 }
 
-void owl_message_create_from_zwriteline(owl_message *m, char *line, char *body, char *zsig)
+void owl_message_create_from_zwriteline(owl_message *m, const char *line, const char *body, const char *zsig)
 {
   owl_zwrite z;
Index: obarray.c
===================================================================
--- obarray.c	(revision fa4562c3dde208105e6938363d047e5622012e67)
+++ obarray.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -14,8 +14,8 @@
  * the index it should be inserted at.
  */
-int owl_obarray_lookup(owl_obarray *oa, char * key, char ** val) /*noproto*/
+int owl_obarray_lookup(owl_obarray *oa, const char * key, const char ** val) /*noproto*/
 {
   int first, last, mid;
-  char * str;
+  const char * str;
   int cmp;
 
@@ -41,7 +41,7 @@
 
 /* Returns NULL if the string doesn't exist in the obarray */
-char * owl_obarray_find(owl_obarray *oa, char * string)
+const char * owl_obarray_find(owl_obarray *oa, const char * string)
 {
-  char *v;
+  const char *v;
   owl_obarray_lookup(oa, string, &v);
   return v;
@@ -49,7 +49,7 @@
 
 /* Inserts the string into the obarray if it doesn't exist */
-char * owl_obarray_insert(owl_obarray *oa, char * string)
+const char * owl_obarray_insert(owl_obarray *oa, const char * string)
 {
-  char *v;
+  const char *v;
   int i;
   i = owl_obarray_lookup(oa, string, &v);
@@ -77,5 +77,5 @@
 int owl_obarray_regtest(void) {
   int numfailed = 0;
-  char *p,*p2;
+  const char *p,*p2;
 
   owl_obarray oa;
Index: owl.c
===================================================================
--- owl.c	(revision 65b21736092356a35d24e53dc2e6b92e13174131)
+++ owl.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -44,12 +44,12 @@
   int newmsgs, nexttimediff;
   struct sigaction sigact;
-  char *configfile, *tty, **argvsave;
+  const char *configfile, *tty, *const *argvsave;
   char *perlout, *perlerr;
-  char *confdir;
+  const char *confdir;
   owl_filter *f;
   owl_style *s;
   time_t nexttime, now;
   struct tm *today;
-  char *dir;
+  const char *dir;
   struct termios tio;
   owl_message *m;
Index: owl.h
===================================================================
--- owl.h	(revision c529ac8bb1d8b29ebbfc9c8c4d856b1a5fa687a8)
+++ owl.h	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -202,9 +202,9 @@
 #endif
 
-/* Convert char ** into char **.  This conversion is safe,
+/* Convert char *const * into const char *const *.  This conversion is safe,
  * and implicit in C++ (conv.qual 4) but for some reason not in C. */
-static inline char **strs(char **pstr)
+static inline const char *const *strs(char *const *pstr)
 {
-  return (char **)pstr;
+  return (const char *const *)pstr;
 }
 
@@ -218,7 +218,7 @@
   char *description;		/* detailed description */
   void *val;                    /* current value */
-  int  (*validate_fn)(struct _owl_variable *v, void *newval);
+  int  (*validate_fn)(struct _owl_variable *v, const void *newval);
                                 /* returns 1 if newval is valid */
-  int  (*set_fn)(struct _owl_variable *v, void *newval); 
+  int  (*set_fn)(struct _owl_variable *v, const void *newval); 
                                 /* sets the variable to a value
 				 * of the appropriate type.
@@ -226,5 +226,5 @@
 				 * should make a copy. 
 				 * returns 0 on success. */
-  int  (*set_fromstring_fn)(struct _owl_variable *v, char *newval);
+  int  (*set_fromstring_fn)(struct _owl_variable *v, const char *newval);
                                 /* sets the variable to a value
 				 * of the appropriate type.
@@ -232,10 +232,10 @@
 				 * should make a copy. 
 				 * returns 0 on success. */
-  void *(*get_fn)(struct _owl_variable *v);
+  const void *(*get_fn)(struct _owl_variable *v);
 				/* returns a reference to the current value.
 				 * WARNING:  this approach is hard to make
 				 * thread-safe... */
   int  (*get_tostring_fn)(struct _owl_variable *v, 
-			  char *buf, int bufsize, void *val); 
+			  char *buf, int bufsize, const void *val); 
                                 /* converts val to a string 
 				 * and puts into buf */
@@ -299,5 +299,5 @@
   
   /* These don't take any context */
-  char *(*cmd_args_fn)(int argc, char **argv, char *buff);  
+  char *(*cmd_args_fn)(int argc, const char *const *argv, const char *buff);  
 				/* takes argv and the full command as buff.
 				 * caller must free return value if !NULL */
@@ -306,5 +306,5 @@
 
   /* The following also take the active context if it's valid */
-  char *(*cmd_ctxargs_fn)(void *ctx, int argc, char **argv, char *buff);  
+  char *(*cmd_ctxargs_fn)(void *ctx, int argc, const char *const *argv, const char *buff);  
 				/* takes argv and the full command as buff.
 				 * caller must free return value if !NULL */
@@ -328,5 +328,5 @@
 
 typedef struct _owl_pair {
-  char *key;
+  const char *key;
   char *value;
 } owl_pair;
@@ -342,5 +342,5 @@
   struct _owl_fmtext_cache * fmtext;
   int delete;
-  char *hostname;
+  const char *hostname;
   owl_list attributes;            /* this is a list of pairs */
   char *timestr;
Index: pair.c
===================================================================
--- pair.c	(revision de1c8a59c19d33ab73607ff6539f55d51088ec6b)
+++ pair.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -1,10 +1,10 @@
 #include "owl.h"
 
-void owl_pair_create(owl_pair *p, char *key, char *value) {
+void owl_pair_create(owl_pair *p, const char *key, char *value) {
   p->key=key;
   p->value=value;
 }
 
-void owl_pair_set_key(owl_pair *p, char *key) {
+void owl_pair_set_key(owl_pair *p, const char *key) {
   p->key=key;
 }
@@ -14,5 +14,5 @@
 }
 
-char *owl_pair_get_key(owl_pair *p) {
+const char *owl_pair_get_key(owl_pair *p) {
   return(p->key);
 }
Index: perlconfig.c
===================================================================
--- perlconfig.c	(revision fa4562c3dde208105e6938363d047e5622012e67)
+++ perlconfig.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -14,5 +14,5 @@
 static void owl_perl_xs_init(pTHX)
 {
-  char *file = __FILE__;
+  const char *file = __FILE__;
   dXSUB_SYS;
   {
@@ -26,5 +26,5 @@
   HV *h, *stash;
   SV *hr;
-  char *type;
+  const char *type;
   char *ptr, *utype, *blessas;
   int i, j;
@@ -135,5 +135,5 @@
   HE * ent;
   I32 count, len;
-  char *key,*val;
+  const char *key,*val;
   HV * hash;
   struct tm tm;
@@ -197,5 +197,5 @@
 /* Calls in a scalar context, passing it a hash reference.
    If return value is non-null, caller must free. */
-char *owl_perlconfig_call_with_message(char *subname, owl_message *m)
+char *owl_perlconfig_call_with_message(const char *subname, owl_message *m)
 {
   dSP ;
@@ -246,5 +246,5 @@
    If the return value is non-null, the caller must free it.
  */
-char * owl_perlconfig_message_call_method(owl_message *m, char *method, int argc, char ** argv)
+char * owl_perlconfig_message_call_method(owl_message *m, const char *method, int argc, const char ** argv)
 {
   dSP;
@@ -296,10 +296,10 @@
 
 
-char *owl_perlconfig_initperl(char * file, int *Pargc, char ***Pargv, char *** Penv)
+char *owl_perlconfig_initperl(const char * file, int *Pargc, char ***Pargv, char *** Penv)
 {
   int ret;
   PerlInterpreter *p;
   char *err;
-  char *args[4] = {"", "-e", "0;", NULL};
+  const char *args[4] = {"", "-e", "0;", NULL};
   AV *inc;
   char *path;
@@ -372,5 +372,5 @@
 
 /* returns whether or not a function exists */
-int owl_perlconfig_is_function(char *fn) {
+int owl_perlconfig_is_function(const char *fn) {
   if (get_cv(fn, FALSE)) return(1);
   else return(0);
@@ -378,9 +378,9 @@
 
 /* caller is responsible for freeing returned string */
-char *owl_perlconfig_execute(char *line)
+char *owl_perlconfig_execute(const char *line)
 {
   STRLEN len;
   SV *response;
-  char *preout;
+  const char *preout;
   char *out;
 
@@ -408,5 +408,5 @@
 }
 
-void owl_perlconfig_getmsg(owl_message *m, char *subname)
+void owl_perlconfig_getmsg(owl_message *m, const char *subname)
 {
   char *ptr = NULL;
@@ -419,5 +419,5 @@
 
 /* Called on all new messages; receivemsg is only called on incoming ones */
-void owl_perlconfig_newmsg(owl_message *m, char *subname)
+void owl_perlconfig_newmsg(owl_message *m, const char *subname)
 {
   char *ptr = NULL;
@@ -429,5 +429,5 @@
 }
 
-void owl_perlconfig_new_command(char *name)
+void owl_perlconfig_new_command(const char *name)
 {
   dSP;
@@ -452,5 +452,5 @@
 }
 
-char *owl_perlconfig_perlcmd(owl_cmd *cmd, int argc, char **argv)
+char *owl_perlconfig_perlcmd(owl_cmd *cmd, int argc, const char *const *argv)
 {
   int i, count;
Index: perlglue.xs
===================================================================
--- perlglue.xs	(revision 3ff3d860fb7ff24e9de46e161c8260f764bc762c)
+++ perlglue.xs	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -32,8 +32,8 @@
 char *
 command(cmd, ...)
-	char *cmd
+	const char *cmd
 	PREINIT:
 		char *rv = NULL;
-		char **argv;
+		const char **argv;
 		int i;
 	CODE:
@@ -85,5 +85,5 @@
 		RETVAL
 
-char *
+const char *
 zephyr_getsender()
 	CODE:
@@ -94,6 +94,6 @@
 void
 zephyr_zwrite(cmd,msg)
-	char *cmd
-	char *msg
+	const char *cmd
+	const char *msg
 	PREINIT:
 		int i;
@@ -103,5 +103,5 @@
 char *
 ztext_stylestrip(ztext)
-	char *ztext
+	const char *ztext
 	PREINIT:
 		char *rv = NULL;
@@ -116,5 +116,5 @@
 char *
 zephyr_smartstrip_user(in)
-	char *in
+	const char *in
 	PREINIT:
 		char *rv = NULL;
@@ -157,6 +157,6 @@
 
 void admin_message(header, body) 
-	char *header
-	char *body
+	const char *header
+	const char *body
 	CODE:
 	{
@@ -165,5 +165,5 @@
 
 void start_question(line, callback)
-	char *line
+	const char *line
 	SV *callback
 	PREINIT:
@@ -181,5 +181,5 @@
 
 void start_password(line, callback)
-	char *line
+	const char *line
 	SV *callback
 	PREINIT:
@@ -197,5 +197,5 @@
 
 void start_edit_win(line, callback)
-	char *line
+	const char *line
 	SV *callback
 	PREINIT:
@@ -223,5 +223,5 @@
 
 
-char * 
+const char * 
 get_data_dir ()
 	CODE:
@@ -230,5 +230,5 @@
 	RETVAL
 
-char * 
+const char * 
 get_config_dir ()
 	CODE:
@@ -239,5 +239,5 @@
 void
 popless_text(text) 
-	char *text
+	const char *text
 	CODE:
 	{
@@ -247,5 +247,5 @@
 void
 popless_ztext(text) 
-	char *text
+	const char *text
 	CODE:
 	{
@@ -259,5 +259,5 @@
 void
 error(text) 
-	char *text
+	const char *text
 	CODE:
 	{
@@ -267,5 +267,5 @@
 void
 debug(text)
-	char *text
+	const char *text
 	CODE:
 	{
@@ -275,5 +275,5 @@
 void
 message(text)
-	char *text
+	const char *text
 	CODE:
 	{
@@ -283,5 +283,5 @@
 void
 create_style(name, object)
-     char *name
+     const char *name
      SV  *object
      PREINIT:
@@ -303,5 +303,5 @@
 void
 _remove_filter(filterName)
-	char *filterName
+	const char *filterName
 	CODE:
 	{
@@ -315,5 +315,5 @@
 char *
 wordwrap(in, cols)
-	char *in
+	const char *in
 	int cols
 	PREINIT:
@@ -368,5 +368,5 @@
 		AV *styles;
 		owl_list l;
-		char *name;
+		const char *name;
 		int i;
 	CODE:
@@ -393,5 +393,5 @@
 		AV *vars;
 		owl_list l;
-		char *name;
+		const char *name;
 		int i;
 	CODE:
@@ -448,8 +448,8 @@
 void
 new_variable_string(name, ival, summ, desc)
-	char * name
-	char * ival
-	char * summ
-	char * desc
+	const char * name
+	const char * ival
+	const char * summ
+	const char * desc
 	CODE:
 	owl_variable_dict_newvar_string(owl_global_get_vardict(&g),
@@ -461,8 +461,8 @@
 void
 new_variable_int(name, ival, summ, desc)
-	char * name
+	const char * name
 	int ival
-	char * summ
-	char * desc
+	const char * summ
+	const char * desc
 	CODE:
 	owl_variable_dict_newvar_int(owl_global_get_vardict(&g),
@@ -474,8 +474,8 @@
 void
 new_variable_bool(name, ival, summ, desc)
-	char * name
+	const char * name
 	int ival
-	char * summ
-	char * desc
+	const char * summ
+	const char * desc
 	CODE:
 	owl_variable_dict_newvar_bool(owl_global_get_vardict(&g),
@@ -520,5 +520,5 @@
 replace(count, string)
 	int count;
-	char *string;
+	const char *string;
 	CODE:
 		RETVAL = owl_editwin_replace(owl_global_get_typwin(&g), count, string);
@@ -536,5 +536,5 @@
 int
 replace_region(string)
-	char *string;
+	const char *string;
 	CODE:
 		RETVAL = owl_editwin_replace_region(owl_global_get_typwin(&g), string);
Index: popexec.c
===================================================================
--- popexec.c	(revision 7565f8f631fb7f476cf9f985819955cb23a1b721)
+++ popexec.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -9,5 +9,5 @@
 
 /* starts up popexec in a new viewwin */
-owl_popexec *owl_popexec_new(char *command)
+owl_popexec *owl_popexec_new(const char *command)
 {
   owl_popexec *pe;
Index: regex.c
===================================================================
--- regex.c	(revision 41c9a9675faf455c3c6adfbc629faf55ddbfe10f)
+++ regex.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -8,9 +8,9 @@
 }
 
-int owl_regex_create(owl_regex *re, char *string)
+int owl_regex_create(owl_regex *re, const char *string)
 {
   int ret;
   char buff1[LINE];
-  char *ptr;
+  const char *ptr;
   
   re->string=owl_strdup(string);
@@ -36,5 +36,5 @@
 }
 
-int owl_regex_create_quoted(owl_regex *re, char *string)
+int owl_regex_create_quoted(owl_regex *re, const char *string)
 {
   char *quoted;
@@ -46,5 +46,5 @@
 }
 
-int owl_regex_compare(owl_regex *re, char *string, int *start, int *end)
+int owl_regex_compare(owl_regex *re, const char *string, int *start, int *end)
 {
   int out, ret;
@@ -74,5 +74,5 @@
 }
 
-char *owl_regex_get_string(owl_regex *re)
+const char *owl_regex_get_string(owl_regex *re)
 {
   return(re->string);
Index: stubgen.pl
===================================================================
--- stubgen.pl	(revision 1aee7d914de75510e7cf09c452bad63b2dad2166)
+++ stubgen.pl	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -28,7 +28,7 @@
 	print "  return owl_variable_get_bool(&g->vars, \"$varname\");\n}\n";
     } elsif ($vartype =~ /^PATH/ or $vartype =~ /^STRING/) {
-	print "void owl_global_set_$altvarname(owl_global *g, char *text) {\n";
+	print "void owl_global_set_$altvarname(owl_global *g, const char *text) {\n";
 	print "  owl_variable_set_string(&g->vars, \"$varname\", text);\n}\n";
-	print "char *owl_global_get_$altvarname(owl_global *g) {\n";
+	print "const char *owl_global_get_$altvarname(owl_global *g) {\n";
 	print "  return owl_variable_get_string(&g->vars, \"$varname\");\n}\n";
     } elsif ($vartype =~ /^INT/ or $vartype =~ /^ENUM/) {
Index: style.c
===================================================================
--- style.c	(revision 65b21736092356a35d24e53dc2e6b92e13174131)
+++ style.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -2,5 +2,5 @@
 #include "owl.h"
 
-void owl_style_create_perl(owl_style *s, char *name, SV *obj)
+void owl_style_create_perl(owl_style *s, const char *name, SV *obj)
 {
   s->name=owl_strdup(name);
@@ -8,5 +8,5 @@
 }
 
-int owl_style_matches_name(owl_style *s, char *name)
+int owl_style_matches_name(owl_style *s, const char *name)
 {
   if (!strcmp(s->name, name)) return(1);
@@ -14,10 +14,10 @@
 }
 
-char *owl_style_get_name(owl_style *s)
+const char *owl_style_get_name(owl_style *s)
 {
   return(s->name);
 }
 
-char *owl_style_get_description(owl_style *s)
+const char *owl_style_get_description(owl_style *s)
 {
   SV *sv = NULL;
@@ -41,5 +41,5 @@
 void owl_style_get_formattext(owl_style *s, owl_fmtext *fm, owl_message *m)
 {
-  char *body;
+  const char *body;
   char *indent;
   int curlen;
Index: text.c
===================================================================
--- text.c	(revision 65b21736092356a35d24e53dc2e6b92e13174131)
+++ text.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -5,7 +5,7 @@
 #include "owl.h"
 
-void owl_text_indent(char *out, char *in, int n)
-{
-  char *ptr1, *ptr2, *last;
+void owl_text_indent(char *out, const char *in, int n)
+{
+  const char *ptr1, *ptr2, *last;
   int i;
 
@@ -29,5 +29,5 @@
 }
 
-int owl_text_num_lines(char *in)
+int owl_text_num_lines(const char *in)
 {
   int lines, i;
@@ -46,7 +46,7 @@
 
 /* caller must free the return */
-char *owl_text_htmlstrip(char *in)
-{
-  char *ptr1, *end, *ptr2, *ptr3;
+char *owl_text_htmlstrip(const char *in)
+{
+  const char *ptr1, *end, *ptr2, *ptr3;
   char *out, *out2;
 
@@ -129,8 +129,8 @@
 
 /* Caller must free return */
-char *owl_text_expand_tabs(char *in)
+char *owl_text_expand_tabs(const char *in)
 {
   int ntabs = 0;
-  char *p = in;
+  const char *p = in;
   char *ret, *out;
   int col;
@@ -166,5 +166,5 @@
 
 /* caller must free the return */
-char *owl_text_wordwrap(char *in, int col)
+char *owl_text_wordwrap(const char *in, int col)
 {
   char *out;
@@ -227,8 +227,8 @@
 
 /* return 1 if a string is only whitespace, otherwise 0 */
-int only_whitespace(char *s)
+int only_whitespace(const char *s)
 {
   if (g_utf8_validate(s,-1,NULL)) {
-    char *p;
+    const char *p;
     for(p = s; p[0]; p=g_utf8_next_char(p)) {
       if (!g_unichar_isspace(g_utf8_get_char(p))) return 0;
@@ -244,5 +244,5 @@
 }
 
-char *owl_getquoting(char *line)
+const char *owl_getquoting(const char *line)
 {
   if (line[0]=='\0') return("'");
@@ -257,5 +257,5 @@
  * Caller must free returned string.
  */
-char *owl_text_substitute(char *in, char *from, char *to)
+char *owl_text_substitute(const char *in, const char *from, const char *to)
 {
   
@@ -307,5 +307,5 @@
  * On success returns the string, on error returns NULL.
  */
-char *owl_text_quote(char *in, char *toquote, char *quotestr)
+char *owl_text_quote(const char *in, const char *toquote, const char *quotestr)
 {
   int i, x, r, place, escape;
Index: util.c
===================================================================
--- util.c	(revision fa4562c3dde208105e6938363d047e5622012e67)
+++ util.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -6,5 +6,5 @@
 #include <pwd.h>
 
-void sepbar(char *in)
+void sepbar(const char *in)
 {
   char buff[1024];
@@ -13,5 +13,5 @@
   owl_view *v;
   int x, y, i;
-  char *foo, *appendtosepbar;
+  const char *foo, *appendtosepbar;
 
   sepwin=owl_global_get_curs_sepwin(&g);
@@ -125,5 +125,5 @@
 }
 
-char **atokenize(char *buffer, char *sep, int *i)
+char **atokenize(const char *buffer, const char *sep, int *i)
 {
   /* each element of return must be freed by user */
@@ -157,5 +157,5 @@
 }
 
-char *skiptokens(char *buff, int n) {
+const char *skiptokens(const char *buff, int n) {
   /* skips n tokens and returns where that would be.
    * TODO: handle quotes more sanely. */
@@ -177,5 +177,5 @@
  * duplicate slashes are removed.  Caller must free the return.
  */
-char *owl_util_makepath(char *in)
+char *owl_util_makepath(const char *in)
 {
   int i, j, x;
@@ -262,5 +262,5 @@
 }
 
-char **owl_parseline(char *line, int *argc)
+char **owl_parseline(const char *line, int *argc)
 {
   /* break a command line up into argv, argc.  The caller must free
@@ -409,5 +409,5 @@
  * if the named color is not available
  */
-int owl_util_string_to_color(char *color)
+int owl_util_string_to_color(const char *color)
 {
   int c;
@@ -439,5 +439,5 @@
 
 /* Return a string name of the given owl color */
-char *owl_util_color_to_string(int color)
+const char *owl_util_color_to_string(int color)
 {
   if (color==OWL_COLOR_BLACK)   return("black");
@@ -456,5 +456,5 @@
 char *owl_util_get_default_tty()
 {
-  char *tmp;
+  const char *tmp;
   char *out;
 
@@ -480,5 +480,5 @@
   owl_message *m;
   owl_fmtext *fm;
-  char *text, *ptr;
+  const char *text, *ptr;
   int place;
 
@@ -532,5 +532,5 @@
  * return.
  */
-char *owl_util_stripnewlines(char *in)
+char *owl_util_stripnewlines(const char *in)
 {
   
@@ -558,5 +558,5 @@
  * memory.
  */
-void owl_util_file_deleteline(char *filename, char *line, int backup)
+void owl_util_file_deleteline(const char *filename, const char *line, int backup)
 {
   char buff[LINE], *text;
@@ -646,5 +646,5 @@
    The caller is responsible for freeing the allocated string.
 */
-char * owl_util_baseclass(char * class)
+char * owl_util_baseclass(const char * class)
 {
   char *start, *end;
@@ -664,7 +664,7 @@
 }
 
-char * owl_get_datadir()
-{
-  char * datadir = getenv("BARNOWL_DATA_DIR");
+const char * owl_get_datadir()
+{
+  const char * datadir = getenv("BARNOWL_DATA_DIR");
   if(datadir != NULL)
     return datadir;
Index: variable.c
===================================================================
--- variable.c	(revision fa4562c3dde208105e6938363d047e5622012e67)
+++ variable.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -375,5 +375,5 @@
 /* commonly useful */
 
-int owl_variable_int_validate_gt0(owl_variable *v, void *newval)
+int owl_variable_int_validate_gt0(owl_variable *v, const void *newval)
 {
   if (newval == NULL) return(0);
@@ -382,5 +382,5 @@
 }
 
-int owl_variable_int_validate_positive(owl_variable *v, void *newval)
+int owl_variable_int_validate_positive(owl_variable *v, const void *newval)
 {
   if (newval == NULL) return(0);
@@ -390,5 +390,5 @@
 
 /* typewinsize */
-int owl_variable_typewinsize_set(owl_variable *v, void *newval)
+int owl_variable_typewinsize_set(owl_variable *v, const void *newval)
 {
   int rv;
@@ -399,5 +399,5 @@
 
 /* debug (cache value in g->debug) */
-int owl_variable_debug_set(owl_variable *v, void *newval)
+int owl_variable_debug_set(owl_variable *v, const void *newval)
 {
   if (newval && (*(const int*)newval == 1 || *(const int*)newval == 0)) {
@@ -408,5 +408,5 @@
 
 /* When 'aaway' is changed, need to notify the AIM server */
-int owl_variable_aaway_set(owl_variable *v, void *newval)
+int owl_variable_aaway_set(owl_variable *v, const void *newval)
 {
   if (newval) {
@@ -420,5 +420,5 @@
 }
 
-int owl_variable_pseudologins_set(owl_variable *v, void *newval)
+int owl_variable_pseudologins_set(owl_variable *v, const void *newval)
 {
   if (newval) {
@@ -432,5 +432,5 @@
 /* note that changing the value of this will clobber 
  * any user setting of this */
-int owl_variable_disable_ctrl_d_set(owl_variable *v, void *newval)
+int owl_variable_disable_ctrl_d_set(owl_variable *v, const void *newval)
 {
 
@@ -449,5 +449,5 @@
 }
 
-int owl_variable_tty_set(owl_variable *v, void *newval)
+int owl_variable_tty_set(owl_variable *v, const void *newval)
 {
   owl_zephyr_set_locationinfo(owl_global_get_hostname(&g), newval);
@@ -531,5 +531,5 @@
 }
 
-owl_variable * owl_variable_newvar(char *name, char *summary, char * description) {
+owl_variable * owl_variable_newvar(const char *name, const char *summary, const char * description) {
   owl_variable * var = owl_malloc(sizeof(owl_variable));
   memset(var, 0, sizeof(owl_variable));
@@ -540,5 +540,5 @@
 }
 
-void owl_variable_update(owl_variable *var, char *summary, char *desc) {
+void owl_variable_update(owl_variable *var, const char *summary, const char *desc) {
   if(var->summary) owl_free(var->summary);
   var->summary = owl_strdup(summary);
@@ -547,5 +547,5 @@
 }
 
-void owl_variable_dict_newvar_string(owl_vardict * vd, char *name, char *summ, char * desc, char * initval) {
+void owl_variable_dict_newvar_string(owl_vardict * vd, const char *name, const char *summ, const char * desc, const char * initval) {
   owl_variable *old = owl_variable_get_var(vd, name, OWL_VARIABLE_STRING);
   if(old) {
@@ -567,5 +567,5 @@
 }
 
-void owl_variable_dict_newvar_int(owl_vardict * vd, char *name, char *summ, char * desc, int initval) {
+void owl_variable_dict_newvar_int(owl_vardict * vd, const char *name, const char *summ, const char * desc, int initval) {
   owl_variable *old = owl_variable_get_var(vd, name, OWL_VARIABLE_INT);
   if(old) {
@@ -588,5 +588,5 @@
 }
 
-void owl_variable_dict_newvar_bool(owl_vardict * vd, char *name, char *summ, char * desc, int initval) {
+void owl_variable_dict_newvar_bool(owl_vardict * vd, const char *name, const char *summ, const char * desc, int initval) {
   owl_variable *old = owl_variable_get_var(vd, name, OWL_VARIABLE_BOOL);
   if(old) {
@@ -628,13 +628,13 @@
 
 
-char *owl_variable_get_description(owl_variable *v) {
+const char *owl_variable_get_description(owl_variable *v) {
   return v->description;
 }
 
-char *owl_variable_get_summary(owl_variable *v) {
+const char *owl_variable_get_summary(owl_variable *v) {
   return v->summary;
 }
 
-char *owl_variable_get_validsettings(owl_variable *v) {
+const char *owl_variable_get_validsettings(owl_variable *v) {
   if (v->validsettings) {
     return v->validsettings;
@@ -647,5 +647,5 @@
 
 /* returns 0 on success, prints a status msg if msg is true */
-int owl_variable_set_fromstring(owl_vardict *d, char *name, char *value, int msg, int requirebool) {
+int owl_variable_set_fromstring(owl_vardict *d, const char *name, const char *value, int msg, int requirebool) {
   owl_variable *v;
   char buff2[1024];
@@ -676,5 +676,5 @@
 }
  
-int owl_variable_set_string(owl_vardict *d, char *name, char *newval) {
+int owl_variable_set_string(owl_vardict *d, const char *name, const char *newval) {
   owl_variable *v;
   if (!name) return(-1);
@@ -685,5 +685,5 @@
 }
  
-int owl_variable_set_int(owl_vardict *d, char *name, int newval) {
+int owl_variable_set_int(owl_vardict *d, const char *name, int newval) {
   owl_variable *v;
   if (!name) return(-1);
@@ -694,13 +694,13 @@
 }
  
-int owl_variable_set_bool_on(owl_vardict *d, char *name) {
+int owl_variable_set_bool_on(owl_vardict *d, const char *name) {
   return owl_variable_set_int(d,name,1);
 }
 
-int owl_variable_set_bool_off(owl_vardict *d, char *name) {
+int owl_variable_set_bool_off(owl_vardict *d, const char *name) {
   return owl_variable_set_int(d,name,0);
 }
 
-int owl_variable_get_tostring(owl_vardict *d, char *name, char *buf, int bufsize) {
+int owl_variable_get_tostring(owl_vardict *d, const char *name, char *buf, int bufsize) {
   owl_variable *v;
   if (!name) return(-1);
@@ -710,5 +710,5 @@
 }
 
-int owl_variable_get_default_tostring(owl_vardict *d, char *name, char *buf, int bufsize) {
+int owl_variable_get_default_tostring(owl_vardict *d, const char *name, char *buf, int bufsize) {
   owl_variable *v;
   if (!name) return(-1);
@@ -722,5 +722,5 @@
 }
 
-owl_variable *owl_variable_get_var(owl_vardict *d, char *name, int require_type) {
+owl_variable *owl_variable_get_var(owl_vardict *d, const char *name, int require_type) {
   owl_variable *v;
   if (!name) return(NULL);
@@ -731,5 +731,5 @@
 
 /* returns a reference */
-void *owl_variable_get(owl_vardict *d, char *name, int require_type) {
+const void *owl_variable_get(owl_vardict *d, const char *name, int require_type) {
   owl_variable *v = owl_variable_get_var(d, name, require_type);
   if(v == NULL) return NULL;
@@ -738,14 +738,14 @@
 
 /* returns a reference */
-char *owl_variable_get_string(owl_vardict *d, char *name) {
+const char *owl_variable_get_string(owl_vardict *d, const char *name) {
   return owl_variable_get(d,name, OWL_VARIABLE_STRING);
 }
 
 /* returns a reference */
-void *owl_variable_get_other(owl_vardict *d, char *name) {
+const void *owl_variable_get_other(owl_vardict *d, const char *name) {
   return owl_variable_get(d,name, OWL_VARIABLE_OTHER);
 }
 
-int owl_variable_get_int(owl_vardict *d, char *name) {
+int owl_variable_get_int(owl_vardict *d, const char *name) {
   const int *pi;
   pi = owl_variable_get(d,name,OWL_VARIABLE_INT);
@@ -754,5 +754,5 @@
 }
 
-int owl_variable_get_bool(owl_vardict *d, char *name) {
+int owl_variable_get_bool(owl_vardict *d, const char *name) {
   const int *pi;
   pi = owl_variable_get(d,name,OWL_VARIABLE_BOOL);
@@ -761,5 +761,5 @@
 }
 
-void owl_variable_describe(owl_vardict *d, char *name, owl_fmtext *fm) {
+void owl_variable_describe(owl_vardict *d, const char *name, owl_fmtext *fm) {
   char defaultbuf[50];
   char buf[1024];
@@ -785,5 +785,5 @@
 }
 
-void owl_variable_get_help(owl_vardict *d, char *name, owl_fmtext *fm) {
+void owl_variable_get_help(owl_vardict *d, const char *name, owl_fmtext *fm) {
   char buff[1024];
   int bufflen = 1023;
@@ -839,5 +839,5 @@
 /* default common functions */
 
-void *owl_variable_get_default(owl_variable *v) {
+const void *owl_variable_get_default(owl_variable *v) {
   return v->val;
 }
@@ -849,5 +849,5 @@
 /* default functions for booleans */
 
-int owl_variable_bool_validate_default(owl_variable *v, void *newval) {
+int owl_variable_bool_validate_default(owl_variable *v, const void *newval) {
   if (newval == NULL) return(0);
   else if (*(const int*)newval==1 || *(const int*)newval==0) return(1);
@@ -855,5 +855,5 @@
 }
 
-int owl_variable_bool_set_default(owl_variable *v, void *newval) {
+int owl_variable_bool_set_default(owl_variable *v, const void *newval) {
   if (v->validate_fn) {
     if (!v->validate_fn(v, newval)) return(-1);
@@ -863,5 +863,5 @@
 }
 
-int owl_variable_bool_set_fromstring_default(owl_variable *v, char *newval) {
+int owl_variable_bool_set_fromstring_default(owl_variable *v, const char *newval) {
   int i;
   if (!strcmp(newval, "on")) i=1;
@@ -871,5 +871,5 @@
 }
 
-int owl_variable_bool_get_tostring_default(owl_variable *v, char* buf, int bufsize, void *val) {
+int owl_variable_bool_get_tostring_default(owl_variable *v, char* buf, int bufsize, const void *val) {
   if (val == NULL) {
     snprintf(buf, bufsize, "<null>");
@@ -889,10 +889,10 @@
 /* default functions for integers */
 
-int owl_variable_int_validate_default(owl_variable *v, void *newval) {
+int owl_variable_int_validate_default(owl_variable *v, const void *newval) {
   if (newval == NULL) return(0);
   else return (1);
 }
 
-int owl_variable_int_set_default(owl_variable *v, void *newval) {
+int owl_variable_int_set_default(owl_variable *v, const void *newval) {
   if (v->validate_fn) {
     if (!v->validate_fn(v, newval)) return(-1);
@@ -902,7 +902,7 @@
 }
 
-int owl_variable_int_set_fromstring_default(owl_variable *v, char *newval) {
+int owl_variable_int_set_fromstring_default(owl_variable *v, const char *newval) {
   int i;
-  char *ep = "x";
+  const char *ep = "x";
   i = strtol(newval, (char **)&ep, 10);
   if (*ep || ep==newval) return(-1);
@@ -910,5 +910,5 @@
 }
 
-int owl_variable_int_get_tostring_default(owl_variable *v, char* buf, int bufsize, void *val) {
+int owl_variable_int_get_tostring_default(owl_variable *v, char* buf, int bufsize, const void *val) {
   if (val == NULL) {
     snprintf(buf, bufsize, "<null>");
@@ -922,5 +922,5 @@
 /* default functions for enums (a variant of integers) */
 
-int owl_variable_enum_validate(owl_variable *v, void *newval) {  
+int owl_variable_enum_validate(owl_variable *v, const void *newval) {  
   char **enums;
   int nenums, val;
@@ -936,5 +936,5 @@
 }
 
-int owl_variable_enum_set_fromstring(owl_variable *v, char *newval) {
+int owl_variable_enum_set_fromstring(owl_variable *v, const char *newval) {
   char **enums;
   int nenums, i, val=-1;
@@ -952,5 +952,5 @@
 }
 
-int owl_variable_enum_get_tostring(owl_variable *v, char* buf, int bufsize, void *val) {
+int owl_variable_enum_get_tostring(owl_variable *v, char* buf, int bufsize, const void *val) {
   char **enums;
   int nenums, i;
@@ -973,10 +973,10 @@
 /* default functions for stringeans */
 
-int owl_variable_string_validate_default(struct _owl_variable *v, void *newval) {
+int owl_variable_string_validate_default(struct _owl_variable *v, const void *newval) {
   if (newval == NULL) return(0);
   else return (1);
 }
 
-int owl_variable_string_set_default(owl_variable *v, void *newval) {
+int owl_variable_string_set_default(owl_variable *v, const void *newval) {
   if (v->validate_fn) {
     if (!v->validate_fn(v, newval)) return(-1);
@@ -987,14 +987,14 @@
 }
 
-int owl_variable_string_set_fromstring_default(owl_variable *v, char *newval) {
+int owl_variable_string_set_fromstring_default(owl_variable *v, const char *newval) {
   return (v->set_fn(v, newval));
 }
 
-int owl_variable_string_get_tostring_default(owl_variable *v, char* buf, int bufsize, void *val) {
+int owl_variable_string_get_tostring_default(owl_variable *v, char* buf, int bufsize, const void *val) {
   if (val == NULL) {
     snprintf(buf, bufsize, "<null>");
     return -1;
   } else {
-    snprintf(buf, bufsize, "%s", (char*)val);
+    snprintf(buf, bufsize, "%s", (const char*)val);
     return 0;
   }
@@ -1015,5 +1015,5 @@
   int numfailed=0;
   char buf[1024];
-  void *v;
+  const void *v;
 
   in_regtest = 1;
Index: view.c
===================================================================
--- view.c	(revision 4d86e066c8f1fe00bd18a85523b809ba4c968947)
+++ view.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -2,5 +2,5 @@
 #include "owl.h"
 
-void owl_view_create(owl_view *v, char *name, owl_filter *f, owl_style *s)
+void owl_view_create(owl_view *v, const char *name, owl_filter *f, owl_style *s)
 {
   v->name=owl_strdup(name);
@@ -11,5 +11,5 @@
 }
 
-char *owl_view_get_name(owl_view *v)
+const char *owl_view_get_name(owl_view *v)
 {
   return(v->name);
@@ -67,5 +67,5 @@
 }
 
-char *owl_view_get_style_name(owl_view *v) {
+const char *owl_view_get_style_name(owl_view *v) {
   return(owl_style_get_name(v->style));
 }
@@ -154,5 +154,5 @@
 }
 
-char *owl_view_get_filtname(owl_view *v)
+const char *owl_view_get_filtname(owl_view *v)
 {
   return(owl_filter_get_name(v->filter));
Index: viewwin.c
===================================================================
--- viewwin.c	(revision d43edd2156ec9694ba4cec1c13baba690ce46b19)
+++ viewwin.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -7,5 +7,5 @@
  * window that will be used by viewwin
  */
-void owl_viewwin_init_text(owl_viewwin *v, WINDOW *win, int winlines, int wincols, char *text)
+void owl_viewwin_init_text(owl_viewwin *v, WINDOW *win, int winlines, int wincols, const char *text)
 {
   owl_fmtext_init_null(&(v->fmtext));
@@ -25,5 +25,5 @@
 }
 
-void owl_viewwin_append_text(owl_viewwin *v, char *text) {
+void owl_viewwin_append_text(owl_viewwin *v, const char *text) {
     owl_fmtext_append_normal(&(v->fmtext), text);
     v->textlines=owl_fmtext_num_lines(&(v->fmtext));  
Index: zbuddylist.c
===================================================================
--- zbuddylist.c	(revision d43edd2156ec9694ba4cec1c13baba690ce46b19)
+++ zbuddylist.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -6,5 +6,5 @@
 }
 
-int owl_zbuddylist_adduser(owl_zbuddylist *zb, char *name)
+int owl_zbuddylist_adduser(owl_zbuddylist *zb, const char *name)
 {
   int i, j;
@@ -24,5 +24,5 @@
 }
 
-int owl_zbuddylist_deluser(owl_zbuddylist *zb, char *name)
+int owl_zbuddylist_deluser(owl_zbuddylist *zb, const char *name)
 {
   int i, j;
@@ -45,5 +45,5 @@
 }
 
-int owl_zbuddylist_contains_user(owl_zbuddylist *zb, char *name)
+int owl_zbuddylist_contains_user(owl_zbuddylist *zb, const char *name)
 {
   int i, j;
Index: zcrypt.c
===================================================================
--- zcrypt.c	(revision 65b21736092356a35d24e53dc2e6b92e13174131)
+++ zcrypt.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -49,5 +49,5 @@
 } ZWRITEOPTIONS;
 
-char *GetZephyrVarKeyFile(char *whoami, char *class, char *instance);
+char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance);
 
 #ifndef HAVE_DES_ECB_ENCRYPT_PROTO
@@ -69,6 +69,6 @@
  * return 0 on success, otherwise -1
  */
-int owl_zcrypt_decrypt(char *out, char *in, char *class, char *instance) {
-  char *inptr, *endptr;
+int owl_zcrypt_decrypt(char *out, const char *in, const char *class, const char *instance) {
+  const char *inptr, *endptr;
   char *fname, keystring[MAX_KEY];
   FILE *fkey;
@@ -116,5 +116,5 @@
 }
 
-int owl_zcrypt_encrypt(char *out, char *in, char *class, char *instance) {
+int owl_zcrypt_encrypt(char *out, const char *in, const char *class, const char *instance) {
   char *fname, keystring[MAX_KEY];
   FILE *fkey;
@@ -123,5 +123,5 @@
   char input[8], output[8];
   int size, length, i;
-  char *inbuff = NULL, *inptr;
+  const char *inbuff = NULL, *inptr;
   int use_buffer = FALSE;
   int num_blocks=0, last_block_size=0;
@@ -183,5 +183,5 @@
 #define MAX_SEARCH 3
 /* Find the class/instance in the .crypt-table */
-char *GetZephyrVarKeyFile(char *whoami, char *class, char *instance) {
+char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance) {
   char *keyfile = NULL;
   char *varname[MAX_SEARCH];
Index: zephyr.c
===================================================================
--- zephyr.c	(revision fa4562c3dde208105e6938363d047e5622012e67)
+++ zephyr.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -187,5 +187,5 @@
 }
 
-char *owl_zephyr_get_sender()
+const char *owl_zephyr_get_sender()
 {
 #ifdef HAVE_LIBZEPHYR
@@ -235,5 +235,5 @@
  * zephyr to load the subscriptions.
  */
-int owl_zephyr_loadsubs(char *filename, int error_on_nofile)
+int owl_zephyr_loadsubs(const char *filename, int error_on_nofile)
 {
 #ifdef HAVE_LIBZEPHYR
@@ -350,5 +350,5 @@
 }
 
-int owl_zephyr_loadloginsubs(char *filename)
+int owl_zephyr_loadloginsubs(const char *filename)
 {
 #ifdef HAVE_LIBZEPHYR
@@ -422,5 +422,5 @@
 }
 
-int owl_zephyr_sub(char *class, char *inst, char *recip)
+int owl_zephyr_sub(const char *class, const char *inst, const char *recip)
 {
 #ifdef HAVE_LIBZEPHYR
@@ -443,5 +443,5 @@
 
 
-int owl_zephyr_unsub(char *class, char *inst, char *recip)
+int owl_zephyr_unsub(const char *class, const char *inst, const char *recip)
 {
 #ifdef HAVE_LIBZEPHYR
@@ -635,5 +635,5 @@
 
 #ifdef HAVE_LIBZEPHYR
-char *owl_zephyr_get_zsig(ZNotice_t *n, int *k)
+const char *owl_zephyr_get_zsig(ZNotice_t *n, int *k)
 {
   /* return a pointer to the zsig if there is one */
@@ -656,5 +656,5 @@
 }
 #else
-char *owl_zephyr_get_zsig(void *n, int *k)
+const char *owl_zephyr_get_zsig(void *n, int *k)
 {
   return("");
@@ -662,5 +662,5 @@
 #endif
 
-int send_zephyr(char *opcode, char *zsig, char *class, char *instance, char *recipient, char *message)
+int send_zephyr(const char *opcode, const char *zsig, const char *class, const char *instance, const char *recipient, const char *message)
 {
 #ifdef HAVE_LIBZEPHYR
@@ -717,5 +717,5 @@
 #endif
 
-void send_ping(char *to, char *zclass, char *zinstance)
+void send_ping(const char *to, const char *zclass, const char *zinstance)
 {
 #ifdef HAVE_LIBZEPHYR
@@ -885,5 +885,5 @@
 #endif
 
-void owl_zephyr_zlocate(char *user, char *out, int auth)
+void owl_zephyr_zlocate(const char *user, char *out, int auth)
 {
 #ifdef HAVE_LIBZEPHYR
@@ -920,5 +920,5 @@
 }
 
-void owl_zephyr_addsub(char *filename, char *class, char *inst, char *recip)
+void owl_zephyr_addsub(const char *filename, const char *class, const char *inst, const char *recip)
 {
 #ifdef HAVE_LIBZEPHYR
@@ -963,5 +963,5 @@
 }
 
-void owl_zephyr_delsub(char *filename, char *class, char *inst, char *recip)
+void owl_zephyr_delsub(const char *filename, const char *class, const char *inst, const char *recip)
 {
 #ifdef HAVE_LIBZEPHYR
@@ -985,5 +985,5 @@
 
 /* caller must free the return */
-char *owl_zephyr_makesubline(char *class, char *inst, char *recip)
+char *owl_zephyr_makesubline(const char *class, const char *inst, const char *recip)
 {
   char *out;
@@ -998,5 +998,5 @@
 {
 #ifdef HAVE_LIBZEPHYR
-  char *exposure, *eset;
+  const char *exposure, *eset;
   int ret;
 
@@ -1049,5 +1049,5 @@
 }
 
-void owl_zephyr_addbuddy(char *name)
+void owl_zephyr_addbuddy(const char *name)
 {
   char *filename;
@@ -1065,5 +1065,5 @@
 }
 
-void owl_zephyr_delbuddy(char *name)
+void owl_zephyr_delbuddy(const char *name)
 {
   char *filename;
@@ -1076,5 +1076,5 @@
 /* return auth string */
 #ifdef HAVE_LIBZEPHYR
-char *owl_zephyr_get_authstr(ZNotice_t *n)
+const char *owl_zephyr_get_authstr(ZNotice_t *n)
 {
 
@@ -1092,5 +1092,5 @@
 }
 #else
-char *owl_zephyr_get_authstr(void *n)
+const char *owl_zephyr_get_authstr(void *n)
 {
   return("");
@@ -1156,5 +1156,5 @@
 }
 
-char *owl_zephyr_get_variable(char *var)
+const char *owl_zephyr_get_variable(const char *var)
 {
 #ifdef HAVE_LIBZEPHYR
@@ -1165,5 +1165,5 @@
 }
 
-void owl_zephyr_set_locationinfo(char *host, char *val)
+void owl_zephyr_set_locationinfo(const char *host, const char *val)
 {
 #ifdef HAVE_LIBZEPHYR
@@ -1175,5 +1175,5 @@
  * The caller must free the return
  */
-char *short_zuser(char *in)
+char *short_zuser(const char *in)
 {
   char *out, *ptr;
@@ -1192,5 +1192,5 @@
  * The caller must free the return.
  */
-char *long_zuser(char *in)
+char *long_zuser(const char *in)
 {
   if (strchr(in, '@')) {
@@ -1204,5 +1204,5 @@
  * caller must free the return
  */
-char *owl_zephyr_smartstripped_user(char *in)
+char *owl_zephyr_smartstripped_user(const char *in)
 {
   char *ptr, *realm, *out;
@@ -1247,5 +1247,5 @@
  * -1 on failure, 0 on success.
  */
-int owl_zephyr_get_anyone_list(owl_list *in, char *filename)
+int owl_zephyr_get_anyone_list(owl_list *in, const char *filename)
 {
 #ifdef HAVE_LIBZEPHYR
Index: zwrite.c
===================================================================
--- zwrite.c	(revision 65b21736092356a35d24e53dc2e6b92e13174131)
+++ zwrite.c	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
@@ -5,9 +5,9 @@
 #include "owl.h"
 
-int owl_zwrite_create_from_line(owl_zwrite *z, char *line)
+int owl_zwrite_create_from_line(owl_zwrite *z, const char *line)
 {
   int argc, badargs, myargc, i, len;
   char **argv;
-  char **myargv;
+  const char *const *myargv;
   char *msg = NULL;
 
@@ -152,5 +152,5 @@
 void owl_zwrite_populate_zsig(owl_zwrite *z)
 {
-  char *zsigproc, *zsigowlvar, *zsigzvar;
+  const char *zsigproc, *zsigowlvar, *zsigzvar;
   char *ptr;
   struct passwd *pw;
@@ -219,5 +219,5 @@
   for (i=0; i<j; i++) {
     if (strcmp(z->realm, "")) {
-      to = owl_sprintf("%s@%s", (char *) owl_list_get_element(&(z->recips), i), z->realm);
+      to = owl_sprintf("%s@%s", (const char *) owl_list_get_element(&(z->recips), i), z->realm);
     } else {
       to = owl_strdup(owl_list_get_element(&(z->recips), i));
@@ -229,5 +229,5 @@
 }
 
-void owl_zwrite_set_message(owl_zwrite *z, char *msg)
+void owl_zwrite_set_message(owl_zwrite *z, const char *msg)
 {
   int i, j;
@@ -243,7 +243,7 @@
       tmp = toline;
       if (strcmp(z->realm, "")) {
-        toline = owl_sprintf( "%s%s@%s ", toline, (char *) owl_list_get_element(&(z->recips), i), z->realm);
+        toline = owl_sprintf( "%s%s@%s ", toline, (const char *) owl_list_get_element(&(z->recips), i), z->realm);
       } else {
-        toline = owl_sprintf( "%s%s ", toline, (char *) owl_list_get_element(&(z->recips), i));
+        toline = owl_sprintf( "%s%s ", toline, (const char *) owl_list_get_element(&(z->recips), i));
       }
       owl_free(tmp);
@@ -263,5 +263,5 @@
 }
 
-char *owl_zwrite_get_message(owl_zwrite *z)
+const char *owl_zwrite_get_message(owl_zwrite *z)
 {
   if (z->message) return(z->message);
@@ -286,5 +286,5 @@
     for (i=0; i<j; i++) {
       if (strcmp(z->realm, "")) {
-        to = owl_sprintf("%s@%s", (char *) owl_list_get_element(&(z->recips), i), z->realm);
+        to = owl_sprintf("%s@%s", (const char *) owl_list_get_element(&(z->recips), i), z->realm);
       } else {
         to = owl_strdup( owl_list_get_element(&(z->recips), i));
@@ -302,5 +302,5 @@
 }
 
-int owl_zwrite_create_and_send_from_line(char *cmd, char *msg)
+int owl_zwrite_create_and_send_from_line(const char *cmd, const char *msg)
 {
   owl_zwrite z;
@@ -317,20 +317,20 @@
 }
 
-char *owl_zwrite_get_class(owl_zwrite *z)
+const char *owl_zwrite_get_class(owl_zwrite *z)
 {
   return(z->class);
 }
 
-char *owl_zwrite_get_instance(owl_zwrite *z)
+const char *owl_zwrite_get_instance(owl_zwrite *z)
 {
   return(z->inst);
 }
 
-char *owl_zwrite_get_opcode(owl_zwrite *z)
+const char *owl_zwrite_get_opcode(owl_zwrite *z)
 {
   return(z->opcode);
 }
 
-void owl_zwrite_set_opcode(owl_zwrite *z, char *opcode)
+void owl_zwrite_set_opcode(owl_zwrite *z, const char *opcode)
 {
   if (z->opcode) owl_free(z->opcode);
@@ -338,10 +338,10 @@
 }
 
-char *owl_zwrite_get_realm(owl_zwrite *z)
+const char *owl_zwrite_get_realm(owl_zwrite *z)
 {
   return(z->realm);
 }
 
-char *owl_zwrite_get_zsig(owl_zwrite *z)
+const char *owl_zwrite_get_zsig(owl_zwrite *z)
 {
   if (z->zsig) return(z->zsig);
@@ -367,5 +367,5 @@
 }
 
-char *owl_zwrite_get_recip_n(owl_zwrite *z, int n)
+const char *owl_zwrite_get_recip_n(owl_zwrite *z, int n)
 {
   return(owl_list_get_element(&(z->recips), n));
