? data_type.patch
? file
? doc/.dirstamp
? gl/Makefile
? gl/Makefile.am
? gl/Makefile.in
? gl/alloca.c
? gl/alloca_.h
? gl/asnprintf.c
? gl/asprintf.c
? gl/c-ctype.c
? gl/c-ctype.h
? gl/c-strtod.c
? gl/c-strtod.h
? gl/config.charset
? gl/error.c
? gl/error.h
? gl/exit.h
? gl/exitfail.c
? gl/exitfail.h
? gl/full-read.c
? gl/full-read.h
? gl/full-write.c
? gl/full-write.h
? gl/getdelim.c
? gl/getdelim.h
? gl/gethostname.c
? gl/getline.c
? gl/getline.h
? gl/getlogin_r.c
? gl/getlogin_r.h
? gl/getopt.c
? gl/getopt1.c
? gl/getopt_.h
? gl/getopt_int.h
? gl/gettext.h
? gl/intprops.h
? gl/lbrkprop.h
? gl/linebreak.c
? gl/linebreak.h
? gl/localcharset.c
? gl/localcharset.h
? gl/mbchar.c
? gl/mbchar.h
? gl/mbuiter.h
? gl/memcasecmp.c
? gl/memcasecmp.h
? gl/memchr.c
? gl/memcmp.c
? gl/memmem.c
? gl/memmem.h
? gl/memmove.c
? gl/memset.c
? gl/minmax.h
? gl/printf-args.c
? gl/printf-args.h
? gl/printf-parse.c
? gl/printf-parse.h
? gl/progname.c
? gl/progname.h
? gl/readlink.c
? gl/ref-add.sin
? gl/ref-del.sin
? gl/safe-read.c
? gl/safe-read.h
? gl/safe-write.c
? gl/safe-write.h
? gl/size_max.h
? gl/snprintf.c
? gl/snprintf.h
? gl/stat-macros.h
? gl/stdbool_.h
? gl/stdint_.h
? gl/stpcpy.c
? gl/stpcpy.h
? gl/strcase.h
? gl/strcasecmp.c
? gl/strcspn.c
? gl/strerror.c
? gl/strftime.c
? gl/strftime.h
? gl/strncasecmp.c
? gl/strndup.c
? gl/strndup.h
? gl/strnlen.c
? gl/strnlen.h
? gl/strnlen1.c
? gl/strnlen1.h
? gl/strpbrk.c
? gl/strpbrk.h
? gl/strsep.c
? gl/strsep.h
? gl/strstr.c
? gl/strstr.h
? gl/strtod.c
? gl/strtok_r.c
? gl/strtok_r.h
? gl/strtol.c
? gl/strtoul.c
? gl/time_r.c
? gl/time_r.h
? gl/utf16-ucs4.h
? gl/utf8-ucs4.h
? gl/vasnprintf.c
? gl/vasnprintf.h
? gl/vasprintf.c
? gl/vasprintf.h
? gl/vsnprintf.c
? gl/vsnprintf.h
? gl/xalloc-die.c
? gl/xalloc.h
? gl/xasprintf.c
? gl/xmalloc.c
? gl/xreadlink.c
? gl/xreadlink.h
? gl/xsize.h
? gl/xstrndup.c
? gl/xstrndup.h
? gl/xvasprintf.c
? gl/xvasprintf.h
? gl/m4/alloca.m4
? gl/m4/assert.m4
? gl/m4/c-strtod.m4
? gl/m4/codeset.m4
? gl/m4/eoverflow.m4
? gl/m4/error.m4
? gl/m4/exitfail.m4
? gl/m4/extensions.m4
? gl/m4/getdelim.m4
? gl/m4/gethostname.m4
? gl/m4/getline.m4
? gl/m4/getlogin_r.m4
? gl/m4/getopt.m4
? gl/m4/gettext.m4
? gl/m4/glibc2.m4
? gl/m4/glibc21.m4
? gl/m4/gnulib-cache.m4
? gl/m4/gnulib-comp.m4
? gl/m4/gnulib-tool.m4
? gl/m4/iconv.m4
? gl/m4/intdiv0.m4
? gl/m4/intmax.m4
? gl/m4/intmax_t.m4
? gl/m4/inttypes-pri.m4
? gl/m4/inttypes.m4
? gl/m4/inttypes_h.m4
? gl/m4/isc-posix.m4
? gl/m4/lcmessage.m4
? gl/m4/lib-ld.m4
? gl/m4/lib-link.m4
? gl/m4/lib-prefix.m4
? gl/m4/linebreak.m4
? gl/m4/localcharset.m4
? gl/m4/longdouble.m4
? gl/m4/longlong.m4
? gl/m4/mbchar.m4
? gl/m4/mbiter.m4
? gl/m4/mbrtowc.m4
? gl/m4/mbstate_t.m4
? gl/m4/memcasecmp.m4
? gl/m4/memchr.m4
? gl/m4/memcmp.m4
? gl/m4/memmem.m4
? gl/m4/memmove.m4
? gl/m4/memset.m4
? gl/m4/minmax.m4
? gl/m4/nls.m4
? gl/m4/onceonly_2_57.m4
? gl/m4/po.m4
? gl/m4/printf-posix.m4
? gl/m4/progtest.m4
? gl/m4/readlink.m4
? gl/m4/restrict.m4
? gl/m4/safe-read.m4
? gl/m4/safe-write.m4
? gl/m4/signed.m4
? gl/m4/size_max.m4
? gl/m4/snprintf.m4
? gl/m4/ssize_t.m4
? gl/m4/stat-macros.m4
? gl/m4/stdarg.m4
? gl/m4/stdbool.m4
? gl/m4/stdint.m4
? gl/m4/stdint_h.m4
? gl/m4/stpcpy.m4
? gl/m4/strcase.m4
? gl/m4/strcspn.m4
? gl/m4/strerror.m4
? gl/m4/strerror_r.m4
? gl/m4/strftime.m4
? gl/m4/strndup.m4
? gl/m4/strnlen.m4
? gl/m4/strpbrk.m4
? gl/m4/strsep.m4
? gl/m4/strstr.m4
? gl/m4/strtod.m4
? gl/m4/strtok_r.m4
? gl/m4/strtol.m4
? gl/m4/strtoul.m4
? gl/m4/time_r.m4
? gl/m4/tm_gmtoff.m4
? gl/m4/uintmax_t.m4
? gl/m4/ulonglong.m4
? gl/m4/unistd_h.m4
? gl/m4/utf-ucs4.m4
? gl/m4/vasnprintf.m4
? gl/m4/vasprintf.m4
? gl/m4/vsnprintf.m4
? gl/m4/wchar_t.m4
? gl/m4/wint_t.m4
? gl/m4/xalloc.m4
? gl/m4/xreadlink.m4
? gl/m4/xsize.m4
? gl/m4/xstrndup.m4
? gl/m4/xvasprintf.m4
? intl/ChangeLog
? intl/Makefile
? intl/Makefile.in
? intl/VERSION
? intl/bindtextdom.c
? intl/config.charset
? intl/dcgettext.c
? intl/dcigettext.c
? intl/dcngettext.c
? intl/dgettext.c
? intl/dngettext.c
? intl/eval-plural.h
? intl/explodename.c
? intl/finddomain.c
? intl/gettext.c
? intl/gettextP.h
? intl/gmo.h
? intl/hash-string.h
? intl/intl-compat.c
? intl/l10nflist.c
? intl/langprefs.c
? intl/libgnuintl.h.in
? intl/loadinfo.h
? intl/loadmsgcat.c
? intl/localcharset.c
? intl/localcharset.h
? intl/locale.alias
? intl/localealias.c
? intl/localename.c
? intl/log.c
? intl/ngettext.c
? intl/os2compat.c
? intl/os2compat.h
? intl/osdep.c
? intl/plural-exp.c
? intl/plural-exp.h
? intl/plural.c
? intl/plural.y
? intl/printf-args.c
? intl/printf-args.h
? intl/printf-parse.c
? intl/printf-parse.h
? intl/printf.c
? intl/ref-add.sin
? intl/ref-del.sin
? intl/relocatable.c
? intl/relocatable.h
? intl/textdomain.c
? intl/vasnprintf.c
? intl/vasnprintf.h
? intl/vasnwprintf.h
? intl/wprintf-parse.h
? intl/xsize.h
? lib/gsl-extras/.deps
? lib/gsl-extras/.dirstamp
? lib/gtksheet/.deps
? lib/gtksheet/.dirstamp
? lib/linreg/.deps
? lib/linreg/.dirstamp
? m4/Makefile.am
? m4/codeset.m4
? m4/gettext.m4
? m4/glibc2.m4
? m4/glibc21.m4
? m4/iconv.m4
? m4/intdiv0.m4
? m4/intmax.m4
? m4/inttypes-pri.m4
? m4/inttypes.m4
? m4/inttypes_h.m4
? m4/isc-posix.m4
? m4/lcmessage.m4
? m4/lib-ld.m4
? m4/lib-link.m4
? m4/lib-prefix.m4
? m4/longdouble.m4
? m4/longlong.m4
? m4/nls.m4
? m4/po.m4
? m4/printf-posix.m4
? m4/progtest.m4
? m4/signed.m4
? m4/size_max.m4
? m4/stdint_h.m4
? m4/uintmax_t.m4
? m4/ulonglong.m4
? m4/wchar_t.m4
? m4/wint_t.m4
? m4/xsize.m4
? src/data/.deps
? src/data/.dirstamp
? src/language/.deps
? src/language/.dirstamp
? src/language/control/.deps
? src/language/control/.dirstamp
? src/language/data-io/.deps
? src/language/data-io/.dirstamp
? src/language/dictionary/.deps
? src/language/dictionary/.dirstamp
? src/language/expressions/.deps
? src/language/expressions/.dirstamp
? src/language/lexer/.deps
? src/language/lexer/.dirstamp
? src/language/stats/.deps
? src/language/stats/.dirstamp
? src/language/tests/.deps
? src/language/tests/.dirstamp
? src/language/utilities/.deps
? src/language/utilities/.dirstamp
? src/language/xforms/.deps
? src/language/xforms/.dirstamp
? src/libpspp/.deps
? src/libpspp/.dirstamp
? src/libpspp/version.c
? src/math/.deps
? src/math/.dirstamp
? src/math/linreg/.deps
? src/math/linreg/.dirstamp
? src/math/ts/.deps
? src/math/ts/.dirstamp
? src/output/.deps
? src/output/.dirstamp
? src/output/charts/.deps
? src/output/charts/.dirstamp
? src/ui/gui/.deps
? src/ui/gui/.dirstamp
? src/ui/terminal/.deps
? src/ui/terminal/.dirstamp
? tests/libpspp/.deps
? tests/libpspp/.dirstamp
Index: src/data/case.c
===================================================================
RCS file: /sources/pspp/pspp/src/data/case.c,v
retrieving revision 1.4
diff -U3 -r1.4 case.c
--- src/data/case.c	7 May 2006 05:44:18 -0000	1.4
+++ src/data/case.c	13 Jul 2006 01:12:02 -0000
@@ -318,7 +318,7 @@
    IDX.
    (Note that the value is not null-terminated.)
    The caller must not modify the return value. */
