Codebase list ohcount / lintian-fixes/main doc / html / index.html
lintian-fixes/main

Tree @lintian-fixes/main (Download .tar.gz)

index.html @lintian-fixes/mainraw · history · blame

<!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: Ohcount</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 class="current"><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Ohcount</h1>
<p>
The Ohloh source code line counter<p>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public <a class="el" href="structLicense.html" title="Holds a license and its associated details and patterns.">License</a> Version 2 as published by the Free Software Foundation.<p>
Ohcount is specifically licensed under GPL v2.0, and no later version.<p>
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public <a class="el" href="structLicense.html" title="Holds a license and its associated details and patterns.">License</a> for more details.<p>
You should have received a copy of the GNU General Public <a class="el" href="structLicense.html" title="Holds a license and its associated details and patterns.">License</a> along with this program. If not, see &lt;<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>&gt;.<h2><a class="anchor" name="overview">
Overview</a></h2>
Ohcount is a program for counting lines of source code. It was originally developed at Ohloh and used to generate the reports at www.ohloh.net<p>
Ohcount supports multiple languages within a single file: for example a complex HTML document might include regions of both CSS and Javascript.<p>
Ohcount has 4 main components:<p>
<ul>
<li>A detector which determines the primary language family used by a particular source file. </li>
<li>A parser which provides a line-by-line breakdown of the contents of a source file. </li>
<li>Another detector which tries to determine the license(s) the source file is licensed under. </li>
<li>A final detector for gestalts (via the Ruby extension).</li>
</ul>
The command line tool allows you to profile individual files or whole directory trees.<h2><a class="anchor" name="requirements">
System Requirements</a></h2>
Ohcount is supported on Mac OSX 10.5 and Ubuntu 6.06 LTS. Other Linux environments should also work, but your mileage may vary. Windows is not supported.<h2><a class="anchor" name="download">
Download</a></h2>
Ohcount source code is available as a Git repository:<p>
git clone git://ohcount.git.sourceforge.net/gitroot/ohcount/ohcount<h2><a class="anchor" name="build">
Building Ohcount</a></h2>
In order to build Ohcount, the following is required:<p>
<ul>
<li>GNU C compiler - <a href="http://gcc.gnu.org/">http://gcc.gnu.org/</a> </li>
<li>Ragel 6.3 or later - <a href="http://research.cs.queensu.ca/~thurston/ragel/">http://research.cs.queensu.ca/~thurston/ragel/</a> </li>
<li>GNU gperf - <a href="http://www.gnu.org/software/gperf/">http://www.gnu.org/software/gperf/</a> </li>
<li>PCRE - <a href="http://pcre.sourceforge.net/">http://pcre.sourceforge.net/</a></li>
</ul>
Run the 'build' script to build Ohcount.<p>
<div class="fragment"><pre class="fragment"> $ ./build
</pre></div><p>
You may then link or copy 'bin/ohcount' to your system's PATH.<p>
Building the Ruby extension of Ohcount requires:<p>
<ul>
<li>Ruby - <a href="http://ruby-lang.org/">http://ruby-lang.org/</a> </li>
<li>Swig - <a href="http://swig.org/">http://swig.org/</a></li>
</ul>
<div class="fragment"><pre class="fragment"> $ ./build ruby
</pre></div><p>
You may then link or copy 'ruby/ohcount.{rb,so}' and 'ruby/gestalt{/,.rb}' to the appropriate places in your Ruby installation.<h2><a class="anchor" name="start">
First Steps</a></h2>
To measure lines of code, simply pass file or directory names to the bin/ohcount executable:<p>
<div class="fragment"><pre class="fragment"> $ ohcount helloworld.c
</pre></div><p>
Directories will be probed recursively. If you do not pass any parameters, the current directory tree will be counted.<p>
You can use the ohcount 'detect' option to simply determine the language family of each source file. The files will not be parsed or counted. For example, to find all of the Ruby files in the current directory tree:<p>
<div class="fragment"><pre class="fragment"> $ ohcount --detect | grep ^ruby
</pre></div><p>
The 'annotate' option presents a line-by-line accounting of the languages used in a source code file. For example:<p>
<div class="fragment"><pre class="fragment"> $ ohcount --annotate ./test/src_dir/php1.php
</pre></div><p>
More options can be found by typing:<p>
<div class="fragment"><pre class="fragment"> $ ohcount --help
</pre></div><h2><a class="anchor" name="docs">
Additional Documentation</a></h2>
See the Related Pages tab at the top of the page.<h2><a class="anchor" name="contact">
Contact Ohloh</a></h2>
For more information visit the Ohloh website: <a href="http://labs.ohloh.net">http://labs.ohloh.net</a><p>
You can reach Ohloh via email at: <a href="mailto:info@ohloh.net">info@ohloh.net</a> </div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Aug 28 16:26:52 2009 for ohcount by&nbsp;
<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>