<body>
<div align="center">
<h1>C I T A D E L</h1>
-<h2>a messaging and collaboration platform
-for groupware and BBS applications</h2>
+<h2>an open source messaging and collaboration platform</h2>
Copyright ©1987-2005 by the Citadel development team:<br>
<br>
<table align="center" border="0" cellpadding="2" cellspacing="2">
<td valign="top"><i>client software development<br>
</i></td>
</tr>
- <tr>
- <td style="vertical-align: top;">Urs Jannsen<br>
- </td>
- <td style="vertical-align: top;"><span style="font-style: italic;">text
-search algorithm</span><br>
- </td>
- </tr>
<tr>
<td valign="top">Andru Luvisi<br>
</td>
}
fieldptr = rfc822_fetch_field(msg->cm_fields['M'], "Bcc");
if (fieldptr != NULL) {
- if (bmstrstr(fieldptr, itemlist[pos+1], strncasecmp)) {
+ if (strcasestr(fieldptr, itemlist[pos+1])) {
match = 1;
}
free(fieldptr);
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (bmstrstr(msg->cm_fields['M'], itemlist[pos+1], strncasecmp)) {
+ if (strcasestr(msg->cm_fields['M'], itemlist[pos+1])) {
match = 1;
}
pos += 2;
}
fieldptr = rfc822_fetch_field(msg->cm_fields['M'], "Cc");
if (fieldptr != NULL) {
- if (bmstrstr(fieldptr, itemlist[pos+1], strncasecmp)) {
+ if (strcasestr(fieldptr, itemlist[pos+1])) {
match = 1;
}
free(fieldptr);
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (bmstrstr(msg->cm_fields['A'], itemlist[pos+1], strncasecmp)) {
+ if (strcasestr(msg->cm_fields['A'], itemlist[pos+1])) {
match = 1;
}
pos += 2;
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (bmstrstr(msg->cm_fields['U'], itemlist[pos+1], strncasecmp)) {
+ if (strcasestr(msg->cm_fields['U'], itemlist[pos+1])) {
match = 1;
}
pos += 2;
need_to_free_msg = 1;
}
for (i='A'; i<='Z'; ++i) {
- if (bmstrstr(msg->cm_fields[i], itemlist[pos+1], strncasecmp)) {
+ if (strcasestr(msg->cm_fields[i], itemlist[pos+1])) {
match = 1;
}
}
msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
need_to_free_msg = 1;
}
- if (bmstrstr(msg->cm_fields['R'], itemlist[pos+1], strncasecmp)) {
+ if (strcasestr(msg->cm_fields['R'], itemlist[pos+1])) {
match = 1;
}
pos += 2;
snprintf(fieldhdr, sizeof fieldhdr, "%s:", fieldname);
/* Locate the end of the headers, so we don't run past that point */
- end_of_headers = bmstrstr(rfc822, "\n\r\n", strncmp);
+ end_of_headers = strcasestr(rfc822, "\n\r\n");
if (end_of_headers == NULL) {
- end_of_headers = bmstrstr(rfc822, "\n\n", strncmp);
+ end_of_headers = strcasestr(rfc822, "\n\n");
}
if (end_of_headers == NULL) return (NULL);
- field_start = bmstrstr(rfc822, fieldhdr, strncasecmp);
+ field_start = strcasestr(rfc822, fieldhdr);
if (field_start == NULL) return(NULL);
if (field_start > end_of_headers) return(NULL);
part_start = NULL;
do {
-
- /* next_boundary = bmstrstr(ptr, startary, memcmp); */
next_boundary = NULL;
for (srch=ptr; srch<content_end; ++srch) {
if (!memcmp(srch, startary, startary_len)) {
break;
case 4:
strcpy(content_type, "text/plain");
- mptr = bmstrstr(msg->cm_fields['M'],
- "Content-type: ", strncasecmp);
+ mptr = strcasestr(msg->cm_fields['M'], "Content-type: ");
if (mptr != NULL) {
safestrncpy(content_type, &mptr[14],
sizeof content_type);
if (IMAP->authstate == imap_as_expecting_password) {
lprintf(CTDL_INFO, "IMAP: <password>\n");
}
- else if (bmstrstr(cmdbuf, " LOGIN ", strncasecmp)) {
+ else if (strcasestr(cmdbuf, " LOGIN ")) {
lprintf(CTDL_INFO, "IMAP: LOGIN...\n");
}
else {
}
-/*
- * bmstrstr() is a variant of strstr() that uses the Boyer-Moore search
- * algorithm, and can use any caller-supplied string compare function whose
- * calling syntax is similar to strncmp(). For example, we can supply it
- * with strncasecmp() to do a case-insensitive search.
- *
- * Original code: copyright (c) 1997-1998 by Urs Janssen <urs@tin.org>
- * Modifications: copyright (c) 2003 by Art Cancro <ajc@uncensored.citadel.org>
- */
-char *bmstrstr(char *text, char *pattern,
- int (*cmpfunc)(const char *, const char *, size_t) )
-{
- register unsigned char *p, *t;
- register int i, j, *delta;
- register size_t p1;
- int deltaspace[256];
- size_t textlen;
- size_t patlen;
-
- if (text == NULL) return(NULL);
- if (pattern == NULL) return(NULL);
-
- textlen = strlen(text);
- patlen = strlen(pattern);
-
- /* algorithm fails if pattern is empty */
- if ((p1 = patlen) == 0)
- return (text);
-
- /* code below fails (whenever i is unsigned) if pattern too long */
- if (p1 > textlen)
- return (NULL);
-
- /* set up deltas */
- delta = deltaspace;
- for (i = 0; i <= 255; i++)
- delta[i] = p1;
- for (p = (unsigned char *) pattern, i = p1; --i > 0;)
- delta[*p++] = i;
-
- /*
- * From now on, we want patlen - 1.
- * In the loop below, p points to the end of the pattern,
- * t points to the end of the text to be tested against the
- * pattern, and i counts the amount of text remaining, not
- * including the part to be tested.
- */
- p1--;
- p = (unsigned char *) pattern + p1;
- t = (unsigned char *) text + p1;
- i = textlen - patlen;
- while (1) {
- if (tolower(*p) == tolower(*t)
- && cmpfunc((p - p1), (t - p1), p1) == 0)
- return ((char *) t - p1);
- j = delta[*t];
- if (i < j)
- break;
- i -= j;
- t += j;
- }
- return (NULL);
-}
-
/*
* In our world, we want strcpy() to be able to work with overlapping strings.
void urlesc(char *outbuf, char *strbuf);
char *CtdlTempFileName(char *prefix1, int prefix2);
FILE *CtdlTempFile(void);
-char *bmstrstr(char *text, char *pattern,
- int (*cmpfunc)(const char *, const char *, size_t) );
-
char *ascmonths[12];
void generate_uuid(char *buf);
char *searchstring;
searchstring = (char *)data;
- if (bmstrstr(usbuf->fullname, searchstring, strncasecmp) == NULL) {
+ if (strcasestr(usbuf->fullname, searchstring) == NULL) {
return;
}