-const char *
+const datum_t *
 case_str (const struct ccase *c, size_t idx) 
 {
   assert (c != NULL);
@@ -385,8 +385,8 @@
         }
       else 
         {
-          const char *as = case_str (ca, va->fv);
-          const char *bs = case_str (cb, vb->fv);
+          const datum_t *as = case_str (ca, va->fv);
+          const datum_t *bs = case_str (cb, vb->fv);
           int cmp = memcmp (as, bs, va->width);
 
           if (cmp != 0)
Index: src/data/case.h
===================================================================
RCS file: /sources/pspp/pspp/src/data/case.h,v
retrieving revision 1.4
diff -U3 -r1.4 case.h
--- src/data/case.h	7 May 2006 05:44:18 -0000	1.4
+++ src/data/case.h	13 Jul 2006 01:12:02 -0000
@@ -73,7 +73,7 @@
 
 CASE_INLINE const union value *case_data (const struct ccase *, size_t idx);
 CASE_INLINE double case_num (const struct ccase *, size_t idx);
-CASE_INLINE const char *case_str (const struct ccase *, size_t idx);
+CASE_INLINE const datum_t *case_str (const struct ccase *, size_t idx);
 
 CASE_INLINE union value *case_data_rw (struct ccase *, size_t idx);
 
@@ -175,7 +175,7 @@
   return c->case_data->values[idx].f;
 }
 
