projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added files in src/math
[pspp]
/
src
/
dfm-write.c
diff --git
a/src/dfm-write.c
b/src/dfm-write.c
index 762a53496a11bb8ef0b5ff575f72772051b2fe55..39aa7e387933b767bf4e13219e262f7ef0d0803b 100644
(file)
--- a/
src/dfm-write.c
+++ b/
src/dfm-write.c
@@
-14,8
+14,8
@@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
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., 5
9 Temple Place - Suite 330
, Boston, MA
- 0211
1-1307
, USA. */
+ Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA
+ 0211
0-1301
, USA. */
#include <config.h>
#include "dfm-write.h"
#include <config.h>
#include "dfm-write.h"
@@
-28,6
+28,9
@@
#include "filename.h"
#include "str.h"
#include "filename.h"
#include "str.h"
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
/* Data file writer. */
struct dfm_writer
{
/* Data file writer. */
struct dfm_writer
{
@@
-43,7
+46,7
@@
dfm_open_writer (struct file_handle *fh)
struct dfm_writer *w;
void **aux;
struct dfm_writer *w;
void **aux;
- aux = fh_open (fh, "data file", "ws");
+ aux = fh_open (fh,
FH_REF_FILE,
"data file", "ws");
if (aux == NULL)
return NULL;
if (*aux != NULL)
if (aux == NULL)
return NULL;
if (*aux != NULL)
@@
-54,7
+57,7
@@
dfm_open_writer (struct file_handle *fh)
w->file.file = NULL;
w->bounce = NULL;
w->file.file = NULL;
w->bounce = NULL;
- w->file.filename = xstrdup (
handle
_get_filename (w->fh));
+ w->file.filename = xstrdup (
fh
_get_filename (w->fh));
w->file.mode = "wb";
w->file.file = NULL;
w->file.sequence_no = NULL;
w->file.mode = "wb";
w->file.file = NULL;
w->file.sequence_no = NULL;
@@
-66,7
+69,7
@@
dfm_open_writer (struct file_handle *fh)
{
msg (ME, _("An error occurred while opening \"%s\" for writing "
"as a data file: %s."),
{
msg (ME, _("An error occurred while opening \"%s\" for writing "
"as a data file: %s."),
-
handle
_get_filename (w->fh), strerror (errno));
+
fh
_get_filename (w->fh), strerror (errno));
goto error;
}
goto error;
}
@@
-86,10
+89,10
@@
dfm_put_record (struct dfm_writer *w, const char *rec, size_t len)
{
assert (w != NULL);
{
assert (w != NULL);
- if (
handle_get_mode (w->fh) ==
MODE_BINARY
- && len <
handle
_get_record_width (w->fh))
+ if (
fh_get_mode (w->fh) == FH_
MODE_BINARY
+ && len <
fh
_get_record_width (w->fh))
{
{
- size_t rec_width =
handle
_get_record_width (w->fh);
+ size_t rec_width =
fh
_get_record_width (w->fh);
if (w->bounce == NULL)
w->bounce = xmalloc (rec_width);
memcpy (w->bounce, rec, len);
if (w->bounce == NULL)
w->bounce = xmalloc (rec_width);
memcpy (w->bounce, rec, len);
@@
-101,7
+104,7
@@
dfm_put_record (struct dfm_writer *w, const char *rec, size_t len)
if (fwrite (rec, len, 1, w->file.file) != 1)
{
msg (ME, _("Error writing file %s: %s."),
if (fwrite (rec, len, 1, w->file.file) != 1)
{
msg (ME, _("Error writing file %s: %s."),
-
handle
_get_name (w->fh), strerror (errno));
+
fh
_get_name (w->fh), strerror (errno));
err_cond_fail ();
return 0;
}
err_cond_fail ();
return 0;
}