Browse Source

Add bts_filename which gets the current filename from a bt_stream.

master
Richard Nyberg 18 years ago
parent
commit
00e242ce2b
2 changed files with 8 additions and 0 deletions
  1. +6
    -0
      misc/stream.c
  2. +2
    -0
      misc/stream.h

+ 6
- 0
misc/stream.c View File

@@ -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;
}

+ 2
- 0
misc/stream.h View File

@@ -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

Loading…
Cancel
Save