source: trunk/libtransmission/platform.h @ 13625

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

Follow more common whitespace style conventions in the C code (libtransmission, daemon, utils, cli, gtk).

  • Property svn:keywords set to Date Rev Author Id
File size: 2.3 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 13625 2012-12-05 17:29:46Z 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/** @brief return the number of bytes available for use in the specified path, or -1 on error */
46int64_t tr_getFreeSpace (const char * path);
47
48
49/** @} */
50
51
52/**
53 * @addtogroup utils Utilities
54 * @{
55 */
56
57typedef struct tr_thread tr_thread;
58
59/** @brief Instantiate a new process thread */
60tr_thread* tr_threadNew (void (*func)(void *), void * arg);
61
62/** @brief Return nonzero if this function is being called from `thread'
63    @param thread the thread being tested */
64bool tr_amInThread (const tr_thread *);
65
66/***
67****
68***/
69
70typedef struct tr_lock tr_lock;
71
72/** @brief Create a new thread mutex object */
73tr_lock * tr_lockNew (void);
74
75/** @brief Destroy a thread mutex object */
76void tr_lockFree (tr_lock *);
77
78/** @brief Attempt to lock a thread mutex object */
79void tr_lockLock (tr_lock *);
80
81/** @brief Unlock a thread mutex object */
82void tr_lockUnlock (tr_lock *);
83
84/** @brief return nonzero if the specified lock is locked */
85int tr_lockHave (const tr_lock *);
86
87#ifdef WIN32
88void * mmap (void *ptr, long  size, long  prot, long  type, long  handle, long  arg);
89
90long munmap (void *ptr, long  size);
91#endif
92
93/* @} */
94
95#endif
Note: See TracBrowser for help on using the repository browser.