Index: commands.c
===================================================================
--- commands.c	(revision 8e5935d11c699a7ce5a3e6e9a47799564c696d6a)
+++ commands.c	(revision f34dd65b3adbc2eedc045a674dd89b7e20257680)
@@ -1726,11 +1726,4 @@
   return(NULL);
 }
-
-
-void owl_command_zlog_out(void)
-{
-  owl_zephyr_zlog_out();
-}
-
 
 char *owl_command_subscribe(int argc, char **argv, char *buff)
Index: filter.c
===================================================================
--- filter.c	(revision 9711a6ed78d99195d08bc9f693d8d203fea0cc12)
+++ filter.c	(revision f34dd65b3adbc2eedc045a674dd89b7e20257680)
@@ -18,5 +18,4 @@
 {
   f->name=owl_strdup(name);
-  f->polarity=0;
   f->fgcolor=OWL_COLOR_DEFAULT;
   f->bgcolor=OWL_COLOR_DEFAULT;
@@ -157,14 +156,4 @@
 }
 
-void owl_filter_set_polarity_match(owl_filter *f)
-{
-  f->polarity=0;
-}
-
-void owl_filter_set_polarity_unmatch(owl_filter *f)
-{
-  f->polarity=1;
-}
-
 void owl_filter_set_fgcolor(owl_filter *f, int color)
 {
@@ -205,5 +194,4 @@
   if(!f->root) return 0;
   ret = owl_filterelement_match(f->root, m);
-  if(f->polarity) ret = !ret;
   return ret;
 }
Index: functions.c
===================================================================
--- functions.c	(revision 99b50a5e32e22a9d4f38cb502932d6091ae8a9a2)
+++ functions.c	(revision f34dd65b3adbc2eedc045a674dd89b7e20257680)
@@ -14,9 +14,4 @@
 
 static const char fileIdent[] = "$Id$";
-
-void owl_function_noop(void)
-{
-  return;
-}
 
 char *owl_function_command(char *cmdbuff)
@@ -717,15 +712,4 @@
 }
 
-void owl_function_nextmsg_personal()
-{
-  owl_function_nextmsg_full("personal", 0, 0);
-}
-
-void owl_function_prevmsg_personal()
-{
-  owl_function_prevmsg_full("personal", 0, 0);
-}
-
-
 /* if move_after is 1, moves after the delete */
 void owl_function_deletecur(int move_after)
@@ -1276,9 +1260,4 @@
 
   va_end(ap);
-}
-
-void owl_function_refresh()
-{
-  owl_function_resize();
 }
 
@@ -1647,22 +1626,4 @@
   owl_global_set_typwin_lines(&g, newsize);
   owl_function_resize();
-}
-
-void owl_function_typwin_grow()
-{
-  int i;
-
-  i=owl_global_get_typwin_lines(&g);
-  owl_function_resize_typwin(i+1);
-}
-
-void owl_function_typwin_shrink()
-{
-  int i;
-
-  i=owl_global_get_typwin_lines(&g);
-  if (i>2) {
-    owl_function_resize_typwin(i-1);
-  }
 }
 
Index: global.c
===================================================================
--- global.c	(revision 58d1f8a9e59b62d12e32430472533fe6c48e7ea7)
+++ global.c	(revision f34dd65b3adbc2eedc045a674dd89b7e20257680)
@@ -51,5 +51,4 @@
   owl_keys_setup_keymaps(&g->kh);
 
-  owl_list_create(&(g->muxevents));
   owl_list_create(&(g->filterlist));
   owl_list_create(&(g->puntlist));
@@ -588,10 +587,4 @@
 }
 
-/* muxevents */
-
-owl_muxevents *owl_global_get_muxevents(owl_global *g) {
-  return(&(g->muxevents));
-}
-
 /* filterlist */
 
@@ -717,24 +710,4 @@
 int owl_global_get_newmsgproc_pid(owl_global *g) {
   return(g->newmsgproc_pid);
-}
-
-void owl_global_add_to_malloced(owl_global *g, int i) {
-  g->malloced+=i;
-}
-
-void owl_global_add_to_freed(owl_global *g, int i) {
-  g->freed+=1;
-}
-
-int owl_global_get_malloced(owl_global *g) {
-  return(g->malloced);
-}
-
-int owl_global_get_freed(owl_global *g) {
-  return(g->freed);
-}
-
-int owl_global_get_meminuse(owl_global *g) {
-  return(g->malloced-g->freed);
 }
 
