add function fc_memrchr
parent
90e61572c0
commit
798244cc1b
4
HISTORY
4
HISTORY
|
|
@ -1,9 +1,11 @@
|
||||||
|
|
||||||
Version 1.44 2020-02-03
|
Version 1.44 2020-02-08
|
||||||
* add test file src/tests/test_pthread_lock.c
|
* add test file src/tests/test_pthread_lock.c
|
||||||
* add uniq_skiplist.[hc]
|
* add uniq_skiplist.[hc]
|
||||||
* add function split_string_ex
|
* add function split_string_ex
|
||||||
* fast_mblock.[hc]: add init_args for init_func
|
* fast_mblock.[hc]: add init_args for init_func
|
||||||
|
* struct fast_task_info add field: nio_stage
|
||||||
|
* add function fc_memrchr
|
||||||
|
|
||||||
Version 1.43 2019-12-25
|
Version 1.43 2019-12-25
|
||||||
* replace function call system to getExecResult,
|
* replace function call system to getExecResult,
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ struct fast_task_info
|
||||||
int size; //alloc size
|
int size; //alloc size
|
||||||
int length; //data length
|
int length; //data length
|
||||||
int offset; //current offset
|
int offset; //current offset
|
||||||
|
char nio_stage; //stage for network IO
|
||||||
int64_t req_count; //request count
|
int64_t req_count; //request count
|
||||||
TaskFinishCallback finish_callback;
|
TaskFinishCallback finish_callback;
|
||||||
struct nio_thread_data *thread_data;
|
struct nio_thread_data *thread_data;
|
||||||
|
|
|
||||||
|
|
@ -2854,6 +2854,23 @@ const char *fc_memmem(const string_t *str, const string_t *needle)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *fc_memrchr(const char *str, const int ch, const int len)
|
||||||
|
{
|
||||||
|
const char *p;
|
||||||
|
|
||||||
|
p = str + len - 1;
|
||||||
|
while (p >= str)
|
||||||
|
{
|
||||||
|
if (*p == ch)
|
||||||
|
{
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
--p;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
char *format_http_date(time_t t, BufferInfo *buffer)
|
char *format_http_date(time_t t, BufferInfo *buffer)
|
||||||
{
|
{
|
||||||
struct tm tm_info;
|
struct tm tm_info;
|
||||||
|
|
|
||||||
|
|
@ -844,6 +844,14 @@ char *fc_strdup(const char *str, const int len);
|
||||||
*/
|
*/
|
||||||
const char *fc_memmem(const string_t *str, const string_t *needle);
|
const char *fc_memmem(const string_t *str, const string_t *needle);
|
||||||
|
|
||||||
|
/** memmem
|
||||||
|
* parameters:
|
||||||
|
* str: the string to match
|
||||||
|
* needle: the needle string
|
||||||
|
* return: the matched string, NULL for fail
|
||||||
|
*/
|
||||||
|
const char *fc_memrchr(const char *str, const int ch, const int len);
|
||||||
|
|
||||||
/** format HTTP Date as: Sat, 11 Mar 2017 21:49:51 GMT
|
/** format HTTP Date as: Sat, 11 Mar 2017 21:49:51 GMT
|
||||||
* parameters:
|
* parameters:
|
||||||
* t: the time to format
|
* t: the time to format
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,8 @@ typedef struct uniq_skiplist_iterator {
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define uniq_skiplist_count(sl) (sl)->element_count
|
||||||
|
|
||||||
#define uniq_skiplist_init(factory, max_level_count, compare_func, free_func) \
|
#define uniq_skiplist_init(factory, max_level_count, compare_func, free_func) \
|
||||||
uniq_skiplist_init_ex(factory, max_level_count, \
|
uniq_skiplist_init_ex(factory, max_level_count, \
|
||||||
compare_func, free_func, 64 * 1024, \
|
compare_func, free_func, 64 * 1024, \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue