Update all #include directives to the currently preferred style.
[pspp-builds.git] / src / language / data-io / data-reader.c
index 061505f889075cf2ea66d5709c1bc1e5563ad344..2cec413b759e24fdf9aa8554b4e02f0f323168de 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-2004, 2006, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-2004, 2006, 2010, 2011 Free Software Foundation, Inc.
 
    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
@@ -16,7 +16,7 @@
 
 #include <config.h>
 
-#include <language/data-io/data-reader.h>
+#include "language/data-io/data-reader.h"
 
 #include <ctype.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <sys/stat.h>
 
-#include <data/casereader.h>
-#include <data/file-handle-def.h>
-#include <data/file-name.h>
-#include <data/procedure.h>
-#include <language/command.h>
-#include <language/data-io/file-handle.h>
-#include <language/lexer/lexer.h>
-#include <language/prompt.h>
-#include <libpspp/assertion.h>
-#include <libpspp/cast.h>
-#include <libpspp/integer-format.h>
-#include <libpspp/message.h>
-#include <libpspp/str.h>
-
-#include "minmax.h"
-#include "xalloc.h"
+#include "data/casereader.h"
+#include "data/file-handle-def.h"
+#include "data/file-name.h"
+#include "data/procedure.h"
+#include "language/command.h"
+#include "language/data-io/file-handle.h"
+#include "language/lexer/lexer.h"
+#include "language/prompt.h"
+#include "libpspp/assertion.h"
+#include "libpspp/cast.h"
+#include "libpspp/integer-format.h"
+#include "libpspp/message.h"
+#include "libpspp/str.h"
+
+#include "gl/minmax.h"
+#include "gl/xalloc.h"
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -178,7 +178,7 @@ read_inline_record (struct dfm_reader *r)
     {
       r->flags |= DFM_SAW_BEGIN_DATA;
 
-      while (lex_token (r->lexer) == '.')
+      while (lex_token (r->lexer) == T_ENDCMD)
         lex_get (r->lexer);
       if (!lex_force_match_id (r->lexer, "BEGIN") || !lex_force_match_id (r->lexer, "DATA"))
         return false;
@@ -190,7 +190,7 @@ read_inline_record (struct dfm_reader *r)
       lex_discard_line (r->lexer);
       msg (SE, _("Unexpected end-of-file while reading data in BEGIN "
                  "DATA.  This probably indicates "
-                 "a missing or misformatted END DATA command.  "
+                 "a missing or incorrectly formatted END DATA command.  "
                  "END DATA must appear by itself on a single line "
                  "with exactly one space between words."));
       return false;
@@ -556,7 +556,7 @@ dfm_expand_tabs (struct dfm_reader *r)
   if (r->fh != fh_inline_file ()
       && (fh_get_mode (r->fh) != FH_MODE_TEXT
           || fh_get_tab_width (r->fh) == 0
-          || ds_find_char (&r->line, '\t') == SIZE_MAX))
+          || ds_find_byte (&r->line, '\t') == SIZE_MAX))
     return;
 
   /* Expand tabs from r->line into r->scratch, and figure out
@@ -573,11 +573,11 @@ dfm_expand_tabs (struct dfm_reader *r)
 
       c = ds_data (&r->line)[ofs];
       if (c != '\t')
-        ds_put_char (&r->scratch, c);
+        ds_put_byte (&r->scratch, c);
       else
         {
           do
-            ds_put_char (&r->scratch, ' ');
+            ds_put_byte (&r->scratch, ' ');
           while (ds_length (&r->scratch) % tab_width != 0);
         }
     }