2 * io_manager.c --- the I/O manager abstraction
16 #include <sys/types.h>
22 errcode_t io_channel_set_options(io_channel channel, const char *opts)
25 char *next, *ptr, *options, *arg;
27 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
32 if (!channel->manager->set_option)
33 return EXT2_ET_INVALID_ARGUMENT;
35 options = malloc(strlen(opts)+1);
37 return EXT2_ET_NO_MEMORY;
38 strcpy(options, opts);
42 next = strchr(ptr, '&');
46 arg = strchr(ptr, '=');
50 retval = (channel->manager->set_option)(channel, ptr, arg);
59 errcode_t io_channel_write_byte(io_channel channel, unsigned long offset,
60 int count, const void *data)
62 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
64 if (channel->manager->write_byte)
65 return channel->manager->write_byte(channel, offset,
68 return EXT2_ET_UNIMPLEMENTED;