summaryrefslogtreecommitdiffstats
path: root/innbbsd/antisplam.h
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-07 23:13:44 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-07 23:13:44 +0800
commitae31e19f92e717919ac8e3db9039eb38d2b89aae (patch)
treec70164d6a1852344f44b04a653ae2815043512af /innbbsd/antisplam.h
downloadpttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.gz
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.bz2
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.lz
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.xz
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.zst
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.zip
Initial revision
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'innbbsd/antisplam.h')
-rw-r--r--innbbsd/antisplam.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/innbbsd/antisplam.h b/innbbsd/antisplam.h
new file mode 100644
index 00000000..30289da1
--- /dev/null
+++ b/innbbsd/antisplam.h
@@ -0,0 +1,37 @@
+#define char_lower(c) ((c >= 'A' && c <= 'Z') ? c|32 : c)
+
+/*void
+str_lower(t, s)
+ char *t, *s;*/
+void str_lower(char *t, char *s)
+{
+ register char ch;
+ do
+ {
+ ch = *s++;
+ *t++ = char_lower(ch);
+ } while (ch);
+}
+
+#if 0 /* string.h , libc */
+int
+strcasestr(str, tag)
+ char *str, *tag; /* tag : lower-case string */
+{
+ char buf[256];
+
+ str_lower(buf, str);
+ return (int) strstr(buf, tag);
+}
+#endif
+
+int
+bad_subject(char *subject)
+{
+ char *badkey[] = {"µL½X","avcd","mp3",NULL};
+ int i;
+ for(i=0; badkey[i]; i++)
+ if(strcasestr(subject, badkey[i])) return 1;
+ return 0;
+}
+