projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clean up file handle code in preparation to add temporary file
[pspp]
/
src
/
sysfile-info.c
diff --git
a/src/sysfile-info.c
b/src/sysfile-info.c
index 45bffad762d22c03ce38434b757772ad5040931c..a9f074ab3be2ae6838f76ddd42afe1298fbf0d88 100644
(file)
--- a/
src/sysfile-info.c
+++ b/
src/sysfile-info.c
@@
-29,6
+29,7
@@
#include "file-handle.h"
#include "hash.h"
#include "lexer.h"
#include "file-handle.h"
#include "hash.h"
#include "lexer.h"
+#include "magic.h"
#include "misc.h"
#include "output.h"
#include "sfm-read.h"
#include "misc.h"
#include "output.h"
#include "sfm-read.h"
@@
-97,7
+98,7
@@
cmd_sysfile_info (void)
t = tab_create (2, 9, 0);
tab_vline (t, TAL_1 | TAL_SPACING, 1, 0, 8);
tab_text (t, 0, 0, TAB_LEFT, _("File:"));
t = tab_create (2, 9, 0);
tab_vline (t, TAL_1 | TAL_SPACING, 1, 0, 8);
tab_text (t, 0, 0, TAB_LEFT, _("File:"));
- tab_text (t, 1, 0, TAB_LEFT,
handle
_get_filename (h));
+ tab_text (t, 1, 0, TAB_LEFT,
fh
_get_filename (h));
tab_text (t, 0, 1, TAB_LEFT, _("Label:"));
{
const char *label = dict_get_label (d);
tab_text (t, 0, 1, TAB_LEFT, _("Label:"));
{
const char *label = dict_get_label (d);
@@
-171,7
+172,7
@@
cmd_sysfile_info (void)
static void display_macros (void);
static void display_documents (void);
static void display_macros (void);
static void display_documents (void);
-static void display_variables (struct variable **,
in
t, int);
+static void display_variables (struct variable **,
size_
t, int);
static void display_vectors (int sorted);
int
static void display_vectors (int sorted);
int
@@
-181,7
+182,7
@@
cmd_display (void)
int sorted;
/* Variables to display. */
int sorted;
/* Variables to display. */
-
in
t n;
+
size_
t n;
struct variable **vl;
if (lex_match_id ("MACROS"))
struct variable **vl;
if (lex_match_id ("MACROS"))
@@
-247,7
+248,7
@@
cmd_display (void)
if (as == AS_SCRATCH)
{
if (as == AS_SCRATCH)
{
-
in
t i, m;
+
size_
t i, m;
for (i = 0, m = n; i < n; i++)
if (dict_class_from_id (vl[i]->name) != DC_SCRATCH)
{
for (i = 0, m = n; i < n; i++)
if (dict_class_from_id (vl[i]->name) != DC_SCRATCH)
{
@@
-341,7
+342,7
@@
variables_dim (struct tab_table *t, struct outp_driver *d)
}
static void
}
static void
-display_variables (struct variable **vl,
in
t n, int as)
+display_variables (struct variable **vl,
size_
t n, int as)
{
struct variable **vp = vl; /* Variable pointer. */
struct tab_table *t;
{
struct variable **vp = vl; /* Variable pointer. */
struct tab_table *t;
@@
-349,7
+350,7
@@
display_variables (struct variable **vl, int n, int as)
int nr; /* Number of rows. */
int pc; /* `Position column' */
int r; /* Current row. */
int nr; /* Number of rows. */
int pc; /* `Position column' */
int r; /* Current row. */
-
in
t i;
+
size_
t i;
_as = as;
switch (as)
_as = as;
switch (as)
@@
-575,7
+576,7
@@
display_vectors (int sorted)
return;
}
return;
}
- vl = x
malloc (sizeof *vl * nvec
);
+ vl = x
nmalloc (nvec, sizeof *vl
);
for (i = 0; i < nvec; i++)
vl[i] = dict_get_vector (default_dict, i);
if (sorted)
for (i = 0; i < nvec; i++)
vl[i] = dict_get_vector (default_dict, i);
if (sorted)