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/
67 * @li Bash - http://www.gnu.org/software/bash/
69 * Run the 'build' script to build Ohcount.
75 * You may then link or copy 'bin/ohcount' to your system's PATH.
77 * Building the Ruby extension of Ohcount requires:
79 * @li Ruby - http://ruby-lang.org/
80 * @li Swig - http://swig.org/
86 * You may then link or copy 'ruby/ohcount.{rb,so}' and 'ruby/gestalt{/,.rb}'
87 * to the appropriate places in your Ruby installation.
89 * Building the Doxygen docs requires:
91 * @li Doxygen - http://www.doxygen.org/
98 * @section start First Steps
100 * To measure lines of code, simply pass file or directory names to the
101 * bin/ohcount executable:
104 * $ ohcount helloworld.c
107 * Directories will be probed recursively. If you do not pass any parameters,
108 * the current directory tree will be counted.
110 * You can use the ohcount 'detect' option to simply determine the language
111 * family of each source file. The files will not be parsed or counted. For
112 * example, to find all of the Ruby files in the current directory tree:
115 * $ ohcount --detect | grep ^ruby
118 * The 'annotate' option presents a line-by-line accounting of the languages
119 * used in a source code file. For example:
122 * $ ohcount --annotate ./test/src_dir/php1.php
125 * More options can be found by typing:
131 * @section docs Additional Documentation
133 * See the Related Pages tab at the top of the page.
135 * @section contact Contact Ohloh
137 * For more information visit the Ohloh website: https://sourceforge.net/projects/ohcount
139 * You can reach Ohloh via email at: info@ohloh.net
142 #define COMMAND_ANNOTATE 1
143 #define COMMAND_DETECT 2
144 #define COMMAND_HELP 3
145 #define COMMAND_INDIVIDUAL 4
146 #define COMMAND_LICENSES 5
147 #define COMMAND_RAWENTITIES 6
148 #define COMMAND_SUMMARY 7