mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-10 00:02:39 +00:00
* Fix list iterators for Vala 0.16 (and probably 0.14 too)
This commit is contained in:
parent
2a0b57d51d
commit
149a58581c
@ -41,6 +41,7 @@ typedef struct r_oflist_t {
|
||||
#define r_list_iter_next(x) (x?1:0)
|
||||
#define r_list_iter_cur(x) x->p
|
||||
#define r_list_iter_unref(x) x
|
||||
#define r_list_iter_free(x) x
|
||||
R_API RList *r_list_new();
|
||||
R_API RListIter *r_list_append(RList *list, void *data);
|
||||
R_API RListIter *r_list_prepend(RList *list, void *data);
|
||||
|
@ -127,12 +127,27 @@ public class RList<G> {
|
||||
public unowned G pop();
|
||||
}
|
||||
|
||||
//[Compact]
|
||||
[Compact]
|
||||
[CCode (cprefix="r_list_iter_", cheader_filename="r_list.h", cname="struct r_list_iter_t")]
|
||||
public class RListIter<G> {
|
||||
public bool next();
|
||||
public RListIter<G> n;
|
||||
public RListIter<G> p;
|
||||
public G data;
|
||||
|
||||
// public G @free(G arg);
|
||||
/*
|
||||
public bool next();
|
||||
public unowned G get();
|
||||
*/
|
||||
|
||||
[ReturnsModifiedPointer, CCode (cname = "_vala_r_list_iter_next")]
|
||||
public bool next() {
|
||||
return (bool)this.n;
|
||||
}
|
||||
[CCode (cname = "_vala_r_list_iter_get")]
|
||||
public G get () {
|
||||
return this.data;
|
||||
}
|
||||
}
|
||||
|
||||
[Compact]
|
||||
|
Loading…
x
Reference in New Issue
Block a user