mirror of
https://github.com/radareorg/radare2.git
synced 2025-03-01 18:57:20 +00:00
Add wc--* command to purge all cache layers ##io
This commit is contained in:
parent
b78a39855f
commit
8290315c53
@ -1439,7 +1439,13 @@ static int cmd_wc(void *data, const char *input) {
|
||||
break;
|
||||
case '-': // "wc-"
|
||||
if (input[1] == '-') { // "wc--"
|
||||
r_io_cache_pop (core->io);
|
||||
if (input[2] == '*') {
|
||||
while (r_io_cache_pop (core->io)) {
|
||||
// nothing here
|
||||
}
|
||||
} else {
|
||||
r_io_cache_pop (core->io);
|
||||
}
|
||||
} else if (input[1] == '?') {
|
||||
r_core_cmd_help_match (core, help_msg_wc, "wc-", false);
|
||||
} else {
|
||||
|
@ -531,9 +531,9 @@ R_API int r_io_cache_invalidate(RIO *io, ut64 from, ut64 to, bool many);
|
||||
R_API void r_io_cache_commit(RIO *io, ut64 from, ut64 to, bool many);
|
||||
// cache layers
|
||||
R_API void r_io_cache_push(RIO *io);
|
||||
R_API void r_io_cache_pop(RIO *io);
|
||||
R_API void r_io_cache_undo(RIO *io);
|
||||
R_API void r_io_cache_redo(RIO *io);
|
||||
R_API bool r_io_cache_pop(RIO *io);
|
||||
R_API bool r_io_cache_undo(RIO *io);
|
||||
R_API bool r_io_cache_redo(RIO *io);
|
||||
|
||||
/* io/p_cache.c */
|
||||
R_API bool r_io_desc_cache_init(RIODesc *desc);
|
||||
|
@ -517,17 +517,19 @@ R_API void r_io_cache_push(RIO *io) {
|
||||
r_list_append (io->cache.layers, iocache_layer_new ());
|
||||
}
|
||||
|
||||
R_API void r_io_cache_pop(RIO *io) {
|
||||
R_API bool r_io_cache_pop(RIO *io) {
|
||||
if (!r_list_empty (io->cache.layers)) {
|
||||
RIOCacheLayer *cl = r_list_pop (io->cache.layers);
|
||||
iocache_layer_free (cl);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
R_API void r_io_cache_undo(RIO *io) { // "wcu"
|
||||
r_return_if_fail (io);
|
||||
R_API bool r_io_cache_undo(RIO *io) { // "wcu"
|
||||
r_return_val_if_fail (io, false);
|
||||
if (r_list_empty (io->cache.layers)) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
RIOCacheLayer *layer = r_list_last (io->cache.layers);
|
||||
void **iter;
|
||||
@ -547,8 +549,10 @@ R_API void r_io_cache_undo(RIO *io) { // "wcu"
|
||||
free_elem (c);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
R_API void r_io_cache_redo(RIO *io) { // "wcU"
|
||||
// TODO
|
||||
R_API bool r_io_cache_redo(RIO *io) { // "wcU"
|
||||
// TODO : not implemented
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user