From 0cc9b20c15460213e488bf5e70963b941482f628 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Tue, 14 Jan 2025 16:06:02 -0600 Subject: Add source. --- utils/say.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 utils/say.c (limited to 'utils/say.c') diff --git a/utils/say.c b/utils/say.c new file mode 100644 index 0000000..b774eaf --- /dev/null +++ b/utils/say.c @@ -0,0 +1,34 @@ +/* + * Send text to speech server. May be used in script files. + * $Id: say.c 1.2 Mon, 24 Mar 1997 12:25:37 -0500 dyfet $ + * Copyright (c) 1997 by Tycho Softworks. + * For conditions on distribution and reuse see product license. + */ + +#include +#include +#include + +void main(int argc, char **argv) +{ + STREAM fp; + int port = getservice("speak"); + char buf[128]; + + if(argc != 3) + fatal(EX_USAGE, "use: say host \"message\"\n"); + + if(!port) + fatal(EX_UNAVAILABLE, "say: speak: service not in /etc/services\n"); + + fp = opentcp(argv[1], port); + if(!fp) + fatal(EX_UNAVAILABLE, "say: %s: speak service unavailable\n", argv[1]); + + gettcp(buf, 127, fp); + puttcp(argv[2], fp); + puttcp("\n", fp); + closetcp(fp); +} + + -- cgit v1.2.3-54-g00ecf