diff -ruN ../build/pointerize-0.3/src/trim-mo.c ./pointerize-0.3/src/trim-mo.c
--- ../build/pointerize-0.3/src/trim-mo.c       Mon Mar  8 05:18:53 1999
+++ ./pointerize-0.3/src/trim-mo.c      Sat Jan 15 14:08:26 2000
@@ -93,3 +104,97 @@
	fwrite (ptr, len + 1, 1, stdout);
     }
 }
+
+
+static int
+write_table_2 (struct loaded_domain *domain,
+	       struct loaded_domain *ref_domain)
+{
+  size_t cnt;
+  nls_uint32 nstrings_ref, nstrings, offset;
+  char **messages;
+
+  nstrings_ref = ref_domain->nstrings;
+  nstrings = domain->nstrings;
+
+  /* Write the header out.  */
+  fwrite (&nstrings_ref, sizeof (nstrings), 1, stdout);
+	       
+  /* allocate the space for messages */
+  if((messages = (char **)calloc (nstrings_ref, sizeof (char *))) == NULL) {
+    return (-1); /* can not allocate memory */
+  }
+
+  /* Now Get the Reference strings.  */
+  for (cnt = 0; cnt < nstrings_ref; ++cnt)
+    {
+      messages[cnt] = (char *) (ref_domain->data +
+		      ref_domain->orig_tab[cnt].offset);
+    }
+  
+  /* Now, array messages[] has all the Reference strings,
+   * and array len_msgs[] has all the length of strings in
+   * messages[]. We use these to find the translated
+   * messages using descOrig and descTrans and binary search
+   * in the sorted array of messages.
+   */
+  
+  /* These codes are based on dcgettext.c in GNU gettext */
+  for (cnt = 0; cnt < nstrings_ref; ++cnt)
+    {
+      size_t bottom, top, act;
+      const char *ref_ptr;
+
+      ref_ptr = messages[cnt];
+      bottom = 0;
+      top = nstrings;
+
+      while (bottom < top)
+	{
+	  int cmp_val;
+  
+	  act = (bottom + top) / 2;
+	  cmp_val = strcmp (ref_ptr, (char *)(domain->data+
+				     domain->orig_tab[act].offset));
+	  if (cmp_val < 0)
+	    top = act;
+	  else if (cmp_val > 0)
+	    bottom = act + 1;
+	  else
+	    break;
+	}
+
+      /* If an translation is found, replace messages[cnt] using it */
+      if (bottom < top) {
+	 messages[cnt] = (char *) domain->data +
+				  domain->trans_tab[act].offset;
+      }
+    }
+      
+  /* Set offset to first byte after all the tables.  */
+  offset = sizeof (nstrings) + nstrings_ref * sizeof (offset);
+  
+  /* Write out starting offset for all strings.  */
+  for (cnt = 0; cnt < nstrings_ref; ++cnt)
+    {
+      size_t len;
+	    
+      len = strlen (messages[cnt]);
+  
+      fwrite (&offset, sizeof (offset), 1, stdout);
+      offset += len + 1;
+    }
+
+  /* Now write all the strings.  */
+  for (cnt = 0; cnt < nstrings_ref; ++cnt)
+    {
+      size_t len;
+
+      len = strlen (messages[cnt]);
+      
+      fwrite (messages[cnt], len + 1, 1, stdout);
+    }
+  
+  return (0); /* Success! */
+}
+    
