taskfs fix up, minor refactoring
[lunaix-os.git] / lunaix-os / includes / lunaix / fs / twimap.h
index c9d56a2aaa6a1de1dcd8a8a29cdf74ed88b43808..465c99fc021a69424fdb8ca9d11fe6d1edead20b 100644 (file)
@@ -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);