NAME

gffdMatchName, gffdMatchData - perform matching operations

SYNOPSIS

#include <gffd/gffd.h>

int gffdMatchName(gffd_context_t ctx, const char *name);

int gffdMatchData(gffd_context_t ctx, const unsigned char *data, int length);

DESCRIPTION

Matches are operations which update the score values of the set of possible matches stored in the matching context. The set of matches is kept in sorted order, from highest score to lowest score, so that the best match will always be at index #0. Match operations do not remove possible matches from the set.

gffdMatchName() matches the given filename against the current set of possible matches, using the name information contained in the LibGFFD file format database.

gffdMatchData() matches the file's data (taken from the beginning of the file) against the current set of possible matches, using the magic-number information contained in the LibGFFD file format database.

For the best matching results, it is recommended that both gffdMatchName() and gffdMatchData() are called. This is not compulsory however, LibGFFD can be used to match based solely on filenames or solely on magic numbers.

RETURN VALUES

On success, gffdMatchName() and gffdMatchData() return zero, otherwise they return a negative error code.