#ifndef __IO_H
#define __IO_H

#include <types.h>

/*
  memory block functions used to load the kernel
 */

struct device_block_s
{
  uintptr_t addr;


};

/*
  block_read functions reads memory block to dst of size n_block at offset

  @param dst pointer to the memory area where the block is written
  @param n_block size_t number of block to read
  @param offset off_t offset where begin the reading
 */
#define DEV_BLOCK_READ(x) size_t (x)(struct device_block_s *bdev, uintptr_t dst, size_t n_block, off_t offset);
typedef DEV_BLOCK_READ(dev_block_read_t);

#warning clean up
size_t block_read(void *dst, size_t n_block, off_t offset);

/*
  block_init function inits the block driver

  @param addr uintptr_t address of the block device
 */
#define DEV_BLOCK_INIT(x) error_t (x)(struct device_block_s *bdev, uintptr_t addr);
typedef DEV_BLOCK_INIT(dev_block_init_t);

#warning clean up
void block_init(uint32_t *addr);

/*
  block_get_size function gives the handle block size
  
  @return size_t size of one block
 */
#define DEV_BLOCK_GETSIZE(x) size_t (x)(struct device_block_s *bdev);
typedef DEV_BLOCK_GETSIZE(dev_block_getsize_t);

#warning clean up
size_t block_get_size();

/*
  block_free function releases all ressources allocated for the block device
 */
#define DEV_BLOCK_RELEASE(x) error_t (x)(struct device_block_s *bdev);
typedef DEV_BLOCK_RELEASE(dev_block_release_t);

#warning clean up
void block_free();

/*
  set standart output parameters
 */
void print_init(uint32_t *addr);

/*
  standart ouput functions
 */
void printc(const char *str, size_t size);

#endif
