Index: global.c
===================================================================
--- global.c	(revision 9e5c9f3896b2bcb356b0ca00fbab6361fd85e7c5)
+++ global.c	(revision 8742840558e219e58e3eb585dc8c087427c24f08)
@@ -168,13 +168,13 @@
 }
 			 
-int owl_global_get_lines(owl_global *g) {
+int owl_global_get_lines(const owl_global *g) {
   return(g->lines);
 }
 
-int owl_global_get_cols(owl_global *g) {
+int owl_global_get_cols(const owl_global *g) {
   return(g->cols);
 }
 
-int owl_global_get_recwin_lines(owl_global *g) {
+int owl_global_get_recwin_lines(const owl_global *g) {
   return(g->recwinlines);
 }
@@ -182,5 +182,5 @@
 /* curmsg */
 
-int owl_global_get_curmsg(owl_global *g) {
+int owl_global_get_curmsg(const owl_global *g) {
   return(g->curmsg);
 }
@@ -195,5 +195,5 @@
 /* topmsg */
 
-int owl_global_get_topmsg(owl_global *g) {
+int owl_global_get_topmsg(const owl_global *g) {
   return(g->topmsg);
 }
@@ -205,5 +205,5 @@
 /* markedmsgid */
 
-int owl_global_get_markedmsgid(owl_global *g) {
+int owl_global_get_markedmsgid(const owl_global *g) {
   return(g->markedmsgid);
 }
@@ -245,17 +245,17 @@
 /* curses windows */
 
-WINDOW *owl_global_get_curs_recwin(owl_global *g) {
+WINDOW *owl_global_get_curs_recwin(const owl_global *g) {
   return(g->recwin);
 }
 
-WINDOW *owl_global_get_curs_sepwin(owl_global *g) {
+WINDOW *owl_global_get_curs_sepwin(const owl_global *g) {
   return(g->sepwin);
 }
 
-WINDOW *owl_global_get_curs_msgwin(owl_global *g) {
+WINDOW *owl_global_get_curs_msgwin(const owl_global *g) {
   return(g->msgwin);
 }
 
-WINDOW *owl_global_get_curs_typwin(owl_global *g) {
+WINDOW *owl_global_get_curs_typwin(const owl_global *g) {
   return(g->typwin);
 }
@@ -263,5 +263,5 @@
 /* typwin */
 
-owl_editwin *owl_global_get_typwin(owl_global *g) {
+owl_editwin *owl_global_get_typwin(const owl_global *g) {
   return(g->tw);
 }
@@ -273,5 +273,5 @@
 }
 
-const char *owl_global_get_buffercommand(owl_global *g) {
+const char *owl_global_get_buffercommand(const owl_global *g) {
   return owl_editwin_get_command(owl_global_get_typwin(g));
 }
@@ -281,5 +281,5 @@
 }
 
-void (*owl_global_get_buffercallback(owl_global *g))(owl_editwin*) {
+void (*owl_global_get_buffercallback(const owl_global *g))(owl_editwin*) {
   return owl_editwin_get_callback(owl_global_get_typwin(g));
 }
@@ -287,5 +287,5 @@
 /* refresh */
 
-int owl_global_is_needrefresh(owl_global *g) {
+int owl_global_is_needrefresh(const owl_global *g) {
   if (g->needrefresh==1) return(1);
   return(0);
@@ -318,5 +318,5 @@
 }
 
-int owl_global_get_rightshift(owl_global *g) {
+int owl_global_get_rightshift(const owl_global *g) {
   return(g->rightshift);
 }
@@ -324,5 +324,5 @@
 /* typwin */
 
-int owl_global_is_typwin_active(owl_global *g) {
+int owl_global_is_typwin_active(const owl_global *g) {
   if (g->typwinactive==1) return(1);
   return(0);
@@ -351,10 +351,10 @@
 }
 
-const char *owl_global_get_homedir(owl_global *g) {
+const char *owl_global_get_homedir(const owl_global *g) {
   if (g->homedir) return(g->homedir);
   return("/");
 }
 
-const char *owl_global_get_confdir(owl_global *g) {
+const char *owl_global_get_confdir(const owl_global *g) {
   if (g->confdir) return(g->confdir);
   return("/");
@@ -371,10 +371,10 @@
 }
 
-const char *owl_global_get_startupfile(owl_global *g) {
+const char *owl_global_get_startupfile(const owl_global *g) {
   if(g->startupfile) return(g->startupfile);
   return("/");
 }
 
-int owl_global_get_direction(owl_global *g) {
+int owl_global_get_direction(const owl_global *g) {
   return(g->direction);
 }
@@ -394,9 +394,9 @@
 }
 
-void *owl_global_get_perlinterp(owl_global *g) {
+void *owl_global_get_perlinterp(const owl_global *g) {
   return(g->perl);
 }
 
-int owl_global_is_config_format(owl_global *g) {
+int owl_global_is_config_format(const owl_global *g) {
   if (g->config_format) return(1);
   return(0);
@@ -498,5 +498,5 @@
 /* debug */
 
-int owl_global_is_debug_fast(owl_global *g) {
+int owl_global_is_debug_fast(const owl_global *g) {
   if (g->debug) return(1);
   return(0);
@@ -505,13 +505,13 @@
 /* starttime */
 
-time_t owl_global_get_starttime(owl_global *g) {
+time_t owl_global_get_starttime(const owl_global *g) {
   return(g->starttime);
 }
 
-time_t owl_global_get_runtime(owl_global *g) {
+time_t owl_global_get_runtime(const owl_global *g) {
   return(time(NULL)-g->starttime);
 }
 
-time_t owl_global_get_lastinputtime(owl_global *g) {
+time_t owl_global_get_lastinputtime(const owl_global *g) {
   return(g->lastinputtime);
 }
@@ -521,9 +521,9 @@
 }
 
-time_t owl_global_get_idletime(owl_global *g) {
+time_t owl_global_get_idletime(const owl_global *g) {
   return(time(NULL)-g->lastinputtime);
 }
 
-void owl_global_get_runtime_string(owl_global *g, char *buff) {
+void owl_global_get_runtime_string(const owl_global *g, char *buff) {
   time_t diff;
 
@@ -534,5 +534,5 @@
 }
 
-const char *owl_global_get_hostname(owl_global *g) {
+const char *owl_global_get_hostname(const owl_global *g) {
   if (g->thishost) return(g->thishost);
   return("");
@@ -549,9 +549,9 @@
 }
 
-int owl_global_get_userclue(owl_global *g) {
+int owl_global_get_userclue(const owl_global *g) {
   return(g->userclue);
 }
 
-int owl_global_is_userclue(owl_global *g, int clue) {
+int owl_global_is_userclue(const owl_global *g, int clue) {
   if (g->userclue & clue) return(1);
   return(0);
@@ -567,5 +567,5 @@
 /* vert offset */
 
-int owl_global_get_curmsg_vert_offset(owl_global *g) {
+int owl_global_get_curmsg_vert_offset(const owl_global *g) {
   return(g->curmsg_vert_offset);
 }
@@ -595,5 +595,5 @@
 }
 
-const char *owl_global_get_startupargs(owl_global *g) {
+const char *owl_global_get_startupargs(const owl_global *g) {
   if (g->startupargs) return(g->startupargs);
   return("");
@@ -616,5 +616,5 @@
 }
 
-owl_filter *owl_global_get_filter(owl_global *g, const char *name) {
+owl_filter *owl_global_get_filter(const owl_global *g, const char *name) {
   int i, j;
   owl_filter *f;
@@ -663,5 +663,5 @@
 /* has colors */
 
-int owl_global_get_hascolors(owl_global *g) {
+int owl_global_get_hascolors(const owl_global *g) {
   if (g->hascolors) return(1);
   return(0);
@@ -670,5 +670,5 @@
 /* color pairs */
 
-int owl_global_get_colorpairs(owl_global *g) {
+int owl_global_get_colorpairs(const owl_global *g) {
   return(g->colorpairs);
 }
@@ -707,5 +707,5 @@
 }
 
-int owl_global_is_search_active(owl_global *g) {
+int owl_global_is_search_active(const owl_global *g) {
   if (owl_regex_is_set(&g->search_re)) return(1);
   return(0);
@@ -721,5 +721,5 @@
 }
 
-const owl_regex *owl_global_get_search_re(owl_global *g) {
+const owl_regex *owl_global_get_search_re(const owl_global *g) {
   return &g->search_re;
 }
@@ -729,5 +729,5 @@
 }
 
-int owl_global_get_newmsgproc_pid(owl_global *g) {
+int owl_global_get_newmsgproc_pid(const owl_global *g) {
   return(g->newmsgproc_pid);
 }
@@ -735,5 +735,5 @@
 /* AIM stuff */
 
-int owl_global_is_aimloggedin(owl_global *g)
+int owl_global_is_aimloggedin(const owl_global *g)
 {
   if (g->aim_loggedin) return(1);
@@ -741,5 +741,5 @@
 }
 
-const char *owl_global_get_aim_screenname(owl_global *g)
+const char *owl_global_get_aim_screenname(const owl_global *g)
 {
   if (owl_global_is_aimloggedin(g)) {
@@ -749,5 +749,5 @@
 }
 
-const char *owl_global_get_aim_screenname_for_filters(owl_global *g)
+const char *owl_global_get_aim_screenname_for_filters(const owl_global *g)
 {
   if (owl_global_is_aimloggedin(g)) {
@@ -776,5 +776,5 @@
 }
 
-int owl_global_is_doaimevents(owl_global *g)
+int owl_global_is_doaimevents(const owl_global *g)
 {
   if (g->aim_doprocessing) return(1);
@@ -843,5 +843,5 @@
 /* Return the style with name 'name'.  If it does not exist return
  * NULL */
-const owl_style *owl_global_get_style_by_name(owl_global *g, const char *name)
+const owl_style *owl_global_get_style_by_name(const owl_global *g, const char *name)
 {
   return owl_dict_find_element(&(g->styledict), name);
@@ -850,5 +850,5 @@
 /* creates a list and fills it in with keys.  duplicates the keys, 
  * so they will need to be freed by the caller. */
-int owl_global_get_style_names(owl_global *g, owl_list *l) {
+int owl_global_get_style_names(const owl_global *g, owl_list *l) {
   return owl_dict_get_keys(&(g->styledict), l);
 }
@@ -873,5 +873,5 @@
 }
 
-int owl_global_is_haveaim(owl_global *g)
+int owl_global_is_haveaim(const owl_global *g)
 {
   if (g->haveaim) return(1);
@@ -889,5 +889,5 @@
 }
 
-int owl_global_is_ignore_aimlogin(owl_global *g)
+int owl_global_is_ignore_aimlogin(const owl_global *g)
 {
     return g->ignoreaimlogin;
@@ -899,5 +899,5 @@
 }
 
-int owl_global_is_havezephyr(owl_global *g)
+int owl_global_is_havezephyr(const owl_global *g)
 {
   if (g->havezephyr) return(1);
@@ -957,5 +957,5 @@
 }
 
-int owl_global_is_interrupted(owl_global *g) {
+int owl_global_is_interrupted(const owl_global *g) {
   return g->interrupted;
 }
Index: stubgen.pl
===================================================================
--- stubgen.pl	(revision e19eb97bacd75cf02905ec2b7a6a73b9642b907a)
+++ stubgen.pl	(revision 8742840558e219e58e3eb585dc8c087427c24f08)
@@ -25,15 +25,15 @@
 	print "void owl_global_set_${altvarname}_off(owl_global *g) {\n";
 	print "  owl_variable_set_bool_off(&g->vars, \"$varname\");\n}\n";
-	print "int owl_global_is_$altvarname(owl_global *g) {\n";
+	print "int owl_global_is_$altvarname(const owl_global *g) {\n";
 	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, const char *text) {\n";
 	print "  owl_variable_set_string(&g->vars, \"$varname\", text);\n}\n";
-	print "const char *owl_global_get_$altvarname(owl_global *g) {\n";
+	print "const char *owl_global_get_$altvarname(const owl_global *g) {\n";
 	print "  return owl_variable_get_string(&g->vars, \"$varname\");\n}\n";
     } elsif ($vartype =~ /^INT/ or $vartype =~ /^ENUM/) {
 	print "void owl_global_set_$altvarname(owl_global *g, int n) {\n";
 	print "  owl_variable_set_int(&g->vars, \"$varname\", n);\n}\n";
-	print "int owl_global_get_$altvarname(owl_global *g) {\n";
+	print "int owl_global_get_$altvarname(const owl_global *g) {\n";
 	print "  return owl_variable_get_int(&g->vars, \"$varname\");\n}\n";
     } 
