]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fastbuf.c
Moved object reading and writing functions where they belong.
[libucw.git] / lib / fastbuf.c
index d2e08f8648def7918c8fc04404f530aa18fabd0b..85df8250370f10197234d902f4cbcc908fd73895 100644 (file)
@@ -355,3 +355,15 @@ bskip(struct fastbuf *f, uns len)
       len -= l;
     }
 }
+
+sh_off_t
+bfilesize(struct fastbuf *f)
+{
+  if (!f)
+    return 0;
+  sh_off_t pos = btell(f);
+  bseek(f, 0, SEEK_END);
+  sh_off_t len = btell(f);
+  bsetpos(f, pos);
+  return len;
+}