mirror of
https://github.com/cc65/cc65.git
synced 2025-01-12 02:30:44 +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:
parent
006be848f2
commit
b6329757d7
@ -48,8 +48,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int Compare (const void* Key, const void* Id)
|
int CompareFileId (const void* Key, const void* Id)
|
||||||
/* Compare function for bsearch */
|
/* Compare function used when calling bsearch with a table of FileIds */
|
||||||
{
|
{
|
||||||
return strcmp (Key, ((const FileId*) Id)->Ext);
|
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 */
|
/* 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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);
|
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.
|
/* 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
|
* The table passed to the function must be sorted alphabetically. If the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user