#include        <stdio.h>
#include        <iodef.h>
#include        "bob$talk:talk.h"

cmd_enableq()   /* enable the speaker request queue */

{
extern  int     master_chan;
extern  int     inc_chan;
extern  int     talk_port;

        short   iosb[4];
        TALKMSG talkmsg;

        talkmsg.tm_type = TALKM_ENABLEQ;
        talkmsg.tm_port = talk_port;

        sys$qiow(0, master_chan, IO$_WRITEVBLK | IO$M_NOW, iosb, 0, 0,
                &talkmsg, TMSIZE, 0, 0, 0, 0);

            do {
                sys$qiow(0, inc_chan, IO$_READVBLK, iosb,
                    0, 0, &talkmsg, TMSIZE, 0, 0, 0, 0);
                switch(talkmsg.tm_type) {
                    case TALKM_LINE:    buffer_line(talkmsg.tm_msg);
                                        break;
                    case TALKM_GOOD:
                    case TALKM_BAD:     printf("%s\r\n", talkmsg.tm_msg);
                                        break;
                    default:            printf("bad type %d\r\n", talkmsg.tm_type);
                                        break;
                }
            } while ((talkmsg.tm_type != TALKM_BAD) && 
                     (talkmsg.tm_type != TALKM_GOOD));

}
                                                                                
