🌈 style:

This commit is contained in:
lzy
2024-05-26 15:39:14 +08:00
parent 6f28a3384a
commit a57bbdb4c1
156 changed files with 765 additions and 770 deletions

View File

@@ -7,8 +7,8 @@
// !!! 变长结构体
struct llist_node_st
{
struct llist_node_st *prev;
struct llist_node_st *next;
struct llist_node_st* prev;
struct llist_node_st* next;
// data要放在最后
char data[1]; // 占位符数据的起始。C99才只是[0]
};
@@ -19,21 +19,21 @@ typedef struct
struct llist_node_st head;
} LLIST;
typedef void llist_op(const void *);
typedef int llist_cmp(const void *, const void *);
typedef void llist_op(const void*);
typedef int llist_cmp(const void*, const void*);
LLIST *llist_create(int initsize);
LLIST* llist_create(int initsize);
int llist_insert(LLIST *ptr, const void *data, int mode);
int llist_insert(LLIST* ptr, const void* data, int mode);
void *llist_find(LLIST *ptr, const void *key, llist_cmp *);
void* llist_find(LLIST* ptr, const void* key, llist_cmp*);
int llist_delete(LLIST *, const void *key, llist_cmp *);
int llist_delete(LLIST*, const void* key, llist_cmp*);
int llist_fetch(LLIST *, const void *key, llist_cmp *, void *data);
int llist_fetch(LLIST*, const void* key, llist_cmp*, void* data);
void llist_travel(LLIST *ptr, llist_op *op);
void llist_travel(LLIST* ptr, llist_op* op);
void llist_destroy(LLIST *ptr);
void llist_destroy(LLIST* ptr);
#endif