~ubuntu-branches/ubuntu/wily/igraph/wily-proposed

« back to all changes in this revision

Viewing changes to examples/simple/gml.c.xml

  • Committer: Package Import Robot
  • Author(s): Tamás Nepusz, Andreas Tille, Tamas Nepusz
  • Date: 2014-08-29 08:39:02 UTC
  • mfrom: (7.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140829083902-y4k2iu2mlizkq0o0
Tags: 0.7.1-2
[ Andreas Tille ]
* Move packagiong from SVN to Git

[ Tamas Nepusz ]
* Remove debian/patches/link_f2c.patch; f2c linkage not needed if
  BLAS, LAPACK and ARPACK are all linked dynamically
  Closes: #702882
* debian/patches/remove_unused_test_target.patch added to make
  dh_auto_test work
* debian/patches/fix_failing_tests.patch added to fix some failing
  test cases 
* debian/patches/cppflags_restore.patch added to fix incorrect
  handling of CPPFLAGS in the configure script
* debian/patches/drl_spelling_fix.patch added to fix a spelling
  error in the source and silence a lintian warning

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<programlisting linenumbering="numbered"><emphasis>/* -*- mode: C -*-  */</emphasis>
2
 
<emphasis>/* </emphasis>
3
 
<emphasis>   IGraph library.</emphasis>
4
 
<emphasis>   Copyright (C) 2007-2012  Gabor Csardi </emphasis>&lt;csardi.gabor@gmail.com&gt;
5
 
<emphasis>   334 Harvard street, Cambridge, MA 02139 USA</emphasis>
6
 
<emphasis>   </emphasis>
7
 
<emphasis>   This program is free software; you can redistribute it and/or modify</emphasis>
8
 
<emphasis>   it under the terms of the GNU General Public License as published by</emphasis>
9
 
<emphasis>   the Free Software Foundation; either version 2 of the License, or</emphasis>
10
 
<emphasis>   (at your option) any later version.</emphasis>
11
 
<emphasis>   </emphasis>
12
 
<emphasis>   This program is distributed in the hope that it will be useful,</emphasis>
13
 
<emphasis>   but WITHOUT ANY WARRANTY; without even the implied warranty of</emphasis>
14
 
<emphasis>   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</emphasis>
15
 
<emphasis>   GNU General Public License for more details.</emphasis>
16
 
<emphasis>   </emphasis>
17
 
<emphasis>   You should have received a copy of the GNU General Public License</emphasis>
18
 
<emphasis>   along with this program; if not, write to the Free Software</emphasis>
19
 
<emphasis>   Foundation, Inc.,  51 Franklin Street, Fifth Floor, Boston, MA </emphasis>
20
 
<emphasis>   02110-1301 USA</emphasis>
21
 
 
22
 
<emphasis>*/</emphasis>
23
 
 
24
 
<emphasis role="strong">#include</emphasis> &lt;igraph.h&gt;
25
 
<emphasis role="strong">#include</emphasis> &lt;stdio.h&gt;
26
 
 
27
 
int <emphasis role="strong">main</emphasis>() {
28
 
 
29
 
  igraph_t g;
30
 
  FILE *ifile;
31
 
  
32
 
  ifile=<emphasis role="strong">fopen</emphasis>("karate.gml", "r");
33
 
  <emphasis role="strong">if</emphasis> (ifile==0) {
34
 
    <emphasis role="strong">return</emphasis> 10;
35
 
  }
36
 
  
37
 
  <emphasis role="strong"><link linkend='igraph_read_graph_gml'>igraph_read_graph_gml</link></emphasis>(&amp;g, ifile);
38
 
  <emphasis role="strong">fclose</emphasis>(ifile);
39
 
 
40
 
  <emphasis role="strong">if</emphasis> (<emphasis role="strong"><link linkend='igraph_is_directed'>igraph_is_directed</link></emphasis>(&amp;g)) {
41
 
    <emphasis role="strong">printf</emphasis>("directed\n");
42
 
  } <emphasis role="strong">else</emphasis> {
43
 
    <emphasis role="strong">printf</emphasis>("undirected\n");
44
 
  }
45
 
    
46
 
  <emphasis role="strong"><link linkend='igraph_write_graph_edgelist'>igraph_write_graph_edgelist</link></emphasis>(&amp;g, stdout);
47
 
  <emphasis role="strong">printf</emphasis>("-----------------\n");
48
 
  <emphasis role="strong"><link linkend='igraph_write_graph_gml'>igraph_write_graph_gml</link></emphasis>(&amp;g, stdout, 0, "test suite");
49
 
  <emphasis role="strong"><link linkend='igraph_destroy'>igraph_destroy</link></emphasis>(&amp;g);
50
 
  
51
 
  <emphasis role="strong">return</emphasis> 0;
52
 
}
53
 
</programlisting>