Interface Patterns Summary
- Read Applying Unix Interface-Design Patterns from TAOUP
- Read Silence Is Golden from TAOUP
-
Connect to your shell account via PuTTY or ssh and read source of
bc
at/usr/src/bc-1.06/bc/main.c
for syntax highlighting and easy line number open in
vim
, or run$ source-highlight -f esc256 -s c </usr/src/bc-1.06/bc/main.c | less -NR
Self Study
-
Does our
wordfreq
program follow the Polyvalent-Program Pattern? -
Has our
wordfreq
program followed the “Silence is Golden” rule? Why or why not? -
Identify the functions defined in
main.c
of thebc
source. At a high level, what does each one do? -
At what line of
bc
’smain.c
do each of the following modules start:- command line option parsing
- the read/parse/execute interpreter loop (the loop itself is
actually hidden away in a function, what is the name of this top-level
function called in
main()
?)
-
Where in the source of
bc
is the check to determine interactive mode vs. non-interactive mode? What function is used? Read the man page for this function.