- {
- tab_text (t, 0, r, TAB_LEFT, _("Product:"));
- tab_text (t, 1, r++, TAB_LEFT, info.product_ext);
- }
-
- tab_text (t, 0, r, TAB_LEFT, _("Integer Format:"));
- tab_text (t, 1, r++, TAB_LEFT,
- info.integer_format == INTEGER_MSB_FIRST ? _("Big Endian")
- : info.integer_format == INTEGER_LSB_FIRST ? _("Little Endian")
- : _("Unknown"));
-
- tab_text (t, 0, r, TAB_LEFT, _("Real Format:"));
- tab_text (t, 1, r++, TAB_LEFT,
- info.float_format == FLOAT_IEEE_DOUBLE_LE ? _("IEEE 754 LE.")
- : info.float_format == FLOAT_IEEE_DOUBLE_BE ? _("IEEE 754 BE.")
- : info.float_format == FLOAT_VAX_D ? _("VAX D.")
- : info.float_format == FLOAT_VAX_G ? _("VAX G.")
- : info.float_format == FLOAT_Z_LONG ? _("IBM 390 Hex Long.")
- : _("Unknown"));
-
- tab_text (t, 0, r, TAB_LEFT, _("Variables:"));
- tab_text_format (t, 1, r++, TAB_LEFT, "%zu", dict_get_var_cnt (d));
-
- tab_text (t, 0, r, TAB_LEFT, _("Cases:"));
- if (info.case_cnt == -1)
- tab_text (t, 1, r, TAB_LEFT, _("Unknown"));
- else
- tab_text_format (t, 1, r, TAB_LEFT, "%ld", (long int) info.case_cnt);
- r++;
-
- tab_text (t, 0, r, TAB_LEFT, _("Type:"));
- tab_text (t, 1, r++, TAB_LEFT, _("System File"));
-
- tab_text (t, 0, r, TAB_LEFT, _("Weight:"));
- {
- struct variable *weight_var = dict_get_weight (d);
- tab_text (t, 1, r++, TAB_LEFT,
- (weight_var != NULL
- ? var_get_name (weight_var) : _("Not weighted.")));
- }
-
- tab_text (t, 0, r, TAB_LEFT, _("Compression:"));
- tab_text_format (t, 1, r++, TAB_LEFT,
- info.compression == SFM_COMP_NONE ? _("None")
- : info.compression == SFM_COMP_SIMPLE ? "SAV"
- : "ZSAV");
-
- tab_text (t, 0, r, TAB_LEFT, _("Charset:"));
- tab_text (t, 1, r++, TAB_LEFT, dict_get_encoding (d));
-
- tab_submit (t);
-
- t = tab_create (4, 1 + 2 * dict_get_var_cnt (d));
- tab_headers (t, 0, 0, 1, 0);
- tab_text (t, 0, 0, TAB_LEFT | TAT_TITLE, _("Variable"));
- tab_joint_text (t, 1, 0, 2, 0, TAB_LEFT | TAT_TITLE, _("Description"));
- tab_text (t, 3, 0, TAB_LEFT | TAT_TITLE, _("Position"));
- tab_hline (t, TAL_2, 0, 3, 1);
- for (r = 1, i = 0; i < dict_get_var_cnt (d); i++)
- r = describe_variable (dict_get_var (d, i), t, r, 3,
- DF_ALL & ~DF_AT_ATTRIBUTES);
-
- tab_box (t, TAL_1, TAL_1, -1, -1, 0, 0, 3, r);
- tab_vline (t, TAL_1, 1, 0, r);
- tab_vline (t, TAL_1, 3, 0, r);
-
- tab_resize (t, -1, r);
- tab_submit (t);
-
- dict_destroy (d);
+ add_row (table, N_("Product"),
+ pivot_value_new_user_text (info.product_ext, -1));
+
+ add_row (table, N_("Integer Format"),
+ pivot_value_new_text (
+ info.integer_format == INTEGER_MSB_FIRST ? N_("Big Endian")
+ : info.integer_format == INTEGER_LSB_FIRST ? N_("Little Endian")
+ : N_("Unknown")));
+
+ add_row (table, N_("Real Format"),
+ pivot_value_new_text (
+ info.float_format == FLOAT_IEEE_DOUBLE_LE ? N_("IEEE 754 LE.")
+ : info.float_format == FLOAT_IEEE_DOUBLE_BE ? N_("IEEE 754 BE.")
+ : info.float_format == FLOAT_VAX_D ? N_("VAX D.")
+ : info.float_format == FLOAT_VAX_G ? N_("VAX G.")
+ : info.float_format == FLOAT_Z_LONG ? N_("IBM 390 Hex Long.")
+ : N_("Unknown")));
+
+ add_row (table, N_("Variables"),
+ pivot_value_new_integer (dict_get_var_cnt (d)));
+
+ add_row (table, N_("Cases"),
+ (info.case_cnt == -1
+ ? pivot_value_new_text (N_("Unknown"))
+ : pivot_value_new_integer (info.case_cnt)));
+
+ add_row (table, N_("Type"),
+ pivot_value_new_text (info.klass->name));
+
+ struct variable *weight_var = dict_get_weight (d);
+ add_row (table, N_("Weight"),
+ (weight_var
+ ? pivot_value_new_variable (weight_var)
+ : pivot_value_new_text (N_("Not weighted"))));
+
+ add_row (table, N_("Compression"),
+ (info.compression == ANY_COMP_NONE
+ ? pivot_value_new_text (N_("None"))
+ : pivot_value_new_user_text (
+ info.compression == ANY_COMP_SIMPLE ? "SAV" : "ZSAV", -1)));
+
+ add_row (table, N_("Encoding"),
+ pivot_value_new_user_text (dict_get_encoding (d), -1));
+
+ if (dict_get_document_line_cnt (d) > 0)
+ add_row (table, N_("Documents"),
+ pivot_value_new_user_text_nocopy (get_documents_as_string (d)));
+
+ pivot_table_submit (table);
+
+ size_t n_vars = dict_get_var_cnt (d);
+ const struct variable **vars = xnmalloc (n_vars, sizeof *vars);
+ for (size_t i = 0; i < dict_get_var_cnt (d); i++)
+ vars[i] = dict_get_var (d, i);
+ display_variables (vars, n_vars, DF_ALL_VARIABLE);
+ display_value_labels (vars, n_vars);
+ display_attributes (dict_get_attributes (dataset_dict (ds)),
+ vars, n_vars, DF_ATTRIBUTES);
+ free (vars);
+
+ dict_unref (d);