Index: list.c
===================================================================
--- list.c	(revision 50622a59357b6958f78b136d6d25ce31540f7c59)
+++ list.c	(revision f34dd65b3adbc2eedc045a674dd89b7e20257680)
@@ -78,13 +78,4 @@
 }
 
-/* todo: might leak memory */
-int owl_list_replace_element(owl_list *l, int n, void *element)
-{
-  if (n>l->size-1) return(-1);
-
-  l->list[n]=element;
-  return(0);
-}
-
 void owl_list_free_all(owl_list *l, void (*elefree)(void *))
 {
Index: message.c
===================================================================
--- message.c	(revision 7d471c3073d4a465878d13959b7a08d05711647a)
+++ message.c	(revision f34dd65b3adbc2eedc045a674dd89b7e20257680)
@@ -338,16 +338,4 @@
 }
 
-/* caller must free the return */
-char *owl_message_get_shorttimestr(owl_message *m)
-{
-  struct tm *tmstruct;
-  char *out;
-
-  tmstruct=localtime(&(m->time));
-  out=owl_sprintf("%2.2i:%2.2i", tmstruct->tm_hour, tmstruct->tm_min);
-  if (out) return(out);
-  return("??:??");
-}
-
 void owl_message_set_type_admin(owl_message *m)
 {
@@ -384,10 +372,4 @@
 {
   return owl_message_is_type(m, "admin");
-}
-
-int owl_message_is_type_generic(owl_message *m)
-{
-  char * t = owl_message_get_attribute_value(m, "type");
-  return (t == NULL);
 }
 
@@ -573,40 +555,8 @@
 }
 
