1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3 <title>ohcount: /Users/andy/dev/ohcount/src/sourcefile.h File Reference</title>
4 <link href="tabs.css" rel="stylesheet" type="text/css">
5 <link href="doxygen.css" rel="stylesheet" type="text/css">
7 <!-- Generated by Doxygen 1.5.9 -->
8 <div class="navigation" id="top">
11 <li><a href="index.html"><span>Main Page</span></a></li>
12 <li><a href="pages.html"><span>Related Pages</span></a></li>
13 <li><a href="annotated.html"><span>Data Structures</span></a></li>
14 <li class="current"><a href="files.html"><span>Files</span></a></li>
19 <li><a href="files.html"><span>File List</span></a></li>
20 <li><a href="globals.html"><span>Globals</span></a></li>
24 <div class="contents">
25 <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>
26 <code>#include "<a class="el" href="parsed__language_8h_source.html">parsed_language.h</a>"</code><br>
29 <a href="sourcefile_8h_source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
31 <tr><td colspan="2"><br><h2>Functions</h2></td></tr>
32 <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>
34 <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>
36 <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>
38 <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>
40 <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>
42 <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>
44 <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>
46 <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>
48 <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>
50 <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>
52 <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>
54 <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>
56 <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>
58 <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>
60 <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>
62 <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>
64 <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>
66 <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>
68 <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>
70 <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>
72 <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>
74 <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>
76 <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>
79 <hr><h2>Function Documentation</h2>
80 <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)" -->
82 <div class="memproto">
83 <table class="memname">
85 <td class="memname"><a class="el" href="structLocDelta.html">LocDelta</a>* ohcount_sourcefile_calc_loc_delta </td>
87 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
88 <td class="paramname"> <em>from</em>, </td>
91 <td class="paramkey"></td>
93 <td class="paramtype">const char * </td>
94 <td class="paramname"> <em>language</em>, </td>
97 <td class="paramkey"></td>
99 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
100 <td class="paramname"> <em>to</em></td><td> </td>
105 <td></td><td></td><td></td>
112 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>
113 <table border="0" cellspacing="2" cellpadding="0">
114 <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>
115 <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>
116 <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>
119 <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>
123 <a class="anchor" name="8095075cc741f56ec8e85856c8e33952"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_diff" ref="8095075cc741f56ec8e85856c8e33952" args="(SourceFile *from, SourceFile *to)" -->
124 <div class="memitem">
125 <div class="memproto">
126 <table class="memname">
128 <td class="memname"><a class="el" href="structLocDeltaListItem.html">LocDeltaList</a>* ohcount_sourcefile_diff </td>
130 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
131 <td class="paramname"> <em>from</em>, </td>
134 <td class="paramkey"></td>
136 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
137 <td class="paramname"> <em>to</em></td><td> </td>
142 <td></td><td></td><td></td>
149 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>
150 <table border="0" cellspacing="2" cellpadding="0">
151 <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>
152 <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>
155 <dl class="return" compact><dt><b>Returns:</b></dt><dd>LocDeltaList </dd></dl>
159 <a class="anchor" name="ecebea5934ca15350c7aefc0283f28c3"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_free" ref="ecebea5934ca15350c7aefc0283f28c3" args="(SourceFile *sourcefile)" -->
160 <div class="memitem">
161 <div class="memproto">
162 <table class="memname">
164 <td class="memname">void ohcount_sourcefile_free </td>
166 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
167 <td class="paramname"> <em>sourcefile</em> </td>
168 <td> ) </td>
176 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>
177 <table border="0" cellspacing="2" cellpadding="0">
178 <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>
184 <a class="anchor" name="d78d1d1726970dbcdb8b999f1ab7c175"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_get_contents" ref="d78d1d1726970dbcdb8b999f1ab7c175" args="(SourceFile *sourcefile)" -->
185 <div class="memitem">
186 <div class="memproto">
187 <table class="memname">
189 <td class="memname">char* ohcount_sourcefile_get_contents </td>
191 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
192 <td class="paramname"> <em>sourcefile</em> </td>
193 <td> ) </td>
201 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>
202 <table border="0" cellspacing="2" cellpadding="0">
203 <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>
206 <dl class="return" compact><dt><b>Returns:</b></dt><dd>pointer to string file contents. </dd></dl>
210 <a class="anchor" name="f0bda4d5eb8ebae78653881196d1b2ea"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_get_contents_size" ref="f0bda4d5eb8ebae78653881196d1b2ea" args="(SourceFile *sourcefile)" -->
211 <div class="memitem">
212 <div class="memproto">
213 <table class="memname">
215 <td class="memname">int ohcount_sourcefile_get_contents_size </td>
217 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
218 <td class="paramname"> <em>sourcefile</em> </td>
219 <td> ) </td>
227 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>
228 <table border="0" cellspacing="2" cellpadding="0">
229 <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>
232 <dl class="return" compact><dt><b>Returns:</b></dt><dd>size of the file's contents. </dd></dl>
236 <a class="anchor" name="f717654d914aaf5630438d84852690ea"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_get_filenames" ref="f717654d914aaf5630438d84852690ea" args="(SourceFile *sourcefile)" -->
237 <div class="memitem">
238 <div class="memproto">
239 <table class="memname">
241 <td class="memname">char** ohcount_sourcefile_get_filenames </td>
243 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
244 <td class="paramname"> <em>sourcefile</em> </td>
245 <td> ) </td>
253 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>
254 <table border="0" cellspacing="2" cellpadding="0">
255 <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>
258 <dl class="return" compact><dt><b>Returns:</b></dt><dd>pointer to a list of filenames (NULL-pointer terminated). </dd></dl>
262 <a class="anchor" name="4e26432b8859af9b569e7ceb76a0c4f2"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_get_language" ref="4e26432b8859af9b569e7ceb76a0c4f2" args="(SourceFile *sourcefile)" -->
263 <div class="memitem">
264 <div class="memproto">
265 <table class="memname">
267 <td class="memname">const char* ohcount_sourcefile_get_language </td>
269 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
270 <td class="paramname"> <em>sourcefile</em> </td>
271 <td> ) </td>
279 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>
280 <table border="0" cellspacing="2" cellpadding="0">
281 <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>
284 <dl class="return" compact><dt><b>Returns:</b></dt><dd>string language name. </dd></dl>
288 <a class="anchor" name="c8301992dd8f9eb8af00f04404c8ddac"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_get_license_list" ref="c8301992dd8f9eb8af00f04404c8ddac" args="(SourceFile *sourcefile)" -->
289 <div class="memitem">
290 <div class="memproto">
291 <table class="memname">
293 <td class="memname"><a class="el" href="structLicenseListItem.html">LicenseList</a>* ohcount_sourcefile_get_license_list </td>
295 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
296 <td class="paramname"> <em>sourcefile</em> </td>
297 <td> ) </td>
305 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>
306 <table border="0" cellspacing="2" cellpadding="0">
307 <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>
310 <dl class="return" compact><dt><b>Returns:</b></dt><dd>LicenseList </dd></dl>
314 <a class="anchor" name="6f2cfdb608e1b2c02546dd7f82c7f0ae"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_get_loc_list" ref="6f2cfdb608e1b2c02546dd7f82c7f0ae" args="(SourceFile *sourcefile)" -->
315 <div class="memitem">
316 <div class="memproto">
317 <table class="memname">
319 <td class="memname"><a class="el" href="structLocListItem.html">LocList</a>* ohcount_sourcefile_get_loc_list </td>
321 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
322 <td class="paramname"> <em>sourcefile</em> </td>
323 <td> ) </td>
331 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>
332 <table border="0" cellspacing="2" cellpadding="0">
333 <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>
336 <dl class="return" compact><dt><b>Returns:</b></dt><dd>LocList </dd></dl>
340 <a class="anchor" name="ac4df12ae1934a82e8a5fa0418da898b"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_get_parsed_language_list" ref="ac4df12ae1934a82e8a5fa0418da898b" args="(SourceFile *sourcefile)" -->
341 <div class="memitem">
342 <div class="memproto">
343 <table class="memname">
345 <td class="memname"><a class="el" href="structParsedLanguageListItem.html">ParsedLanguageList</a>* ohcount_sourcefile_get_parsed_language_list </td>
347 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
348 <td class="paramname"> <em>sourcefile</em> </td>
349 <td> ) </td>
357 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>
358 <table border="0" cellspacing="2" cellpadding="0">
359 <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>
362 <dl class="return" compact><dt><b>Returns:</b></dt><dd>ParsedLanguageList </dd></dl>
366 <a class="anchor" name="0341ae7733a4f6d42af9723fe61ea7ca"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_list_add_directory" ref="0341ae7733a4f6d42af9723fe61ea7ca" args="(SourceFileList *list, const char *directory)" -->
367 <div class="memitem">
368 <div class="memproto">
369 <table class="memname">
371 <td class="memname">void ohcount_sourcefile_list_add_directory </td>
373 <td class="paramtype"><a class="el" href="structSourceFileListItem.html">SourceFileList</a> * </td>
374 <td class="paramname"> <em>list</em>, </td>
377 <td class="paramkey"></td>
379 <td class="paramtype">const char * </td>
380 <td class="paramname"> <em>directory</em></td><td> </td>
385 <td></td><td></td><td></td>
392 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>
393 <table border="0" cellspacing="2" cellpadding="0">
394 <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>
395 <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>
401 <a class="anchor" name="9645f2e3e3cdf8a12b21c7658fe99d52"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_list_add_file" ref="9645f2e3e3cdf8a12b21c7658fe99d52" args="(SourceFileList *list, const char *filepath)" -->
402 <div class="memitem">
403 <div class="memproto">
404 <table class="memname">
406 <td class="memname">void ohcount_sourcefile_list_add_file </td>
408 <td class="paramtype"><a class="el" href="structSourceFileListItem.html">SourceFileList</a> * </td>
409 <td class="paramname"> <em>list</em>, </td>
412 <td class="paramkey"></td>
414 <td class="paramtype">const char * </td>
415 <td class="paramname"> <em>filepath</em></td><td> </td>
420 <td></td><td></td><td></td>
427 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>
428 <table border="0" cellspacing="2" cellpadding="0">
429 <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>
430 <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>
436 <a class="anchor" name="aa1f233ca6c060ad519feae0b535d95a"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_list_analyze_languages" ref="aa1f233ca6c060ad519feae0b535d95a" args="(SourceFileList *list)" -->
437 <div class="memitem">
438 <div class="memproto">
439 <table class="memname">
441 <td class="memname"><a class="el" href="structLocListItem.html">LocList</a>* ohcount_sourcefile_list_analyze_languages </td>
443 <td class="paramtype"><a class="el" href="structSourceFileListItem.html">SourceFileList</a> * </td>
444 <td class="paramname"> <em>list</em> </td>
445 <td> ) </td>
453 Returns a new LocList for all files in the given SourceFileList. <dl compact><dt><b>Parameters:</b></dt><dd>
454 <table border="0" cellspacing="2" cellpadding="0">
455 <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>
458 <dl class="return" compact><dt><b>Returns:</b></dt><dd>LocList </dd></dl>
462 <a class="anchor" name="6651000741c6ab4d4a17ed2ecb12aa7d"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_list_free" ref="6651000741c6ab4d4a17ed2ecb12aa7d" args="(SourceFileList *list)" -->
463 <div class="memitem">
464 <div class="memproto">
465 <table class="memname">
467 <td class="memname">void ohcount_sourcefile_list_free </td>
469 <td class="paramtype"><a class="el" href="structSourceFileListItem.html">SourceFileList</a> * </td>
470 <td class="paramname"> <em>list</em> </td>
471 <td> ) </td>
479 Frees the memory allocated for a given SourceFileList. <dl compact><dt><b>Parameters:</b></dt><dd>
480 <table border="0" cellspacing="2" cellpadding="0">
481 <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>
487 <a class="anchor" name="82c7b67a2f332af1da50bb86ee86d216"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_list_new" ref="82c7b67a2f332af1da50bb86ee86d216" args="()" -->
488 <div class="memitem">
489 <div class="memproto">
490 <table class="memname">
492 <td class="memname"><a class="el" href="structSourceFileListItem.html">SourceFileList</a>* ohcount_sourcefile_list_new </td>
494 <td class="paramname"> </td>
495 <td> ) </td>
503 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>
507 <a class="anchor" name="a2a2f198bc5d0cae789b7efc92717ea1"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_new" ref="a2a2f198bc5d0cae789b7efc92717ea1" args="(const char *filepath)" -->
508 <div class="memitem">
509 <div class="memproto">
510 <table class="memname">
512 <td class="memname"><a class="el" href="structSourceFile.html">SourceFile</a>* ohcount_sourcefile_new </td>
514 <td class="paramtype">const char * </td>
515 <td class="paramname"> <em>filepath</em> </td>
516 <td> ) </td>
524 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>
525 <table border="0" cellspacing="2" cellpadding="0">
526 <tr><td valign="top"></td><td valign="top"><em>filepath</em> </td><td>The path to a file on disk. </td></tr>
529 <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>
533 <a class="anchor" name="2be63654c50b188e223a349b27cdcb92"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_parse" ref="2be63654c50b188e223a349b27cdcb92" args="(SourceFile *sourcefile)" -->
534 <div class="memitem">
535 <div class="memproto">
536 <table class="memname">
538 <td class="memname">void ohcount_sourcefile_parse </td>
540 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
541 <td class="paramname"> <em>sourcefile</em> </td>
542 <td> ) </td>
550 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>
551 <table border="0" cellspacing="2" cellpadding="0">
552 <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>
558 <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)" -->
559 <div class="memitem">
560 <div class="memproto">
561 <table class="memname">
563 <td class="memname">void ohcount_sourcefile_parse_entities_with_callback </td>
565 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
566 <td class="paramname"> <em>sourcefile</em>, </td>
569 <td class="paramkey"></td>
571 <td class="paramtype">void(*)(const char *, const char *, int, int, void *) </td>
572 <td class="paramname"> <em>callback</em>, </td>
575 <td class="paramkey"></td>
577 <td class="paramtype">void * </td>
578 <td class="paramname"> <em>userdata</em></td><td> </td>
583 <td></td><td></td><td></td>
590 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>
591 <table border="0" cellspacing="2" cellpadding="0">
592 <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>
593 <tr><td valign="top"></td><td valign="top"><em>callback</em> </td><td>The callback function to call for every entity parsed. </td></tr>
594 <tr><td valign="top"></td><td valign="top"><em>userdata</em> </td><td>Userdata to pass to the callback function. </td></tr>
600 <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)" -->
601 <div class="memitem">
602 <div class="memproto">
603 <table class="memname">
605 <td class="memname">void ohcount_sourcefile_parse_with_callback </td>
607 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
608 <td class="paramname"> <em>sourcefile</em>, </td>
611 <td class="paramkey"></td>
613 <td class="paramtype">void(*)(const char *, const char *, int, int, void *) </td>
614 <td class="paramname"> <em>callback</em>, </td>
617 <td class="paramkey"></td>
619 <td class="paramtype">void * </td>
620 <td class="paramname"> <em>userdata</em></td><td> </td>
625 <td></td><td></td><td></td>
632 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>
633 <table border="0" cellspacing="2" cellpadding="0">
634 <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>
635 <tr><td valign="top"></td><td valign="top"><em>callback</em> </td><td>The callback function to call for every line parsed. </td></tr>
636 <tr><td valign="top"></td><td valign="top"><em>userdata</em> </td><td>Userdata to pass to the callback function. </td></tr>
642 <a class="anchor" name="46b6f512d9afd86e9f9d6c39bdbe9252"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_set_contents" ref="46b6f512d9afd86e9f9d6c39bdbe9252" args="(SourceFile *sourcefile, const char *contents)" -->
643 <div class="memitem">
644 <div class="memproto">
645 <table class="memname">
647 <td class="memname">void ohcount_sourcefile_set_contents </td>
649 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
650 <td class="paramname"> <em>sourcefile</em>, </td>
653 <td class="paramkey"></td>
655 <td class="paramtype">const char * </td>
656 <td class="paramname"> <em>contents</em></td><td> </td>
661 <td></td><td></td><td></td>
668 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>
669 <table border="0" cellspacing="2" cellpadding="0">
670 <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>
671 <tr><td valign="top"></td><td valign="top"><em>contents</em> </td><td>The contents to set for sourcefile. </td></tr>
677 <a class="anchor" name="0f98a5da511c34ff772e648ec13915ff"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_set_diskpath" ref="0f98a5da511c34ff772e648ec13915ff" args="(SourceFile *sourcefile, const char *diskpath)" -->
678 <div class="memitem">
679 <div class="memproto">
680 <table class="memname">
682 <td class="memname">void ohcount_sourcefile_set_diskpath </td>
684 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
685 <td class="paramname"> <em>sourcefile</em>, </td>
688 <td class="paramkey"></td>
690 <td class="paramtype">const char * </td>
691 <td class="paramname"> <em>diskpath</em></td><td> </td>
696 <td></td><td></td><td></td>
703 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>
704 <table border="0" cellspacing="2" cellpadding="0">
705 <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>
706 <tr><td valign="top"></td><td valign="top"><em>diskpath</em> </td><td>The real path to the file on disk. </td></tr>
712 <a class="anchor" name="a2b205a57495f4362a89a415889e80dc"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_set_filenames" ref="a2b205a57495f4362a89a415889e80dc" args="(SourceFile *sourcefile, char **filenames)" -->
713 <div class="memitem">
714 <div class="memproto">
715 <table class="memname">
717 <td class="memname">void ohcount_sourcefile_set_filenames </td>
719 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
720 <td class="paramname"> <em>sourcefile</em>, </td>
723 <td class="paramkey"></td>
725 <td class="paramtype">char ** </td>
726 <td class="paramname"> <em>filenames</em></td><td> </td>
731 <td></td><td></td><td></td>
738 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>
739 <table border="0" cellspacing="2" cellpadding="0">
740 <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>
741 <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>
747 <a class="anchor" name="f34b9fa3dc4968fe54d261404a6aa609"></a><!-- doxytag: member="sourcefile.h::ohcount_sourcefile_set_language" ref="f34b9fa3dc4968fe54d261404a6aa609" args="(SourceFile *sourcefile, const char *language)" -->
748 <div class="memitem">
749 <div class="memproto">
750 <table class="memname">
752 <td class="memname">void ohcount_sourcefile_set_language </td>
754 <td class="paramtype"><a class="el" href="structSourceFile.html">SourceFile</a> * </td>
755 <td class="paramname"> <em>sourcefile</em>, </td>
758 <td class="paramkey"></td>
760 <td class="paramtype">const char * </td>
761 <td class="paramname"> <em>language</em></td><td> </td>
766 <td></td><td></td><td></td>
773 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>
774 <table border="0" cellspacing="2" cellpadding="0">
775 <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>
776 <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>
783 <hr size="1"><address style="text-align: right;"><small>Generated on Fri Aug 28 15:20:08 2009 for ohcount by
784 <a href="http://www.doxygen.org/index.html">
785 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>