~sense/ubuntu/lucid/transmission/fix-497882

« back to all changes in this revision

Viewing changes to libtransmission/utils.h

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2008-11-28 15:33:48 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20081128153348-it70trfnxiroblmc
Tags: 1.40-0ubuntu1
* New upstream release (LP: #302672)
  - Tracker communication uses fewer resources
  - More accurate bandwidth limits
  - Reduce disk fragmentation by preallocating files (LP: #287726)
  - Stability, security and performance improvements to the RPC /
    Web UI server (closes LP: #290423)
  - Support compression when serving Web UI and RPC responses
  - Simplify the RPC whitelist
  - Fix bug that prevented handshakes with encrypted BitComet peers
  - Fix 1.3x bug that could re-download some data unnecessarily
    (LP: #295040)
  - Option to automatically update the blocklist weekly
  - Added off-hour bandwidth scheduling
  - Simplify file/priority selection in the details dialog
  - Fix a couple of crashes
  - New / updated translations
  - Don't inhibit hibernation by default (LP: #292929)
  - Use "close" animation when sending to notification area (LP: #130811)
  - Fix resize problems (LP: #269872)
  - Support "--version" option when launching from command line
    (LP: #292011)
  - Correctly parse announce URLs that have leading or trailing
    spaces (LP: #262411)
  - Display an error when "Open Torrent" fails (LP: #281463)
* Dropped 10_fix_crasher_from_upstream.dpatch: Fix is in this
  upstream release.
* debian/control: Don't just build-depend on libcurl-dev, which is
  a virtual package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/******************************************************************************
2
 
 * $Id: utils.h 6768 2008-09-16 17:50:16Z charles $
 
2
 * $Id: utils.h 6961 2008-10-26 15:39:04Z charles $
3
3
 *
4
4
 * Copyright (c) 2005-2008 Transmission authors and contributors
5
5
 *
31
31
#include <stdio.h> /* FILE* */
32
32
#include <time.h> /* time_t* */
33
33
 
 
34
#ifdef __cplusplus
 
35
extern "C" {
 
36
#endif
 
37
 
34
38
/***
35
39
****
36
40
***/
37
41
 
38
42
#ifndef FALSE
39
 
#define FALSE 0
 
43
 #define FALSE 0
40
44
#endif
41
45
 
42
46
#ifndef TRUE
43
 
#define TRUE 1
 
47
 #define TRUE 1
44
48
#endif
45
49
 
46
50
#ifndef UNUSED
47
 
#ifdef __GNUC__
48
 
#define UNUSED __attribute__((unused))
49
 
#else
50
 
#define UNUSED
51
 
#endif
 
51
 #ifdef __GNUC__
 
52
  #define UNUSED __attribute__ ( ( unused ) )
 
53
 #else
 
54
  #define UNUSED
 
55
 #endif
52
56
#endif
53
57
 
54
58
#ifndef TR_GNUC_PRINTF
55
 
#ifdef __GNUC__
56
 
#define TR_GNUC_PRINTF( fmt, args ) __attribute__((format (printf, fmt, args)))
57
 
#else
58
 
#define TR_GNUC_PRINTF( fmt, args )
59
 
#endif
 
59
 #ifdef __GNUC__
 
60
  #define TR_GNUC_PRINTF( fmt,\
 
61
                          args ) __attribute__ ( ( format ( printf, fmt,\
 
62
                                                            args ) ) )
 
63
 #else
 
64
  #define TR_GNUC_PRINTF( fmt, args )
 
65
 #endif
60
66
#endif
61
67
 
62
68
#ifndef TR_GNUC_NULL_TERMINATED
63
 
#if __GNUC__ >= 4
64
 
#define TR_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
65
 
#else
66
 
#define TR_GNUC_NULL_TERMINATED
67
 
#endif
 
69
 #if __GNUC__ >= 4
 
70
  #define TR_GNUC_NULL_TERMINATED __attribute__ ( ( __sentinel__ ) )
 
71
 #else
 
72
  #define TR_GNUC_NULL_TERMINATED
 
73
 #endif
68
74
#endif
69
75
 
70
 
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
71
 
#define TR_GNUC_PURE __attribute__((__pure__))
72
 
#define TR_GNUC_MALLOC __attribute__((__malloc__))
 
76
#if __GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 96 )
 
77
 #define TR_GNUC_PURE __attribute__ ( ( __pure__ ) )
 
78
 #define TR_GNUC_MALLOC __attribute__ ( ( __malloc__ ) )
73
79
#else
74
 
#define TR_GNUC_PURE
75
 
#define TR_GNUC_MALLOC
 
80
 #define TR_GNUC_PURE
 
81
 #define TR_GNUC_MALLOC
76
82
#endif
77
83
 
78
84
 
80
86
****
81
87
***/
82
88
 
83
 
#if !defined(_)
84
 
#if defined(SYS_DARWIN)
85
 
  #define _(a) (a)
86
 
#elif defined(HAVE_LIBINTL_H)
 
89
#if !defined( _ )
 
90
 #if defined( SYS_DARWIN )
 
91
  #define _( a ) ( a )
 
92
 #elif defined( HAVE_LIBINTL_H )
87
93
  #include <libintl.h>
88
 
  #define _(a) gettext (a)
89
 
#else
90
 
  #define _(a) (a)
91
 
#endif
92
 
#endif
93
 
 
94
 
#define tr_nerr( n, a... ) tr_msg( __FILE__, __LINE__, TR_MSG_ERR, n, ## a )
95
 
#define tr_ninf( n, a... ) tr_msg( __FILE__, __LINE__, TR_MSG_INF, n, ## a )
96
 
#define tr_ndbg( n, a... ) tr_msg( __FILE__, __LINE__, TR_MSG_DBG, n, ## a )
97
 
 
98
 
#define tr_torerr( tor, a... ) tr_msg( __FILE__, __LINE__, TR_MSG_ERR, tor->info.name, ## a )
99
 
#define tr_torinf( tor, a... ) tr_msg( __FILE__, __LINE__, TR_MSG_INF, tor->info.name, ## a )
100
 
#define tr_tordbg( tor, a... ) tr_msg( __FILE__, __LINE__, TR_MSG_DBG, tor->info.name, ## a )
101
 
 
102
 
#define tr_err( a... ) tr_msg( __FILE__, __LINE__, TR_MSG_ERR, NULL, ## a )
103
 
#define tr_inf( a... ) tr_msg( __FILE__, __LINE__, TR_MSG_INF, NULL, ## a )
104
 
#define tr_dbg( a... ) tr_msg( __FILE__, __LINE__, TR_MSG_DBG, NULL, ## a )
105
 
 
106
 
void tr_msgInit( void );
107
 
 
108
 
void tr_msg( const char * file, int line,
109
 
             int level, const char * torrent,
110
 
             const char * fmt, ... ) TR_GNUC_PRINTF( 5, 6 );
111
 
 
112
 
FILE* tr_getLog( void );
113
 
 
114
 
void tr_deepLog( const char * file, int line,
115
 
                 const char * name,
116
 
                 const char * fmt, ... ) TR_GNUC_PRINTF( 4, 5 );
117
 
 
118
 
char* tr_getLogTimeStr( char * buf, int buflen );
119
 
 
120
 
/** Returns a random number in the range of [0...n) */
121
 
int tr_rand ( int n );
 
94
  #define _( a ) gettext ( a )
 
95
 #else
 
96
  #define _( a ) ( a )
 
97
 #endif
 
98
#endif
 
99
 
 
100
/* #define DISABLE_GETTEXT */
 
101
#if defined(TR_EMBEDDED) && !defined(DISABLE_GETTEXT)
 
102
 #define DISABLE_GETTEXT
 
103
#endif
 
104
#ifdef DISABLE_GETTEXT
 
105
 const char * tr_strip_positional_args( const char * fmt );
 
106
 #undef _
 
107
 #define _( a ) tr_strip_positional_args( a )
 
108
#endif
 
109
 
 
110
#define tr_nerr( n, ... ) tr_msg( __FILE__, __LINE__, TR_MSG_ERR, n, __VA_ARGS__ )
 
111
#define tr_ninf( n, ... ) tr_msg( __FILE__, __LINE__, TR_MSG_INF, n, __VA_ARGS__ )
 
112
#define tr_ndbg( n, ... ) tr_msg( __FILE__, __LINE__, TR_MSG_DBG, n, __VA_ARGS__ )
 
113
 
 
114
#define tr_torerr( tor, ... ) tr_msg( __FILE__, __LINE__, TR_MSG_ERR, tor->info.name, __VA_ARGS__ )
 
115
#define tr_torinf( tor, ... ) tr_msg( __FILE__, __LINE__, TR_MSG_INF, tor->info.name, __VA_ARGS__ )
 
116
#define tr_tordbg( tor, ... ) tr_msg( __FILE__, __LINE__, TR_MSG_DBG, tor->info.name, __VA_ARGS__ )
 
117
 
 
118
#define tr_err( ... ) tr_msg( __FILE__, __LINE__, TR_MSG_ERR, NULL, __VA_ARGS__ )
 
119
#define tr_inf( ... ) tr_msg( __FILE__, __LINE__, TR_MSG_INF, NULL, __VA_ARGS__ )
 
120
#define tr_dbg( ... ) tr_msg( __FILE__, __LINE__, TR_MSG_DBG, NULL, __VA_ARGS__ )
 
121
 
 
122
int            tr_wildmat( const char * text,
 
123
                           const char * pattern );
 
124
 
 
125
void           tr_msgInit( void );
 
126
 
 
127
void           tr_msg( const char * file,
 
128
                       int          line,
 
129
                       int          level,
 
130
                       const char * torrent,
 
131
                       const char * fmt,
 
132
                       ... ) TR_GNUC_PRINTF( 5, 6 );
 
133
 
 
134
FILE*          tr_getLog( void );
 
135
 
 
136
int            tr_deepLoggingIsActive( void );
 
137
 
 
138
void           tr_deepLog( const char * file,
 
139
                           int          line,
 
140
                           const char * name,
 
141
                           const char * fmt,
 
142
                           ... ) TR_GNUC_PRINTF( 4, 5 );
 
143
 
 
144
char*          tr_getLogTimeStr( char * buf,
 
145
                                 int    buflen );
 
146
 
 
147
/** a portability wrapper for getcwd(). */
 
148
char*          tr_getcwd( void ) TR_GNUC_MALLOC;
 
149
 
 
150
/** a portability wrapper for basename(). */
 
151
char*          tr_basename( const char * path ) TR_GNUC_MALLOC;
 
152
 
 
153
/** a portability wrapper for dirname(). */
 
154
char*          tr_dirname( const char * path ) TR_GNUC_MALLOC;
122
155
 
123
156
/**
124
157
 * a portability wrapper around mkdir().
127
160
 * @return zero on success, or -1 if an error occurred
128
161
 * (in which case errno is set appropriately).
129
162
 */
130
 
int tr_mkdir( const char * path, int permissions );
 
163
int            tr_mkdir( const char * path,
 
164
                         int          permissions );
131
165
 
132
166
/**
133
167
 * Like mkdir, but makes parent directories as needed.
135
169
 * @return zero on success, or -1 if an error occurred
136
170
 * (in which case errno is set appropriately).
137
171
 */
138
 
int tr_mkdirp( const char * path, int permissions );
139
 
 
140
 
 
141
 
uint8_t* tr_loadFile( const char * filename, size_t * size ) TR_GNUC_MALLOC;
 
172
int            tr_mkdirp( const char * path,
 
173
                          int          permissions );
 
174
 
 
175
 
 
176
/**
 
177
 * Loads a file and returns its contents.
 
178
 * On failure, NULL is returned and errno is set.
 
179
 */
 
180
uint8_t*       tr_loadFile( const char * filename,
 
181
                            size_t *     size ) TR_GNUC_MALLOC;
142
182
 
143
183
 
144
184
/* creates a filename from a series of elements using the
145
185
   correct separator for filenames. */
146
 
void tr_buildPath( char* buf, size_t buflen,
147
 
                   const char * first_element, ... )
148
 
                                      TR_GNUC_NULL_TERMINATED;
149
 
 
150
 
struct timeval tr_timevalMsec( uint64_t milliseconds );
151
 
 
152
 
 
153
 
int tr_ioErrorFromErrno( int err );
154
 
 
155
 
const char * tr_errorString( int code );
 
186
char*          tr_buildPath( const char * first_element, ... )
 
187
                                              TR_GNUC_NULL_TERMINATED
 
188
                                              TR_GNUC_MALLOC;
 
189
 
 
190
struct timeval;
 
191
 
 
192
void tr_timevalMsec( uint64_t           milliseconds,
 
193
                     struct timeval   * setme );
 
194
 
156
195
 
157
196
/* return the current date in milliseconds */
158
 
uint64_t tr_date( void );
 
197
uint64_t       tr_date( void );
159
198
 
160
199
/* wait the specified number of milliseconds */
161
 
void tr_wait( uint64_t delay_milliseconds );
 
200
void           tr_wait( uint64_t delay_milliseconds );
162
201
 
163
202
/***
164
203
****
167
206
/* Sometimes the system defines MAX/MIN, sometimes not. In the latter
168
207
   case, define those here since we will use them */
169
208
#ifndef MAX
170
 
#define MAX(a,b) ((a)>(b)?(a):(b))
 
209
 #define MAX( a, b ) ( ( a ) > ( b ) ? ( a ) : ( b ) )
171
210
#endif
172
211
#ifndef MIN
173
 
#define MIN(a,b) ((a)>(b)?(b):(a))
 
212
 #define MIN( a, b ) ( ( a ) > ( b ) ? ( b ) : ( a ) )
174
213
#endif
175
214
 
176
215
/***
177
216
****
178
217
***/
179
218
 
180
 
#define tr_new(struct_type, n_structs)           \
181
 
    ((struct_type *) tr_malloc (((size_t) sizeof (struct_type)) * ((size_t) (n_structs))))
182
 
#define tr_new0(struct_type, n_structs)          \
183
 
    ((struct_type *) tr_malloc0 (((size_t) sizeof (struct_type)) * ((size_t) (n_structs))))
184
 
#define tr_renew(struct_type, mem, n_structs)    \
185
 
    ((struct_type *) realloc ((mem), ((size_t) sizeof (struct_type)) * ((size_t) (n_structs))))
186
 
 
187
 
void* tr_malloc  ( size_t ) TR_GNUC_MALLOC;
188
 
void* tr_malloc0 ( size_t ) TR_GNUC_MALLOC;
189
 
void* tr_calloc  ( size_t nmemb, size_t size ) TR_GNUC_MALLOC;
190
 
void  tr_free    ( void* );
191
 
 
192
 
char* tr_strdup( const void * str ) TR_GNUC_MALLOC;
193
 
char* tr_strndup( const void * str, int len ) TR_GNUC_MALLOC;
194
 
void* tr_memdup( const void * src, int byteCount ) TR_GNUC_MALLOC;
195
 
char* tr_strdup_printf( const char * fmt, ... )  TR_GNUC_PRINTF( 1, 2 ) TR_GNUC_MALLOC;
196
 
char* tr_base64_encode( const void * input, int inlen, int *outlen ) TR_GNUC_MALLOC;
197
 
char* tr_base64_decode( const void * input, int inlen, int *outlen ) TR_GNUC_MALLOC;
198
 
 
199
 
size_t tr_strlcpy( char * dst, const char * src, size_t siz );
200
 
int tr_snprintf( char * buf, size_t buflen, const char * fmt, ... );
201
 
 
202
 
int   tr_stringEndsWith( const char * string, const char * end );
 
219
#define tr_new( struct_type, n_structs )           \
 
220
    ( (struct_type *) tr_malloc ( ( (size_t) sizeof ( struct_type ) ) * ( (\
 
221
                                                                             size_t) (\
 
222
                                                                             n_structs ) ) ) )
 
223
#define tr_new0( struct_type, n_structs )          \
 
224
    ( (struct_type *) tr_malloc0 ( ( (size_t) sizeof ( struct_type ) ) * ( (\
 
225
                                                                              size_t) (\
 
226
                                                                              n_structs ) ) ) )
 
227
#define tr_renew( struct_type, mem, n_structs )    \
 
228
    ( (struct_type *) realloc ( ( mem ),\
 
229
                               ( (size_t) sizeof ( struct_type ) ) * ( (\
 
230
                                                                          size_t) (\
 
231
                                                                          n_structs ) ) ) )
 
232
 
 
233
void*       tr_malloc( size_t ) TR_GNUC_MALLOC;
 
234
 
 
235
void*       tr_malloc0( size_t ) TR_GNUC_MALLOC;
 
236
 
 
237
void        tr_free( void* );
 
238
 
 
239
char*       tr_strdup( const void * str ) TR_GNUC_MALLOC;
 
240
 
 
241
char*       tr_strndup( const void * str,
 
242
                        int          len ) TR_GNUC_MALLOC;
 
243
 
 
244
void*       tr_memdup( const void * src,
 
245
                       int          byteCount ) TR_GNUC_MALLOC;
 
246
 
 
247
char*       tr_strdup_printf( const char * fmt,
 
248
                              ... )  TR_GNUC_PRINTF( 1, 2 ) TR_GNUC_MALLOC;
 
249
 
 
250
char*       tr_base64_encode( const void * input,
 
251
                              int          inlen,
 
252
                              int *        outlen ) TR_GNUC_MALLOC;
 
253
 
 
254
char*       tr_base64_decode( const void * input,
 
255
                              int          inlen,
 
256
                              int *        outlen ) TR_GNUC_MALLOC;
 
257
 
 
258
size_t      tr_strlcpy( char *       dst,
 
259
                        const void * src,
 
260
                        size_t       siz );
 
261
 
 
262
int         tr_snprintf( char *       buf,
 
263
                         size_t       buflen,
 
264
                         const char * fmt,
 
265
                         ... ) TR_GNUC_PRINTF( 3, 4 );
203
266
 
204
267
const char* tr_strerror( int );
205
268
 
 
269
char*       tr_strstrip( char * str );
 
270
 
206
271
/***
207
272
****
208
273
***/
209
274
 
210
 
typedef void (tr_set_func)(void * element, void * userData );
211
 
 
212
 
void tr_set_compare( const void * a, size_t aCount,
213
 
                     const void * b, size_t bCount,
214
 
                     int compare( const void * a, const void * b ),
215
 
                     size_t elementSize,
216
 
                     tr_set_func in_a_cb,
217
 
                     tr_set_func in_b_cb,
218
 
                     tr_set_func in_both_cb,
219
 
                     void * userData );
220
 
                    
221
 
int tr_compareUint16( uint16_t a, uint16_t b );
222
 
int tr_compareUint32( uint32_t a, uint32_t b );
223
 
int tr_compareUint64( uint64_t a, uint64_t b );
224
 
int tr_compareDouble( double a, double b );
225
 
 
226
 
int tr_strcmp( const void * a, const void * b );
227
 
int tr_strcasecmp( const char * a, const char * b );
228
 
 
229
 
void tr_sha1_to_hex( char * out, const uint8_t * sha1 );
230
 
 
231
 
 
232
 
int tr_httpIsValidURL( const char * url );
233
 
 
234
 
int tr_httpParseURL( const char * url,
235
 
                     int          url_len,
236
 
                     char     ** setme_host,
237
 
                     int       * setme_port,
238
 
                     char     ** setme_path );
 
275
typedef void ( tr_set_func )( void * element, void * userData );
 
276
 
 
277
void        tr_set_compare( const void * a,
 
278
                            size_t aCount,
 
279
                            const void * b,
 
280
                            size_t bCount,
 
281
                            int compare( const void * a, const void * b ),
 
282
                            size_t elementSize,
 
283
                            tr_set_func in_a_cb,
 
284
                            tr_set_func in_b_cb,
 
285
                            tr_set_func in_both_cb,
 
286
                            void * userData );
 
287
 
 
288
void tr_sha1_to_hex( char *          out,
 
289
                     const uint8_t * sha1 );
 
290
 
 
291
 
 
292
int  tr_httpIsValidURL( const char * url );
 
293
 
 
294
int  tr_httpParseURL( const char * url,
 
295
                      int          url_len,
 
296
                      char **      setme_host,
 
297
                      int *        setme_port,
 
298
                      char **      setme_path );
239
299
 
240
300
 
241
301
/***
244
304
 
245
305
struct tr_bitfield
246
306
{
247
 
    uint8_t * bits;
248
 
    size_t bitCount;
249
 
    size_t byteCount;
 
307
    uint8_t *  bits;
 
308
    size_t     bitCount;
 
309
    size_t     byteCount;
250
310
};
251
311
 
252
312
typedef struct tr_bitfield tr_bitfield;
253
313
 
254
314
tr_bitfield* tr_bitfieldNew( size_t bitcount ) TR_GNUC_MALLOC;
 
315
 
255
316
tr_bitfield* tr_bitfieldDup( const tr_bitfield* ) TR_GNUC_MALLOC;
256
 
void tr_bitfieldFree( tr_bitfield*);
257
 
 
258
 
void tr_bitfieldClear( tr_bitfield* );
259
 
int  tr_bitfieldAdd( tr_bitfield*, size_t bit );
260
 
int  tr_bitfieldRem( tr_bitfield*, size_t bit );
261
 
int  tr_bitfieldAddRange( tr_bitfield *, size_t begin, size_t end );
262
 
int  tr_bitfieldRemRange ( tr_bitfield*, size_t begin, size_t end );
263
 
void tr_bitfieldDifference( tr_bitfield *, const tr_bitfield * );
264
 
 
265
 
int    tr_bitfieldHas( const tr_bitfield*, size_t bit );
266
 
int    tr_bitfieldIsEmpty( const tr_bitfield* );
267
 
size_t tr_bitfieldCountTrueBits( const tr_bitfield* );
268
 
 
269
 
tr_bitfield* tr_bitfieldOr( tr_bitfield*, const tr_bitfield* );
 
317
 
 
318
void         tr_bitfieldFree( tr_bitfield* );
 
319
 
 
320
void         tr_bitfieldClear( tr_bitfield* );
 
321
 
 
322
int          tr_bitfieldAdd(                             tr_bitfield*,
 
323
                                                  size_t bit );
 
324
 
 
325
int          tr_bitfieldRem(                             tr_bitfield*,
 
326
                                                  size_t bit );
 
327
 
 
328
int          tr_bitfieldAddRange(                             tr_bitfield *,
 
329
                                                       size_t begin,
 
330
                                                       size_t end );
 
331
 
 
332
int          tr_bitfieldRemRange(                             tr_bitfield*,
 
333
                                                       size_t begin,
 
334
                                                       size_t end );
 
335
 
 
336
void         tr_bitfieldDifference(                         tr_bitfield *,
 
337
                                                      const tr_bitfield * );
 
338
 
 
339
int          tr_bitfieldIsEmpty( const tr_bitfield* );
 
340
 
 
341
size_t       tr_bitfieldCountTrueBits( const tr_bitfield* );
 
342
 
 
343
tr_bitfield* tr_bitfieldOr(                               tr_bitfield*,
 
344
                                                    const tr_bitfield* );
270
345
 
271
346
/** A stripped-down version of bitfieldHas to be used
272
347
    for speed when you're looping quickly.  This version
273
348
    has none of tr_bitfieldHas()'s safety checks, so you
274
349
    need to call tr_bitfieldTestFast() first before you
275
350
    start looping. */
276
 
#define tr_bitfieldHasFast(bitfield,nth) \
277
 
    (( bitfield->bits[(nth)>>3u] << ((nth)&7u) & 0x80) != 0 )
 
351
#define tr_bitfieldHasFast( bitfield, nth ) \
 
352
    ( ( bitfield->bits[( nth ) >> 3u] << ( ( nth ) & 7u ) & 0x80 ) != 0 )
278
353
 
279
354
/** @param high the highest nth bit you're going to access */
280
 
#define tr_bitfieldTestFast(bitfield,high) \
281
 
    ( (bitfield) && ((bitfield)->bits) && ((high)<(bitfield)->bitCount ) )
282
 
 
283
 
double tr_getRatio( double numerator, double denominator );
 
355
#define tr_bitfieldTestFast( bitfield, high ) \
 
356
    ( ( bitfield ) && ( ( bitfield )->bits )\
 
357
    && ( ( high ) < ( bitfield )->bitCount ) )
 
358
 
 
359
#define tr_bitfieldHas( bitfield, nth ) \
 
360
    ( tr_bitfieldTestFast( bitfield, nth )    \
 
361
    && tr_bitfieldHasFast( bitfield, nth ) )
 
362
 
 
363
double tr_getRatio( double numerator,
 
364
                    double denominator );
 
365
 
 
366
#ifdef __cplusplus
 
367
}
 
368
#endif
284
369
 
285
370
#endif