X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/61a1daa59589212608039e2734009870818bacd3..0fd474df7001837bde53da0e42e83081827c9641:/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 7adbc53..3086c63 100644 --- a/lunaix-os/includes/lunaix/fs/twimap.h +++ b/lunaix-os/includes/lunaix/fs/twimap.h @@ -3,20 +3,34 @@ #include -#define twimap_index(twimap, type) ((type)((twimap)->index)) -#define twimap_data(twimap, type) ((type)((twimap)->data)) +#define twimap_index(twimap, type) ((type)__ptr((twimap)->index)) +#define twimap_data(twimap, type) ((type)__ptr((twimap)->data)) extern struct v_file_ops twimap_file_ops; +#define __TWIMAP_OPS \ + void (*read)(struct twimap* mapping); \ + int (*go_next)(struct twimap* mapping); \ + void (*reset)(struct twimap* mapping); + +struct twimap; +struct twimap_ops +{ + __TWIMAP_OPS +}; + 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 twimap_ops ops; + struct { __TWIMAP_OPS }; + }; + }; int