This assignment requires you to write a program to control another program by stopping and starting it. The other program plays a well-known radio station. The control program utilises an X-Window program with a stop and a start button.
xonoff
and play_radio
.
The program xonoff
displays a window with two buttons, on and off.
Each time the on button is pressed a ``1'' is written to stdout
terminated by a newline, and each time the off button is pressed
a ``0'' is written to stdout, terminated by a newline.
The program play_radio
listens on the network for a
broadcast radio and sends this to the builtin speaker on the Sun.
The program that you write has to use xonoff
to
provide two buttons to control play_radio
.
When the user clicks on the on button, the radio will play,
and when the user clicks on the off button the radio will stop.
The program will start off with the radio playing.
The user can terminate execution by pressing ctrl-C in the xterm
that started the program.
give
.
This command runs with two parameters.
The first parameter should be the string ``a3'' and the second should be the
name of the file containing your C program. For example,
give a3 control_radio.c
You may run give
any number of times.
Each time you run give
it replaces any
earlier submission of the assignment.
Submit the C source code for your assignment, not the executable
xonoff
and the control of
play_radio
.
A program can be terminated by sending it the SIGKILL signal.
Aternatively, it can be stopped and restarted by sending it the
SIGSTOP and SIGCONT signals.