-static inline const char *
+static inline const datum_t *
 case_str (const struct ccase *c, size_t idx)
 {
   return c->case_data->values[idx].s;
Index: src/data/data-in.c
===================================================================
RCS file: /sources/pspp/pspp/src/data/data-in.c,v
retrieving revision 1.12
diff -U3 -r1.12 data-in.c
--- src/data/data-in.c	4 Jul 2006 04:39:04 -0000	1.12
+++ src/data/data-in.c	13 Jul 2006 01:12:02 -0000
@@ -568,10 +568,11 @@
 }
 
 
+
 static inline bool
 parse_A (struct data_in *i)
 {
-  buf_copy_rpad (i->v->s, i->format.w, i->s, i->e - i->s);
+  buf_copy_data_rpad (i->v->s, i->format.w, (datum_t *) i->s, i->e - i->s);
   
   return true;
 }
Index: src/data/data-out.c
===================================================================
RCS file: /sources/pspp/pspp/src/data/data-out.c,v
retrieving revision 1.6
diff -U3 -r1.6 data-out.c
--- src/data/data-out.c	8 Jul 2006 03:05:51 -0000	1.6
+++ src/data/data-out.c	13 Jul 2006 01:12:02 -0000
@@ -49,7 +49,7 @@
 
 static numeric_converter try_F, convert_infinite;
 
