projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added automake.mk files in src/language
[pspp]
/
src
/
file-type.c
diff --git
a/src/file-type.c
b/src/file-type.c
index 6a706eec5c2d5a01412d007773450796e858f459..4c7c4a03075931aaa0bcf25f7b2e0b4e88f8cf15 100644
(file)
--- a/
src/file-type.c
+++ b/
src/file-type.c
@@
-33,6
+33,9
@@
#include "var.h"
#include "vfm.h"
#include "var.h"
#include "vfm.h"
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
/* Defines the three types of complex files read by FILE TYPE. */
enum
{
/* Defines the three types of complex files read by FILE TYPE. */
enum
{
@@
-71,8
+74,7
@@
struct record_type
int ft, lt; /* First, last transformation index. */
}; /* record_type */
int ft, lt; /* First, last transformation index. */
}; /* record_type */
-/* Represents a FILE TYPE input program. Does not contain a
- trns_header because it's never submitted as a transformation. */
+/* Represents a FILE TYPE input program. */
struct file_type_pgm
{
int type; /* One of the FTY_* constants. */
struct file_type_pgm
{
int type; /* One of the FTY_* constants. */
@@
-101,7
+103,7
@@
int
cmd_file_type (void)
{
static struct file_type_pgm *fty; /* FIXME: static? WTF? */
cmd_file_type (void)
{
static struct file_type_pgm *fty; /* FIXME: static? WTF? */
- struct file_handle *fh =
NULL
;
+ struct file_handle *fh =
fh_inline_file ()
;
/* Initialize. */
discard_variables ();
/* Initialize. */
discard_variables ();
@@
-137,7
+139,7
@@
cmd_file_type (void)
if (lex_match_id ("FILE"))
{
lex_match ('=');
if (lex_match_id ("FILE"))
{
lex_match ('=');
- fh = fh_parse ();
+ fh = fh_parse (
FH_REF_FILE | FH_REF_INLINE
);
if (fh == NULL)
goto error;
}
if (fh == NULL)
goto error;
}
@@
-277,7
+279,7
@@
cmd_file_type (void)
fty->reader = dfm_open_reader (fh);
if (fty->reader == NULL)
goto error;
fty->reader = dfm_open_reader (fh);
if (fty->reader == NULL)
goto error;
-
default_handle = fh
;
+
fh_set_default_handle (fh)
;
create_col_var (&fty->record);
if (fty->case_sbc.name[0])
create_col_var (&fty->record);
if (fty->case_sbc.name[0])
@@
-442,7
+444,7
@@
cmd_record_type (void)
if (rct->nv >= mv)
{
mv += 16;
if (rct->nv >= mv)
{
mv += 16;
- rct->v = x
realloc (rct->v, mv *
sizeof *rct->v);
+ rct->v = x
nrealloc (rct->v, mv,
sizeof *rct->v);
}
if (formats[fty->record.fmt].cat & FCAT_STRING)
}
if (formats[fty->record.fmt].cat & FCAT_STRING)
@@
-450,8
+452,8
@@
cmd_record_type (void)
if (!lex_force_string ())
goto error;
rct->v[rct->nv].c = xmalloc (fty->record.nc + 1);
if (!lex_force_string ())
goto error;
rct->v[rct->nv].c = xmalloc (fty->record.nc + 1);
-
st_bare_pad_copy (rct->v[rct->nv].c, ds_c_str (&tokstr)
,
-
fty->record.nc + 1
);
+
buf_copy_str_rpad (rct->v[rct->nv].c, fty->record.nc + 1
,
+
ds_c_str (&tokstr)
);
}
else
{
}
else
{