add function fc_compare_string
parent
08dce9933e
commit
4ae9c8f55f
|
|
@ -37,7 +37,7 @@ HEADER_FILES = common_define.h hash.h chain.h logger.h base64.h \
|
|||
skiplist_common.h system_info.h fast_blocked_queue.h \
|
||||
php7_ext_wrapper.h id_generator.h char_converter.h \
|
||||
char_convert_loader.h common_blocked_queue.h \
|
||||
multi_socket_client.h skiplist_set.h
|
||||
multi_socket_client.h skiplist_set.h fc_list.h
|
||||
|
||||
ALL_OBJS = $(FAST_STATIC_OBJS) $(FAST_SHARED_OBJS)
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#define _COMMON_DEFINE_H_
|
||||
|
||||
#include <pthread.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
|
@ -206,6 +207,20 @@ typedef void* (*MallocFunc)(size_t size);
|
|||
#define __gcc_attribute__(x)
|
||||
#endif
|
||||
|
||||
static inline int fc_compare_string(const string_t *s1, const string_t *s2)
|
||||
{
|
||||
int result;
|
||||
if (s1->len == s2->len) {
|
||||
return memcmp(s1->str, s2->str, s1->len);
|
||||
} else if (s1->len < s2->len) {
|
||||
result = memcmp(s1->str, s2->str, s1->len);
|
||||
return result == 0 ? -1 : result;
|
||||
} else {
|
||||
result = memcmp(s1->str, s2->str, s2->len);
|
||||
return result == 0 ? 1 : result;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ struct mpool_chain {
|
|||
|
||||
static struct mpool_chain g_mpool = {NULL, NULL};
|
||||
|
||||
#define ALIGNED_TASK_INFO_SIZE MEM_ALIGN(sizeof(struct fast_task_info))
|
||||
|
||||
int task_queue_init(struct fast_task_queue *pQueue)
|
||||
{
|
||||
int result;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@
|
|||
#include "ioevent.h"
|
||||
#include "fast_timer.h"
|
||||
|
||||
#define ALIGNED_TASK_INFO_SIZE MEM_ALIGN(sizeof(struct fast_task_info))
|
||||
|
||||
struct nio_thread_data;
|
||||
struct fast_task_info;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue