mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-19 05:38:43 +00:00
Add r_spaces_purge() (#15428)
This commit is contained in:
parent
cab7a195ba
commit
b18fc9e428
@ -67,6 +67,8 @@ R_API bool r_spaces_init(RSpaces *sp, const char *name);
|
||||
R_API void r_spaces_fini(RSpaces *sp);
|
||||
// Finalize and free an existing RSpaces
|
||||
R_API void r_spaces_free(RSpaces *sp);
|
||||
// Delete all spaces
|
||||
R_API void r_spaces_purge(RSpaces *sp);
|
||||
// Get the RSpace with the given name
|
||||
R_API RSpace *r_spaces_get(RSpaces *sp, const char *name);
|
||||
// Add a new RSpace if one does not already exist, otherwise return the existing one
|
||||
|
@ -65,6 +65,13 @@ R_API void r_spaces_fini(RSpaces *sp) {
|
||||
R_FREE (sp->name);
|
||||
}
|
||||
|
||||
R_API void r_spaces_purge(RSpaces *sp) {
|
||||
sp->current = NULL;
|
||||
r_list_purge (sp->spacestack);
|
||||
r_rbtree_free (sp->spaces, space_node_free);
|
||||
sp->spaces = NULL;
|
||||
}
|
||||
|
||||
static int name_space_cmp(const void *incoming, const RBNode *rb, void *user) {
|
||||
const RSpace *s = container_of (rb, const RSpace, rb);
|
||||
return strcmp (incoming, s->name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user