Annotation of coherent/b/kernel/FWB/speech.h, revision 1.1

1.1     ! root        1: /*-----------------------------------------------------------------------------
        !             2:        Talking BIOS device driver for the AT&T PC6300.
        !             3:        Copyright (C) Karl Dahlke 1987
        !             4:        This software may be freely used and distributed
        !             5:        for any non-profit purpose.
        !             6:  *-----------------------------------------------------------------------------
        !             7:  */
        !             8: 
        !             9: /* speech.h: header file for speaking device drivers */
        !            10: 
        !            11: #ifndef MSDOS
        !            12: /* char far *  is the same as char * in Unix */
        !            13: #define far
        !            14: #endif
        !            15: 
        !            16: /* don't incorporate any C routines from libc.a,
        !            17:  * becaues they do stack checking, and this is not a normal stack.
        !            18:  * However, we can use the ctype macros and static _ctype[] array. */
        !            19: 
        !            20: #include <ctype.h>
        !            21: 
        !            22: #define WORDLEN 24 /* length of longest "word" */
        !            23: #define LINELEN 38 /* length of support command line */
        !            24: #define N_CMDS 32 /* number of available speech commands */
        !            25: 
        !            26: /* record additional keystrokes,
        !            27:  * when a speech command requires extra data.
        !            28:  * For instance, search through the circular buffer for a string,
        !            29:  * and start reading at that point. */
        !            30: struct MULTIKEY {
        !            31: char lastcmd; /* the multi-key command */
        !            32: char nextchar; /* command needs the next character */
        !            33: char nextline; /* command needs the next line */
        !            34: char textlen;
        !            35: short support; /* extra key, could be function key etc */
        !            36: char text[LINELEN];
        !            37: char lasttext[LINELEN];
        !            38: };
        !            39: 
        !            40: /* control structure for speaking session */
        !            41: extern struct SDCONTROL {
        !            42: struct MULTIKEY indata, outdata;
        !            43: char *bufbot, *buftop; /* the circular buffer */
        !            44: char *bufhead, *buftail; /* extend of text within the buffer */
        !            45: char *bufcur; /* position of internal cursor within the buffer */
        !            46: int (*dev_in)(); /* function to put char on device input queue */
        !            47: char talkcmd; /* talking command */
        !            48: char dumping; /* dumping text to a file? */
        !            49: char macsel; /* macro set selection, 0 through 9 */
        !            50: long drain_lbolt;
        !            51: /* flags/modes */
        !            52: char xparent; /* transparent mode, emulate the original driver */
        !            53: char buf_ok; /* send output characters to the circular buffer for reading */
        !            54: char ctrl_ok; /* allow control characters to enter the buffer for reading */
        !            55: char dev_ok; /* send output characters to the screen (or com port) */
        !            56: char rdflag; /* currently reading text */
        !            57: char onesymb; /* reading one symbol */
        !            58: char oneline; /* read one line at a time */
        !            59: char esc; /* last char was escape */
        !            60: char esc_lc; /* escape leftbrace received */
        !            61: /* arrays of text */
        !            62: /* punctuation pronounciation table, at most 10 letters per symbol.
        !            63:  * it turns out, you don't want long names for these anyways.
        !            64:  * it slows you down, reducing productivity.  */
        !            65: char punctab[40*10];
        !            66: /* bind keys to talking commands */
        !            67: char keymap[146];
        !            68: char defcbuf[80]; /* in case kalloc fails */
        !            69: } *sdcontrol[5];
        !            70: 
        !            71: /* the above structures are initialized upon startup.
        !            72:  * One should use kalloc() to allocate the circular
        !            73:  * buffer and replacement text space at load time rather than compile time. */
        !            74: 
        !            75: /* speech command structure, one for each possible command */
        !            76: extern struct SDCMD {
        !            77: char *desc; /* description */
        !            78: char brief[8];
        !            79: char nonempty; /* buffer must be nonempty */
        !            80: char rdline; /* read the current line */
        !            81: char rdsymb; /* read one symbol */
        !            82: char rdchar; /* read one character */
        !            83: char nextkey; /* needs next key to complete command */
        !            84: char nextline; /* needs line of text to complete command */
        !            85: } sdcmds[];
        !            86: 
        !            87: /* state variables, set when entering deferred speech routines */
        !            88: extern struct SDCONTROL *sdc;
        !            89: extern char sdw[];
        !            90: extern int sdsession, sdnoises, sdtones;
        !            91: extern int sd0synth, sd0comport;
        !            92: extern int sdscreenmode, sdoverride;
        !            93: 
        !            94: #ifdef MSDOS
        !            95: extern char *kalloc();
        !            96: #else
        !            97: extern char *allkp, *alloc();
        !            98: #define        kalloc(n)       alloc(allkp, n)
        !            99: #define kfree(p)       free(p)
        !           100: #endif
        !           101: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.