X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-var-view.c;h=13db8e60e4c0cd2c78866cc4ac2cc07e9c625b18;hb=487ffe246e97caf4c0bc8d40b554f2e158982cec;hp=f8625d5bd749ec2df021c924d0891793b6e28b69;hpb=004d2b8ac3e73718f59117eab0d2b77d8ecb5b98;p=pspp diff --git a/src/ui/gui/psppire-var-view.c b/src/ui/gui/psppire-var-view.c index f8625d5bd7..13db8e60e4 100644 --- a/src/ui/gui/psppire-var-view.c +++ b/src/ui/gui/psppire-var-view.c @@ -21,6 +21,7 @@ #include "psppire-var-ptr.h" #include "psppire-select-dest.h" +#include #include #include @@ -371,6 +372,31 @@ psppire_var_view_append_names (PsppireVarView *vv, gint column, GString *string) return n_vars; } +/* Return a linked list of struct variables which are + contained in VV. + The caller is responsible for freeing the returned list. + The variables however are owned by their dictionary + and should not be freed. + */ +GSList * +psppire_var_view_list_names (PsppireVarView *vv, gint column) +{ + GtkTreeIter iter; + GSList *list = NULL; + + if ( psppire_var_view_get_iter_first (vv, &iter) ) + { + do + { + const struct variable *var = psppire_var_view_get_variable (vv, column, &iter); + list = g_slist_prepend (list, CONST_CAST (struct variable *, var)); + } + while (psppire_var_view_get_iter_next (vv, &iter)); + } + + return list; +} + /* Append the names of selected variables to STR