home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume8 / libhoward / part08 / new-3.b < prev    next >
Text File  |  1989-10-01  |  2KB  |  75 lines

  1.   
  2. # new-3.b - create a new section 3 manual entry source file from a prototype
  3. #
  4. # $Header: new-3.b,v 1.1 89/09/21 12:44:29 howard Exp $
  5. #
  6. # Copyright 1989 Howard Lee Gayle
  7. # This file is written in the ISO 8859/1 character set.
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License version 1,
  11. # as published by the Free Software Foundation.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. #
  22. # Shell variables:
  23. # a - file name prefix in all caps
  24. # d - '$'
  25. # f - steps through files to create
  26. # p - file name prefix
  27. # u - usage string
  28.  
  29. CMDNAME=new-3
  30. export CMDNAME
  31. u="Usage: $CMDNAME file..."
  32. if [ $# -eq 0 ]
  33. then
  34.    echo "$u" 1>&2
  35.    exit 1
  36. fi
  37. d='$'
  38. for f
  39. do
  40.    p=`basename "$f" .3`
  41.    a=`echo "$p" | tr '[a-z]' '[A-Z]'`
  42.    cat << EOF > "$f"
  43. .\" ${d}Header${d}
  44. .TH $a 3 "${d}Revision${d}"
  45. .SH NAME
  46. $p \- 
  47. .SH SYNOPSIS
  48. .nf
  49. .BR "#include <" stdio.h ">"
  50. .fi
  51. .LP
  52. .BR "void " "$p ("
  53. EOF
  54.    if [ "$NEWTEXTPATH" ]
  55.    then
  56.       cat-path "$NEWTEXTPATH" new-3.cprt >> "$f"
  57.    fi
  58.    cat << EOF >> "$f"
  59. .SH DESCRIPTION
  60. .I $p
  61. .SH RETURNS
  62. .SH EXAMPLES
  63. .nf
  64. .fi
  65. .SH FILES
  66. .SH "SEE ALSO"
  67. .SH DIAGNOSTICS
  68. .SH BUGS
  69. EOF
  70.    if [ "$NEWTEXTPATH" ]
  71.    then
  72.       cat-path "$NEWTEXTPATH" new-3.txt >> "$f"
  73.    fi
  74. done
  75.