OUTPUT:
RETVAL
+
+struct variable *
+pxs_get_var_by_name (dict, name)
+ struct dictionary *dict
+ const char *name
+INIT:
+ SV *errstr = get_sv("PSPP::errstr", TRUE);
+ sv_setpv (errstr, "");
+CODE:
+ struct variable *var = dict_lookup_var (dict, name);
+ if ( ! var )
+ sv_setpv (errstr, "No such variable.");
+ RETVAL = var;
+ OUTPUT:
+RETVAL
+
+
MODULE = PSPP PACKAGE = PSPP::Var
return $var;
}
+=pod
+
+=head3 get_var_by_name ($name)
+
+Returns the variable from the dictionary whose name is C<name>.
+If there is no such variable, a null reference will be returned.
+
+=cut
+
+sub get_var_by_name
+{
+ my $dict = shift;
+ my $name = shift;
+ my $var = pxs_get_var_by_name ($dict, $name);
+
+ if ( ref $var )
+ {
+ bless ($var, "PSPP::Var");
+ }
+ return $var;
+}
+
package PSPP::Fmt;