diff --git a/src/common/fileid.c b/src/common/fileid.c index 8e0a875a5..d7a1fcdc8 100644 --- a/src/common/fileid.c +++ b/src/common/fileid.c @@ -48,8 +48,8 @@ -static int Compare (const void* Key, const void* Id) -/* Compare function for bsearch */ +int CompareFileId (const void* Key, const void* Id) +/* Compare function used when calling bsearch with a table of FileIds */ { return strcmp (Key, ((const FileId*) Id)->Ext); } @@ -72,7 +72,7 @@ const FileId* GetFileId (const char* Name, const FileId* Table, unsigned Count) } /* Search for a table entry and return it */ - return bsearch (Ext+1, Table, Count, sizeof (FileId), Compare); + return bsearch (Ext+1, Table, Count, sizeof (FileId), CompareFileId); } diff --git a/src/common/fileid.h b/src/common/fileid.h index 1faf31ef8..649c84844 100644 --- a/src/common/fileid.h +++ b/src/common/fileid.h @@ -61,6 +61,9 @@ struct FileId { +int CompareFileId (const void* Key, const void* Id); +/* Compare function used when calling bsearch with a table of FileIds */ + const FileId* GetFileId (const char* Name, const FileId* Table, unsigned Count); /* Determine the id of the given file by looking at file extension of the name. * The table passed to the function must be sorted alphabetically. If the