+
+
+gboolean
+psppire_dict_rename_var (PsppireDict *dict, struct variable *v,
+ const gchar *name)
+{
+ if ( ! dict_id_is_valid (dict->dict, name, false))
+ return FALSE;
+
+ /* Make sure no other variable has this name */
+ if ( NULL != psppire_dict_lookup_var (dict, name))
+ return FALSE;
+
+ dict_rename_var (dict->dict, v, name);
+
+ return TRUE;
+}
+
+
+struct variable *
+psppire_dict_get_weight_variable (const PsppireDict *dict)
+{
+ return dict_get_weight (dict->dict);
+}
+
+
+
+#if DEBUGGING
+void
+psppire_dict_dump (const PsppireDict *dict)
+{
+ gint i;
+ const struct dictionary *d = dict->dict;
+
+ for (i = 0; i < dict_get_var_cnt (d); ++i)
+ {
+ const struct variable *v = psppire_dict_get_variable (dict, i);
+ int di = var_get_dict_index (v);
+ g_print ("`%s' idx=%d, fv=%d\n",
+ var_get_name(v),
+ di,
+ var_get_case_index(v));
+
+ }
+}
+#endif
+
+
+
+
+const gchar *
+psppire_dict_encoding (const PsppireDict *dict)
+{
+ return dict_get_encoding (dict->dict);
+}