


				  - 1 -



       linecounter - generate source line statistics for C,  Pascal



				  - 1 -



       or  Shell  script  source.   linecounter [options] [file(s)]



				  - 1 -



       Level: Non-Standard Origin: HP LLLLiiiinnnneeeeccccoooouuuunnnntttteeeerrrr is a shell script
       that  functions	as  a  coordinator for the following source
       line  counting  utility	 programs:   ssssssssiiiizzzzeeee((((1111)))),,,,	 ccccssssttttrrrriiiipppp((((1111)))),,,,
       ppppssssttttrrrriiiipppp((((1111)))),,,,  sssshhhhssssttttrrrriiiipppp((((1111)))),,,,	ccccaaaattttffffiiiilllleeeessss((((1111))))  and cccckkkkffffiiiilllleeeessss((((1111)))).  These
       programs are assumed to be in the user's  path.	 The  basic
       steps taken by linecounter can be roughly described as:

	    1. The specified file names are checked by ckfiles.

	    2.	The number of blank lines and whole  comment  lines
	    are  computed by cstrip (or pstrip or shstrip) with the
	    -r option.

	    3.	The number  of	new  lines,  added  lines,  deleted
	    lines,  modified lines and NCSL are computed by calling
	    ssize -S.

	    4.	Some post processing  is  done	to  manipulate	the
	    output  from  ssize  and  the  stripper into the format
	    described below.
       Linecounter reads its input from the named file(s)  or  from
       stdin.  Each input line must be of the form:

	       _t_y_p_e-_l_e_t_t_e_r   _f_i_l_e_n_a_m_e	[_q_u_a_l_i_f_i_e_r_s]

       _T_y_p_e-_l_e_t_t_e_r must be one of:

	    nnnn - meaning the file contains new source code.

	    rrrr - meaning the file contains reused  source  code	and
	    old code is available for comparison.

	    uuuu - meaning the file contains reused  source  code	and
	    old code is not available for comparison.
       _F_i_l_e_n_a_m_e specifies what file is to be counted.  The file may











				  - 2 -



       be under SSSSCCCCCCCCSSSS or RRRRCCCCSSSS source code control, in which case, the
       appropriate version is extracted before any counting is done
       (see  ssize).   _F_i_l_e_n_a_m_e is considered to be an SCCS file if
       and only if  its  basename  begins  with  the  prefix  "s.".
       _F_i_l_e_n_a_m_e  is considered to be an RCS file if and only if its
       basename ends with the suffix ",v".  The optional  qualifier
       for  an	nnnn or uuuu file under SSSSCCCCCCCCSSSS control is a "release.level"
       number indicating which version of the file to count.  If no
       qualifier is given, the top-most version is counted.  For an
       rrrr file under SCCS  control,  the  qualifier  is	a  pair  of
       release.level  numbers specifying which versions of the file
       to compare.  The first qualifier is assumed to  be  the	new
       version	while the second qualifier is assumed to be the old
       version.  The qualifiers for  rrrr	files  under  SCCS  control
       cannot be file names.  Note, while not an error, it does not
       make sense for the qualifiers of an rrrr file to be  the  same.
       This  would  cause ssize to compare the specified version of
       the file with itself.  Typical examples of SCCS	file  usage
       would look like:

	       n    s.file1.c	 2.1
	       u    s.file2	 8.7
	       r    s.file3	 4.1	 3.2

       The optional qualifier for an nnnn or uuuu file under RRRRCCCCSSSS  control
       is  a  "release.level" number or a symbolic tag (created via
       the -n option of ci(1)) indicating which version of the file
       to count.  If no qualifier is given, the top-most version is
       counted.  For an rrrr file under RCS control, the qualifier  is
       a   pair   of   rev_numbers/symbolic_tags  specifying  which
       versions of the file to compare.   The  first  qualifier  is
       assumed	to be the new version while the second qualifier is
       assumed to be the old version.  The qualifiers for  rrrr  files
       under  RCS control cannot be file names.  Note, while not an
       error, it does not make sense for the  qualifiers  of  an  rrrr
       file  to be the same.  This would cause ssize to compare the
       specified version of the file with itself.  Typical examples
       of RCS file usage would look like:

	       n    file1.c,v	 2.1
	       u    file2,v	 release_2
	       r    file3,v	 4.1	 3.2
	       r    file4,v	 rel3	 rel2

       For files that are  not	under  SCCS  or  RCS  control,	the
       qualifier  for an nnnn or uuuu file is ignored.  For an rrrr file not
       under SCCS or RCS control, the qualifier is the name of	the
       file which is compared to the original.	Typical usage would
       look like:

	       n    file1.c











				  - 3 -



	       u    file2
	       r    file3 file4 Output from linecounter is  printed
       on  stdout.  The output is divided into three sections.	The
       first section contains information about the files named  in
       the input.  This information consists of the number of files
       named, how many of the names are  valid,  how  many  of	the
       names  are  not	valid  and a list of all the invalid names.
       The second section  contains  the  cumulative  line  counts,
       broken  down into different categories, for all of the valid
       file names.  The  third	section  contains  some  commentary
       notes  about  the various counts.  There are several options



				  - 3 -



       that affect  linecounter's  behavior.   These  options  are:
       ----bbbbccccooooffffffff - Suppress blank and whole comment line counting.  By
       default,  linecounter  reports  how  many  blank  and  whole
       comment	lines  are  found  in the input.  This option stops



				  - 3 -



       this calculation.  ----bbbbccccoooonnnnllllyyyy - Only report how many blank	and
       whole  comment  lines  are  present in the input.  The other



				  - 3 -



       counts are suppressed.  ----cccckkkkooooffffffff - Suppress the checking  done
       by  ckfiles.  If the input data is known to be correct, this
       option will increase performance.  However, if a "bad"  file
       name  or revision number is not screened out by ckfiles then



				  - 3 -



       linecounter halts without generating any counts.  ----cccckkkkoooonnnnllllyyyy  -
       Simply  pass  the  input files through the checker, ckfiles.











				  - 4 -



       No counting is performed.  This	is  useful  when  the  user



				  - 4 -



       simply  wants  to  verify  the input is valid.  ----PPPP - Use the
       Pascal comment stripper, pstrip.  By default, the C  comment



				  - 4 -



       stripper,  cstrip  is used.  ----TTTT ttttiiiittttlllleeee - Use the given string
       as a title to be printed at the top of the report.  Note, if
       the  title  consists  of  more  than  one  word,  it must be



				  - 4 -



       surrounded by double quotes.  ----bbbb - Invoke ssize with the  -b
       option.	 This  causes differences in a line that are due to



				  - 4 -



       changes in white space to be ignored.  ----ssss ssssttttrrrriiiippppppppeeeerrrr - Use the
       specified  comment/blank-line  stripping  program instead of
       cstrip, pstrip or shstrip.  The specified program is used in
       two  ways.  SSSSttttrrrriiiippppppppeeeerrrr is passed directly to ssize via ssize's
       -s option. Linecounter also  invokes  ssssttttrrrriiiippppppppeeeerrrr  directly  to
       calculate  the  total  number  of lines, the number of blank
       lines and the number of whole comment  lines  found  in	the
       input.  As a result, linecounter assumes that ssssttttrrrriiiippppppppeeeerrrr has a
       "-r" option (like cstrip's), and, the output  from  invoking
       ssssttttrrrriiiippppppppeeeerrrr  with the -r option is exactly of the form (without
       the leading and trailing blank lines):

	       Total lines:		 156
	       Whole comment lines:	   0
	       Blank lines:		   0











				  - 5 -



       If ssssttttrrrriiiippppppppeeeerrrr  does  not  meet  these  two  requirements  then
       linecounter will need to be modified.  Linecounter makes two
       key assumptions about the behavior of the tools used to stip
       out  comments and blank lines.  See the -s option discussion
       above for more  details.   ssize(1),  cstrip(1),  pstrip(1),
       shstrip(1),  catfiles(1)  and  ckfiles(1) Scott Warren - UDL
       Productivity




















































