/* $Id: swish-e.h 2295 2009-04-05 02:23:49Z karpet $ This file is part of Swish-e. Swish-e is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Swish-e 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 Swish-e; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA See the COPYING file that accompanies the Swish-e distribution for details of the GNU GPL and the special exception available for linking against the Swish-e library. ** Mon May 9 18:19:34 CDT 2005 ** added GPL */ #ifndef SEARCHSWISH_H #define SEARCHSWISH_H 1 #include "time.h" /* for time_t, which isn't really needed */ #ifdef __cplusplus extern "C" { #endif typedef void * SW_HANDLE; typedef void * SW_SEARCH; typedef void * SW_RESULTS; typedef void * SW_RESULT; typedef void * SW_FUZZYWORD; /* access to the swish-e stemmers */ /* These must match headers.h */ typedef enum { SWISH_NUMBER, SWISH_STRING, SWISH_LIST, SWISH_BOOL, SWISH_WORD_HASH, SWISH_OTHER_DATA, SWISH_HEADER_ERROR /* must check error in this case */ } SWISH_HEADER_TYPE; typedef union { const char *string; const char **string_list; unsigned long number; int boolean; } SWISH_HEADER_VALUE; const char **SwishHeaderNames( SW_HANDLE ); /* fetch the list of available header names */ const char **SwishIndexNames( SW_HANDLE ); /* fetch list of index files names associated */ SWISH_HEADER_VALUE SwishHeaderValue( SW_HANDLE, const char *index_name, const char *cur_header, SWISH_HEADER_TYPE *type ); SWISH_HEADER_VALUE SwishResultIndexValue( SW_RESULT, const char *name, SWISH_HEADER_TYPE *type ); typedef const void * SW_META; typedef SW_META * SWISH_META_LIST; /* Meta and Property Values */ #define SW_META_TYPE_UNDEF 0 #define SW_META_TYPE_STRING 4 #define SW_META_TYPE_ULONG 8 #define SW_META_TYPE_DATE 16 SWISH_META_LIST SwishMetaList( SW_HANDLE, const char *index_name ); SWISH_META_LIST SwishPropertyList( SW_HANDLE, const char *index_name ); SWISH_META_LIST SwishResultMetaList( SW_RESULT ); SWISH_META_LIST SwishResultPropertyList( SW_RESULT ); const char *SwishMetaName( SW_META ); int SwishMetaType( SW_META ); int SwishMetaID( SW_META ); /* Limit searches by structure */ #define IN_FILE_BIT 0 #define IN_TITLE_BIT 1 #define IN_HEAD_BIT 2 #define IN_BODY_BIT 3 #define IN_COMMENTS_BIT 4 #define IN_HEADER_BIT 5 #define IN_EMPHASIZED_BIT 6 #define IN_META_BIT 7 #define IN_FILE (1<