summaryrefslogblamecommitdiffstats
path: root/doc/new_chapters/gen_section
blob: d1b472ec3f06044a17eab3d032b01091216b1208 (plain) (tree)
1
2
3
4
5
6
7


                                                                           
 

                                                                      
          




                                                  
                                                                           
                         
      


                                       

                                                                          
                                                       
      







                                                               









































































                                                                             


























                                                                             

























                                                            
    
                               



          






                                                            
                                   















                                                                   
 
                          
  


                                   
 















                                                                      
                                  














                                      





                   




                                 
 
#
#  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=$1

case ${chapter} in 
  process)
    CHAPTER_CAPS="Process Creation and Execution"
    CHAPTER_LOWER="process creation and execution"
    ROUTINES="fork execl execv execle execve execlp execvp pthread_atfork \
      wait waitpid _exit"
    ;;
  procenv)
    CHAPTER_CAPS="Process Environment"
    CHAPTER_LOWER="process environment"
    ROUTINES="getpid getppid getuid geteuid getgid getegid setuid setgid \
      getgroups getlogin getlogin_r getpgrp setsid setpgid uname times \
      getenv ctermid ttyname ttyname_r isatty sysconf "
    ;;
  files)
    CHAPTER_CAPS="Files and Directories"
    CHAPTER_LOWER="files and directories"
    ROUTINES="opendir readdir readdir_r rewinddir closedir \
       chdir getcwd open creat umask link mkdir mkfifo unlink \
       rmdir rename stat fstat access chmod fchmod chown \
       utime ftrunctate pathconf fpathconf"
    ;;
  io)
    CHAPTER_CAPS="Input and Output Primitives"
    CHAPTER_LOWER="input and output primitives"
    ROUTINES="pipe dup dup2 close read write fcntl lseek fsynch fdatasynch \
       aio_read aio_write lio_listio aio_error aio_return aio_cancel \
       aio_suspend aio_fsync"
    ;;
  device)
    CHAPTER_CAPS="Device- and Class- Specific Functions"
    CHAPTER_LOWER="device- and class- specific functions"
    ROUTINES="cfgetispeed cfgetospeed cfsetispeed cfsetospeed tcgetattr \
       tcsetattr tcsendbreak tcdrain tcflush tcflow tcgetpgrp tcsetpgrp"
    ;;
  cspecific)
    CHAPTER_CAPS="Language-Specific Services for the C Programming Language"
    CHAPTER_LOWER="language-specific services for the C programming language"
    ROUTINES="setlocale fileno fdopen flcokfile ftrylockfile funlockfile \
       getc_unlocked getchar_unlocked putc_unlocked putchar_unlocked \
       setjmp longjmp sigsetjmp siglongjmp tzset strtok_r asctime_r \
       ctime_r gmtime_r localtime_r rand_r"
    ;;
  systemdb)
    CHAPTER_CAPS="System Databases"
    CHAPTER_LOWER="system databases"
    ROUTINES="getgrgid getgrgid_r getgrnam getgrnam_r getpwuid getpwuid_r \
       getpwnam getpwnam_r"
    ;;
  semaphores)
    CHAPTER_CAPS="Semaphores"
    CHAPTER_LOWER="semaphore"
    ROUTINES="sem_init sem_destroy sem_open sem_close sem_unlink sem_wait \
       sem_trywait sem_post sem_getvalue"
    ;;
  memorymgmt)
    CHAPTER_CAPS="Memory Management"
    CHAPTER_LOWER="memory management"
    ROUTINES="mlockall munlockall mlock munlock mmap munmap mprotect \
       msync shm_open shm_unlink"
    ;;
  message)
    CHAPTER_CAPS="Message Passing"
    CHAPTER_LOWER="message passing"
    ROUTINES="mq_open mq_close mq_unlink mq_send mq_receive mq_notify \
       mq_setattr mq_getattr"
    ;;
  cancel)
    CHAPTER_CAPS="Thread Cancellation"
    CHAPTER_LOWER="thread cancellation"
    ROUTINES="pthread_cancel pthread_setcancelstate pthread_setcanceltype \
       pthread_testcancel pthread_cleanup_push"
    ;;
  eventlog)
    CHAPTER_CAPS="Event Logging"
    CHAPTER_LOWER="event logging"
    ROUTINES="log_write log_open log_read log_notify log_close log_seek \
       log_severity_before log_facilityemptyset log_facilityfillset \
       log_facilityaddset log_facilitydelset log_facilityismember"
    ;;
  dumpcontrol)
    CHAPTER_CAPS="Process Dump Control"
    CHAPTER_LOWER="process dump control"
    ROUTINES="dump_setpath"
    ;;
  confspace)
    CHAPTER_CAPS="Configuration Space"
    CHAPTER_LOWER="configuration space"
    ROUTINES="cfg_mount cfg_unmount cfg_mknod cfg_get cfg_set cfg_link \
       cfg_unlink cfg_open cfg_read cfg_children cfg_mark cfg_close"
    ;;
  adminiface)
    CHAPTER_CAPS="Administration Interface"
    CHAPTER_LOWER="administration interface"
    ROUTINES="admin_shutdown"
    ;;
  # XXX this is not all of the C Library Stuff
  libc_ctype)
    CHAPTER_CAPS="C Library Character Handling"
    CHAPTER_LOWER="character handling"
    ROUTINES="isalnum isalpha iscntrl isdigit isgraph islower isprint \
        ispunct isspace isupper isxdigit tolower toupper"
    ;;
  libc_math)
    CHAPTER_CAPS="C Math Library"
    CHAPTER_LOWER="math library"
    ROUTINES="acos asis atan atan2 cos sin tan cosh sinh tanh exp frexp ldexp
      log log10 modf pow sqrt ceil fabs floor fmod"
    ;;
  libc_io)
    CHAPTER_CAPS="C Library IO"
    CHAPTER_LOWER="C Library IO"
    ROUTINES="clearerr fclose feof ferror fflush fgetc fgets fopen fputc \
        fputs fread freopen fseek ftell fwrite getc getchar gets perror \
        printf fprintf sprintf putc putchar puts remove rename rewind \
        scanf fscanf sscanf setbuf tempfile tmpnam ungetc"
    ;;
  libc_string)
    CHAPTER_CAPS="C Library String Handling"
    CHAPTER_LOWER="string handling"
    ROUTINES="strcpy strncpy strcat strncat strcmp strncmp strchr strcspn \
       strpbrk strrchr strspn strstr strtok stlen"
    ;;
  misc_stackchk)
    CHAPTER_CAPS="Stack Bounds Checker"
    CHAPTER_LOWER="stack bounds checker"
    ROUTINES="Stack_check_Initialize Stack_check_Dump_usage"
    ;;
  misc_rtmonuse)
    CHAPTER_CAPS="Rate Monotonic Period Statistics"
    CHAPTER_LOWER="rate monotonic period statistics"
    ROUTINES="Period_usage_Initialize Period_usage_Reset \
        Period_usage_Update Period_usage_Dump"
    ;;
  misc_cpuuse)
    CHAPTER_CAPS="CPU Usage Statistics"
    CHAPTER_LOWER="CPU usage statistics"
    ROUTINES="CPU_usage_Dump CPU_usage_Reset"
    ;;
  misc_error)
    CHAPTER_CAPS="Error Reporting Support"
    CHAPTER_LOWER="error reporting support"
    ROUTINES="rtems_error rtems_panic"
    ;;
  misc_monitor)
    CHAPTER_CAPS="Monitor Task"
    CHAPTER_LOWER="monitor task"
    ROUTINES="rtems_monitor_init rtems_monitor_wakeup"
    ;;
  *)
    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-2002."
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} - "
  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 "@table @b"
  echo "@item E"
  echo "The"
  echo ""
  echo "@end table"
  echo ""
  echo "@subheading DESCRIPTION:"
  echo ""
  echo "@subheading NOTES:"
  echo ""
done