source: rtems/doc/new_chapters/gen_section @ 982e295e

4.104.114.84.95
Last change on this file since 982e295e was bc950e87, checked in by Joel Sherrill <joel.sherrill@…>, on 11/19/98 at 16:02:06

Applied updates from remote work while doing class.

  • Property mode set to 100644
File size: 7.2 KB
Line 
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.
7chapter=$1
8
9case ${chapter} in
10  process)
11    CHAPTER_CAPS="Process Creation and Execution"
12    CHAPTER_LOWER="process creation and execution"
13    ROUTINES="fork 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 getuid geteuid getgid getegid setuid setgid \
20      getgroups getlogin getlogin_r getpgrp setsid setpgid uname times \
21      getenv ctermid ttyname ttyname_r isatty sysconf "
22    ;;
23  files)
24    CHAPTER_CAPS="Files and Directories"
25    CHAPTER_LOWER="files and directories"
26    ROUTINES="opendir readdir readdir_r rewinddir closedir \
27       chdir getcwd open creat umask link mkdir mkfifo unlink \
28       rmdir rename stat fstat access chmod fchmod chown \
29       utime ftrunctate pathconf fpathconf"
30    ;;
31  io)
32    CHAPTER_CAPS="Input and Output Primitives"
33    CHAPTER_LOWER="input and output primitives"
34    ROUTINES="pipe dup dup2 close read write fcntl lseek fsynch fdatasynch \
35       aio_read aio_write lio_listio aio_error aio_return aio_cancel \
36       aio_suspend aio_fsync"
37    ;;
38  device)
39    CHAPTER_CAPS="Device- and Class- Specific Functions"
40    CHAPTER_LOWER="device- and class- specific functions"
41    ROUTINES="cfgetispeed cfgetospeed cfsetispeed cfsetospeed tcgetattr \
42       tcsetattr tcsendbreak tcdrain tcflush tcflow tcgetpgrp tcsetpgrp"
43    ;;
44  cspecific)
45    CHAPTER_CAPS="Language-Specific Services for the C Programming Language"
46    CHAPTER_LOWER="language-specific services for the C programming language"
47    ROUTINES="setlocale fileno fdopen flcokfile ftrylockfile funlockfile \
48       getc_unlocked getchar_unlocked putc_unlocked putchar_unlocked \
49       setjmp longjmp sigsetjmp siglongjmp tzset strtok_r asctime_r \
50       ctime_r gmtime_r localtime_r rand_r"
51    ;;
52  systemdb)
53    CHAPTER_CAPS="System Databases"
54    CHAPTER_LOWER="system databases"
55    ROUTINES="getgrgid getgrgid_r getgrnam getgrnam_r getpwuid getpwuid_r \
56       getpwnam getpwnam_r"
57    ;;
58  semaphores)
59    CHAPTER_CAPS="Semaphores"
60    CHAPTER_LOWER="semaphore"
61    ROUTINES="sem_init sem_destroy sem_open sem_close sem_unlink sem_wait \
62       sem_trywait sem_post sem_getvalue"
63    ;;
64  memorymgmt)
65    CHAPTER_CAPS="Memory Management"
66    CHAPTER_LOWER="memory management"
67    ROUTINES="mlockall munlockall mlock munlock mmap munmap mprotect \
68       msync shm_open shm_unlink"
69    ;;
70  message)
71    CHAPTER_CAPS="Message Passing"
72    CHAPTER_LOWER="message passing"
73    ROUTINES="mq_open mq_close mq_unlink mq_send mq_receive mq_notify \
74       mq_setattr mq_getattr"
75    ;;
76  cancel)
77    CHAPTER_CAPS="Thread Cancellation"
78    CHAPTER_LOWER="thread cancellation"
79    ROUTINES="pthread_cancel pthread_setcancelstate pthread_setcanceltype \
80       pthread_testcancel pthread_cleanup_push"
81    ;;
82  eventlog)
83    CHAPTER_CAPS="Event Logging"
84    CHAPTER_LOWER="event logging"
85    ROUTINES="log_write log_open log_read log_notify log_close log_seek \
86       log_severity_before log_facilityemptyset log_facilityfillset \
87       log_facilityaddset log_facilitydelset log_facilityismember"
88    ;;
89  dumpcontrol)
90    CHAPTER_CAPS="Process Dump Control"
91    CHAPTER_LOWER="process dump control"
92    ROUTINES="dump_setpath"
93    ;;
94  confspace)
95    CHAPTER_CAPS="Configuration Space"
96    CHAPTER_LOWER="configuration space"
97    ROUTINES="cfg_mount cfg_unmount cfg_mknod cfg_get cfg_set cfg_link \
98       cfg_unlink cfg_open cfg_read cfg_children cfg_mark cfg_close"
99    ;;
100  adminiface)
101    CHAPTER_CAPS="Administration Interface"
102    CHAPTER_LOWER="administration interface"
103    ROUTINES="admin_shutdown"
104    ;;
105  # XXX this is not all of the C Library Stuff
106  libc_ctype)
107    CHAPTER_CAPS="C Library Character Handling"
108    CHAPTER_LOWER="character handling"
109    ROUTINES="isalnum isalpha iscntrl isdigit isgraph islower isprint \
110        ispunct isspace isupper isxdigit tolower toupper"
111    ;;
112  libc_math)
113    CHAPTER_CAPS="C Math Library"
114    CHAPTER_LOWER="math library"
115    ROUTINES="acos asis atan atan2 cos sin tan cosh sinh tanh exp frexp ldexp
116      log log10 modf pow sqrt ceil fabs floor fmod"
117    ;;
118  libc_io)
119    CHAPTER_CAPS="C Library IO"
120    CHAPTER_LOWER="C Library IO"
121    ROUTINES="clearerr fclose feof ferror fflush fgetc fgets fopen fputc \
122        fputs fread freopen fseek ftell fwrite getc getchar gets perror \
123        printf fprintf sprintf putc putchar puts remove rename rewind \
124        scanf fscanf sscanf setbuf tempfile tmpnam ungetc"
125    ;;
126  libc_string)
127    CHAPTER_CAPS="C Library String Handling"
128    CHAPTER_LOWER="string handling"
129    ROUTINES="strcpy strncpy strcat strncat strcmp strncmp strchr strcspn \
130       strpbrk strrchr strspn strstr strtok stlen"
131    ;;
132  misc_stackchk)
133    CHAPTER_CAPS="Stack Bounds Checker"
134    CHAPTER_LOWER="stack bounds checker"
135    ROUTINES="Stack_check_Initialize Stack_check_Dump_usage"
136    ;;
137  misc_rtmonuse)
138    CHAPTER_CAPS="Rate Monotonic Period Statistics"
139    CHAPTER_LOWER="rate monotonic period statistics"
140    ROUTINES="Period_usage_Initialize Period_usage_Reset \
141        Period_usage_Update Period_usage_Dump"
142    ;;
143  misc_cpuuse)
144    CHAPTER_CAPS="CPU Usage Statistics"
145    CHAPTER_LOWER="CPU usage statistics"
146    ROUTINES="CPU_usage_Dump CPU_usage_Reset"
147    ;;
148  misc_error)
149    CHAPTER_CAPS="Error Reporting Support"
150    CHAPTER_LOWER="error reporting support"
151    ROUTINES="rtems_error rtems_panic"
152    ;;
153  misc_monitor)
154    CHAPTER_CAPS="Monitor Task"
155    CHAPTER_LOWER="monitor task"
156    ROUTINES="rtems_monitor_init rtems_monitor_wakeup"
157    ;;
158  *)
159    echo "Unknown chapter name"
160    exit 1
161    ;;
162esac
163
164if [ "x${CHAPTER_CAPS}" = "x" -o "x${CHAPTER_LOWER}" = "x" \
165     -o "x${ROUTINES}" = "x" ] ; then
166  echo "initialization problem"
167  exit 1
168fi
169
170echo "@c"
171echo "@c  COPYRIGHT (c) 1988-1998."
172echo "@c  On-Line Applications Research Corporation (OAR)."
173echo "@c  All rights reserved. "
174echo "@c"
175echo "@c  \$Id\$"
176echo "@c"
177echo ""
178echo "@chapter ${CHAPTER_CAPS}" Manager
179echo ""
180echo "@section Introduction"
181echo ""
182echo "The "
183echo "${CHAPTER_LOWER} manager is ..."
184echo ""
185echo "The directives provided by the ${CHAPTER_LOWER} manager are:"
186echo ""
187echo "@itemize @bullet"
188
189for routine in ${ROUTINES}
190do
191  echo "@item @code{${routine}} - "
192done
193echo "@end itemize"
194
195echo ""
196echo "@section Background"
197echo ""
198echo "@section Operations"
199echo ""
200echo "@section Directives"
201echo ""
202echo "This section details the ${CHAPTER_LOWER} manager's directives."
203echo "A subsection is dedicated to each of this manager's directives"
204echo "and describes the calling sequence, related constants, usage,"
205echo "and status codes."
206echo ""
207
208for routine in ${ROUTINES}
209do
210  echo "@page"
211  echo "@subsection ${routine} - "
212  echo ""
213  echo "@subheading CALLING SEQUENCE:"
214  echo ""
215  echo "@ifset is-C"
216  echo "@example"
217  echo "int ${routine}("
218  echo ");"
219  echo "@end example"
220  echo "@end ifset"
221  echo ""
222  echo "@ifset is-Ada"
223  echo "@end ifset"
224  echo ""
225  echo "@subheading STATUS CODES:"
226  echo ""
227  echo "@table @b"
228  echo "@item E"
229  echo "The"
230  echo ""
231  echo "@end table"
232  echo ""
233  echo "@subheading DESCRIPTION:"
234  echo ""
235  echo "@subheading NOTES:"
236  echo ""
237done
238
Note: See TracBrowser for help on using the repository browser.