-int owl_message_is_from_me(owl_message *m)
-{
-  if (owl_message_is_type_zephyr(m)) {
-    if (!strcasecmp(owl_message_get_sender(m), owl_zephyr_get_sender())) {
-      return(1);
-    } else {
-      return(0);
-    }
-  } else if (owl_message_is_type_aim(m)) {
-    if (!strcasecmp(owl_message_get_sender(m), owl_global_get_aim_screenname(&g))) {
-      return(1);
-    } else {
-      return(0);
-    }
-  } else if (owl_message_is_type_admin(m)) {
-    return(0);
-  }
-  return(0);
-}
-
 int owl_message_is_mail(owl_message *m)
 {
   if (owl_message_is_type_zephyr(m)) {
     if (!strcasecmp(owl_message_get_class(m), "mail") && owl_message_is_private(m)) {
-      return(1);
-    } else {
-      return(0);
-    }
-  }
-  return(0);
-}
-
-int owl_message_is_ping(owl_message *m)
-{
-  if (owl_message_is_type_zephyr(m)) {
-    if (!strcasecmp(owl_message_get_opcode(m), "ping")) {
       return(1);
     } else {
@@ -992,14 +942,4 @@
 }
 
-void owl_message_pretty_zsig(owl_message *m, char *buff)
-{
-  /* stick a one line version of the zsig in buff */
-  char *ptr;
-
-  strcpy(buff, owl_message_get_zsig(m));
-  ptr=strchr(buff, '\n');
-  if (ptr) ptr[0]='\0';
-}
-
 void owl_message_free(owl_message *m)
 {
Index: owl.h
===================================================================
--- owl.h	(revision 40c665796431e6bd112feb7e36e6520b696396c4)
+++ owl.h	(revision f34dd65b3adbc2eedc045a674dd89b7e20257680)
@@ -377,5 +377,4 @@
   int active;
   int needsfirstrefresh;
-  void (*handler) (int ch);
 } owl_popwin;
 
@@ -404,5 +403,4 @@
 typedef struct _owl_filter {
   char *name;
-  int polarity;
   owl_filterelement * root;
   int fgcolor;
@@ -445,14 +443,4 @@
 } owl_editwin;
 
-typedef struct _owl_mux {
-  int handle;			/* for referencing this */
-  int active;			/* has this been deleted? */
-  int fd;		       
-  int eventmask;		/* bitmask of OWL_MUX_* */
-  void (*handler_fn)(int handle, int fd, int eventmask, void *data);
-  void *data;			/* data reference to pass to callback */
-} owl_mux;
-typedef owl_list owl_muxevents;
-
 typedef struct _owl_keybinding {
   int  *j;			/* keypress stack (0-terminated) */  
@@ -541,5 +529,4 @@
   owl_list filterlist;
   owl_list puntlist;
-  owl_muxevents muxevents;	/* fds to dispatch on */
   owl_vardict vars;
   owl_cmddict cmds;
Index: popwin.c
===================================================================
--- popwin.c	(revision 818a07348f30d7fbee5ff8c98ceca4886c9a710f)
+++ popwin.c	(revision f34dd65b3adbc2eedc045a674dd89b7e20257680)
@@ -57,14 +57,4 @@
 }
 
-int owl_popwin_display_text(owl_popwin *pw, char *text)
-{
-  waddstr(pw->popwin, text);
-  wnoutrefresh(pw->popwin);
-  touchwin(pw->borderwin);
-  wnoutrefresh(pw->borderwin);
-  owl_global_set_needrefresh(&g);
-  return(0);
-}	      
-
 int owl_popwin_close(owl_popwin *pw)
 {
@@ -96,14 +86,4 @@
 }
 
-void owl_popwin_set_handler(owl_popwin *pw, void (*func)(int ch))
-{
-  pw->handler=func;
-}
-
-void owl_popwin_unset_handler(owl_popwin *pw)
-{
-  pw->handler=NULL;
-}
-
 WINDOW *owl_popwin_get_curswin(owl_popwin *pw)
 {
Index: text.c
===================================================================
--- text.c	(revision 3bcf12527e47f730a032a807fd38018ae8b13c7e)
+++ text.c	(revision f34dd65b3adbc2eedc045a674dd89b7e20257680)
@@ -6,115 +6,4 @@
 
 static const char fileIdent[] = "$Id$";
-
-/* start with line aline (where the first line is 1) and print 'lines'
- *  lines
- */
-int owl_text_truncate_lines(char *out, char *in, int aline, int lines)
-{
-  char *ptr1, *ptr2;
-  int i;
-
-  strcpy(out, "");
-  
-  if (aline==0) aline=1; /* really illegal use */
-
-  /* find the starting line */
-  ptr1=in;
-  if (aline!=1) {
-     for (i=0; i<aline-1; i++) {
-      ptr1=strchr(ptr1, '\n');
-      if (!ptr1) return(-1);
-      ptr1++;
-    }
-  }
-  /* ptr1 now holds the starting point */
-
-  /* copy in the next 'lines' lines */
-  if (lines<1) return(-1);
-  
-  for (i=0; i<lines; i++) {
-    ptr2=strchr(ptr1, '\n');
-    if (!ptr2) {
-      strcat(out, ptr1);
-      return(-1);
-    }
-    strncat(out, ptr1, ptr2-ptr1+1);
-    ptr1=ptr2+1;
-  }
-  return(0);
-}
-
-  
-/* the first column is column 0.  The message is expected to end in a
- * new line for now */
-void owl_text_truncate_cols(char *out, char *in, int acol, int bcol)
-{
-  char *ptr_s, *ptr_e, *ptr_c, *tmpbuff, *last;
-  int col, cnt, padding;
-  
-  tmpbuff=owl_malloc(strlen(in)+20);
-
-  strcpy(tmpbuff, "");
-  last=in+strlen(in)-1;
-  ptr_s=in;
-  while (ptr_s<last) {
-    ptr_e=strchr(ptr_s, '\n');
-    if (!ptr_e) {
-      /* but this shouldn't happen if we end in a \n */
-      break;
-    }
-    
-    if (ptr_e==ptr_s) {
-      strcat(tmpbuff, "\n");
-      ptr_s++;
-      continue;
-    }
-
-    col = 0;
-    cnt = 0;
-    padding = 0;
-    ptr_c = ptr_s;
-    while(col < bcol && ptr_c < ptr_e) {
-      gunichar c = g_utf8_get_char(ptr_c);
-      if (col + mk_wcwidth(c) > bcol) break;
-      col += mk_wcwidth(c);
-      ptr_c = g_utf8_next_char(ptr_c);
-      if (col >= acol) {
-	if (cnt == 0) {
-	  ptr_s = ptr_c;
-	  padding = col - acol;
-	}
-	++cnt;
-      }
-    }
-    if (cnt) {
-      while(padding-- > 0) {
-	strcat(tmpbuff, " ");
-      }
-      strncat(tmpbuff, ptr_s, ptr_c - ptr_s - 1);
-    }
-    strcat(tmpbuff, "\n");
-    ptr_s = ptr_e + 1;
-#if 0
-    /* we need to check that we won't run over here */
-    if ( (ptr_e-ptr_s) < (bcol-acol) ) {
-      len=ptr_e-(ptr_s+acol);
-    } else {
-      len=bcol-acol;
-    }
-    if ((ptr_s+len)>=last) {
-      len-=last-(ptr_s+len);
-    }
-
-    strncat(tmpbuff, ptr_s+acol, len);
-    strcat(tmpbuff, "\n");
-
-    ptr_s=ptr_e+1;
-#endif
-  }
-  strcpy(out, tmpbuff);
-  owl_free(tmpbuff);
-}
-
 
 void owl_text_indent(char *out, char *in, int n)
Index: util.c
===================================================================
--- util.c	(revision e97c4a306ae2c9d2147d83da29fee59918198e70)
+++ util.c	(revision f34dd65b3adbc2eedc045a674dd89b7e20257680)
@@ -125,12 +125,4 @@
   wattroff(sepwin, A_REVERSE);
   wnoutrefresh(sepwin);
-}
-
-
-void pophandler_quit(int ch)
-{
-  if (ch=='q') {
-    owl_popwin_close(owl_global_get_popwin(&g));
-  }
 }
 
@@ -380,57 +372,4 @@
 }
 
-/* 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++) {
-    if (in[i] != in[0]) return(i-1);
-  }
-  return(i);
-}
-
-int owl_util_find_trans_short(short *in, int len)
-{
-  int i;
-  for (i=1; i<len; i++) {
-    if (in[i] != in[0]) return(i-1);
-  }
-  return(i);
-}
-
-/* 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;
-  int toklen, i, j, first=1;
-  cat = owl_malloc(strlen(A)+strlen(B)+3);
-  strcpy(cat, A);
-  strcat(cat, " ");
-  strcat(cat, B);
-  tok = atokenize(cat, " ", &toklen);
-  strcpy(cat, "");
-  for (i=0; i<toklen; i++) {
-    int dup=0;
-    for (j=0; j<i; j++) {
-      if (!strcmp(tok[i], tok[j])) dup=1;
-    }
-    if (!dup && (!prohibit || !strchr(prohibit, tok[i][0]))) {
-      if (!first) {
-	strcat(cat, " ");
-      }
-      first=0;
-      strcat(cat, tok[i]);
-    }
-  }
-  atokenize_free(tok, toklen);
-  return(cat);
-}
-
 /* hooks for doing memory allocation et. al. in owl */
 
@@ -692,32 +631,4 @@
 }
 
