
2003-08-26 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-parser.[c,h]: s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g and s/_header_state/_camel_mime_parser_state/g * camel-filter-driver.c: Same. * camel-folder-summary.c: Here too. * camel-http-stream.c: And here. * camel-mime-message.c: ... * camel-mime-part-utils.c: ... * camel-mime-part.c: ... * camel-movemail.c: ... * camel-multipart-signed.c: ... * camel-multipart.c: ... * providers/local/camel-mbox-folder.c: ... * providers/local/camel-mbox-summary.c: ... * providers/local/camel-mh-summary.c: ... * providers/nntp/camel-nntp-summary.c: ... * providers/pop3/camel-pop3-folder.c: ... 2003-08-25 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.[c,h]: Namespaced. * camel-data-wrapper.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-digest-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-driver.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.h: updated for namespace changed made to camel-mime-utils.[c,h] * camel-internet-address.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-medium.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-message.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-parser.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-movemail.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-encrypted.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-signed.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-search-private.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-types.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-store-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imapp/camel-imapp-utils.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-local-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-maildir-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-mbox-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-spool-summary.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/pop3/camel-pop3-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/sendmail/camel-sendmail-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/smtp/camel-smtp-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] svn path=/trunk/; revision=22613
83 lines
2.7 KiB
C
83 lines
2.7 KiB
C
/*
|
|
* Copyright (C) 2001 Ximian Inc.
|
|
*
|
|
* Authors: Michael Zucchi <notzed@ximian.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of version 2 of the GNU General Public
|
|
* License as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public
|
|
* License along with this program; if not, write to the
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
* Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#ifndef _CAMEL_SEARCH_PRIVATE_H
|
|
#define _CAMEL_SEARCH_PRIVATE_H
|
|
|
|
#include <regex.h>
|
|
|
|
typedef enum {
|
|
CAMEL_SEARCH_MATCH_START = 1<<0,
|
|
CAMEL_SEARCH_MATCH_END = 1<<1,
|
|
CAMEL_SEARCH_MATCH_REGEX = 1<<2, /* disables the first 2 */
|
|
CAMEL_SEARCH_MATCH_ICASE = 1<<3,
|
|
CAMEL_SEARCH_MATCH_NEWLINE = 1<<4,
|
|
} camel_search_flags_t;
|
|
|
|
typedef enum {
|
|
CAMEL_SEARCH_MATCH_EXACT,
|
|
CAMEL_SEARCH_MATCH_CONTAINS,
|
|
CAMEL_SEARCH_MATCH_STARTS,
|
|
CAMEL_SEARCH_MATCH_ENDS,
|
|
CAMEL_SEARCH_MATCH_SOUNDEX,
|
|
} camel_search_match_t;
|
|
|
|
typedef enum {
|
|
CAMEL_SEARCH_TYPE_ASIS,
|
|
CAMEL_SEARCH_TYPE_ENCODED,
|
|
CAMEL_SEARCH_TYPE_ADDRESS,
|
|
CAMEL_SEARCH_TYPE_ADDRESS_ENCODED,
|
|
CAMEL_SEARCH_TYPE_MLIST, /* its a mailing list pseudo-header */
|
|
} camel_search_t;
|
|
|
|
/* builds a regex that represents a string search */
|
|
int camel_search_build_match_regex(regex_t *pattern, camel_search_flags_t type, int argc, struct _ESExpResult **argv, CamelException *ex);
|
|
gboolean camel_search_message_body_contains(CamelDataWrapper *object, regex_t *pattern);
|
|
|
|
gboolean camel_search_header_match(const char *value, const char *match, camel_search_match_t how, camel_search_t type, const char *default_charset);
|
|
gboolean camel_search_camel_header_soundex(const char *header, const char *match);
|
|
|
|
/* TODO: replace with a real search function */
|
|
const char *camel_ustrstrcase(const char *haystack, const char *needle);
|
|
|
|
/* Some crappy utility functions for handling multiple search words */
|
|
enum _camel_search_word_t {
|
|
CAMEL_SEARCH_WORD_SIMPLE = 1,
|
|
CAMEL_SEARCH_WORD_COMPLEX = 2,
|
|
CAMEL_SEARCH_WORD_8BIT = 4,
|
|
};
|
|
struct _camel_search_word {
|
|
enum _camel_search_word_t type;
|
|
char *word;
|
|
};
|
|
|
|
struct _camel_search_words {
|
|
int len;
|
|
enum _camel_search_word_t type; /* OR of all word types in list */
|
|
struct _camel_search_word **words;
|
|
};
|
|
|
|
struct _camel_search_words *camel_search_words_split(const unsigned char *in);
|
|
struct _camel_search_words *camel_search_words_simple(struct _camel_search_words *wordin);
|
|
void camel_search_words_free(struct _camel_search_words *);
|
|
|
|
#endif /* ! _CAMEL_SEARCH_PRIVATE_H */
|
|
|