From 00e242ce2b0cdf75e0b3c7aca4169dbcba582e1c Mon Sep 17 00:00:00 2001
From: Richard Nyberg <rnyberg@murmeldjur.se>
Date: Thu, 2 Nov 2006 21:03:56 +0000
Subject: [PATCH] Add bts_filename which gets the current filename from a
 bt_stream.

---
 misc/stream.c | 6 ++++++
 misc/stream.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/misc/stream.c b/misc/stream.c
index 4c51d96..9fcfd81 100644
--- a/misc/stream.c
+++ b/misc/stream.c
@@ -178,3 +178,9 @@ bts_sha(struct bt_stream *bts, off_t start, off_t length, uint8_t *hash)
     SHA1_Final(hash, &ctx);
     return err;
 }
+
+const char *
+bts_filename(struct bt_stream *bts)
+{
+    return bts->files[bts->index].path;
+}
diff --git a/misc/stream.h b/misc/stream.h
index 0b5b7aa..c67e3f4 100644
--- a/misc/stream.h
+++ b/misc/stream.h
@@ -23,4 +23,6 @@ int bts_get(struct bt_stream *bts, off_t off, uint8_t *buf, size_t len);
 int bts_put(struct bt_stream *bts, off_t off, const uint8_t *buf, size_t len);
 int bts_sha(struct bt_stream *bts, off_t start, off_t length, uint8_t *hash);
 
+const char *bts_filename(struct bt_stream *bts);
+
 #endif