X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Fdata-writer.c;h=0680fc410d0533df8e78b43ea566fea134da8794;hb=0730ccfa7528b67b7b2d699925668ea3a6e77b75;hp=6199e77264b1d87cdaef52c3ccabefc9fa051208;hpb=480a0746507ce73d26f528b56dc3ed80195096e0;p=pspp-builds.git diff --git a/src/language/data-io/data-writer.c b/src/language/data-io/data-writer.c index 6199e772..0680fc41 100644 --- a/src/language/data-io/data-writer.c +++ b/src/language/data-io/data-writer.c @@ -1,20 +1,18 @@ -/* PSPP - computes sample statistics. +/* PSPP - a program for statistical analysis. Copyright (C) 1997-2004, 2006 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 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 . */ #include @@ -49,7 +47,7 @@ dfm_open_writer (struct file_handle *fh) { struct dfm_writer *w; void **aux; - + aux = fh_open (fh, FH_REF_FILE, "data file", "ws"); if (aux == NULL) return NULL; @@ -77,7 +75,7 @@ dfm_open_writer (struct file_handle *fh) /* 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); } @@ -94,7 +92,7 @@ dfm_put_record (struct dfm_writer *w, const char *rec, size_t len) 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); @@ -107,7 +105,7 @@ dfm_put_record (struct dfm_writer *w, const char *rec, size_t len) 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); @@ -137,7 +135,7 @@ dfm_close_writer (struct dfm_writer *w) if (fh_close (w->fh, "data file", "ws")) { free (file_name); - return true; + return true; } ok = true;