1 /* -*- mode: C -*-  */
2 /*
3    IGraph library.
4    Copyright (C) 2006-2012  Gabor Csardi <csardi.gabor@gmail.com>
5    334 Harvard st, Cambridge MA, 02139 USA
6 
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11 
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc.,  51 Franklin Street, Fifth Floor, Boston, MA
20    02110-1301 USA
21 
22 */
23 
24 #include <igraph.h>
25 
main()26 int main() {
27 
28     igraph_t g;
29     FILE *ifile;
30 
31     /* turn on attribute handling */
32     /*   igraph_set_attribute_table(&igraph_cattribute_table); */
33 
34     ifile = fopen("pajek1.net", "r");
35     if (ifile == 0) {
36         return 1;
37     }
38     igraph_read_graph_pajek(&g, ifile);
39     fclose(ifile);
40     igraph_write_graph_pajek(&g, stdout);
41     igraph_destroy(&g);
42 
43     ifile = fopen("pajek2.net", "r");
44     if (ifile == 0) {
45         return 2;
46     }
47     igraph_read_graph_pajek(&g, ifile);
48     fclose(ifile);
49     igraph_write_graph_pajek(&g, stdout);
50     igraph_destroy(&g);
51 
52     ifile = fopen("pajek3.net", "r");
53     if (ifile == 0) {
54         return 3;
55     }
56     igraph_read_graph_pajek(&g, ifile);
57     fclose(ifile);
58     igraph_write_graph_pajek(&g, stdout);
59     igraph_destroy(&g);
60 
61     ifile = fopen("pajek4.net", "r");
62     if (ifile == 0) {
63         return 4;
64     }
65     igraph_read_graph_pajek(&g, ifile);
66     fclose(ifile);
67     igraph_write_graph_pajek(&g, stdout);
68     igraph_destroy(&g);
69 
70     return 0;
71 }
72