]>
jfr.im git - irc/evilnet/x3.git/blob - src/globtest.c
10 struct glob_test glob_yes
[] = {
11 { "*Zoot*!*@*.org", { "Zoot!Zoot@services.org",
12 "zoot!bleh@j00.are.r00t3d.org",
14 { "*!*@*", { "DK-Entrope!entrope@clan-dk.dyndns.org",
16 { "*", { "anything at all!",
21 struct glob_test glob_no
[] = {
22 { "*Zoot*!*@*.org", { "Zoot!Zoot@services.net",
24 { "*!*@*", { "luser@host.com",
29 struct glob_test glob_globs
[] = {
30 { "*@foo", { "foo@bar",
33 { "foo@bar", { "*@foo",
41 main(UNUSED_ARG(int argc
), UNUSED_ARG(char *argv
[]))
46 for (i
= 0; glob_yes
[i
].glob
; i
++) {
47 for (j
=0; glob_yes
[i
].texts
[j
]; j
++) {
48 if (!match_ircglob(glob_yes
[i
].texts
[j
], glob_yes
[i
].glob
)) {
49 fprintf(stderr
, "%s did not match glob %s!\n",
50 glob_yes
[i
].texts
[j
], glob_yes
[i
].glob
);
55 for (i
= 0; glob_no
[i
].glob
; i
++) {
56 for (j
=0; glob_no
[i
].texts
[j
]; j
++) {
57 if (match_ircglob(glob_no
[i
].texts
[j
], glob_no
[i
].glob
)) {
58 fprintf(stderr
, "%s matched glob %s!\n",
59 glob_no
[i
].texts
[j
], glob_no
[i
].glob
);
64 for (i
=0; glob_globs
[i
].glob
; i
++) {
65 for (j
=0; glob_globs
[i
].texts
[j
]; j
++) {
66 fprintf(stdout
, "match_ircglobs(\"%s\", \"%s\") -> %d\n",
67 glob_globs
[i
].glob
, glob_globs
[i
].texts
[j
],
68 match_ircglobs(glob_globs
[i
].glob
, glob_globs
[i
].texts
[j
]));
75 /* because tools.c likes to log stuff.. */
77 log_module(UNUSED_ARG(struct log_type
*type
), UNUSED_ARG(enum log_severity sev
), const char *format
, ...)
81 vfprintf(stderr
, format
, va
);
86 language_find_message(UNUSED_ARG(struct language
*lang
), UNUSED_ARG(const char *msgid
))
88 return "Stub -- Not implemented.";
91 struct language
*lang_C
= NULL
;
92 struct log_type
*MAIN_LOG
= NULL
;
93 const char *hidden_host_suffix
;