#!/bin/sh

# $Copyright:	$
# Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
# Sequent Computer Systems, Inc.   All rights reserved.
#  
# This software is furnished under a license and may be used
# only in accordance with the terms of that license and with the
# inclusion of the above copyright notice.   This software may not
# be provided or otherwise made available to, or used by, any
# other person.  No title to or ownership of the software is
# hereby transferred.

# $Header: maketoc 1.5 86/05/18 $
case $1 in
	toc1 ) s="1.*" ;;
	toc2 ) s="2.*" ;;
	toc3 ) s="3" ;;
	toc3c ) s="3C" ;;
	toc3m ) s="3M" ;;
	toc3n ) s="3N" ;;
	toc3p ) s="3P" ;;
	toc3s ) s="3S" ;;
	toc3x ) s="3X" ;;
	toc4 ) s="4.*" ;;
	toc5 ) s="5.*" ;;
	toc6 ) s="6.*" ;;
	toc7 ) s="7.*" ;;
	toc8 ) s="8.*" ;;
	* )
		echo >&2 "Bad section number $1"
		exit 1 ;;
esac
grep "^[^ ]*($s)" ptxin |
sed 's/^intro(/&/'|
sort |
sed '
	s/^//
	s/^\([^(]*\).*: \(.*\)$/\1\2/
'
