summaryrefslogtreecommitdiffstats
path: root/development/c_count/README
blob: bec4a2e914fedc9e7f6668b9b05abc4c866cf377 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
c_count (classify and count lines of C or C++ source)

c_count counts lines, statements, other simple measures of C/C++
source programs. It isn't lex/yacc based, and is easily portable to a
variety of systems.

Note: By default, the binary and man page are installed as C_count
(uppercase C), to prevent a conflict with /usr/bin/c_count from the
SBo sloccount package. If you really want, you can run this script
with LOWERCASE=yes in the environment to install as c_count... but if
you do this, don't install sloccount on the same system.

c_count gives more detailed statistics than sloccount, but does not
include sloccount's person-years and cost estimates.

Example output from c_count:

$ C_count filename.c
  3656  1513   |filename.c
----------------
  3656  1513    total lines/statements

   881   lines had comments        24.1 %
    47   comments are inline       -1.3 %
   537   lines were blank          14.7 %
   197   lines for preprocessor     5.4 %
  2088   lines containing code     57.1 %
  3656   total lines              100.0 %

 18053   comment-chars             22.8 %
  4739   nontext-comment-chars      6.0 %
 18594   whitespace-chars          23.5 %
  2527   preprocessor-chars         3.2 %
 35098   statement-chars           44.4 %
 79011   total characters         100.0 %

  3919   tokens, average length 6.99

  0.48   ratio of comment:code

   205   top-level blocks/statements
     9   maximum blocklevel
  2.93   ratio of blocklevel:code