~ubuntu-branches/ubuntu/trusty/picviz/trusty

« back to all changes in this revision

Viewing changes to src/libpicviz/plugins/output/outcsv.c

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Chifflier
  • Date: 2009-03-30 10:42:08 UTC
  • Revision ID: james.westby@ubuntu.com-20090330104208-j095obwkp574t1lm
Tags: upstream-0.5
ImportĀ upstreamĀ versionĀ 0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Picviz - Parallel coordinates ploter
 
3
 * Copyright (C) 2008 Sebastien Tricaud <toady@gscore.org>
 
4
 *
 
5
 * This program is free software: you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation version 3.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 */
 
17
 
 
18
#include <stdio.h>
 
19
#include <string.h>
 
20
#include <stdlib.h>
 
21
 
 
22
#include <picviz.h>
 
23
 
 
24
 
 
25
void output(pcimage_t *i, char *arg _U_)
 
26
{
 
27
        struct axis_t *a;
 
28
        struct line_t *l;
 
29
        struct axisplot_t *axisplot;
 
30
        unsigned int axisnb = 0;
 
31
        unsigned int counter;
 
32
 
 
33
        llist_for_each_entry(a, &i->axes, list) {
 
34
                axisnb++;
 
35
        }
 
36
 
 
37
        llist_for_each_entry(l, &i->lines, list) {
 
38
                if (!l->hidden) {
 
39
                        counter = 0;
 
40
                        llist_for_each_entry(axisplot, &l->axisplot, list) {
 
41
                                counter++;
 
42
                                if (axisnb == counter)
 
43
                                        printf("%llu",axisplot->y);
 
44
                                else
 
45
                                        printf("%llu,",axisplot->y);
 
46
                        }
 
47
                        printf("\n");
 
48
                }
 
49
        }
 
50
 
 
51
}
 
52
 
 
53