add FilenameString type and macro
parent
13de41bc05
commit
07ba689835
3
HISTORY
3
HISTORY
|
|
@ -1,8 +1,9 @@
|
||||||
|
|
||||||
Version 1.49 2021-03-16
|
Version 1.49 2021-03-19
|
||||||
* add macros: FC_ABS and FC_NEGATIVE
|
* add macros: FC_ABS and FC_NEGATIVE
|
||||||
* uniq_skiplist.c: add uniq_skiplist_pair struct and init function
|
* uniq_skiplist.c: add uniq_skiplist_pair struct and init function
|
||||||
* add functions: fc_mkdirs and str_replace
|
* add functions: fc_mkdirs and str_replace
|
||||||
|
* add FilenameString type and macro
|
||||||
|
|
||||||
Version 1.48 2021-02-01
|
Version 1.48 2021-02-01
|
||||||
* fast_buffer.[hc]: add function fast_buffer_append_binary
|
* fast_buffer.[hc]: add function fast_buffer_append_binary
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|
||||||
|
|
@ -224,6 +225,12 @@ typedef struct
|
||||||
pthread_cond_t cond;
|
pthread_cond_t cond;
|
||||||
} pthread_lock_cond_pair_t;
|
} pthread_lock_cond_pair_t;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
char buff[PATH_MAX];
|
||||||
|
string_t s;
|
||||||
|
} FilenameString;
|
||||||
|
|
||||||
typedef void (*FreeDataFunc)(void *ptr);
|
typedef void (*FreeDataFunc)(void *ptr);
|
||||||
typedef int (*CompareFunc)(void *p1, void *p2);
|
typedef int (*CompareFunc)(void *p1, void *p2);
|
||||||
typedef void* (*MallocFunc)(size_t size);
|
typedef void* (*MallocFunc)(size_t size);
|
||||||
|
|
@ -283,6 +290,13 @@ typedef void* (*MallocFunc)(size_t size);
|
||||||
#define FC_IS_NULL_STRING(s) ((s)->str == NULL)
|
#define FC_IS_NULL_STRING(s) ((s)->str == NULL)
|
||||||
#define FC_IS_EMPTY_STRING(s) ((s)->len == 0)
|
#define FC_IS_EMPTY_STRING(s) ((s)->len == 0)
|
||||||
|
|
||||||
|
#define FC_INIT_FILENAME_STRING(filename) \
|
||||||
|
FC_SET_STRING_EX((filename).s, (filename).buff, 0)
|
||||||
|
|
||||||
|
#define FC_FILENAME_STRING_OBJ(filename) ((filename).s)
|
||||||
|
#define FC_FILENAME_STRING_PTR(filename) ((filename).buff)
|
||||||
|
#define FC_FILENAME_BUFFER_SIZE(filename) sizeof((filename).buff)
|
||||||
|
|
||||||
#define fc_compare_string(s1, s2) fc_string_compare(s1, s2)
|
#define fc_compare_string(s1, s2) fc_string_compare(s1, s2)
|
||||||
|
|
||||||
static inline int fc_string_compare(const string_t *s1, const string_t *s2)
|
static inline int fc_string_compare(const string_t *s1, const string_t *s2)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue