-/* PSPP - computes sample statistics.
+/* PSPP - a program for statistical analysis.
Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
- 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 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 3 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.
+ 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. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
{
struct dfm_writer *w;
void **aux;
-
+
aux = fh_open (fh, FH_REF_FILE, "data file", "ws");
if (aux == NULL)
return NULL;
/* Returns false if an I/O error occurred on WRITER, true otherwise. */
bool
-dfm_write_error (const struct dfm_writer *writer)
+dfm_write_error (const struct dfm_writer *writer)
{
return ferror (writer->file);
}
if (dfm_write_error (w))
return false;
- switch (fh_get_mode (w->fh))
+ switch (fh_get_mode (w->fh))
{
case FH_MODE_TEXT:
fwrite (rec, len, 1, w->file);
size_t write_bytes = MIN (len, record_width);
size_t pad_bytes = record_width - write_bytes;
fwrite (rec, write_bytes, 1, w->file);
- while (pad_bytes > 0)
+ while (pad_bytes > 0)
{
static const char spaces[32] = " ";
size_t chunk = MIN (pad_bytes, sizeof spaces);
if (fh_close (w->fh, "data file", "ws"))
{
free (file_name);
- return true;
+ return true;
}
ok = true;