blob: 4cc43fe0830911c8d3b3983e6141b3aeaf759463 (
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
#ifndef _ZoO_PERVASIVE_H_
#define _ZoO_PERVASIVE_H_
#include <limits.h>
#ifndef ZoO_NETWORK_TIMEOUT
#define ZoO_NETWORK_TIMEOUT 200
#endif
#ifndef ZoO_MAX_REPLY_WORDS
#define ZoO_MAX_REPLY_WORDS 64
#endif
#ifndef ZoO_DEFAULT_DATA_FILENAME
#define ZoO_DEFAULT_DATA_FILENAME "./memory.txt"
#endif
#ifndef ZoO_DEFAULT_IRC_SERVER_ADDR
#define ZoO_DEFAULT_IRC_SERVER_ADDR "irc.foonetic.net"
#endif
#ifndef ZoO_DEFAULT_IRC_SERVER_PORT
#define ZoO_DEFAULT_IRC_SERVER_PORT "6667"
#endif
#ifndef ZoO_DEFAULT_IRC_SERVER_CHANNEL
#define ZoO_DEFAULT_IRC_SERVER_CHANNEL "#theborghivemind"
#endif
#ifndef ZoO_DEFAULT_IRC_USERNAME
#define ZoO_DEFAULT_IRC_USERNAME "zeroofone"
#endif
#ifndef ZoO_DEFAULT_IRC_REALNAME
#define ZoO_DEFAULT_IRC_REALNAME "Zero of One (bot)"
#endif
#ifndef ZoO_DEFAULT_REPLY_RATE
#define ZoO_DEFAULT_REPLY_RATE 8
#endif
#ifndef ZoO_MARKOV_ORDER
#define ZoO_MARKOV_ORDER 2
#endif
typedef unsigned int ZoO_index;
#define ZoO_INDEX_MAX UINT_MAX
/* ZoO_char = UTF-8 char */
typedef char ZoO_char;
/* Functions that can handle UTF-8 'char' will use this symbol. */
#define ZoO_CHAR_STRING_SYMBOL "%s"
#define ZoO__TO_STRING(x) #x
#define ZoO_TO_STRING(x) ZoO__TO_STRING(x)
#define ZoO_ISOLATE(a) do {a} while (0)
/* strncmp stops at '\0' and strlen does not count '\0'. */
#define ZoO_IS_PREFIX(a, b) (strncmp(a, b, strlen(a)) == 0)
#define ZoO_STRING_EQUALS(a, b) (strcmp(a, b) == 0)
#endif
|