aboutsummaryrefslogtreecommitdiff
path: root/pkg/system/help/lroff/textlen.x
blob: e192314f39777f605f932f0dbfd97970af9c5c45 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	<chars.h>
include	"lroff.h"

# TEXTLEN -- Return the number of printable characters in a text string.

int procedure textlen (text_string)

char	text_string[ARB]
int	ip, nchars

begin
	nchars = 0
	for (ip=1;  text_string[ip] != EOS;  ip=ip+1)
	    if (!INVISIBLE (text_string[ip]))
		nchars = nchars + 1

	return (nchars)
end