X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/28c176b668c841a3b7fb093faccf0efa39257603..6f65553ca5d2740738f399d88b3a4eb298255427:/lunaix-os/includes/lunaix/fs/twimap.h diff --git a/lunaix-os/includes/lunaix/fs/twimap.h b/lunaix-os/includes/lunaix/fs/twimap.h index c9d56a2..465c99f 100644 --- a/lunaix-os/includes/lunaix/fs/twimap.h +++ b/lunaix-os/includes/lunaix/fs/twimap.h @@ -8,17 +8,37 @@ extern struct v_file_ops twimap_file_ops; +struct twimap; +struct twimap_ops +{ + void (*read)(struct twimap* mapping); + int (*go_next)(struct twimap* mapping); + void (*reset)(struct twimap* mapping); +}; + struct twimap { void* index; void* buffer; void* data; size_t size_acc; - void (*read)(struct twimap* mapping); - int (*go_next)(struct twimap* mapping); - void (*reset)(struct twimap* mapping); + + union { + struct { + void (*read)(struct twimap* mapping); + int (*go_next)(struct twimap* mapping); + void (*reset)(struct twimap* mapping); + }; + struct twimap_ops ops; + }; }; +void +__twimap_default_reset(struct twimap* map); + +int +__twimap_default_gonext(struct twimap* map); + int twimap_read(struct twimap* map, void* buffer, size_t len, size_t fpos);