NeoMutt  2025-12-11-694-ga89709
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
fuzzy.c File Reference

Fuzzy matching dispatcher. More...

#include "config.h"
#include "fuzzy.h"
#include "lib.h"
+ Include dependency graph for fuzzy.c:

Go to the source code of this file.

Functions

int fuzzy_match (const char *pattern, const char *candidate, enum FuzzyAlgo algo, const struct FuzzyOptions *opts, struct FuzzyResult *out)
 Perform fuzzy matching.
 

Detailed Description

Fuzzy matching dispatcher.

Authors
  • Richard Russon

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, see http://www.gnu.org/licenses/.

Definition in file fuzzy.c.

Function Documentation

◆ fuzzy_match()

int fuzzy_match ( const char * pattern,
const char * candidate,
enum FuzzyAlgo algo,
const struct FuzzyOptions * opts,
struct FuzzyResult * out )

Perform fuzzy matching.

Parameters
patternPattern to match
candidateCandidate string to match against
algoFuzzy matching algorithm to use
optsFuzzy matching options
outOutput result structure
Return values
>=0Match score
-1Error or no match

Definition at line 58 of file fuzzy.c.

60{
61 if (!pattern || !candidate)
62 return -1;
63
64 if (algo == FUZZY_ALGO_SUBSEQ)
65 return fuzzy_subseq_match(pattern, candidate, opts, out);
66
67 return -1;
68}
bool candidate(struct CompletionData *cd, char *user, const char *src, char *dest, size_t dlen)
Helper function for completion.
Definition helpers.c:79
@ FUZZY_ALGO_SUBSEQ
Subsequence matching algorithm.
Definition lib.h:77
int fuzzy_subseq_match(const char *pattern, const char *candidate, const struct FuzzyOptions *opts, struct FuzzyResult *out)
Perform subsequence fuzzy matching (UTF-8 aware, ASCII case-folding)
Definition subseq.c:262
+ Here is the call graph for this function:
+ Here is the caller graph for this function: