|
|
|
@ -16,6 +16,7 @@ Contributors:
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
#include <ctype.h>
|
|
|
|
|
#include <limits.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
@ -47,12 +48,33 @@ Contributors:
|
|
|
|
|
#include "mqtt3_protocol.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef WIN32
|
|
|
|
|
int scmp_p(const void *p1, const void *p2)
|
|
|
|
|
{
|
|
|
|
|
return strcasecmp(*(const char **)p1, *(const char **)p2);
|
|
|
|
|
const char *s1 = *(const char **)p1;
|
|
|
|
|
const char *s2 = *(const char **)p2;
|
|
|
|
|
int result;
|
|
|
|
|
|
|
|
|
|
while(s1[0] && s2[0]){
|
|
|
|
|
/* Sort by case insensitive part first */
|
|
|
|
|
result = toupper(s1[0]) - toupper(s2[0]);
|
|
|
|
|
if(result == 0){
|
|
|
|
|
/* Case insensitive part matched, now distinguish between case */
|
|
|
|
|
result = s1[0] - s2[0];
|
|
|
|
|
if(result != 0){
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
/* Return case insensitive match fail */
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
s1++;
|
|
|
|
|
s2++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return s1[0] - s2[0];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef WIN32
|
|
|
|
|
int config__get_dir_files(const char *include_dir, char ***files, int *file_count)
|
|
|
|
|
{
|
|
|
|
|
int len;
|
|
|
|
@ -112,10 +134,6 @@ int config__get_dir_files(const char *include_dir, char ***files, int *file_coun
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef WIN32
|
|
|
|
|
int scmp_p(const void *p1, const void *p2)
|
|
|
|
|
{
|
|
|
|
|
return strcmp(*(const char **)p1, *(const char **)p2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int config__get_dir_files(const char *include_dir, char ***files, int *file_count)
|
|
|
|
|
{
|
|
|
|
|