diff options
author | Matias Linares <matiaslina@opmbx.org> | 2015-04-26 21:43:42 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@opmbx.org> | 2015-04-26 21:43:42 -0300 |
commit | 2dd5cf430edaae01594d566c9f27d780c3ffb4ef (patch) | |
tree | 13111bc82a73e951d5d7c07865a206c025d15529 /block_walker.h | |
download | medianinfs-2dd5cf430edaae01594d566c9f27d780c3ffb4ef.tar.gz |
Initial commit
Diffstat (limited to 'block_walker.h')
-rw-r--r-- | block_walker.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/block_walker.h b/block_walker.h new file mode 100644 index 0000000..00efc09 --- /dev/null +++ b/block_walker.h @@ -0,0 +1,25 @@ +#ifndef _BLOCK_WALKER_H +#define _BLOCK_WALKER_H +#include <stdint.h> + +typedef struct _block_walker bwalker; + +/* Creacion y destruccion */ +bwalker *bwalker_create(const char *base_mem,size_t size, uint16_t *indirect_mem); +void bwalker_destroy (bwalker *bw); + +/* Consigue un bloque libre. En caso de fallar, retorna 0 */ +uint16_t bwalker_direct_length(bwalker *bw); +uint16_t bwalker_indirect_length(bwalker *bw); + +uint16_t bwalker_allocate_block(bwalker *bw); +void bwalker_free_block(bwalker *bw); + +uint16_t bwalker_next(bwalker *bw); +uint16_t bwalker_prev(bwalker *bw); +uint16_t bwalker_last_indirect (bwalker *bw); +uint16_t bwalker_last_block (bwalker *bw); +uint16_t bwalker_block_is_last(bwalker *bw); + +void bwalker_set_first(bwalker *bw); +#endif |