aboutsummaryrefslogtreecommitdiffstats
path: root/spo256/speak.h
blob: 07b98753b7f31b5f8a176d8a179e378458058f32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
 * Master header for spo server.
 * $Id$
 * Copyright (c) 1997 by Tycho Softworks.
 * For conditions of distribution and use see license.
 * 
 * Abstract:
 *	Define internal hash index system to quickly find text for
 *	substitutions.  The spo-256 is driven by substitution tables
 *	which provide alternate spellings to adjust mis-pronounced
 *	speech.
 */

typedef	enum
{
	P_END,		/* Finish line off, send SPO-end mark	*/
	P_LINE,		/* Send nl because we have a empty line */
	P_SENTANCE,	/* Pause at end of sentance (nl)	*/
	P_WORD		/* Inter-word delay (spaces)		*/
}	PAUSE; 

#define	KEYSIZE	791	/* Size of internal hash database keyrange 	*/

typedef	struct _idx
{
	struct	_idx	*word_link;	/* hash link chain		*/
	char	*word_key;		/* initial word & hash key	*/
	char	*word_spo;		/* substitute spelling		*/
}	IDX;

extern	int	spo;
extern	IDX	**widx, **aidx;
extern	char	*mask;
extern	FILE	*io;
extern	bool	echo, spell, lit;

void	abbrev(char *str);
int	getspo(CONFIG *cfg);
void	getidx(CONFIG *cfg);
char	*find(IDX **table, char *str);
void	client(char *hostname, ushort port);

void	spo_init(void);
void	spo_cmd(char *str);
void	spo_word(char *str);
void	spo_pause(PAUSE);
void	spo_begquote(void);
void	spo_endquote(void);