# # 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 task) CHAPTER_CAPS="Task" CHAPTER_LOWER="task" ROUTINES=" cre_tsk del_tsk sta_tsk ext_tsk exd_tsk ter_tsk \ dis_dsp ena_dsp chg_pri rot_rdq rel_wai get_tid ref_tsk" ;; tasksync) CHAPTER_CAPS="Task-Dependent Synchronization" CHAPTER_LOWER="task-dependent synchronization" ROUTINES=" sus_tsk rsm_tsk frsm_tsk \ slp_tsk tslp_tsk wup_tsk can_wup" ;; semaphore) CHAPTER_CAPS="Semaphore" CHAPTER_LOWER="semaphore" ROUTINES="cre_sem del_sem sig_sem wai_sem preq_sem twai_sem ref_sem " ;; eventflags) CHAPTER_CAPS="Eventflags" CHAPTER_LOWER="eventflags" ROUTINES=" cre_flg del_flg set_flg clr_flg wai_flg pol_flg \ twai_flg ref_flg " ;; mailbox) CHAPTER_CAPS="Mailbox" CHAPTER_LOWER="mailbox" ROUTINES="cre_mbx del_mbx snd_msg rcv_msg prcv_msg trcv_msg ref_mbx" ;; msgbuffer) CHAPTER_CAPS="Message Buffer" CHAPTER_LOWER="message buffer" ROUTINES=" cre_mbf del_mbf snd_mbf psnd_mbf tsnd_mbf rcv_mbf prcv_mbf \ trcv_mbf ref_mbf " ;; rendezvous) CHAPTER_CAPS="Rendezvous" CHAPTER_LOWER="rendezvous" ROUTINES=" cre_por del_por cal_por pcal_por tcal_por acp_por pacp_por \ tacp_por fwd_por rpl_rdv ref_por" ;; interrupt) CHAPTER_CAPS="Interrupt" CHAPTER_LOWER="interrupt" ROUTINES=" def_int ret_int ret_wup loc_cpu unl_cpu dis_int ena_int chg_iXX ref_iXX" ;; memorypool) CHAPTER_CAPS="Memory Pool" CHAPTER_LOWER="memory pool" ROUTINES=" cre_mpl del_mpl get_blk pget_blk tget_blk rel_blk ref_mpl" ;; fixedblock) CHAPTER_CAPS="Fixed Block" CHAPTER_LOWER="fixed block" ROUTINES=" cre_mpf del_mpf get_blf pget_blf tget_blf rel_blf ref_mpf" ;; time) CHAPTER_CAPS="Time" CHAPTER_LOWER="time" ROUTINES=" get_tim set_tim dly_tsk \ def_cyc act_cyc ref_cyc \ def_alm ref_alm ret_tmr" ;; config) CHAPTER_CAPS="System" CHAPTER_LOWER="system" ROUTINES=" get_ver ref_sys ref_cfg def_svc def_exc" ;; network) CHAPTER_CAPS="Network Support" CHAPTER_LOWER="network support" ROUTINES=" nrea_dat nwri_dat nget_nod nget_ver" ;; *) 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 This is the chapter from the RTEMS ITRON User's Guide that" echo "@c documents the services provided by the ${CHAPTER_LOWER}" echo "@c manager." 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 services provided by the ${CHAPTER_LOWER} manager are:" echo "" echo "@itemize @bullet" for routine in ${ROUTINES} do description=`grep " ${routine} " ../../itron_spec/itron3-1.txt | grep "]" | cut -d']' -f2 ` description=`echo ${description}` echo "@item @code{${routine}} - ${description}" done echo "@end itemize" echo "" echo "@section Background" echo "" echo "@section Operations" echo "" echo "@section System Calls" echo "" echo "This section details the ${CHAPTER_LOWER} manager's services." echo "A subsection is dedicated to each of this manager's services" echo "and describes the calling sequence, related constants, usage," echo "and status codes." echo "" for routine in ${ROUTINES} do description=`grep ${routine} ../../itron_spec/itron3-1.txt | grep "]" | cut -d']' -f2` description=`echo -n ${description}` echo "" echo "@c" echo "@c ${routine}" echo "@c" echo "" echo "@page" echo "@subsection ${routine} - " ${description} echo "" echo "@subheading CALLING SEQUENCE:" echo "" echo "@ifset is-C" echo "@example" proto=`grep "${routine} (" ../../itron_spec/itron3-6.txt | sed -e 's/ercd = //'` # | sed -e 's/ \\(/(/'` echo `echo -n ${proto} | cut -d'(' -f1`"(" echo ${proto} | cut -d'(' -f2 | sed -e 's/ .;//' echo ");" # 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 "@code{EXXX} - " echo "" echo "@subheading DESCRIPTION:" echo "" echo "@subheading NOTES:" echo "" done