-typedef int string_converter (char *, const struct fmt_spec *, const char *);
+typedef int string_converter (char *, const struct fmt_spec *, const datum_t *);
 static string_converter convert_A, convert_AHEX;
 
 /* Converts binary value V into printable form in the exactly
@@ -164,7 +164,7 @@
   else 
     {
       /* String formatting. */
-      const char *string = v->s;
+      const datum_t *string = v->s;
 
       switch (fp->type) 
         {
@@ -390,14 +390,14 @@
 }
 
 static int
-convert_A (char *dst, const struct fmt_spec *fp, const char *string)
+convert_A (char *dst, const struct fmt_spec *fp, const datum_t *string)
 {
   memcpy(dst, string, fp->w);
   return 1;
 }
 
 static int
-convert_AHEX (char *dst, const struct fmt_spec *fp, const char *string)
+convert_AHEX (char *dst, const struct fmt_spec *fp, const datum_t *string)
 {
   int i;
 
Index: src/data/missing-values.c
===================================================================
RCS file: /sources/pspp/pspp/src/data/missing-values.c,v
retrieving revision 1.3
diff -U3 -r1.3 missing-values.c
--- src/data/missing-values.c	8 Jul 2006 03:05:51 -0000	1.3
+++ src/data/missing-values.c	13 Jul 2006 01:12:02 -0000
@@ -283,7 +283,7 @@
    NEW_WIDTH (inclusive) and OLD_WIDTH (exclusive),
    false otherwise. */
 static bool
-can_resize_string (const char *s, int old_width, int new_width) 
+can_resize_string (const datum_t *s, int old_width, int new_width) 
 {
   int i;
 
@@ -362,7 +362,7 @@
    MV must be a set of string missing values. 
    S[] must contain exactly as many characters as MV's width. */
 bool
-mv_is_str_missing (const struct missing_values *mv, const char s[])
+mv_is_str_missing (const struct missing_values *mv, const datum_t s[])
 {
   return mv_is_str_user_missing (mv, s);
 }
@@ -407,7 +407,7 @@
    S[] must contain exactly as many characters as MV's width. */
 bool
 mv_is_str_user_missing (const struct missing_values *mv,
-                        const char s[])
+                        const datum_t s[])
 {
   const union value *v = mv->values;
   assert (mv->width > 0);
Index: src/data/missing-values.h
===================================================================
RCS file: /sources/pspp/pspp/src/data/missing-values.h,v
retrieving revision 1.1
diff -U3 -r1.1 missing-values.h
--- src/data/missing-values.h	4 Mar 2006 01:11:57 -0000	1.1
+++ src/data/missing-values.h	13 Jul 2006 01:12:02 -0000
@@ -78,13 +78,13 @@
 /* Is a value system or user missing? */
 bool mv_is_value_missing (const struct missing_values *, const union value *);
 bool mv_is_num_missing (const struct missing_values *, double);
-bool mv_is_str_missing (const struct missing_values *, const char[]);
+bool mv_is_str_missing (const struct missing_values *, const datum_t[]);
 
 /* Is a value user missing? */
 bool mv_is_value_user_missing (const struct missing_values *,
                                const union value *);
 bool mv_is_num_user_missing (const struct missing_values *, double);
-bool mv_is_str_user_missing (const struct missing_values *, const char[]);
+bool mv_is_str_user_missing (const struct missing_values *, const datum_t[]);
 
 /* Is a value system missing? */
 bool mv_is_value_system_missing (const struct missing_values *,
Index: src/data/por-file-reader.c
===================================================================
RCS file: /sources/pspp/pspp/src/data/por-file-reader.c,v
retrieving revision 1.11
diff -U3 -r1.11 por-file-reader.c
--- src/data/por-file-reader.c	9 Jun 2006 22:51:23 -0000	1.11
+++ src/data/por-file-reader.c	13 Jul 2006 01:12:02 -0000
@@ -338,9 +338,10 @@
 }
 
 /* Reads a string into BUF, which must have room for 256
-   characters. */
+   characters.  The number of bytes read is placed into LEN.
+*/
 static void
-read_string (struct pfm_reader *r, char *buf)
+read_data (struct pfm_reader *r, datum_t *buf, int *len)
 {
   int n = read_int (r);
   if (n < 0 || n > 255)
@@ -352,18 +353,46 @@
       advance (r);
     }
   *buf = '\0';
+
+  *len = n;
+}
+
+/* Reads a string into BUF, which must have room for 256
+   characters.  The number of bytes read is placed into LEN.
+*/
+static void
+read_string (struct pfm_reader *r, char *buf, int *len)
+{
+  int n = read_int (r);
+  if (n < 0 || n > 255)
+    error (r, _("Bad string length %d."), n);
+  
+  while (n-- > 0)
+    {
+      *buf++ = r->cc;
+      advance (r);
+    }
+  *buf = '\0';
+
+  if ( len ) 
+    *len = n;
 }
 
+
+
 /* Reads a string and returns a copy of it allocated from R's
    pool. */
 static char *
 read_pool_string (struct pfm_reader *r) 
 {
+  int len;
   char string[256];
-  read_string (r, string);
+  read_string (r, string, &len);
   return pool_strdup (r->pool, string);
 }
+
 
+
 /* Reads the 464-byte file header. */
 static void
 read_header (struct pfm_reader *r)
@@ -415,8 +444,8 @@
 static void
 read_version_data (struct pfm_reader *r, struct pfm_read_info *info)
 {
-  static char empty_string[] = "";
-  char *date, *time, *product, *author, *subproduct;
+  static const char empty_string[] = "";
+  const char *date, *time, *product, *author, *subproduct;
   int i;
 
   /* Read file. */
@@ -525,7 +554,7 @@
 	error (r, _("Invalid variable width %d."), width);
       r->widths[i] = width;
 
-      read_string (r, name);
+      read_string (r, name, 0);
       for (j = 0; j < 6; j++)
         fmt[j] = read_int (r);
 
@@ -565,7 +594,7 @@
       if (match (r, 'C')) 
         {
           char label[256];
-          read_string (r, label);
+          read_string (r, label, 0);
           v->label = xstrdup (label); 
         }
     }
@@ -589,9 +618,10 @@
   
   if (vv->type == ALPHA) 
     {
-      char string[256];
-      read_string (r, string);
-      buf_copy_str_rpad (v.s, 8, string); 
+      int len;
+      datum_t data[256];
+      read_data (r, data, &len);
+      buf_copy_data_rpad (v.s, 8, data, len); 
     }
   else
     v.f = read_float (r);
@@ -617,7 +647,7 @@
   for (i = 0; i < nv; i++)
     {
       char name[256];
-      read_string (r, name);
+      read_string (r, name, 0);
 
       v[i] = dict_lookup_var (dict, name);
       if (v[i] == NULL)
@@ -637,7 +667,7 @@
       int j;
 
       val = parse_value (r, v[0]);
-      read_string (r, label);
+      read_string (r, label, 0);
 
       /* Assign the value_label's to each variable. */
       for (j = 0; j < nv; j++)
@@ -684,9 +714,10 @@
         }
       else
         {
-          char string[256];
-          read_string (r, string);
-          buf_copy_str_rpad (case_data_rw (c, idx)->s, width, string);
+	  int len;
+          datum_t data[256];
+          read_data (r, data, &len);
+          buf_copy_data_rpad (case_data_rw (c, idx)->s, width, data, len);
           idx += DIV_RND_UP (width, MAX_SHORT_STRING);
         }
     }
