/* A pointer to the dictionary. Owned externally */
const struct dictionary *dict;
+
+ /* The scalar containing the dictionary */
+ SV *dict_sv;
};
MODULE = PSPP
-BOOT:
+MODULE = PSPP PACKAGE = PSPP
+
+void
+onBoot (ver)
+ const char *ver
+CODE:
+ assert (0 == strcmp (ver, bare_version));
msg_init (NULL, message_handler);
settings_init (0, 0);
fh_init ();
-
-MODULE = PSPP PACKAGE = PSPP
-
SV *
format_value (val, var)
SV *val
struct sysfile_info *
-pxs_create_sysfile (name, dict, opts_hr)
+pxs_create_sysfile (name, dict_ref, opts_hr)
char *name
- struct dictionary *dict
+ SV *dict_ref
SV *opts_hr
INIT:
+ SV *dict_sv = SvRV (dict_ref);
+ struct dictionary *dict = (void *) SvIV (dict_sv);
struct sfm_write_options opts;
if (!SvROK (opts_hr))
{
sfi->writer = sfm_open_writer (fh, dict, opts);
sfi->dict = dict;
sfi->opened = true;
+ sfi->dict_sv = dict_sv;
+ SvREFCNT_inc (sfi->dict_sv);
RETVAL = sfi;
OUTPUT:
struct sysfile_info *sfi
CODE:
sysfile_close (sfi);
+ SvREFCNT_dec (sfi->dict_sv);
free (sfi);
int
OUTPUT:
RETVAL
-