-/* add the string 'str' to the list 'list' of strings, only if it
- * is not already present
- */
-void owl_util_list_add_unique_string(owl_list *list, char *str)
-{
-  int i, j;
-
-  j=owl_list_get_size(list);
-  for (i=0; i<j; i++) {
-    if (!strcmp(str, owl_list_get_element(list, i))) return;
-  }
-  owl_list_append_element(list, owl_strdup(str));
-}
-
-int owl_util_common_strings_in_lists(owl_list *a, owl_list *b)
-{
-  int i, j, x, y;
-
-  j=owl_list_get_size(a);
-  for (i=0; i<j; i++) {
-    y=owl_list_get_size(b);
-    for (x=0; x<y; x++) {
-      if (!strcmp(owl_list_get_element(a, i), owl_list_get_element(b, x))) return(1);
-    }
-  }
-  return(0);
-}
-
 int owl_util_max(int a, int b)
 {
@@ -883,11 +794,4 @@
 	      !strcmp("meep", skiptokens("foo 'bar quux' meep", 2)));
 
-  FAIL_UNLESS("owl_util_uniq 1", 
-	      !strcmp("foo bar x", owl_util_uniq("foo", "bar x", "-")));
-  FAIL_UNLESS("owl_util_uniq 2", 
-	      !strcmp("foo bar x", owl_util_uniq("foo", "bar -y x", "-")));
-  FAIL_UNLESS("owl_util_uniq 3", 
-	      !strcmp("meep foo bar", owl_util_uniq("meep foo", "bar foo meep", "-")));
-
   /* if (numfailed) printf("*** WARNING: failures encountered with owl_util\n"); */
   printf("# END testing owl_util (%d failures)\n", numfailed);
