source: trunk/libtransmission/platform.h @ 14532

Last change on this file since 14532 was 14532, checked in by mikedld, 6 years ago

Add more booleans to the picture

  • Property svn:keywords set to Date Rev Author Id
File size: 1.9 KB
Line 
1/*
2 * This file Copyright (C) 2009-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 * $Id: platform.h 14532 2015-05-31 22:13:31Z mikedld $
8 */
9
10#ifndef __TRANSMISSION__
11 #error only libtransmission should #include this header.
12#endif
13
14#ifndef TR_PLATFORM_H
15#define TR_PLATFORM_H
16
17#define TR_PATH_DELIMITER '/'
18#define TR_PATH_DELIMITER_STR "/"
19
20/**
21 * @addtogroup tr_session Session
22 * @{
23 */
24
25/**
26 * @brief invoked by tr_sessionInit () to set up the locations of the resume, torrent, and clutch directories.
27 * @see tr_getResumeDir ()
28 * @see tr_getTorrentDir ()
29 * @see tr_getWebClientDir ()
30 */
31void tr_setConfigDir (tr_session * session, const char * configDir);
32
33/** @brief return the directory where .resume files are stored */
34const char * tr_getResumeDir (const tr_session *);
35
36/** @brief return the directory where .torrent files are stored */
37const char * tr_getTorrentDir (const tr_session *);
38
39/** @brief return the directory where the Web Client's web ui files are kept */
40const char * tr_getWebClientDir (const tr_session *);
41
42/** @} */
43
44
45/**
46 * @addtogroup utils Utilities
47 * @{
48 */
49
50typedef struct tr_thread tr_thread;
51
52/** @brief Instantiate a new process thread */
53tr_thread* tr_threadNew (void (*func)(void *), void * arg);
54
55/** @brief Return nonzero if this function is being called from `thread'
56    @param thread the thread being tested */
57bool tr_amInThread (const tr_thread *);
58
59/***
60****
61***/
62
63typedef struct tr_lock tr_lock;
64
65/** @brief Create a new thread mutex object */
66tr_lock * tr_lockNew (void);
67
68/** @brief Destroy a thread mutex object */
69void tr_lockFree (tr_lock *);
70
71/** @brief Attempt to lock a thread mutex object */
72void tr_lockLock (tr_lock *);
73
74/** @brief Unlock a thread mutex object */
75void tr_lockUnlock (tr_lock *);
76
77/** @brief return nonzero if the specified lock is locked */
78bool tr_lockHave (const tr_lock *);
79
80/* @} */
81
82#endif
Note: See TracBrowser for help on using the repository browser.