forked from github/server
WIP: use latest clibs with selist.
adding a transitional quicklist.c module to reduce work.
This commit is contained in:
parent
3ff5a3155e
commit
955997d58c
2
clibs
2
clibs
|
@ -1 +1 @@
|
||||||
Subproject commit bce9b6568d4e9ace26c95a7740140cd71029b21f
|
Subproject commit 339ac5680ec9027c88c4516c72b9da8233b6f3e3
|
|
@ -88,6 +88,7 @@ set (ERESSEA_SRC
|
||||||
move.c
|
move.c
|
||||||
piracy.c
|
piracy.c
|
||||||
spells.c
|
spells.c
|
||||||
|
quicklist.c
|
||||||
battle.c
|
battle.c
|
||||||
alchemy.c
|
alchemy.c
|
||||||
academy.c
|
academy.c
|
||||||
|
|
|
@ -54,8 +54,8 @@ void add_donation(faction * f1, faction * f2, int amount, region * r)
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_donations(void) {
|
void free_donations(void) {
|
||||||
ql_foreach(transfers, free);
|
selist_foreach(transfers, free);
|
||||||
ql_free(transfers);
|
selist_free(transfers);
|
||||||
transfers = 0;
|
transfers = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
#include "quicklist.h"
|
||||||
|
|
||||||
|
bool ql_set_insert_ex(struct quicklist **qlp, void *data, int (*cmp_cb)(const void *lhs, const void *rhs));
|
||||||
|
bool ql_set_find_ex(struct quicklist **qlp, int *qip, const void *data, int (*cmp_cb)(const void *lhs, const void *rhs));
|
|
@ -0,0 +1,14 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define selist quicklist
|
||||||
|
#define selist_free ql_free
|
||||||
|
#define selist_get ql_get
|
||||||
|
#define selist_push ql_push
|
||||||
|
#define selist_empty ql_empty
|
||||||
|
#define selist_advance ql_advance
|
||||||
|
#include <selist.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
typedef void(*ql_cb)(void *);
|
||||||
|
bool ql_set_insert_ex(struct quicklist **qlp, void *data, int (*cmp_cb)(const void *lhs, const void *rhs));
|
||||||
|
bool ql_set_find_ex(struct quicklist **qlp, int *qip, const void *data, int (*cmp_cb)(const void *lhs, const void *rhs));
|
Loading…
Reference in New Issue