1 /*
2  * This file Copyright (C) 2005-2014 Mnemosyne LLC
3  *
4  * It may be used under the GNU GPL versions 2 or 3
5  * or any future license endorsed by Mnemosyne LLC.
6  *
7  */
8 
9 #pragma once
10 
11 #ifndef __TRANSMISSION__
12 #error only libtransmission should #include this header.
13 #endif
14 
15 #include "transmission.h"
16 #include "variant.h"
17 
18 enum tr_metainfo_basename_format
19 {
20     TR_METAINFO_BASENAME_NAME_AND_PARTIAL_HASH,
21     TR_METAINFO_BASENAME_HASH
22 };
23 
24 bool tr_metainfoParse(tr_session const* session, tr_variant const* variant, tr_info* setmeInfo, bool* setmeHasInfoDict,
25     size_t* setmeInfoDictLength);
26 
27 void tr_metainfoRemoveSaved(tr_session const* session, tr_info const* info);
28 
29 char* tr_metainfoGetBasename(tr_info const*, enum tr_metainfo_basename_format format);
30 
31 void tr_metainfoMigrateFile(tr_session const* session, tr_info const* info, enum tr_metainfo_basename_format old_format,
32     enum tr_metainfo_basename_format new_format);
33 
34 /** @brief Private function that's exposed here only for unit tests */
35 char* tr_metainfo_sanitize_path_component(char const* str, size_t len, bool* is_adjusted);
36