title: Read a YAML file using a C script
body: <p>I would like to read a thin YAML file using a simple C program. I beleve the best way for this is to use the follow library: Pyyaml.org.</p>
  
  <p>After reading the wiki page, I have try to use some examples here:
  <a href="http://pyyaml.org/browser/libyaml/branches/stable/tests/" rel="nofollow noreferrer">http://pyyaml.org/browser/libyaml/branches/stable/tests/</a>
  But for a noob like me, it is not very simple to understand.</p>
  
  <p>If for example I get this more simple YAML file (named <strong>test.yml</strong>):</p>
  
  <pre><code>test:
    - {conf: hi}
    - {conf: test}
    - {conf: abc}
  </code></pre>
  
  <p>How can I do to do somethig like this:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(int argc, char **argv)
  {
    /* I do not really see how to load the file here... */
  
    char *conf[3] = {"hi", "test", "abc"}; /* configuration of the YAML file */
  
    int i;
    for (i = 0; i &lt; 3; i++)
    {
      printf("content: %s\n", conf[i]);
    }
  
    return 0;
  }
  </code></pre>
  
  <p>...but from the given YAML file?</p>
  
  <p>Many thanks for any suggestions!</p>