LINUMB - return the current line number of a file.

Usage:

B:
   num = linumb( [unit] );
C:
   int linumb( [FILE *unit] );

Where:

unit
is the number of the open I/O unit where the desired file is to be found. If "unit" is not specified, LINUMB looks at the file associated with the current read unit.
num
is the line number of the current line.

Description:

LINUMB returns the line number of the current line of the file associated with the given input unit.

Normally, this will just be a sequential line number, but if the B library function STRIP has been called or if an external called .STRIP is defined and set to some non-zero value, LINUMB will return the line number "stripped" from the beginning of the line. In this case, if no line number is found, the value returned will be the previous line number plus one.

If the input unit specified is associated with the terminal, LINUMB will always return zero.

See Also:

expl b lib strip

expl b lib externals

Copyright © 1996, Thinkage Ltd.