Let ede_strverscmp() be linked correctly

This commit is contained in:
Sanel Zukan 2008-05-29 11:09:54 +00:00
parent 9f8409e863
commit 8901c59050
3 changed files with 13 additions and 5 deletions

View File

@ -39,7 +39,7 @@
equal to or greater than S2 (for more info, see the texinfo doc).
*/
extern int ede_strverscmp (const char *s1, const char *s2)
int ede_strverscmp (const char *s1, const char *s2)
{
const unsigned char *p1 = (const unsigned char *) s1;
const unsigned char *p2 = (const unsigned char *) s2;

View File

@ -1,6 +1,14 @@
#ifndef EDE_STRVERSCMP_H
#define EDE_STRVERSCMP_H
extern int ede_strverscmp (const char *, const char *);
#ifdef __cplusplus
extern "C" {
#endif
int ede_strverscmp (const char *, const char *);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -47,7 +47,7 @@
#include "fileops.h" // file operations
#include "filesystem.h" // filesystem support
//#include "ede_strverscmp.h" // local copy of strverscmp
#include "ede_strverscmp.h" // local copy of strverscmp
@ -235,7 +235,7 @@ char *simpleopener(const char* mimetype) {
int ede_versionsort(const void *a, const void *b) {
struct dirent** ka = (struct dirent**)a;
struct dirent** kb = (struct dirent**)b;
return strverscmp((*ka)->d_name,(*kb)->d_name);
return ede_strverscmp((*ka)->d_name,(*kb)->d_name);
}
// Modification of versionsort which ignores case
@ -245,7 +245,7 @@ int ede_versioncasesort(const void *a, const void *b) {
char* ma = strdup((*ka)->d_name);
char* mb = strdup((*kb)->d_name);
edelib::str_tolower((unsigned char*)ma); edelib::str_tolower((unsigned char*)mb);
int k = strverscmp(ma,mb);
int k = ede_strverscmp(ma,mb);
free(ma); free(mb);
return k;
}