source: rtems/doc/new_chapters/gen_section @ e694c94b

4.104.114.84.95
Last change on this file since e694c94b was e694c94b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/14/06 at 15:06:38

2006-09-14 Joel Sherrill <joel@…>

  • new_chapters/Makefile.am, new_chapters/gen_section, new_chapters/new_chapters.texi, user/Makefile.am, user/c_user.texi, user/dirstat.texi: Promote CPU Usage to first class citizen. Rename to start with rtems_ and include documentation in user guide.
  • user/cpuuse.t: New file.
  • new_chapters/cpuuse.t: Removed.
  • Property mode set to 100644
File size: 6.9 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_rtmonuse)
133    CHAPTER_CAPS="Rate Monotonic Period Statistics"
134    CHAPTER_LOWER="rate monotonic period statistics"
135    ROUTINES="Period_usage_Initialize Period_usage_Reset \
136        Period_usage_Update Period_usage_Dump"
137    ;;
138  misc_error)
139    CHAPTER_CAPS="Error Reporting Support"
140    CHAPTER_LOWER="error reporting support"
141    ROUTINES="rtems_error rtems_panic"
142    ;;
143  misc_monitor)
144    CHAPTER_CAPS="Monitor Task"
145    CHAPTER_LOWER="monitor task"
146    ROUTINES="rtems_monitor_init rtems_monitor_wakeup"
147    ;;
148  *)
149    echo "Unknown chapter name"
150    exit 1
151    ;;
152esac
153
154if [ "x${CHAPTER_CAPS}" = "x" -o "x${CHAPTER_LOWER}" = "x" \
155     -o "x${ROUTINES}" = "x" ] ; then
156  echo "initialization problem"
157  exit 1
158fi
159
160echo "@c"
161echo "@c  COPYRIGHT (c) 1988-2002."
162echo "@c  On-Line Applications Research Corporation (OAR)."
163echo "@c  All rights reserved. "
164echo "@c"
165echo "@c  \$Id\$"
166echo "@c"
167echo ""
168echo "@chapter ${CHAPTER_CAPS}" Manager
169echo ""
170echo "@section Introduction"
171echo ""
172echo "The "
173echo "${CHAPTER_LOWER} manager is ..."
174echo ""
175echo "The directives provided by the ${CHAPTER_LOWER} manager are:"
176echo ""
177echo "@itemize @bullet"
178
179for routine in ${ROUTINES}
180do
181  echo "@item @code{${routine}} - "
182done
183echo "@end itemize"
184
185echo ""
186echo "@section Background"
187echo ""
188echo "@section Operations"
189echo ""
190echo "@section Directives"
191echo ""
192echo "This section details the ${CHAPTER_LOWER} manager's directives."
193echo "A subsection is dedicated to each of this manager's directives"
194echo "and describes the calling sequence, related constants, usage,"
195echo "and status codes."
196echo ""
197
198for routine in ${ROUTINES}
199do
200  echo "@page"
201  echo "@subsection ${routine} - "
202  echo ""
203  echo "@subheading CALLING SEQUENCE:"
204  echo ""
205  echo "@ifset is-C"
206  echo "@example"
207  echo "int ${routine}("
208  echo ");"
209  echo "@end example"
210  echo "@end ifset"
211  echo ""
212  echo "@ifset is-Ada"
213  echo "@end ifset"
214  echo ""
215  echo "@subheading STATUS CODES:"
216  echo ""
217  echo "@table @b"
218  echo "@item E"
219  echo "The"
220  echo ""
221  echo "@end table"
222  echo ""
223  echo "@subheading DESCRIPTION:"
224  echo ""
225  echo "@subheading NOTES:"
226  echo ""
227done
228
Note: See TracBrowser for help on using the repository browser.