projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Damn! Forgot to change casenum_t in *.q
[pspp-builds.git]
/
src
/
language
/
dictionary
/
sys-file-info.c
diff --git
a/src/language/dictionary/sys-file-info.c
b/src/language/dictionary/sys-file-info.c
index 98cc90ddfb9e600114de1b8712ff97b65c08c729..b2e016ae149d0288b12dc669b09009b00c40fe1b 100644
(file)
--- a/
src/language/dictionary/sys-file-info.c
+++ b/
src/language/dictionary/sys-file-info.c
@@
-18,25
+18,30
@@
02110-1301, USA. */
#include <config.h>
02110-1301, USA. */
#include <config.h>
-#include <libpspp/message.h>
+
#include <ctype.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdlib.h>
-#include <libpspp/array.h>
-#include <libpspp/alloc.h>
-#include <language/command.h>
+
#include <data/dictionary.h>
#include <data/dictionary.h>
-#include <libpspp/message.h>
#include <data/file-handle-def.h>
#include <data/file-handle-def.h>
-#include <libpspp/hash.h>
+#include <data/procedure.h>
+#include <data/sys-file-reader.h>
+#include <data/value-labels.h>
+#include <data/variable.h>
+#include <language/command.h>
+#include <language/data-io/file-handle.h>
#include <language/lexer/lexer.h>
#include <language/lexer/lexer.h>
+#include <language/lexer/variable-parser.h>
+#include <libpspp/alloc.h>
+#include <libpspp/array.h>
+#include <libpspp/hash.h>
#include <libpspp/magic.h>
#include <libpspp/magic.h>
+#include <libpspp/message.h>
+#include <libpspp/message.h>
#include <libpspp/misc.h>
#include <libpspp/misc.h>
-#include <output/output.h>
-#include <data/sys-file-reader.h>
#include <output/manager.h>
#include <output/manager.h>
+#include <output/output.h>
#include <output/table.h>
#include <output/table.h>
-#include <data/value-labels.h>
-#include <data/variable.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "gettext.h"
#define _(msgid) gettext (msgid)
@@
-73,7
+78,7
@@
sysfile_info_dim (struct tab_table *t, struct outp_driver *d)
/* SYSFILE INFO utility. */
int
/* SYSFILE INFO utility. */
int
-cmd_sysfile_info (
void
)
+cmd_sysfile_info (
struct dataset *ds UNUSED
)
{
struct file_handle *h;
struct dictionary *d;
{
struct file_handle *h;
struct dictionary *d;
@@
-96,9
+101,9
@@
cmd_sysfile_info (void)
sfm_close_reader (reader);
t = tab_create (2, 9, 0);
sfm_close_reader (reader);
t = tab_create (2, 9, 0);
- tab_vline (t, TAL_
1 | TAL_SPACING
, 1, 0, 8);
+ tab_vline (t, TAL_
GAP
, 1, 0, 8);
tab_text (t, 0, 0, TAB_LEFT, _("File:"));
tab_text (t, 0, 0, TAB_LEFT, _("File:"));
- tab_text (t, 1, 0, TAB_LEFT, fh_get_filename (h));
+ tab_text (t, 1, 0, TAB_LEFT, fh_get_file
_
name (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,12
+176,12
@@
cmd_sysfile_info (void)
/* DISPLAY utility. */
static void display_macros (void);
/* DISPLAY utility. */
static void display_macros (void);
-static void display_documents (
void
);
+static void display_documents (
const struct dictionary *dict
);
static void display_variables (struct variable **, size_t, int);
static void display_variables (struct variable **, size_t, int);
-static void display_vectors (int sorted);
+static void display_vectors (
const struct dictionary *dict,
int sorted);
int
int
-cmd_display (
void
)
+cmd_display (
struct dataset *ds
)
{
/* Whether to sort the list of variables alphabetically. */
int sorted;
{
/* Whether to sort the list of variables alphabetically. */
int sorted;
@@
-188,19
+193,19
@@
cmd_display (void)
if (lex_match_id ("MACROS"))
display_macros ();
else if (lex_match_id ("DOCUMENTS"))
if (lex_match_id ("MACROS"))
display_macros ();
else if (lex_match_id ("DOCUMENTS"))
- display_documents ();
+ display_documents (
dataset_dict (ds)
);
else if (lex_match_id ("FILE"))
{
som_blank_line ();
if (!lex_force_match_id ("LABEL"))
return CMD_FAILURE;
else if (lex_match_id ("FILE"))
{
som_blank_line ();
if (!lex_force_match_id ("LABEL"))
return CMD_FAILURE;
- if (dict_get_label (d
efault_dict
) == NULL)
+ if (dict_get_label (d
ataset_dict (ds)
) == NULL)
tab_output_text (TAB_LEFT,
_("The active file does not have a file label."));
else
{
tab_output_text (TAB_LEFT | TAT_TITLE, _("File label:"));
tab_output_text (TAB_LEFT,
_("The active file does not have a file label."));
else
{
tab_output_text (TAB_LEFT | TAT_TITLE, _("File label:"));
- tab_output_text (TAB_LEFT | TA
T_FIX, dict_get_label (default_dict
));
+ tab_output_text (TAB_LEFT | TA
B_FIX, dict_get_label (dataset_dict (ds)
));
}
}
else
}
}
else
@@
-226,7
+231,7
@@
cmd_display (void)
if (as == AS_VECTOR)
{
if (as == AS_VECTOR)
{
- display_vectors (sorted);
+ display_vectors (
dataset_dict(ds),
sorted);
return CMD_SUCCESS;
}
return CMD_SUCCESS;
}
@@
-236,7
+241,7
@@
cmd_display (void)
if (token != '.')
{
if (token != '.')
{
- if (!parse_variables (d
efault_dict
, &vl, &n, PV_NONE))
+ if (!parse_variables (d
ataset_dict (ds)
, &vl, &n, PV_NONE))
{
free (vl);
return CMD_FAILURE;
{
free (vl);
return CMD_FAILURE;
@@
-244,7
+249,7
@@
cmd_display (void)
as = AS_DICTIONARY;
}
else
as = AS_DICTIONARY;
}
else
- dict_get_vars (d
efault_dict
, &vl, &n, 0);
+ dict_get_vars (d
ataset_dict (ds)
, &vl, &n, 0);
if (as == AS_SCRATCH)
{
if (as == AS_SCRATCH)
{
@@
-284,9
+289,9
@@
display_macros (void)
}
static void
}
static void
-display_documents (
void
)
+display_documents (
const struct dictionary *dict
)
{
{
- const char *documents = dict_get_documents (d
efault_d
ict);
+ const char *documents = dict_get_documents (dict);
som_blank_line ();
if (documents == NULL)
som_blank_line ();
if (documents == NULL)
@@
-311,7
+316,7
@@
display_documents (void)
&& len > 0)
len--;
buf[len + 1] = 0;
&& len > 0)
len--;
buf[len + 1] = 0;
- tab_output_text (TAB_LEFT | TA
T
_FIX | TAT_NOWRAP, buf);
+ tab_output_text (TAB_LEFT | TA
B
_FIX | TAT_NOWRAP, buf);
}
}
}
}
}
}
@@
-478,11
+483,11
@@
describe_variable (struct variable *v, struct tab_table *t, int r, int as)
double x, y;
mv_pop_range (&mv, &x, &y);
if (x == LOWEST)
double x, y;
mv_pop_range (&mv, &x, &y);
if (x == LOWEST)
- cp +=
n
sprintf (cp, "LOWEST THRU %g", y);
+ cp += sprintf (cp, "LOWEST THRU %g", y);
else if (y == HIGHEST)
else if (y == HIGHEST)
- cp +=
n
sprintf (cp, "%g THRU HIGHEST", x);
+ cp += sprintf (cp, "%g THRU HIGHEST", x);
else
else
- cp +=
n
sprintf (cp, "%g THRU %g", x, y);
+ cp += sprintf (cp, "%g THRU %g", x, y);
cnt++;
}
while (mv_has_value (&mv))
cnt++;
}
while (mv_has_value (&mv))
@@
-490,9
+495,9
@@
describe_variable (struct variable *v, struct tab_table *t, int r, int as)
union value value;
mv_pop_value (&mv, &value);
if (cnt++ > 0)
union value value;
mv_pop_value (&mv, &value);
if (cnt++ > 0)
- cp +=
n
sprintf (cp, "; ");
+ cp += sprintf (cp, "; ");
if (v->type == NUMERIC)
if (v->type == NUMERIC)
- cp +=
n
sprintf (cp, "%g", value.f);
+ cp += sprintf (cp, "%g", value.f);
else
{
*cp++ = '"';
else
{
*cp++ = '"';
@@
-562,14
+567,14
@@
compare_vectors_by_name (const void *a_, const void *b_)
/* Display a list of vectors. If SORTED is nonzero then they are
sorted alphabetically. */
static void
/* Display a list of vectors. If SORTED is nonzero then they are
sorted alphabetically. */
static void
-display_vectors (int sorted)
+display_vectors (
const struct dictionary *dict,
int sorted)
{
const struct vector **vl;
int i;
struct tab_table *t;
size_t nvec;
{
const struct vector **vl;
int i;
struct tab_table *t;
size_t nvec;
- nvec = dict_get_vector_cnt (d
efault_d
ict);
+ nvec = dict_get_vector_cnt (dict);
if (nvec == 0)
{
msg (SW, _("No vectors defined."));
if (nvec == 0)
{
msg (SW, _("No vectors defined."));
@@
-578,7
+583,7
@@
display_vectors (int sorted)
vl = xnmalloc (nvec, sizeof *vl);
for (i = 0; i < nvec; i++)
vl = xnmalloc (nvec, sizeof *vl);
for (i = 0; i < nvec; i++)
- vl[i] = dict_get_vector (d
efault_d
ict, i);
+ vl[i] = dict_get_vector (dict, i);
if (sorted)
qsort (vl, nvec, sizeof *vl, compare_vectors_by_name);
if (sorted)
qsort (vl, nvec, sizeof *vl, compare_vectors_by_name);