#! /bin/sh
#
# @(#)setIOBUFSIZE	1.3	LPS_UNX_COM	02/19/95
#
# Copyright 1993   Digital Equipment Corporation, Maynard, MA
#
# setIOBUFSIZE
#
# A script that produces a value for attribute IOBUFSIZE.
#
# Parameters:
#    $1 - LPS class identifier, one of {PC, MC, PS, ENV}
#    $2 - Operating system type identifier (eg: SV2, BSD, etc)
#    $3 - Print client type identifier (eg: AIX, BSD, SV3, etc)
#    $4 - PrintServer printer model (eg: LPS17, LPS20)
#    $5 - Default value for the attribute
#    $6 - Path of the output file to receive the final attribute value
#
# Global variables:
#    ECHON
#    FUNCS
#    PAGER
#    TMPDIR
#    TR    (for the checknumrange() function)
#
# Exit values:
#    0 - Success, output file contains newly set attribute value.
#    1 - Error or interruption occurred, error messages go to stderr,
#	 contents of the output file are undefined.
###

CLASS=$1
OSTYPE=$2
PCTYPE=$3
PSMODEL=$4
DEFVAL=$5
OUTFILE=$6

. $FUNCS   # Import the standard LPS shell functions

if [ "$CLASS" = "ENV" ]
then
   NOTES="
A typical site will choose the default response for this question."
fi

# Note that for the general menu system to work properly, ENV_IOBUFSIZE
# must represent one of the values in the list below.  Actually, there
# is no requirement that the value be of the suggested set; it can be
# any reasonable integer value.

showhelp true "
What is the size for file I/O buffers?

Most LPS programs read and process files.  Depending on your particular
system configuration, you may wish to use large buffers when processing
files, thereby usually increasing overall filesystem performance.

Using smaller buffers, however, generally results in smaller process
sizes, which may be desirable for memory-constrained system
configurations.
$NOTES"

list="2048 4096 8192 16384 32768 65536"

choose $DEFVAL "File buffer size (in bytes)" $list

if [ -z "$RESPONSE" ]
then
    RESPONSE="$DEFVAL"
fi

echo "$RESPONSE" > $OUTFILE

exit 0
