1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-07 19:29:18 +00:00

Export the compare function since it is used in a few places.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5583 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2012-03-09 11:45:08 +00:00
parent 006be848f2
commit b6329757d7
2 changed files with 6 additions and 3 deletions

View File

@ -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);
}

View File

@ -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