Index: zcrypt.c
===================================================================
--- zcrypt.c	(revision 8412869342784413be6107a419653629f690937d)
+++ zcrypt.c	(revision f34dd65b3adbc2eedc045a674dd89b7e20257680)
@@ -66,204 +66,4 @@
 #define M_RANDOMIZE       4
 #define M_SETKEY          5
-
-int zcrypt(int argc, char *argv[]) {
-  char *fname = NULL;
-  int error = FALSE;
-  int zephyr = FALSE;
-  char *class = NULL, *instance = NULL;
-  int mode = M_NONE;
-
-  extern int optind, opterr;
-  extern char *optarg;
-  char c;
-
-  int messageflag = FALSE;
-  ZWRITEOPTIONS zoptions;
-  zoptions.flags = 0;
-
-  while ((c = getopt(argc, argv, "ZDERSF:c:i:advqtluons:f:m")) != (char)EOF) {
-    switch(c) {
-      case 'Z':
-        /* Zephyr encrypt */
-        mode = M_ZEPHYR_ENCRYPT;
-	break;
-      case 'D':
-        /* Decrypt */
-	mode = M_DECRYPT;
-	break;
-      case 'E':
-	/* Encrypt */
-	mode = M_ENCRYPT;
-	break;
-      case 'R':
-	/* Randomize the keyfile */
-	mode = M_RANDOMIZE;
-	break;
-      case 'S':
-	/* Set a new key value from stdin */
-	mode = M_SETKEY;
-	break;
-      case 'F':
-	/* Specify the keyfile explicitly */
-	if (fname != NULL) error = TRUE;
-	fname = optarg;
-	break;
-      case 'c':
-	/* Zwrite/zcrypt: class name */
-	if (class != NULL) error = TRUE;
-	class = optarg;
-	break;
-      case 'i':
-	/* Zwrite/zcrypt: instance name */
-	if (instance != NULL) error = TRUE;
-	instance = optarg;
-	break;
-      case 'a':
-	/* Zwrite: authenticate (default) */
-	zoptions.flags &= ~ZWRITE_OPT_NOAUTH;
-	break;
-      case 'd':
-	/* Zwrite: do not authenticate */
-	zoptions.flags |= ZWRITE_OPT_NOAUTH;
-	break;
-      case 'v':
-	/* Zwrite: verbose */
-	zoptions.flags |= ZWRITE_OPT_VERBOSE;
-	break;
-      case 'q':
-	/* Zwrite: quiet */
-	zoptions.flags |= ZWRITE_OPT_QUIET;
-	break;
-      case 't':
-	/* Zwrite: no expand tabs (ignored) */
-	break;
-      case 'l':
-	/* Zwrite: ignore '.' on a line by itself (ignored) */
-	zoptions.flags |= ZCRYPT_OPT_IGNOREDOT;
-	break;
-      case 'u':
-	/* Zwrite: urgent message */
-	instance = "URGENT";
-	break;
-      case 'o':
-	/* Zwrite: ignore zephyr variables zwrite-class, zwrite-inst, */
-	/*         zwrite-opcode */
-	zoptions.flags |= ZWRITE_OPT_IGNOREVARS;
-	break;
-      case 'n':
-	/* Zwrite: prevent PING message (always used) */
-	break;
-      case 's':
-	/* Zwrite: signature */
-	zoptions.flags |= ZWRITE_OPT_SIGNATURE;
-	zoptions.signature = optarg;
-	break;
-      case 'f':
-	/* Zwrite: file system specification (ignored) */
-	break;
-      case 'm':
-	/* Message on rest of line */
-	messageflag = TRUE;
-	break;
-      case '?':
-	error = TRUE;
-	break;
-    }
-    if (error || messageflag) break;
-  }
-
-  if (class != NULL || instance != NULL) {
-    zephyr = TRUE;
-  }
-
-  if (messageflag) {
-    zoptions.flags |= ZCRYPT_OPT_MESSAGE;
-    zoptions.message = BuildArgString(argv, optind, argc);
-    if (!zoptions.message)
-    {
-      printf("Memory allocation error.\n");
-      error = TRUE;
-    }
-  } else if (optind < argc) {
-    error = TRUE;
-  }
-
-  if (mode == M_NONE) mode = (zephyr?M_ZEPHYR_ENCRYPT:M_ENCRYPT);
-
-  if (mode == M_ZEPHYR_ENCRYPT && !zephyr) error = TRUE;
-
-  if (!error && fname == NULL && (class != NULL || instance != NULL)) {
-    fname = GetZephyrVarKeyFile(argv[0], class, instance);
-  }
-
-  
-  if (error || fname == NULL) {
-    printf("Usage: %s [-Z|-D|-E|-R|-S] [-F Keyfile] [-c class] [-i instance]\n", argv[0]);
-    printf("       [-advqtluon] [-s signature] [-f arg] [-m message]\n");
-    printf("  One or more of class, instance, and keyfile must be specified.\n");
-  } else {
-    if (mode == M_RANDOMIZE) {
-      /* Choose a new, random key */
-/*
-      FILE *fkey = fopen(fname, "w");
-      if (!fkey)
-	printf("Could not open key file for writing: %s\n", fname);
-      else
-      {
-	char string[100];
-	fputs(fkey, string);
-	fclose(fkey);
-	}
- */
-      printf("Feature not yet implemented.\n");
-    } else if (mode == M_SETKEY) {
-      /* Set a new, user-entered key */
-      char newkey[MAX_KEY];
-      FILE *fkey;
-      
-      if (isatty(0)) {
-	printf("Enter new key: ");
-	/* Really should read without echo!!! */
-	fgets(newkey, MAX_KEY - 1, stdin);
-      } else {
-	fgets(newkey, MAX_KEY - 1, stdin);
-      }
-
-      fkey = fopen(fname, "w");
-      if (!fkey) {
-	printf("Could not open key file for writing: %s\n", fname);
-      } else {
-	if (fputs(newkey, fkey) != strlen(newkey) || putc('\n', fkey) != '\n') {
-	  printf("Error writing to key file.\n");
-	  fclose(fkey);
-	} else {
-	  fclose(fkey);
-	  printf("Key update complete.\n");
-	}
-      }
-    } else {
-      /* Encrypt/decrypt */
-      FILE *fkey = fopen(fname, "r");
-      if (!fkey) {
-	printf("Could not open key file: %s\n", fname);
-      } else {
-	char keystring[MAX_KEY];
-	fgets(keystring, MAX_KEY-1, fkey);
-	if (mode == M_ZEPHYR_ENCRYPT || mode == M_ENCRYPT) {
-	  do_encrypt(keystring, (mode == M_ZEPHYR_ENCRYPT), class, instance,
-		     &zoptions, fname);
-	} else {
-	  do_decrypt(keystring);
-	}
-	fclose(fkey);
-      }
-    }
-  }
-
-  /* Always print the **END** message if -D is specified. */
-  if (mode == M_DECRYPT) printf("**END**\n");
-
-  exit(0);
-}
 
 /* The 'owl_zcrypt_decrypt' function was written by kretch for Owl.
@@ -384,37 +184,4 @@
 }
 
-/* Build a space-separated string from argv from elements between start  *
- * and end - 1.  owl_malloc()'s the returned string. */
-char *BuildArgString(char **argv, int start, int end) {
-  int len = 1;
-  int i;
-  char *result;
-
-  /* Compute the length of the string.  (Plus 1 or 2) */
-  for (i = start; i < end; i++) {
-    len += strlen(argv[i]) + 1;
-  }
-
-  /* Allocate memory */
-  result = (char *)owl_malloc(len);
-  if (result) {
-    /* Build the string */
-    char *ptr = result;
-    /* Start with an empty string, in case nothing is copied. */
-    *ptr = '\0';
-    /* Copy the arguments */
-    for (i = start; i < end; i++) {
-      char *temp = argv[i];
-      /* Add a space, if not the first argument */
-      if (i != start) *ptr++ = ' ';
-      /* Copy argv[i], leaving ptr pointing to the '\0' copied from temp */
-      while ((*ptr = *temp++)!=0) {
-	ptr++;
-      }
-    }
-  }
-
-  return(result);
-}
 
 #define MAX_BUFF 258
