1 | # |
---|
2 | # This shell script generates the starting template for a manager chapter. |
---|
3 | # |
---|
4 | |
---|
5 | |
---|
6 | # Set this based on which chapter you want to generate a template for. |
---|
7 | chapter="process" |
---|
8 | |
---|
9 | case ${chapter} in |
---|
10 | process) |
---|
11 | CHAPTER_CAPS="Process Creation and Execution" |
---|
12 | CHAPTER_LOWER="process creation and execution" |
---|
13 | ROUTINES="execl execv execle execve execlp execvp pthread_atfork \ |
---|
14 | wait waitpid _exit" |
---|
15 | ;; |
---|
16 | procenv) |
---|
17 | CHAPTER_CAPS="Process Environment" |
---|
18 | CHAPTER_LOWER="process environment" |
---|
19 | ROUTINES="getpid getppid getgid getegid setuid setgid getgroups \ |
---|
20 | getlogin getlogin_r getpgrp setsid setpgid uname times \ |
---|
21 | getenv ctermid ttyname ttyname_r isatty sysconf " |
---|
22 | ;; |
---|
23 | *) |
---|
24 | echo "Unknown chapter name" |
---|
25 | exit 1 |
---|
26 | ;; |
---|
27 | esac |
---|
28 | |
---|
29 | if [ "x${CHAPTER_CAPS}" = "x" -o "x${CHAPTER_LOWER}" = "x" \ |
---|
30 | -o "x${ROUTINES}" = "x" ] ; then |
---|
31 | echo "initialization problem" |
---|
32 | exit 1 |
---|
33 | fi |
---|
34 | |
---|
35 | echo "@c" |
---|
36 | echo "@c COPYRIGHT (c) 1988-1998." |
---|
37 | echo "@c On-Line Applications Research Corporation (OAR)." |
---|
38 | echo "@c All rights reserved. " |
---|
39 | echo "@c" |
---|
40 | echo "@c \$Id\$" |
---|
41 | echo "@c" |
---|
42 | echo "" |
---|
43 | echo "@chapter ${CHAPTER_CAPS}" Manager |
---|
44 | echo "" |
---|
45 | echo "@section Introduction" |
---|
46 | echo "" |
---|
47 | echo "The " |
---|
48 | echo "${CHAPTER_LOWER} manager is ..." |
---|
49 | echo "" |
---|
50 | echo "The directives provided by the ${CHAPTER_LOWER} manager are:" |
---|
51 | echo "" |
---|
52 | echo "@itemize @bullet" |
---|
53 | |
---|
54 | for routine in ${ROUTINES} |
---|
55 | do |
---|
56 | echo "@item @code{${routine}} - " |
---|
57 | done |
---|
58 | echo "@end itemize" |
---|
59 | |
---|
60 | echo "" |
---|
61 | echo "@section Background" |
---|
62 | echo "" |
---|
63 | echo "@section Operations" |
---|
64 | echo "" |
---|
65 | echo "@section Directives" |
---|
66 | echo "" |
---|
67 | echo "This section details the ${CHAPTER_LOWER} manager's directives." |
---|
68 | echo "A subsection is dedicated to each of this manager's directives" |
---|
69 | echo "and describes the calling sequence, related constants, usage," |
---|
70 | echo "and status codes." |
---|
71 | echo "" |
---|
72 | |
---|
73 | for routine in ${ROUTINES} |
---|
74 | do |
---|
75 | echo "@page" |
---|
76 | echo "@subsection ${routine} - XXX" |
---|
77 | echo "" |
---|
78 | echo "@subheading CALLING SEQUENCE:" |
---|
79 | echo "" |
---|
80 | echo "@ifset is-C" |
---|
81 | echo "@example" |
---|
82 | echo "int ${routine}(" |
---|
83 | echo ");" |
---|
84 | echo "@end example" |
---|
85 | echo "@end ifset" |
---|
86 | echo "" |
---|
87 | echo "@ifset is-Ada" |
---|
88 | echo "@end ifset" |
---|
89 | echo "" |
---|
90 | echo "@subheading STATUS CODES:" |
---|
91 | echo "" |
---|
92 | echo "@subheading DESCRIPTION:" |
---|
93 | echo "" |
---|
94 | echo "@subheading NOTES:" |
---|
95 | echo "" |
---|
96 | done |
---|
97 | |
---|