#define _GNU_SOURCE #include #include #include enum stats_output_format_t { CSV, TXT, HTML, XML, ODOC }; struct stats_output_t { enum stats_output_format_t type; }; struct stats_output_t *create_stats(enum stats_output_format_t format) { struct stats_output_t *output=malloc(sizeof(struct stats_output_t)); output->type=format; switch (type) { case CSV: break; case HTML: printf("\n"); printf("\n"); printf("\n"); printf(" Report\n"); printf(" \n"); printf("\n"); printf("\n"); printf("

Report

\n"); printf("\n"); printf(" \n"); break; case XML: printf("\n"); printf("\n"); printf(" \n"); break; default: fprintf(stderr,"Unknown format\n"); break; } return output; } struct stats_output_t *add_column_heading(struct stats_output_t *out,char *heading,...) { va_list va; va_start(va,heading); vasprintf(&buf,heading,va); switch (out->type) { case CSV: } va_end(va); }