Camel.Search - disksummary
The disksummary version of search has been enhanced slightly over Evolution/Camel.Search. The new interfaces allow searches to be more efficiently executed over smaller sets repeatedly. i.e. what occurs with a typical vFolder or folder view calculation.
All of the strange interfaces to set up the search have been removed - all searches are based on a source Evolution/Camel.Iterator. This relies in part on the ability to be able to retrieve the message purely from having the CamelMessageInfo (by dereferencing mi.summary.folder, using camel_message_info_folder).
All in all, a much cleaner and simpler interface.
All of the various folder, summary and current message information has been removed, this now lives in the iterator.
The s-expression functions are the same as Evolution/Camel.Search#Camel.FolderSearch.
The main search interface, it will return a Evolution/Camel.Iterator which can be used to iterate over all matching message infos from the set supplied by iter. Multiple iterators can be active at any given time.
CamelFolderSearchIterator *camel_folder_search_search(CamelFolderSearch *, const char *expr, CamelIterator *iter, CamelException *ex);
There is also a special-case function which can be used to match a single message against the search evaluator. In this case, search_search is called with iter = NULL, and the returned iterator can be passed to search_match. It returns a boolean as to whether the search expression matches this message or not.
int camel_folder_search_match(CamelFolderSearchIterator *iter, const CamelMessageInfo *mi, CamelException *ex);
A helper function will parse an expression and determine whether or not it is based on static data. i.e. things like message content, headers, cannot change once a message has been created, but flags and other status information can. This is used by the Evolution/CamelDS.FolderSummaryDisk code to optimise when it might need to re-evaluate a changed message against an expression.
int camel_folder_search_is_static(CamelFolderSearch *search, const char *expr, CamelException *ex);
is_static should probably work on an iterator or other parsed expression, although given the way it is used, it probably isn't worth worrying about.
The '(match-threads ...)' function hasn't been fully implemented - since it is only given a subset of messages to match against, it may be impossible to implement properly at all.