1 /* vi: set sw=4 ts=4: */
3 * io_manager.c --- the I/O manager abstraction
17 #include <sys/types.h>
23 errcode_t io_channel_set_options(io_channel channel, const char *opts)
26 char *next, *ptr, *options, *arg;
28 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
33 if (!channel->manager->set_option)
34 return EXT2_ET_INVALID_ARGUMENT;
36 options = malloc(strlen(opts)+1);
38 return EXT2_ET_NO_MEMORY;
39 strcpy(options, opts);
43 next = strchr(ptr, '&');
47 arg = strchr(ptr, '=');
51 retval = (channel->manager->set_option)(channel, ptr, arg);
60 errcode_t io_channel_write_byte(io_channel channel, unsigned long offset,
61 int count, const void *data)
63 EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
65 if (channel->manager->write_byte)
66 return channel->manager->write_byte(channel, offset,
69 return EXT2_ET_UNIMPLEMENTED;