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;
