Subject: Forward: VI Limit, BIG5 Table

From: Rupert Zhu <[email-masked]>
Date: Sat, 26 Oct 1991 18:48:28 -0400

The following message from Yongguang Zhang is quite informative.
The first part contains information about size limit of VI and CELVIS.
The second part is a shell script to produce BIG5 Table.

Thank you, Yongguang!

-- Rupert Zhu

--------------------- Start of Forwarded Message ----------------------

>From [email-masked] Sat Oct 26 17:38 EDT 1991
To: Rupert Zhu <[email-masked]>
Subject: Re: Open Question 1: GB Viewer for Large Files on PC
From: [email-masked]

> d)  What is the size limit for editors on MacIntosh and X-Window systems?
>     (I guess celvis has unlimited capacity because VI does.)

VI also has a limit, as well as celvis.  However, you can change the limit
in compile time.  In celvis, the default block size is 1024 and the maximum
number of block is the block size divided by 2.  The practical maximum file
length is about 400K (theoretically 512K).  By giving a compiler option
-DBLKSIZE=2048 when you compile celvis, you can increase the block size
by the 2, hence increase maximum file length by 4.  You may define BLKSIZE
to be any number from 512 to 2**16, as long as it is the power of 2, but
remember that the larger BLKSIZE is, the faster the temporary file grows.

2. about BIG5 codetable, I wonder what do you mean.  If you want a mapping
of HEX representation of a HZ to the binary representation (2-byte code),
that is quite trivial.  Here is one:  save it and type "sh allb5.sh -l"

------------- BEGIN OF allb5.sh --------------------
#!/bin/sh
#
# List all the HKU BIG5 coding hanzi, one in a line.
# Option "-l" => long listing.
#
l='printf "%c%c\n", q, w;'
s=164
while [ $# -gt 0 ]; do
	case "$1" in
	  -l )
		l='printf "%c%c\t%x%x %d\n", q, w, q, w, q*256+w;'
		shift;;
	  -s )
		s=161			# start from the symbol, 0xa0
		shift;;
	  * )
		echo "Usage: $0 [ -l ] [ -s ]" 1>&2
		exit 1
	esac
done
echo "" | awk '
BEGIN {
	for ( q = '"$s"'; q <= 246; q++ ) {		# 0xa4 -- 0xf6
		for ( w =  64; w <= 126; w++ ) { '"$l"' }	# 0x40 -- 0x7e
		for ( w = 161; w <= 254; w++ ) { '"$l"' }	# 0xa1 -- 0xfe
	}
	q = 247; {				# 0xf7
		for ( w =  64; w <=  85; w++ ) { '"$l"' }	# 0x40 -- 0x55
	}
}'
#------------- END OF allb5.sh --------------------

-ygz