*/
struct report_format pcp_fmt = {
.id = F_PCP_OUTPUT,
- .options = FO_HEADER_ONLY + FO_LOCAL_TIME + FO_NO_TRUE_TIME,
+ .options = FO_HEADER_ONLY + FO_LOCAL_TIME + FO_NO_TRUE_TIME +
+ FO_ITEM_LIST,
.f_header = print_pcp_header,
.f_statistics = print_pcp_statistics,
.f_timestamp = print_pcp_timestamp,
long cnt = 1;
char *pcparchive = (char *) dparm;
- /* Count items in file. Needed only for PCP output */
- if (format == F_PCP_OUTPUT) {
- count_file_items(ifd, file, file_magic, file_actlst, rectime, loctime);
+ if (CREATE_ITEM_LIST(fmt[f_position]->options)) {
+ /* Count items in file (e.g. for PCP output) */
+ if (!count_file_items(ifd, file, file_magic, file_actlst, rectime, loctime))
+ /* No record to display */
+ return;
}
/* Save current file position */
*/
#define FO_NO_TRUE_TIME 0x100
+/*
+ * Indicate that the number of different items should be counted and
+ * a list created (see @item_list and @item_list_sz in struct activity).
+ */
+#define FO_ITEM_LIST 0x200
+
#define SET_LC_NUMERIC_C(m) (((m) & FO_LC_NUMERIC_C) == FO_LC_NUMERIC_C)
#define ACCEPT_HEADER_ONLY(m) (((m) & FO_HEADER_ONLY) == FO_HEADER_ONLY)
#define ACCEPT_BAD_FILE_FORMAT(m) (((m) & FO_BAD_FILE_FORMAT) == FO_BAD_FILE_FORMAT)
#define DISPLAY_FIELD_LIST(m) (((m) & FO_FIELD_LIST) == FO_FIELD_LIST)
#define TEST_MARKUP(m) (((m) & FO_TEST_MARKUP) == FO_TEST_MARKUP)
#define REJECT_TRUE_TIME(m) (((m) & FO_NO_TRUE_TIME) == FO_NO_TRUE_TIME)
+#define CREATE_ITEM_LIST(m) (((m) & FO_ITEM_LIST) == FO_ITEM_LIST)
/*