Index: util.c
===================================================================
--- util.c	(revision 73624b445ce7ec3252a00b29ef2396a3c97e3700)
+++ util.c	(revision e4eebe8517ea568f157d4a0ef957099d7af050a2)
@@ -8,5 +8,6 @@
 static const char fileIdent[] = "$Id$";
 
-void sepbar(char *in) {
+void sepbar(char *in)
+{
   char buff[1024];
   WINDOW *sepwin;
@@ -117,5 +118,6 @@
 
 
-void pophandler_quit(int ch) {
+void pophandler_quit(int ch)
+{
   if (ch=='q') {
     owl_popwin_close(owl_global_get_popwin(&g));
@@ -123,5 +125,6 @@
 }
 
-char **atokenize(char *buffer, char *sep, int *i) {
+char **atokenize(char *buffer, char *sep, int *i)
+{
   /* each element of return must be freed by user */
   char **args;
@@ -171,5 +174,6 @@
 }
 
-void atokenize_free(char **tok, int nels) {
+void atokenize_free(char **tok, int nels)
+{
   int i;
   for (i=0; i<nels; i++) {
@@ -180,5 +184,6 @@
 
 
-void owl_parsefree(char **argv, int argc) {
+void owl_parsefree(char **argv, int argc)
+{
   int i;
 
@@ -191,5 +196,6 @@
 }
 
-char **owl_parseline(char *line, int *argc) {
+char **owl_parseline(char *line, int *argc)
+{
   /* break a command line up into argv, argc.  The caller must free
      the returned values.  If there is an error argc will be set to
@@ -275,8 +281,7 @@
 
 
-
-int owl_util_find_trans(char *in, int len) {
-  /* return the index of the last char before a change from the first
-     one */
+/* return the index of the last char before a change from the first one */
+int owl_util_find_trans(char *in, int len)
+{
   int i;
   for (i=1; i<len; i++) {
@@ -287,5 +292,7 @@
 
 
-void downstr(char *foo) {
+/* downcase the string 'foo' */
+void downstr(char *foo)
+{
   int i;
   for (i=0; foo[i]!='\0'; i++) {
@@ -294,6 +301,7 @@
 }
 
-char *stristr(char *a, char *b) {
-  /* exactly like strstr but it's case insensitive */
+/* exactly like strstr but case insensitive */
+char *stristr(char *a, char *b)
+{
   char *x, *y, *ret;
 
@@ -314,11 +322,12 @@
 }
 
-char *owl_util_uniq(char *A, char *B, char *prohibit) {
-  /* Caller must free response. 
-     Takes in strings which are space-separated lists of tokens
-     and returns a single string containing no token more than once.
-     If prohibit is non-null, no token may start with a character
-     in prohibit.
-  */
+/* Caller must free response. 
+ * Takes in strings which are space-separated lists of tokens
+ * and returns a single string containing no token more than once.
+ * If prohibit is non-null, no token may start with a character
+ * in prohibit.
+ */
+char *owl_util_uniq(char *A, char *B, char *prohibit)
+{
   
   char *cat, **tok;
@@ -347,7 +356,7 @@
 }
 
-int only_whitespace(char *s) {
-  /* returns if a string is only whitespace */
-
+/* return 1 if a string is only whitespace, otherwise 0 */
+int only_whitespace(char *s)
+{
   int i;
   for (i=0; s[i]; i++) {
@@ -359,26 +368,31 @@
 /* hooks for doing memory allocation et. al. in owl */
 
-void *owl_malloc(size_t size) {
+void *owl_malloc(size_t size)
+{
   return(malloc(size));
 }
 
-void owl_free(void *ptr) {
+void owl_free(void *ptr)
+{
   free(ptr);
 }
 
-char *owl_strdup(const char *s1) {
+char *owl_strdup(const char *s1)
+{
   return(strdup(s1));
 }
 
-void *owl_realloc(void *ptr, size_t size) {
+void *owl_realloc(void *ptr, size_t size)
+{
   return(realloc(ptr, size));
 }
 
-char *owl_sprintf(const char *fmt, ...) {
-  /* allocates memory and returns the string or null.
-   * caller must free the string. 
-   * from Linux sprintf man page. 
-   */
-  
+
+/* allocates memory and returns the string or null.
+ * caller must free the string. 
+ * from Linux sprintf man page. 
+ */
+char *owl_sprintf(const char *fmt, ...)
+{
   int n, size = 100;
   char *p;
@@ -403,6 +417,9 @@
 }
 
-/* the caller must free the return */
-char *short_zuser(char *in) {
+/* Strip a local realm fron the zephyr user name.
+ * The caller must free the return
+ */
+char *short_zuser(char *in)
+{
   char *out, *ptr;
 
@@ -417,6 +434,9 @@
 }
 
-/* the caller must free the return */
-char *long_zuser(char *in) {
+/* Append a local realm to the zephyr user name if necessary.
+ * The caller must free the return.
+ */
+char *long_zuser(char *in)
+{
   char *ptr;
 
@@ -429,9 +449,10 @@
 
 
-char *owl_util_smartstripped_user(char *in) {
-  /* strip out the instance from a zsender's principal.  Preserves the
-   * realm if present.  daemon.webzephyr is a special case.  The
-   * caller must free the return */
-
+/* strip out the instance from a zsender's principal.  Preserves the
+ * realm if present.  daemon.webzephyr is a special case.  The
+ * caller must free the return
+ */
+char *owl_util_smartstripped_user(char *in)
+{
   char *ptr, *realm, *out;
 
@@ -452,5 +473,4 @@
   }
 
-
   /* remove the realm from ptr, but hold on to it */
   realm=strchr(out, '@');
@@ -471,5 +491,6 @@
 }
 
-char *owl_getquoting(char *line) {
+char *owl_getquoting(char *line)
+{
   if (line[0]=='\0') return("'");
   if (strchr(line, '\'')) return("\"");
@@ -479,9 +500,12 @@
 }
 
-char *owl_util_substitute(char *in, char *from, char *to) {
-  /* Caller must free returned string.
-   * Returns a string with any occurances of 'from' replaced with 'to'.
-   * Does not currently handle backslash quoting, but may in the future.
-   */
+
+
+/* Return a string with any occurances of 'from' replaced with 'to'.
+ * Does not currently handle backslash quoting, but may in the future.
+ * Caller must free returned string.
+ */
+char *owl_util_substitute(char *in, char *from, char *to)
+{
   
   char *out;
@@ -511,7 +535,9 @@
 }
 
-void owl_util_tr(char *buff, char a, char b) {
-  /* replace all instances of character a in buff with the character
-     b.  buff must be null terminated */
+/* replace all instances of character a in buff with the character
+ * b.  buff must be null terminated.
+ */
+void owl_util_tr(char *buff, char a, char b)
+{
   int i;
 
@@ -523,5 +549,8 @@
 }
 
-int owl_util_string_to_color(char *color) {
+
+/* Return the owl color associated with the named color */
+int owl_util_string_to_color(char *color)
+{
   if (!strcasecmp(color, "black")) {
     return(OWL_COLOR_BLACK);
@@ -546,5 +575,7 @@
 }
 
-char *owl_util_color_to_string(int color) {
+/* Return a string name of the given owl color */
+char *owl_util_color_to_string(int color)
+{
   if (color==OWL_COLOR_BLACK)   return("black");
   if (color==OWL_COLOR_RED)     return("red");
@@ -559,6 +590,7 @@
 }
 
-char *owl_util_get_default_tty() {
-  /* call must free the return */
+/* Get the default tty name.  Caller must free the return */
+char *owl_util_get_default_tty()
+{
   char *out, *tmp;
 
@@ -578,5 +610,7 @@
 
 
-void owl_hack_animate() {
+/* Animation hack */
+void owl_hack_animate()
+{
   owl_messagelist *ml;
   owl_message *m;
@@ -631,7 +665,9 @@
 }
 
-char *owl_util_stripnewlines(char *in) {
-  /* strip leading and trailing new lines.
-     caller must free the return */
+/* strip leading and trailing new lines.  Caller must free the
+ * return.
+ */
+char *owl_util_stripnewlines(char *in)
+{
   
   char  *tmp, *ptr1, *ptr2, *out;
@@ -733,5 +769,6 @@
 #define FAIL_UNLESS(desc,pred) printf("\t%-4s: %s\n", (pred)?"ok":(numfailed++,"FAIL"), desc)
 
-int owl_util_regtest(void) {
+int owl_util_regtest(void)
+{
   int numfailed=0;
 
