proto = casereader_get_proto (reader);
nvals = caseproto_get_n_widths (proto);
-
+
for (; (c = casereader_read (reader)) != NULL; case_unref (c))
{
int i;
else
{
char *ss = xzalloc (width + 1);
- memcpy (ss, value_str (val, width), width);
-
+ memcpy (ss, val->s, width);
+
printf ("%s ", ss);
free (ss);
}
casereader_destroy (reader);
}
-static void
+static void
print_msg (const struct msg *m, void *aux UNUSED)
{
fprintf (stderr, "%s\n", m->text);
int
-main (int argc, char *argv[] )
+main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *hbox;
settings_init ();
gtk_init (&argc, &argv);
-
- if ( argc < 2)
+
+ if (argc < 2)
g_error ("Usage: prog file\n");
- msg_set_handler (print_msg, 0);
+ msg_set_handler (&(struct msg_handler) { .output_msg = print_msg });
stuff.sp = NULL;
if (stuff.sp == NULL)
stuff.sp = ods_probe (argv[1], false);
-
+
if (stuff.sp == NULL)
{
g_error ("%s is neither a gnumeric nor a ods file\n", argv[1]);
button = gtk_button_new_with_label ("Test reader");
g_signal_connect (button, "clicked", G_CALLBACK (on_clicked), &stuff);
-
+
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
-
+
stuff.combo_box = gtk_combo_box_new();
{
gtk_main ();
- spreadsheet_destroy (stuff.sp);
+ spreadsheet_unref (stuff.sp);
return 0;
}