c-source">
            <pre>VALUE
c_TranslationUnit_get_diagnostic(VALUE self, VALUE num)
{
    TranslationUnit_t *t;
    Data_Get_Struct(self, TranslationUnit_t, t);
    unsigned int max;
    unsigned int c_num;
    VALUE diagnostic;

    max = clang_getNumDiagnostics(t-&gt;data);
    c_num = NUM2UINT(num);
    CHECK_IN_RANGE(c_num, 0, max);
    Diagnostic_t *d;
    R_GET_CLASS_DATA(&quot;Clangc&quot;, Diagnostic, diagnostic, d);
    d-&gt;data = clang_getDiagnostic(t-&gt;data, c_num);
    d-&gt;parent = s