@@ -508,261 +275,3 @@
 static pid_t zephyrpipe_pid = 0;
 
-/* Open a pipe to zwrite */
-static FILE *GetZephyrPipe(char *class, char *instance, ZWRITEOPTIONS *zoptions) {
-  int fildes[2];
-  pid_t pid;
-  FILE *result;
-  char *argv[20];
-  int argc = 0;
-
-  if (pipe(fildes) < 0) return(NULL);
-  pid = fork();
-
-  if (pid < 0) {
-    /* Error: clean up */
-    close(fildes[0]);
-    close(fildes[1]);
-    result = NULL;
-  } else if (pid == 0) {
-    /* Setup child process */
-    argv[argc++] = "zwrite";
-    argv[argc++] = "-n";     /* Always send without ping */
-    if (class) {
-      argv[argc++] = "-c";
-      argv[argc++] = class;
-    }
-    if (instance) {
-      argv[argc++] = "-i";
-      argv[argc++] = instance;
-    }
-    if (zoptions->flags & ZWRITE_OPT_NOAUTH) argv[argc++] = "-d";
-    if (zoptions->flags & ZWRITE_OPT_QUIET) argv[argc++] = "-q";
-    if (zoptions->flags & ZWRITE_OPT_VERBOSE) argv[argc++] = "-v";
-    if (zoptions->flags & ZWRITE_OPT_SIGNATURE) {
-      argv[argc++] = "-s";
-      argv[argc++] = zoptions->signature;
-    }
-    argv[argc++] = "-O";
-    argv[argc++] = "crypt";
-    argv[argc] = NULL;
-    close(fildes[1]);
-    if (fildes[0] != STDIN_FILENO) {
-      if (dup2(fildes[0], STDIN_FILENO) != STDIN_FILENO) exit(0);
-      close(fildes[0]);
-    }
-    close(fildes[0]);
-    execvp(argv[0], argv);
-    printf("Exec error: could not run zwrite\n");
-    exit(0);
-  } else {
-    close(fildes[0]);
-    /* Create a FILE * for the zwrite pipe */
-    result = (FILE *)fdopen(fildes[1], "w");
-    zephyrpipe_pid = pid;
-  }
-
-  return(result);
-}
-
-/* Close the pipe to zwrite */
-void CloseZephyrPipe(FILE *pipe) {
-  fclose(pipe);
-  waitpid(zephyrpipe_pid, NULL, 0);
-  zephyrpipe_pid = 0;
-}
-
-#define MAX_RESULT 2048
-
-
-void block_to_ascii(char *output, FILE *outfile) {
-  int i;
-  for (i = 0; i < 8; i++) {
-    putc(((output[i] & 0xf0) >> 4) + BASE_CODE, outfile);
-    putc( (output[i] & 0x0f)       + BASE_CODE, outfile);
-  }
-}
-
-#define MAX_LINE 128
-
-/* Encrypt stdin, with prompt if isatty, and send to stdout, or to zwrite
-   if zephyr is set. */
-static int do_encrypt(char *keystring, int zephyr, char *class, char *instance, ZWRITEOPTIONS *zoptions, char* keyfile) {
-  des_cblock key;
-  des_key_schedule schedule;
-  char input[8], output[8];
-  int size;
-  FILE *outfile = stdout;
-  int error = FALSE;
-  char *inbuff = NULL, *inptr;
-  int freein = FALSE;
-  int use_buffer = FALSE;
-  int num_blocks=0, last_block_size=0;
-
-  des_string_to_key(keystring, key);
-  des_key_sched(key, schedule);
-
-  if (zephyr) {
-    if (zoptions->flags & ZCRYPT_OPT_MESSAGE) {
-      /* Use the -m message */
-      int length;
-      inbuff = zoptions->message;      
-      length = strlen(inbuff);
-      num_blocks = (length + 7) / 8;
-      last_block_size = ((length + 7) % 8) + 1;
-      use_buffer = TRUE;
-    } else if (isatty(0)) {
-      /* tty input, so show the "Type your message now..." message */
-      if (zoptions->flags & ZCRYPT_OPT_IGNOREDOT) {
-	printf("Type your message now.  End with the end-of-file character.\n");
-      } else {
-	printf("Type your message now.  End with control-D or a dot on a line by itself.\n");
-      }
-      use_buffer = TRUE;
-      if ((inptr = inbuff = (char *)owl_malloc(MAX_RESULT)) == NULL) {
-	printf("Memory allocation error\n");
-	return FALSE;
-      }
-      while (inptr - inbuff < MAX_RESULT - MAX_LINE - 20) {
-	fgets(inptr, MAX_LINE, stdin);
-	if (inptr[0]) {
-	  if (inptr[0] == '.' && inptr[1] == '\n' && 
-	      !(zoptions->flags & ZCRYPT_OPT_IGNOREDOT)) {
-	    inptr[0] = '\0';
-	    break;
-	  } else {
-	    inptr += strlen(inptr);
-	  }
-	} else {
-	  break;
-	}
-      }
-      num_blocks = (inptr - inbuff + 7) / 8;
-      last_block_size = ((inptr - inbuff + 7) % 8) + 1;
-      freein = TRUE;
-    }
-
-    /* if (zephyr) */
-    outfile = GetZephyrPipe(class, instance, zoptions);
-    if (!outfile) {
-      printf("Could not run zwrite\n");
-      if (freein && inbuff) {
-	owl_free(inbuff);
-      }
-      return(FALSE);
-    }
-  }
-
-  inptr = inbuff;
-
-  /* Encrypt the input (inbuff or stdin) and send it to outfile */
-  while (TRUE) {
-    if (use_buffer) {
-      /* Get 8 bytes from buffer */
-      if (num_blocks > 1) {
-	size = 8;
-	memcpy(input, inptr, size);
-	inptr += 8;
-	num_blocks--;
-      } else if (num_blocks == 1) {
-	size = last_block_size;
-	memcpy(input, inptr, size);
-	num_blocks--;
-      } else {
-	size = 0;
-      }
-    } else {
-      /* Get 8 bytes from stdin */
-      size = fread(input, 1, 8, stdin);
-    }
-
-    /* Check for EOF and pad the string to 8 chars, if needed */
-    if (size == 0) break;     /* END OF INPUT: BREAK FROM while LOOP! */
-      
-    if (size < 8) memset(input + size, 0, 8 - size);
-
-    /* Encrypt and output the block */
-    des_ecb_encrypt(input, output, schedule, TRUE);
-    block_to_ascii(output, outfile);
-
-    if (size < 8) break;
-  }
-
-  /* Close out the output */
-  if (!error) putc('\n', outfile);
-  if (zephyr) CloseZephyrPipe(outfile);
-
-  /* Free the input buffer, if necessary */
-  if (freein && inbuff) owl_free(inbuff);
-
-  return(!error);
-}
-
-/* Read a half-byte from stdin, skipping invalid characters.  Returns -1
-   if at EOF or file error */
-int read_ascii_nybble() {
-  char c;
-
-  while (TRUE) {
-    if (fread(&c, 1, 1, stdin) == 0) {
-      return(-1);
-    } else if (c >= BASE_CODE && c <= LAST_CODE) {
-      return(c - BASE_CODE);
-    }
-  }
-}
-
-/* Read both halves of the byte and return the single byte.  Returns -1
-   if at EOF or file error. */
-int read_ascii_byte() {
-  int c1, c2;
-  c1 = read_ascii_nybble();
-  if (c1 >= 0) {
-    c2 = read_ascii_nybble();
-    if (c2 >= 0) {
-      return c1 * 0x10 + c2;
-    }
-  }
-  return(-1);
-}
-
-/* Read an 8-byte DES block from stdin */
-int read_ascii_block(char *input) {
-  int c, i;
-
-  for (i = 0; i < 8; i++) {
-    c = read_ascii_byte();
-    if (c < 0) return(FALSE);
-    input[i] = c;
-  }
-
-  return(TRUE);
-}
-
-/* Decrypt stdin */
-int do_decrypt(char *keystring) {
-  des_cblock key;
-  des_key_schedule schedule;
-  char input[8], output[9];
-
-  output[0] = '\0';    /* In case no message at all                 */
-  output[8] = '\0';    /* NULL at end will limit string length to 8 */
-
-  des_string_to_key(keystring, key);
-  des_key_sched(key, schedule);
-
-  while (read_ascii_block(input)) {
-    des_ecb_encrypt(input, output, schedule, FALSE);
-    printf("%s", output);
-  }
-
-  if (output[0]) {
-    if (output[strlen(output)-1] != '\n') {
-      printf("\n");
-    }
-  } else {
-    printf("\n");
-  }
-  return(0);
-}
-
-#endif
+#endif
