EMILE/libcontainer/libcontainer.h

39 lines
951 B
C
Raw Normal View History

2005-11-29 00:14:06 +00:00
/*
*
* (c) 2005 Laurent Vivier <Laurent@lvivier.info>
2005-11-29 00:14:06 +00:00
*
*/
#ifndef _LIBCONTAINER_H_
#define _LIBCONTAINER_H_
2005-11-29 00:14:06 +00:00
#include <sys/types.h>
#include <libstream.h>
struct emile_block {
u_int32_t offset; /* offset of first block */
u_int16_t count; /* number of blocks */
} __attribute__((packed));
struct emile_container {
u_int32_t size;
2005-11-29 00:14:06 +00:00
struct emile_block blocks[0];
} __attribute__((packed));
typedef struct {
unsigned long offset;
2005-12-02 00:48:11 +00:00
device_io_t *device;
2005-11-29 00:14:06 +00:00
struct emile_container* container;
unsigned long current_block;
char *buffer[0];
} container_FILE;
2005-12-01 22:12:53 +00:00
extern container_FILE *container_open(device_io_t *device, char *current);
extern int container_close(container_FILE *file);
extern int container_lseek(container_FILE *file, off_t offset, int whence);
extern ssize_t container_read(container_FILE *file, void *ptr, size_t size);
extern int container_fstat(container_FILE *file, struct stream_stat *buf);
#endif /* _LIBCONTAINER_H_ */