pivot-table: Tolerate nulls in pivot_value_clone().
[pspp] / src / output / output-item.h
index b45e008720dee14132c1d03ee25ad49df982915a..b522df4c90d042f46fcb1c1c95025e0bcaaaa515 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2011 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 /* Output items.
 
-   An output item is a self-contained chunk of output.  The
-   following kinds of output items currently exist:
-
-        - Tables (see output/table-item.h).
-
-        - Charts (see output/chart-item.h).
-
-        - Text strings (see output/text-item.h).
-
-        - Messages (see output/message-item.h).
+   An output item is a self-contained chunk of output.  Several kinds of output
+   items exist.  See *-item.h for details.
 */
 
-#include <libpspp/cast.h>
 #include <stdbool.h>
+#include "libpspp/cast.h"
 
 /* A single output item. */
 struct output_item
@@ -43,10 +35,21 @@ struct output_item
        indicated by a reference count greater than 1.  When this is the case,
        the output item must not be modified. */
     int ref_cnt;
+
+    /* The localized label for the item that appears in the outline pane in the
+       PSPPIRE output viewer and in PDF outlines.  This is NULL if no label has
+       been explicitly set.
+
+       Use output_item_get_label() to read an item's label. */
+    char *label;
   };
 
 struct output_item *output_item_ref (const struct output_item *);
 void output_item_unref (struct output_item *);
 bool output_item_is_shared (const struct output_item *);
 
+const char *output_item_get_label (const struct output_item *);
+void output_item_set_label (struct output_item *, const char *);
+void output_item_set_label_nocopy (struct output_item *, char *);
+
 #endif /* output/output-item.h */