summaryrefslogtreecommitdiffstats
path: root/doc/new_chapters/gen_section
blob: 658f8ce45a28ee8bac9d4f166c9806aef904559c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#
#  This shell script generates the starting template for a manager chapter.
#


# Set this based on which chapter you want to generate a template for.
chapter="process"

case ${chapter} in 
  process)
    CHAPTER_CAPS="Process Creation and Execution"
    CHAPTER_LOWER="process creation and execution"
    ROUTINES="execl execv execle execve execlp execvp pthread_atfork \
      wait waitpid _exit"
    ;;
  procenv)
    CHAPTER_CAPS="Process Environment"
    CHAPTER_LOWER="process environment"
    ROUTINES="getpid getppid getgid getegid setuid setgid getgroups \
      getlogin getlogin_r getpgrp setsid setpgid uname times \
      getenv ctermid ttyname ttyname_r isatty sysconf "
    ;;
  *)
    echo "Unknown chapter name"
    exit 1
    ;;
esac

if [ "x${CHAPTER_CAPS}" = "x" -o "x${CHAPTER_LOWER}" = "x" \
     -o "x${ROUTINES}" = "x" ] ; then
  echo "initialization problem"
  exit 1
fi

echo "@c"
echo "@c  COPYRIGHT (c) 1988-1998."
echo "@c  On-Line Applications Research Corporation (OAR)."
echo "@c  All rights reserved. "
echo "@c"
echo "@c  \$Id\$"
echo "@c"
echo ""
echo "@chapter ${CHAPTER_CAPS}" Manager
echo ""
echo "@section Introduction"
echo ""
echo "The "
echo "${CHAPTER_LOWER} manager is ..."
echo ""
echo "The directives provided by the ${CHAPTER_LOWER} manager are:"
echo ""
echo "@itemize @bullet"

for routine in ${ROUTINES}
do
  echo "@item @code{${routine}} - "
done
echo "@end itemize"

echo ""
echo "@section Background"
echo ""
echo "@section Operations"
echo ""
echo "@section Directives"
echo ""
echo "This section details the ${CHAPTER_LOWER} manager's directives."
echo "A subsection is dedicated to each of this manager's directives"
echo "and describes the calling sequence, related constants, usage,"
echo "and status codes."
echo ""

for routine in ${ROUTINES}
do
  echo "@page"
  echo "@subsection ${routine} - XXX"
  echo ""
  echo "@subheading CALLING SEQUENCE:"
  echo ""
  echo "@ifset is-C"
  echo "@example"
  echo "int ${routine}("
  echo ");"
  echo "@end example"
  echo "@end ifset"
  echo ""
  echo "@ifset is-Ada"
  echo "@end ifset"
  echo ""
  echo "@subheading STATUS CODES:"
  echo ""
  echo "@subheading DESCRIPTION:"
  echo ""
  echo "@subheading NOTES:"
  echo ""
done