<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ohcount: /Users/andy/dev/ohcount/src/sourcefile.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>/Users/andy/dev/ohcount/src/sourcefile.h File Reference</h1><code>#include "<a class="el" href="loc_8h_source.html">loc.h</a>"</code><br>
<code>#include "<a class="el" href="parsed__language_8h_source.html">parsed_language.h</a>"</code><br>
<p>
<a href="sourcefile_8h_source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structSourceFile.html">SourceFile</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new</a> (const char *filepath)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#0f98a5da511c34ff772e648ec13915ff">ohcount_sourcefile_set_diskpath</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile, const char *diskpath)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#46b6f512d9afd86e9f9d6c39bdbe9252">ohcount_sourcefile_set_contents</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile, const char *contents)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#d78d1d1726970dbcdb8b999f1ab7c175">ohcount_sourcefile_get_contents</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#f0bda4d5eb8ebae78653881196d1b2ea">ohcount_sourcefile_get_contents_size</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#f34b9fa3dc4968fe54d261404a6aa609">ohcount_sourcefile_set_language</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile, const char *language)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#4e26432b8859af9b569e7ceb76a0c4f2">ohcount_sourcefile_get_language</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#2be63654c50b188e223a349b27cdcb92">ohcount_sourcefile_parse</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structParsedLanguageListItem.html">ParsedLanguageList</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#ac4df12ae1934a82e8a5fa0418da898b">ohcount_sourcefile_get_parsed_language_list</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#b57d1d049bfd63e3afb384ca38503458">ohcount_sourcefile_parse_with_callback</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile, void(*callback)(const char *, const char *, int, int, void *), void *userdata)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#844a8c3940e726e944e087fdb519d24a">ohcount_sourcefile_parse_entities_with_callback</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile, void(*callback)(const char *, const char *, int, int, void *), void *userdata)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structLicenseListItem.html">LicenseList</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#c8301992dd8f9eb8af00f04404c8ddac">ohcount_sourcefile_get_license_list</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structLocListItem.html">LocList</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#6f2cfdb608e1b2c02546dd7f82c7f0ae">ohcount_sourcefile_get_loc_list</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structLocDeltaListItem.html">LocDeltaList</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#8095075cc741f56ec8e85856c8e33952">ohcount_sourcefile_diff</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *from, <a class="el" href="structSourceFile.html">SourceFile</a> *to)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structLocDelta.html">LocDelta</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#16576e970ec536ba779ce20426e4184b">ohcount_sourcefile_calc_loc_delta</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *from, const char *language, <a class="el" href="structSourceFile.html">SourceFile</a> *to)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#a2b205a57495f4362a89a415889e80dc">ohcount_sourcefile_set_filenames</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile, char **filenames)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char ** </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#f717654d914aaf5630438d84852690ea">ohcount_sourcefile_get_filenames</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#ecebea5934ca15350c7aefc0283f28c3">ohcount_sourcefile_free</a> (<a class="el" href="structSourceFile.html">SourceFile</a> *sourcefile)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structSourceFileListItem.html">SourceFileList</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#82c7b67a2f332af1da50bb86ee86d216">ohcount_sourcefile_list_new</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#9645f2e3e3cdf8a12b21c7658fe99d52">ohcount_sourcefile_list_add_file</a> (<a class="el" href="structSourceFileListItem.html">SourceFileList</a> *list, const char *filepath)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#0341ae7733a4f6d42af9723fe61ea7ca">ohcount_sourcefile_list_add_directory</a> (<a class="el" href="structSourceFileListItem.html">SourceFileList</a> *list, const char *directory)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structLocListItem.html">LocList</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#aa1f233ca6c060ad519feae0b535d95a">ohcount_sourcefile_list_analyze_languages</a> (<a class="el" href="structSourceFileListItem.html">SourceFileList</a> *list)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sourcefile_8h.html#6651000741c6ab4d4a17ed2ecb12aa7d">ohcount_sourcefile_list_free</a> (<a class="el" href="structSourceFileListItem.html">SourceFileList</a> *list)</td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="16576e970ec536ba779ce20426e4184b"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_calc_loc_delta" ref="16576e970ec536ba779ce20426e4184b" args="(SourceFile *from, const char *language, SourceFile *to)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structLocDelta.html">LocDelta</a>* ohcount_sourcefile_calc_loc_delta </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>from</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>language</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>to</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns a <a class="el" href="structLocDelta.html" title="Tracks changes in lines of code, comments, and blank lines for a single language...">LocDelta</a> reflecting the changes from one revision of a <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> to another for a given language. The given language is not copied and may not be 'free'd. Use a language defined in <a class="el" href="languages_8h.html">src/languages.h</a>. The returned pointer must be 'free'd. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>from</em> </td><td>The reference <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>language</em> </td><td>The language to calculate the <a class="el" href="structLocDelta.html" title="Tracks changes in lines of code, comments, and blank lines for a single language...">LocDelta</a> from. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>to</em> </td><td>The <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> to compare the reference <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> to (typically a later revision instead of a completely different <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a>). </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="structLocDelta.html" title="Tracks changes in lines of code, comments, and blank lines for a single language...">LocDelta</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="8095075cc741f56ec8e85856c8e33952"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_diff" ref="8095075cc741f56ec8e85856c8e33952" args="(SourceFile *from, SourceFile *to)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structLocDeltaListItem.html">LocDeltaList</a>* ohcount_sourcefile_diff </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>from</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>to</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns a LocDeltaList reflecting the changes from one revision of a <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> to another for all languages. The returned pointer must be 'free'd. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>from</em> </td><td>The reference <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>to</em> </td><td>The <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> to compare the reference <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> to (typically a later revision instead of a completely different <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a>). </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>LocDeltaList </dd></dl>
</div>
</div><p>
<a class="anchor" name="ecebea5934ca15350c7aefc0283f28c3"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_free" ref="ecebea5934ca15350c7aefc0283f28c3" args="(SourceFile *sourcefile)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ohcount_sourcefile_free </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Frees a <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="d78d1d1726970dbcdb8b999f1ab7c175"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_get_contents" ref="d78d1d1726970dbcdb8b999f1ab7c175" args="(SourceFile *sourcefile)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* ohcount_sourcefile_get_contents </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the file contents of a given <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a>. The returned pointer is used internally and may not be 'free'd. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>pointer to string file contents. </dd></dl>
</div>
</div><p>
<a class="anchor" name="f0bda4d5eb8ebae78653881196d1b2ea"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_get_contents_size" ref="f0bda4d5eb8ebae78653881196d1b2ea" args="(SourceFile *sourcefile)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int ohcount_sourcefile_get_contents_size </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the size of the file contents of a given <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>size of the file's contents. </dd></dl>
</div>
</div><p>
<a class="anchor" name="f717654d914aaf5630438d84852690ea"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_get_filenames" ref="f717654d914aaf5630438d84852690ea" args="(SourceFile *sourcefile)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char** ohcount_sourcefile_get_filenames </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns a string array of the given SourceFile's directory contents. If the existing 'filenames' field is NULL, the directory is accessed and its listing is returned. The returned pointer and its contents are used internally and must not be 'free'd. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>pointer to a list of filenames (NULL-pointer terminated). </dd></dl>
</div>
</div><p>
<a class="anchor" name="4e26432b8859af9b569e7ceb76a0c4f2"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_get_language" ref="4e26432b8859af9b569e7ceb76a0c4f2" args="(SourceFile *sourcefile)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* ohcount_sourcefile_get_language </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the detected language of a given <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a>. The returned pointer is used internally and may not be 'free'd. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>string language name. </dd></dl>
</div>
</div><p>
<a class="anchor" name="c8301992dd8f9eb8af00f04404c8ddac"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_get_license_list" ref="c8301992dd8f9eb8af00f04404c8ddac" args="(SourceFile *sourcefile)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structLicenseListItem.html">LicenseList</a>* ohcount_sourcefile_get_license_list </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns a LicenseList of detected licenses in the given <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a>. The returned list and its contents are used internally and may not be 'free'd. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>LicenseList </dd></dl>
</div>
</div><p>
<a class="anchor" name="6f2cfdb608e1b2c02546dd7f82c7f0ae"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_get_loc_list" ref="6f2cfdb608e1b2c02546dd7f82c7f0ae" args="(SourceFile *sourcefile)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structLocListItem.html">LocList</a>* ohcount_sourcefile_get_loc_list </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns a LocList of total lines of code in each language in the given <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a>. The returned list and its contents are used internally and may not be 'free'd. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>LocList </dd></dl>
</div>
</div><p>
<a class="anchor" name="ac4df12ae1934a82e8a5fa0418da898b"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_get_parsed_language_list" ref="ac4df12ae1934a82e8a5fa0418da898b" args="(SourceFile *sourcefile)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structParsedLanguageListItem.html">ParsedLanguageList</a>* ohcount_sourcefile_get_parsed_language_list </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the ParsedLanguageList parsed out of the given <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>ParsedLanguageList </dd></dl>
</div>
</div><p>
<a class="anchor" name="0341ae7733a4f6d42af9723fe61ea7ca"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_list_add_directory" ref="0341ae7733a4f6d42af9723fe61ea7ca" args="(SourceFileList *list, const char *directory)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ohcount_sourcefile_list_add_directory </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFileListItem.html">SourceFileList</a> * </td>
<td class="paramname"> <em>list</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>directory</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Adds the contents of a given directory to a SourceFileList. The given directory may be 'free'd immediately. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>A SourceFileList created by <a class="el" href="sourcefile_8h.html#82c7b67a2f332af1da50bb86ee86d216">ohcount_sourcefile_list_new()</a>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>directory</em> </td><td>The directory whose contents are to be added to the list. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="9645f2e3e3cdf8a12b21c7658fe99d52"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_list_add_file" ref="9645f2e3e3cdf8a12b21c7658fe99d52" args="(SourceFileList *list, const char *filepath)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ohcount_sourcefile_list_add_file </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFileListItem.html">SourceFileList</a> * </td>
<td class="paramname"> <em>list</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>filepath</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Adds a given file to a SourceFileList. The given filepath is copied and may be 'free'd immediately. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>a SourceFileList created by <a class="el" href="sourcefile_8h.html#82c7b67a2f332af1da50bb86ee86d216">ohcount_sourcefile_list_new()</a>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>filepath</em> </td><td>The full path to the file to be added to the list. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="aa1f233ca6c060ad519feae0b535d95a"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_list_analyze_languages" ref="aa1f233ca6c060ad519feae0b535d95a" args="(SourceFileList *list)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structLocListItem.html">LocList</a>* ohcount_sourcefile_list_analyze_languages </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFileListItem.html">SourceFileList</a> * </td>
<td class="paramname"> <em>list</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns a new LocList for all files in the given SourceFileList. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>A SourceFileList created by <a class="el" href="sourcefile_8h.html#82c7b67a2f332af1da50bb86ee86d216">ohcount_sourcefile_list_new()</a>. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>LocList </dd></dl>
</div>
</div><p>
<a class="anchor" name="6651000741c6ab4d4a17ed2ecb12aa7d"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_list_free" ref="6651000741c6ab4d4a17ed2ecb12aa7d" args="(SourceFileList *list)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ohcount_sourcefile_list_free </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFileListItem.html">SourceFileList</a> * </td>
<td class="paramname"> <em>list</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Frees the memory allocated for a given SourceFileList. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>A SourceFileList created by <a class="el" href="sourcefile_8h.html#82c7b67a2f332af1da50bb86ee86d216">ohcount_sourcefile_list_new()</a>. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="82c7b67a2f332af1da50bb86ee86d216"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_list_new" ref="82c7b67a2f332af1da50bb86ee86d216" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structSourceFileListItem.html">SourceFileList</a>* ohcount_sourcefile_list_new </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a new SourceFileList that is initially empty. Files can be added using <a class="el" href="sourcefile_8h.html#9645f2e3e3cdf8a12b21c7658fe99d52">ohcount_sourcefile_list_add_file()</a>. Directories can be added using <a class="el" href="sourcefile_8h.html#0341ae7733a4f6d42af9723fe61ea7ca">ohcount_sourcefile_list_add_directory()</a>. <dl class="return" compact><dt><b>Returns:</b></dt><dd>SourceFileList </dd></dl>
</div>
</div><p>
<a class="anchor" name="a2a2f198bc5d0cae789b7efc92717ea1"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_new" ref="a2a2f198bc5d0cae789b7efc92717ea1" args="(const char *filepath)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structSourceFile.html">SourceFile</a>* ohcount_sourcefile_new </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>filepath</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates and returns a new <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> from a given filepath. The given filepath is copied and may be 'free'd immediately. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>filepath</em> </td><td>The path to a file on disk. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="2be63654c50b188e223a349b27cdcb92"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_parse" ref="2be63654c50b188e223a349b27cdcb92" args="(SourceFile *sourcefile)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ohcount_sourcefile_parse </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Parses the given <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> with the default callback that keeps track of the number of lines of code, comments, and blank lines. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="844a8c3940e726e944e087fdb519d24a"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_parse_entities_with_callback" ref="844a8c3940e726e944e087fdb519d24a" args="(SourceFile *sourcefile, void(*callback)(const char *, const char *, int, int, void *), void *userdata)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ohcount_sourcefile_parse_entities_with_callback </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void(*)(const char *, const char *, int, int, void *) </td>
<td class="paramname"> <em>callback</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"> <em>userdata</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Parses the given <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> with a specific callback. The callback is called for each entity parsed, not line. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>callback</em> </td><td>The callback function to call for every entity parsed. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>userdata</em> </td><td>Userdata to pass to the callback function. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="b57d1d049bfd63e3afb384ca38503458"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_parse_with_callback" ref="b57d1d049bfd63e3afb384ca38503458" args="(SourceFile *sourcefile, void(*callback)(const char *, const char *, int, int, void *), void *userdata)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ohcount_sourcefile_parse_with_callback </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void(*)(const char *, const char *, int, int, void *) </td>
<td class="paramname"> <em>callback</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"> <em>userdata</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Parses the given <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> with a specific callback. The callback is called for each line parsed, not entity. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>callback</em> </td><td>The callback function to call for every line parsed. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>userdata</em> </td><td>Userdata to pass to the callback function. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="46b6f512d9afd86e9f9d6c39bdbe9252"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_set_contents" ref="46b6f512d9afd86e9f9d6c39bdbe9252" args="(SourceFile *sourcefile, const char *contents)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ohcount_sourcefile_set_contents </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>contents</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Sets the contents of the given <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a>. The given contents are copied and may be 'free'd immediately. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>contents</em> </td><td>The contents to set for sourcefile. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="0f98a5da511c34ff772e648ec13915ff"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_set_diskpath" ref="0f98a5da511c34ff772e648ec13915ff" args="(SourceFile *sourcefile, const char *diskpath)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ohcount_sourcefile_set_diskpath </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>diskpath</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Sets the filepath on the disk of the given <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a>. This is only used if the SourceFile's filepath field is not accurate, typically only in language detection. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>diskpath</em> </td><td>The real path to the file on disk. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="a2b205a57495f4362a89a415889e80dc"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_set_filenames" ref="a2b205a57495f4362a89a415889e80dc" args="(SourceFile *sourcefile, char **filenames)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ohcount_sourcefile_set_filenames </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char ** </td>
<td class="paramname"> <em>filenames</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Sets the given SourceFile's directory contents to the string array given. The given array is copied and may be 'free'd immediately. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>filenames</em> </td><td>String array of filenames. If NULL, the next call to ohcount_sourcefile_get_filenames will access the SourceFile's directory. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="f34b9fa3dc4968fe54d261404a6aa609"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_set_language" ref="f34b9fa3dc4968fe54d261404a6aa609" args="(SourceFile *sourcefile, const char *language)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ohcount_sourcefile_set_language </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
<td class="paramname"> <em>sourcefile</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>language</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Sets the language of a given <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a>. The given language copied and may be 'free'd immediately. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sourcefile</em> </td><td>A <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> created by <a class="el" href="sourcefile_8h.html#a2a2f198bc5d0cae789b7efc92717ea1">ohcount_sourcefile_new()</a>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>language</em> </td><td>The language to set the <a class="el" href="structSourceFile.html" title="Represents a single source code file.">SourceFile</a> to. </td></tr>
</table>
</dl>
</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Aug 28 15:20:08 2009 for ohcount by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>