]> git.sur5r.net Git - cc65/commitdiff
Export the compare function since it is used in a few places.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 9 Mar 2012 11:45:08 +0000 (11:45 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 9 Mar 2012 11:45:08 +0000 (11:45 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@5583 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/common/fileid.c
src/common/fileid.h

index 8e0a875a5fb2583b20e5a8f63adbf7da8e0aa441..d7a1fcdc8c7706bafb0f776de3df311badd83ee5 100644 (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);
 }
 
 
index 1faf31ef8752230ab5b822830314978c6e61f1c4..649c84844c444d2ba5b7a1e535f60d21fad81a75 100644 (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