source: trunk/libtransmission/platform.h @ 8561

Last change on this file since 8561 was 8561, checked in by charles, 13 years ago

(trunk libT) re-start work on making libT doxygen friendly. still a long ways to go on this.

  • Property svn:keywords set to Date Rev Author Id
File size: 1.9 KB
Line 
1/*
2 * This file Copyright (C) 2009 Charles Kerr <charles@transmissionbt.com>
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 8561 2009-05-29 19:17:12Z charles $
11 */
12
13#ifndef TR_PLATFORM_H
14#define TR_PLATFORM_H
15
16#if defined( WIN32 )
17 #define TR_PATH_DELIMITER '\\'
18 #define TR_PATH_DELIMITER_STR "\\"
19#else
20 #define TR_PATH_DELIMITER '/'
21 #define TR_PATH_DELIMITER_STR "/"
22#endif
23
24#ifdef WIN32
25 #include <windows.h>
26 #define MAX_PATH_LENGTH  MAX_PATH
27#else
28 #define MAX_PATH_LENGTH  2048
29#endif
30
31#define MAX_STACK_ARRAY_SIZE 7168
32
33/**
34 * @addtogroup utils Utilities
35 * @{
36 */
37
38typedef struct tr_lock   tr_lock;
39typedef struct tr_thread tr_thread;
40
41void                tr_setConfigDir( tr_session * session,
42                                     const char * configDir );
43
44const char *        tr_getResumeDir( const tr_session * );
45
46const char *        tr_getTorrentDir( const tr_session * );
47
48const char *        tr_getClutchDir( const tr_session * );
49
50
51tr_thread*          tr_threadNew( void   ( *func )(void *),
52                                  void * arg );
53
54int                 tr_amInThread( const tr_thread * );
55
56tr_lock *           tr_lockNew( void );
57
58void                tr_lockFree( tr_lock * );
59
60void                tr_lockLock( tr_lock * );
61
62void                tr_lockUnlock( tr_lock * );
63
64int                 tr_lockHave( const tr_lock * );
65
66tr_lockfile_state_t tr_lockfile( const char * filename );
67
68#ifdef WIN32
69void *              mmap( void *ptr,
70                          long  size,
71                          long  prot,
72                          long  type,
73                          long  handle,
74                          long  arg );
75
76long                munmap( void *ptr,
77                            long  size );
78
79#endif
80
81/* @} */
82
83#endif
Note: See TracBrowser for help on using the repository browser.