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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
$NetBSD: patch-ab,v 1.2 2004/09/10 12:02:54 drochner Exp $
--- splotch.c.orig 2000-10-23 13:37:56.000000000 +0200
+++ splotch.c
@@ -17,9 +17,12 @@
#define NAME "Eliza" /* name of robot */
#define SP_HIST 4 /* number of slots in old key queue */
#define TEMPLSIZ 2000 /* maximum number of templates */
-#define DICTFILE "/usr/share/elizatalk/main.dict" /* name of dictionary file */
-#define SYNFILE "/usr/share/elizatalk/syn.dict" /* name of dictionary file */
-#define WORDSDIR "/usr/share/elizatalk/words" /* name of words directory without '/' at the end*/
+#ifndef ELIZADIR
+#define ELIZADIR "/usr/share/elizatalk"
+#endif
+#define DICTFILE ELIZADIR "/main.dict" /* name of dictionary file */
+#define SYNFILE ELIZADIR "/syn.dict" /* name of dictionary file */
+#define WORDSDIR ELIZADIR "/words" /* name of words directory without '/' at the end*/
#define DEBUG 0 /* debug flag */
#define VERBOSE 0 /* verbose errors */
#define DEB 0
@@ -40,7 +43,6 @@ FILE *dfile; /* file poi
int maxtempl; /* templ[maxtempl] is last entry */
int oldkeywd[SP_HIST]; /* queue of indices of most recent keys */
-char *strcasestr();
char *phrasefind();
char *lower();
@@ -549,7 +551,7 @@ char *lower(s)
char *s;
{
int i;
- char tmp[400];
+ static char tmp[400];
for (i=0; s[i]; ++i)
tmp[i] = tolower(s[i]);
@@ -642,30 +644,6 @@ char fname[50];
-/*********************************
-strcasestr()
-**********************************/
-char *strcasestr (s1, s2)
-char *s1, *s2;
-{
-
- char n1[256], n2[256];
- int j;
-
- for (j=0;s1[j] != '\0';j++)
- n1[j] = toupper (s1[j]);
- n1[j] = '\0';
- for (j=0;s2[j] != '\0';j++)
- n2[j] = toupper (s2[j]);
- n2[j] = '\0';
-
- return (strstr (n1, n2));
-}
-
-
-
-
-
@@ -706,7 +684,7 @@ trytempl(question)
firstime=0;
}
else
- key=strtok(key[strlen(key)], ":\n");
+ key=strtok(0, ":\n");
if (key == NULL) {
done=1;
break;
|