source: trunk/libtransmission/platform.h @ 13696

Last change on this file since 13696 was 13696, checked in by jordan, 8 years ago

(trunk, libT) #3833 'freespace' argument for 'session-get' RPC method -- apply taem's 0001-Check-for-available-quota-when-getting-free-disk-spa.patch​ to check for available quota when getting free disk space

  • Property svn:keywords set to Date Rev Author Id
File size: 2.4 KB
Line 
1/*
2 * This file Copyright (C) Mnemosyne LLC
3 *
4 * This file is licensed by the GPL version 2. Works owned by the
5 * Transmission project are granted a special exemption to clause 2 (b)
6 * so that the bulk of its code can remain under the MIT license.
7 * This exemption does not extend to derived works not owned by
8 * the Transmission project.
9 *
10 * $Id: platform.h 13696 2012-12-27 19:39:44Z jordan $
11 */
12
13#ifndef __TRANSMISSION__
14 #error only libtransmission should #include this header.
15#endif
16
17#ifndef TR_PLATFORM_H
18#define TR_PLATFORM_H
19
20#define TR_PATH_DELIMITER '/'
21#define TR_PATH_DELIMITER_STR "/"
22
23/**
24 * @addtogroup tr_session Session
25 * @{
26 */
27
28/**
29 * @brief invoked by tr_sessionInit () to set up the locations of the resume, torrent, and clutch directories.
30 * @see tr_getResumeDir ()
31 * @see tr_getTorrentDir ()
32 * @see tr_getWebClientDir ()
33 */
34void tr_setConfigDir (tr_session * session, const char * configDir);
35
36/** @brief return the directory where .resume files are stored */
37const char * tr_getResumeDir (const tr_session *);
38
39/** @brief return the directory where .torrent files are stored */
40const char * tr_getTorrentDir (const tr_session *);
41
42/** @brief return the directory where the Web Client's web ui files are kept */
43const char * tr_getWebClientDir (const tr_session *);
44
45/** If the disk quota is enabled and readable, this returns how much is available in the quota.
46    Otherwise, it returns how much is available on the disk, or -1 on error. */
47int64_t tr_getFreeSpace (const char * path);
48
49
50/** @} */
51
52
53/**
54 * @addtogroup utils Utilities
55 * @{
56 */
57
58typedef struct tr_thread tr_thread;
59
60/** @brief Instantiate a new process thread */
61tr_thread* tr_threadNew (void (*func)(void *), void * arg);
62
63/** @brief Return nonzero if this function is being called from `thread'
64    @param thread the thread being tested */
65bool tr_amInThread (const tr_thread *);
66
67/***
68****
69***/
70
71typedef struct tr_lock tr_lock;
72
73/** @brief Create a new thread mutex object */
74tr_lock * tr_lockNew (void);
75
76/** @brief Destroy a thread mutex object */
77void tr_lockFree (tr_lock *);
78
79/** @brief Attempt to lock a thread mutex object */
80void tr_lockLock (tr_lock *);
81
82/** @brief Unlock a thread mutex object */
83void tr_lockUnlock (tr_lock *);
84
85/** @brief return nonzero if the specified lock is locked */
86int tr_lockHave (const tr_lock *);
87
88#ifdef WIN32
89void * mmap (void *ptr, long  size, long  prot, long  type, long  handle, long  arg);
90
91long munmap (void *ptr, long  size);
92#endif
93
94/* @} */
95
96#endif
Note: See TracBrowser for help on using the repository browser.