Index: src/data/sys-file-writer.c
===================================================================
RCS file: /sources/pspp/pspp/src/data/sys-file-writer.c,v
retrieving revision 1.12
diff -U3 -r1.12 sys-file-writer.c
--- src/data/sys-file-writer.c	9 Jun 2006 22:51:23 -0000	1.12
+++ src/data/sys-file-writer.c	13 Jul 2006 01:12:03 -0000
@@ -473,7 +473,7 @@
       if (v->type == NUMERIC)
         m[nm] = value.f;
       else
-        buf_copy_rpad ((char *) &m[nm], sizeof m[nm], value.s, v->width);
+        buf_copy_data_rpad ((datum_t *) &m[nm], sizeof m[nm], value.s, v->width);
       nm++;
     }
   if (mv_has_range (&v->miss))
@@ -911,7 +911,7 @@
 	      {
 		int chunk = MIN (MAX_LONG_STRING, v->width - ofs);
 		int nv = DIV_RND_UP (chunk, sizeof (flt64));
-		buf_copy_rpad ((char *) bounce_cur, nv * sizeof (flt64),
+		buf_copy_data_rpad ((datum_t *) bounce_cur, nv * sizeof (flt64),
 			       case_data (c, v->fv)->s + ofs, chunk);
 		bounce_cur += nv;
 		ofs += chunk;
Index: src/data/value.h
===================================================================
RCS file: /sources/pspp/pspp/src/data/value.h,v
retrieving revision 1.4
diff -U3 -r1.4 value.h
--- src/data/value.h	6 May 2006 23:04:05 -0000	1.4
+++ src/data/value.h	13 Jul 2006 01:12:03 -0000
@@ -21,9 +21,10 @@
 #define value_h 1
 
 #include <float.h>
-
 #include <config.h>
 
+#include <libpspp/types.h>
+
 /* Values. */
 
 /* Max length of a short string value, generally 8 chars. */
@@ -47,12 +48,13 @@
 #define LOWEST second_lowest_value
 #define HIGHEST DBL_MAX
 
+
 /* A numeric or short string value.
    Multiple consecutive values represent a long string. */
 union value
   {
     double f;
-    char s[MAX_SHORT_STRING];
+    datum_t s[MAX_SHORT_STRING];
   };
 
 /* Maximum number of `union value's in a single number or string
Index: src/language/line-buffer.h
===================================================================
RCS file: /sources/pspp/pspp/src/language/line-buffer.h,v
retrieving revision 1.5
diff -U3 -r1.5 line-buffer.h
--- src/language/line-buffer.h	10 Jul 2006 09:28:14 -0000	1.5
+++ src/language/line-buffer.h	13 Jul 2006 01:12:03 -0000
@@ -57,6 +57,8 @@
 
 bool getl_read_line (bool *interactive);
 
+void getl_location (const char **fn, int *ln);
+
 const char *getl_get_prompt (enum getl_prompt_style);
 void getl_set_prompt (enum getl_prompt_style, const char *);
 void getl_set_prompt_style (enum getl_prompt_style);
@@ -67,4 +69,5 @@
 void getl_location (const char **fn, int *ln);
 
 
+
 #endif /* line-buffer.h */
Index: src/language/stats/crosstabs.q
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/crosstabs.q,v
retrieving revision 1.13
diff -U3 -r1.13 crosstabs.q
--- src/language/stats/crosstabs.q	8 Jul 2006 03:05:51 -0000	1.13
+++ src/language/stats/crosstabs.q	13 Jul 2006 01:12:04 -0000
@@ -723,7 +723,7 @@
 	{
 	  assert (x->vars[i]->type == ALPHA);
 	  {
-	    const int diffstr = strncmp (a->values[i].s, b->values[i].s,
+	    const int diffstr = memcmp (a->values[i].s, b->values[i].s,
                                          x->vars[i]->width);
 	    if (diffstr)
 	      return diffstr;
@@ -1617,7 +1617,7 @@
   if (width == 0)
     return (a->f < b->f) ? -1 : (a->f > b->f);
   else
-    return strncmp (a->s, b->s, width);
+    return memcmp (a->s, b->s, width);
 }
 
 /* Given an array of ENTRY_CNT table_entry structures starting at
Index: src/language/xforms/recode.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/xforms/recode.c,v
retrieving revision 1.9
diff -U3 -r1.9 recode.c
--- src/language/xforms/recode.c	8 Jul 2006 03:05:52 -0000	1.9
+++ src/language/xforms/recode.c	13 Jul 2006 01:12:04 -0000
@@ -574,7 +574,7 @@
 /* Returns the output mapping in TRNS for an input of VALUE with
    the given WIDTH, or a null pointer if there is no mapping. */
 static const struct map_out *
-find_src_string (struct recode_trns *trns, const char *value, int width)
+find_src_string (struct recode_trns *trns, const datum_t *value, int width)
 {
   struct mapping *m;
 
Index: src/libpspp/pool.c
===================================================================
RCS file: /sources/pspp/pspp/src/libpspp/pool.c,v
retrieving revision 1.4
diff -U3 -r1.4 pool.c
--- src/libpspp/pool.c	8 Jul 2006 03:05:52 -0000	1.4
+++ src/libpspp/pool.c	13 Jul 2006 01:12:04 -0000
@@ -358,7 +358,7 @@
 
 /* Duplicates null-terminated STRING, within POOL, and returns a
    pointer to the duplicate.  For use only with strings, because
-   the returned pointere may not be aligned properly for other
+   the returned pointer may not be aligned properly for other
    types. */
 char *
 pool_strdup (struct pool *pool, const char *string) 
@@ -366,6 +366,14 @@
   return pool_clone_unaligned (pool, string, strlen (string) + 1);
 }
 
+datum_t *
+pool_datadup (struct pool *pool, const datum_t *data, int length) 
+{
+  return pool_clone_unaligned (pool, data, length);
+}
+
+
+
 /* Formats FORMAT with the given ARGS in memory allocated from
    POOL and returns the formatted string. */
 char *
Index: src/libpspp/pool.h
===================================================================
RCS file: /sources/pspp/pspp/src/libpspp/pool.h,v
retrieving revision 1.5
diff -U3 -r1.5 pool.h
--- src/libpspp/pool.h	9 May 2006 23:49:00 -0000	1.5
+++ src/libpspp/pool.h	13 Jul 2006 01:12:04 -0000
@@ -22,6 +22,7 @@
 
 #include <stdarg.h>
 #include <stdio.h>
+#include "types.h"
 #include "compiler.h"
 
 /* Maximum size of a suballocated block.  Larger blocks are allocated
@@ -64,6 +65,10 @@
 void *pool_alloc_unaligned (struct pool *, size_t) MALLOC_LIKE;
 void *pool_clone_unaligned (struct pool *, const void *, size_t) MALLOC_LIKE;
 char *pool_strdup (struct pool *, const char *) MALLOC_LIKE;
+
+datum_t *pool_datadup (struct pool *pool, const datum_t *data, 
+		       int length) MALLOC_LIKE;
+
 char *pool_vasprintf (struct pool *, const char *, va_list) 
      MALLOC_LIKE PRINTF_FORMAT (2, 0);
 char *pool_asprintf (struct pool *, const char *, ...)
Index: src/libpspp/str.c
===================================================================
RCS file: /sources/pspp/pspp/src/libpspp/str.c,v
retrieving revision 1.13
diff -U3 -r1.13 str.c
--- src/libpspp/str.c	9 Jun 2006 22:51:24 -0000	1.13
+++ src/libpspp/str.c	13 Jul 2006 01:12:05 -0000
@@ -173,6 +173,20 @@
     }
 }
 
+void 
+buf_copy_data_rpad (datum_t *dst, size_t dst_size, 
+		    const datum_t *src, size_t src_size)
+{
+  if (src_size >= dst_size)
+    memmove (dst, src, dst_size * sizeof (datum_t) );
+  else
+    {
+      memmove (dst, src, src_size * sizeof (datum_t) );
+      memset (&dst[src_size], ' ', (dst_size - src_size) * sizeof(datum_t));
+    }
+}
+
+
 /* Copies string SRC to string DST, which is in a buffer DST_SIZE
    bytes long.
    Truncates DST to DST_SIZE - 1 characters or right-pads with
Index: src/libpspp/str.h
===================================================================
RCS file: /sources/pspp/pspp/src/libpspp/str.h,v
retrieving revision 1.10
diff -U3 -r1.10 str.h
--- src/libpspp/str.h	9 Jun 2006 22:51:24 -0000	1.10
+++ src/libpspp/str.h	13 Jul 2006 01:12:05 -0000
@@ -26,6 +26,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include "types.h"
 #include "compiler.h"
 #include "memcasecmp.h"
 #include "memmem.h"
@@ -52,6 +53,7 @@
 int buf_compare_case (const char *, const char *, size_t);
 int buf_compare_rpad (const char *, size_t, const char *, size_t);
 void buf_copy_rpad (char *, size_t, const char *, size_t);
+void buf_copy_data_rpad (datum_t *, size_t, const datum_t *, size_t);
 void buf_copy_str_lpad (char *, size_t, const char *);
 void buf_copy_str_rpad (char *, size_t, const char *);
 
Index: src/libpspp/types.h
===================================================================
RCS file: src/libpspp/types.h
diff -N src/libpspp/types.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/libpspp/types.h	13 Jul 2006 01:12:05 -0000
@@ -0,0 +1,28 @@
+/* PSPP - computes sample statistics.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   Written by John Darrington <john@darrington.wattle.id.au>
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA. */
+
+#if !types_h
+#define types_h 1
+
+
+/* A type to be used for case data */
+typedef unsigned char datum_t;
+
+
+#endif /* types.h */
