1 // ohcount.h written by Mitchell Foral. mitchell<att>caladbolg.net.
2 // See COPYING for license information.
10 * The Ohloh source code line counter
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License Version 2 as
14 * published by the Free Software Foundation.
16 * Ohcount is specifically licensed under GPL v2.0, and no later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 * @section overview Overview
28 * Ohcount is a program for counting lines of source code. It was originally
29 * developed at Ohloh and used to generate the reports at www.ohloh.net
31 * Ohcount supports multiple languages within a single file: for example a
32 * complex HTML document might include regions of both CSS and Javascript.
34 * Ohcount has 4 main components:
36 * @li A detector which determines the primary language family used by a
37 * particular source file.
38 * @li A parser which provides a line-by-line breakdown of the contents of a
40 * @li Another detector which tries to determine the license(s) the source file
42 * @li A final detector for gestalts (via the Ruby extension).
44 * The command line tool allows you to profile individual files or whole
47 * @section requirements System Requirements
49 * Ohcount is supported on Mac OSX 10.5 and Ubuntu 6.06 LTS. Other Linux
50 * environments should also work, but your mileage may vary. Windows is not
53 * @section download Download
55 * Ohcount source code is available as a Git repository:
57 * git clone git://ohcount.git.sourceforge.net/gitroot/ohcount/ohcount
59 * @section build Building Ohcount
61 * In order to build Ohcount, the following is required:
63 * @li GNU C compiler - http://gcc.gnu.org/
64 * @li Ragel 6.3 or later - http://research.cs.queensu.ca/~thurston/ragel/
65 * @li GNU gperf - http://www.gnu.org/software/gperf/
66 * @li PCRE - http://pcre.sourceforge.net/
68 * Run the 'build' script to build Ohcount.
74 * You may then link or copy 'bin/ohcount' to your system's PATH.
76 * Building the Ruby extension of Ohcount requires:
78 * @li Ruby - http://ruby-lang.org/
79 * @li Swig - http://swig.org/
85 * You may then link or copy 'ruby/ohcount.{rb,so}' and 'ruby/gestalt{/,.rb}'
86 * to the appropriate places in your Ruby installation.
88 * @section start First Steps
90 * To measure lines of code, simply pass file or directory names to the
91 * bin/ohcount executable:
94 * $ ohcount helloworld.c
97 * Directories will be probed recursively. If you do not pass any parameters,
98 * the current directory tree will be counted.
100 * You can use the ohcount 'detect' option to simply determine the language
101 * family of each source file. The files will not be parsed or counted. For
102 * example, to find all of the Ruby files in the current directory tree:
105 * $ ohcount --detect | grep ^ruby
108 * The 'annotate' option presents a line-by-line accounting of the languages
109 * used in a source code file. For example:
112 * $ ohcount --annotate ./test/src_dir/php1.php
115 * More options can be found by typing:
121 * @section docs Additional Documentation
123 * See the Related Pages tab at the top of the page.
125 * @section contact Contact Ohloh
127 * For more information visit the Ohloh website: http://labs.ohloh.net
129 * You can reach Ohloh via email at: info@ohloh.net
132 #define COMMAND_ANNOTATE 1
133 #define COMMAND_DETECT 2
134 #define COMMAND_HELP 3
135 #define COMMAND_INDIVIDUAL 4
136 #define COMMAND_LICENSES 5
137 #define COMMAND_RAWENTITIES 6
138 #define COMMAND_SUMMARY 7