1/* Fast fuzzy searching among messages. 2 Copyright (C) 2006 Free Software Foundation, Inc. 3 Written by Bruno Haible <bruno@clisp.org>, 2006. 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 17 18#ifndef _MSGL_FSEARCH_H 19#define _MSGL_FSEARCH_H 1 20 21#include "message.h" 22 23 24#ifdef __cplusplus 25extern "C" { 26#endif 27 28 29/* A fuzzy index is a data structure that corresponds to a set of messages, 30 allowing for fuzzy searching of a message. It is optimized for large sets 31 of messages. */ 32typedef struct message_fuzzy_index_ty message_fuzzy_index_ty; 33 34/* Allocate a fuzzy index corresponding to a given list of messages. 35 The list of messages and the msgctxt and msgid fields of the messages 36 inside it must not be modified while the returned fuzzy index is in use. */ 37extern message_fuzzy_index_ty * 38 message_fuzzy_index_alloc (const message_list_ty *mlp, 39 const char *canon_charset); 40 41/* Find a good match for the given msgctxt and msgid in the given fuzzy index. 42 The match does not need to be optimal. */ 43extern message_ty * 44 message_fuzzy_index_search (message_fuzzy_index_ty *findex, 45 const char *msgctxt, const char *msgid); 46 47/* Free a fuzzy index. */ 48extern void 49 message_fuzzy_index_free (message_fuzzy_index_ty *findex); 50 51 52#ifdef __cplusplus 53} 54#endif 55 56#endif /* _MSGL_FSEARCH_H */ 57