2006-07-16 19:39:23 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* $Id$
|
|
|
|
*
|
2007-02-23 11:26:48 +00:00
|
|
|
* Copyright (c) 2005-2007 Transmission authors and contributors
|
2006-07-16 19:39:23 +00:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef TR_TRANSMISSION_H
|
|
|
|
#define TR_TRANSMISSION_H 1
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2007-10-24 18:36:53 +00:00
|
|
|
#include "version.h"
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
#include <inttypes.h>
|
2007-05-09 07:00:08 +00:00
|
|
|
#ifndef PRId64
|
|
|
|
# define PRId64 "lld"
|
|
|
|
#endif
|
2006-07-16 19:39:23 +00:00
|
|
|
#ifndef PRIu64
|
2007-05-09 07:00:08 +00:00
|
|
|
# define PRIu64 "llu"
|
2006-07-16 19:39:23 +00:00
|
|
|
#endif
|
2006-08-22 02:32:46 +00:00
|
|
|
#include <time.h>
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
#define SHA_DIGEST_LENGTH 20
|
|
|
|
#ifdef __BEOS__
|
|
|
|
# include <StorageDefs.h>
|
|
|
|
# define MAX_PATH_LENGTH B_FILE_NAME_LENGTH
|
|
|
|
#else
|
|
|
|
# define MAX_PATH_LENGTH 1024
|
|
|
|
#endif
|
|
|
|
|
2006-08-14 22:42:32 +00:00
|
|
|
#ifndef INET_ADDRSTRLEN
|
|
|
|
#define INET_ADDRSTRLEN 16
|
|
|
|
#endif
|
|
|
|
|
2007-07-31 16:55:47 +00:00
|
|
|
#if defined(WIN32)
|
2007-06-18 19:39:52 +00:00
|
|
|
#define TR_PATH_DELIMITER '\\'
|
|
|
|
#define TR_PATH_DELIMITER_STR "\\"
|
|
|
|
#else
|
2007-06-18 03:40:41 +00:00
|
|
|
#define TR_PATH_DELIMITER '/'
|
|
|
|
#define TR_PATH_DELIMITER_STR "/"
|
2007-06-18 19:39:52 +00:00
|
|
|
#endif
|
2007-06-18 03:40:41 +00:00
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
#define TR_DEFAULT_PORT 9090
|
2007-01-14 12:00:21 +00:00
|
|
|
|
2007-09-26 01:55:04 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
TR_PEER_FROM_INCOMING = 0, /* connections made to the listening port */
|
|
|
|
TR_PEER_FROM_TRACKER = 1, /* peers received from a tracker */
|
|
|
|
TR_PEER_FROM_CACHE = 2, /* peers read from the peer cache */
|
|
|
|
TR_PEER_FROM_PEX = 3, /* peers discovered via PEX */
|
|
|
|
TR_PEER_FROM__MAX
|
|
|
|
};
|
2007-03-23 08:28:01 +00:00
|
|
|
|
2007-01-14 12:00:21 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* Error codes
|
|
|
|
**********************************************************************/
|
|
|
|
/* General errors */
|
2007-05-11 18:56:59 +00:00
|
|
|
#define TR_OK 0x00000000
|
|
|
|
#define TR_ERROR 0x81000000
|
|
|
|
#define TR_ERROR_ASSERT 0x82000000
|
2007-01-14 12:00:21 +00:00
|
|
|
/* I/O errors */
|
2007-05-11 18:56:59 +00:00
|
|
|
#define TR_ERROR_IO_MASK 0x000000FF
|
2007-07-18 18:09:03 +00:00
|
|
|
#define TR_ERROR_IO_PERMISSIONS 0x80000002
|
|
|
|
#define TR_ERROR_IO_SPACE 0x80000004
|
|
|
|
#define TR_ERROR_IO_FILE_TOO_BIG 0x80000008
|
|
|
|
#define TR_ERROR_IO_OPEN_FILES 0x80000010
|
|
|
|
#define TR_ERROR_IO_DUP_DOWNLOAD 0x80000020
|
|
|
|
#define TR_ERROR_IO_OTHER 0x80000040
|
2007-01-14 12:00:21 +00:00
|
|
|
/* Misc */
|
2007-05-11 18:56:59 +00:00
|
|
|
#define TR_ERROR_TC_MASK 0x00000F00
|
|
|
|
#define TR_ERROR_TC_ERROR 0x80000100
|
|
|
|
#define TR_ERROR_TC_WARNING 0x80000200
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-05-09 18:41:22 +00:00
|
|
|
#define TR_ERROR_ISSET( num, code ) ( (code) == ( (code) & (num) ) )
|
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_init
|
|
|
|
***********************************************************************
|
|
|
|
* Initializes a libtransmission instance. Returns a obscure handle to
|
2007-03-13 06:56:50 +00:00
|
|
|
* be passed to all functions below. The tag argument is a short string
|
|
|
|
* unique to the program invoking tr_init(), it is currently used as
|
|
|
|
* part of saved torrent files' names to prevent one frontend from
|
|
|
|
* deleting a torrent used by another. The following tags are used:
|
|
|
|
* beos cli daemon gtk macosx
|
2006-07-16 19:39:23 +00:00
|
|
|
**********************************************************************/
|
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
typedef struct tr_handle tr_handle;
|
|
|
|
|
|
|
|
tr_handle * tr_init( const char * tag );
|
|
|
|
|
|
|
|
typedef struct tr_tracker_info tr_tracker_info;
|
|
|
|
|
|
|
|
/**
|
|
|
|
***
|
|
|
|
**/
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
2007-11-08 21:20:08 +00:00
|
|
|
TR_PLAINTEXT_PREFERRED,
|
2007-09-20 16:32:01 +00:00
|
|
|
TR_ENCRYPTION_PREFERRED,
|
|
|
|
TR_ENCRYPTION_REQUIRED
|
|
|
|
}
|
|
|
|
tr_encryption_mode;
|
|
|
|
|
|
|
|
tr_encryption_mode tr_getEncryptionMode( tr_handle * handle );
|
|
|
|
|
|
|
|
void tr_setEncryptionMode( tr_handle * handle, tr_encryption_mode mode );
|
2006-12-17 16:36:27 +00:00
|
|
|
|
2006-08-20 18:15:25 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_setMessageLevel
|
|
|
|
***********************************************************************
|
2006-08-22 02:12:58 +00:00
|
|
|
* Set the level of messages to be output or queued
|
2006-08-20 18:15:25 +00:00
|
|
|
**********************************************************************/
|
|
|
|
#define TR_MSG_ERR 1
|
|
|
|
#define TR_MSG_INF 2
|
2006-08-20 22:45:04 +00:00
|
|
|
#define TR_MSG_DBG 3
|
2006-08-20 18:15:25 +00:00
|
|
|
void tr_setMessageLevel( int );
|
|
|
|
int tr_getMessageLevel( void );
|
2006-07-16 23:40:22 +00:00
|
|
|
|
2006-08-22 02:12:58 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_setMessageQueuing
|
|
|
|
***********************************************************************
|
|
|
|
* Enable or disable message queuing
|
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
typedef struct tr_msg_list tr_msg_list;
|
2006-08-22 02:12:58 +00:00
|
|
|
void tr_setMessageQueuing( int );
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* tr_getQueuedMessages
|
|
|
|
***********************************************************************
|
|
|
|
* Return a list of queued messages
|
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
tr_msg_list * tr_getQueuedMessages( void );
|
|
|
|
void tr_freeMessageList( tr_msg_list * list );
|
2006-08-22 02:12:58 +00:00
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_getPrefsDirectory
|
|
|
|
***********************************************************************
|
|
|
|
* Returns the full path to a directory which can be used to store
|
|
|
|
* preferences. The string belongs to libtransmission, do not free it.
|
|
|
|
**********************************************************************/
|
2007-06-18 19:39:52 +00:00
|
|
|
const char * tr_getPrefsDirectory( void );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* tr_setBindPort
|
|
|
|
***********************************************************************
|
2006-09-25 18:37:45 +00:00
|
|
|
* Sets the port to listen for incoming peer connections.
|
|
|
|
* This can be safely called even with active torrents.
|
2006-07-16 19:39:23 +00:00
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_setBindPort( tr_handle *, int );
|
|
|
|
|
|
|
|
int tr_getPublicPort( const tr_handle * );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2006-09-25 18:37:45 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_natTraversalEnable
|
|
|
|
* tr_natTraversalDisable
|
|
|
|
***********************************************************************
|
|
|
|
* Enable or disable NAT traversal using NAT-PMP or UPnP IGD.
|
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_natTraversalEnable( tr_handle *, int enable );
|
2006-09-25 18:37:45 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
2007-02-06 04:26:40 +00:00
|
|
|
* tr_handleStatus
|
2006-09-25 18:37:45 +00:00
|
|
|
***********************************************************************
|
2007-02-06 04:26:40 +00:00
|
|
|
* Returns some status info for the given handle.
|
2006-09-25 18:37:45 +00:00
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
typedef struct tr_handle_status tr_handle_status;
|
|
|
|
tr_handle_status * tr_handleStatus( tr_handle * );
|
2006-09-25 18:37:45 +00:00
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* tr_torrentCount
|
|
|
|
***********************************************************************
|
|
|
|
* Returns the count of open torrents
|
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
int tr_torrentCount( tr_handle * h );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_torrentIterate
|
|
|
|
***********************************************************************
|
|
|
|
* Iterates on open torrents
|
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
typedef struct tr_torrent tr_torrent;
|
|
|
|
typedef void (*tr_callback_t) ( tr_torrent *, void * );
|
|
|
|
void tr_torrentIterate( tr_handle *, tr_callback_t, void * );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-07-20 03:24:04 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
*** Speed Limits
|
2007-07-18 05:27:45 +00:00
|
|
|
**/
|
|
|
|
|
2007-07-20 08:33:59 +00:00
|
|
|
enum { TR_UP, TR_DOWN };
|
|
|
|
|
2007-07-20 03:24:04 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2007-08-03 15:55:32 +00:00
|
|
|
TR_SPEEDLIMIT_GLOBAL, /* only follow the overall speed limit */
|
|
|
|
TR_SPEEDLIMIT_SINGLE, /* only follow the per-torrent limit */
|
2007-07-20 03:24:04 +00:00
|
|
|
TR_SPEEDLIMIT_UNLIMITED /* no limits at all */
|
|
|
|
}
|
2007-09-20 16:32:01 +00:00
|
|
|
tr_speedlimit;
|
2007-07-20 03:24:04 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_torrentSetSpeedMode( tr_torrent * tor,
|
|
|
|
int up_or_down,
|
|
|
|
tr_speedlimit mode );
|
2007-07-20 03:24:04 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
tr_speedlimit tr_torrentGetSpeedMode( const tr_torrent * tor,
|
|
|
|
int up_or_down);
|
2007-07-20 03:24:04 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_torrentSetSpeedLimit( tr_torrent * tor,
|
|
|
|
int up_or_down,
|
|
|
|
int single_KiB_sec );
|
2007-07-18 05:27:45 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
int tr_torrentGetSpeedLimit( const tr_torrent * tor,
|
|
|
|
int up_or_down );
|
2007-01-08 21:53:55 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_setUseGlobalSpeedLimit( tr_handle * handle,
|
2007-07-20 08:33:59 +00:00
|
|
|
int up_or_down,
|
|
|
|
int use_flag );
|
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_setGlobalSpeedLimit( tr_handle * handle,
|
2007-07-20 08:33:59 +00:00
|
|
|
int up_or_down,
|
|
|
|
int global_KiB_sec );
|
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_getGlobalSpeedLimit( tr_handle * handle,
|
2007-07-20 08:33:59 +00:00
|
|
|
int up_or_down,
|
|
|
|
int * setme_is_enabled,
|
|
|
|
int * setme_KiBsec );
|
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* Torrent Priorities
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
TR_PRI_LOW = -1,
|
|
|
|
TR_PRI_NORMAL = 0, /* since NORMAL is 0, memset initializes nicely */
|
|
|
|
TR_PRI_HIGH = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef int8_t tr_priority_t;
|
|
|
|
|
2007-10-19 23:44:01 +00:00
|
|
|
/* set a batch of files to a particular priority.
|
|
|
|
* priority must be one of TR_PRI_NORMAL, _HIGH, or _LOW */
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_torrentSetFilePriorities( tr_torrent * tor,
|
|
|
|
int * files,
|
|
|
|
int fileCount,
|
|
|
|
tr_priority_t priority );
|
2007-07-13 00:27:47 +00:00
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
/* returns a malloc()ed array of tor->info.fileCount items,
|
2007-07-10 03:12:46 +00:00
|
|
|
* each holding a value of TR_PRI_NORMAL, _HIGH, or _LOW.
|
2007-06-18 03:40:41 +00:00
|
|
|
free the array when done. */
|
2007-09-20 16:32:01 +00:00
|
|
|
tr_priority_t* tr_torrentGetFilePriorities( const tr_torrent * );
|
2007-06-18 03:40:41 +00:00
|
|
|
|
|
|
|
/* single-file form of tr_torrentGetFilePriorities.
|
2007-07-10 03:12:46 +00:00
|
|
|
* returns one of TR_PRI_NORMAL, _HIGH, or _LOW. */
|
2007-09-20 16:32:01 +00:00
|
|
|
tr_priority_t tr_torrentGetFilePriority( const tr_torrent *, int file );
|
2007-06-18 03:40:41 +00:00
|
|
|
|
2007-07-10 03:12:46 +00:00
|
|
|
/* returns true if the file's `download' flag is set */
|
2007-09-20 16:32:01 +00:00
|
|
|
int tr_torrentGetFileDL( const tr_torrent *, int file );
|
2007-07-10 03:12:46 +00:00
|
|
|
|
2007-07-13 01:17:21 +00:00
|
|
|
/* set a batch of files to be downloaded or not. */
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_torrentSetFileDLs ( tr_torrent * tor,
|
2007-10-19 23:23:21 +00:00
|
|
|
int * files,
|
|
|
|
int fileCount,
|
|
|
|
int do_download );
|
2007-07-10 03:12:46 +00:00
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_torrentRates
|
|
|
|
***********************************************************************
|
|
|
|
* Gets the total download and upload rates
|
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_torrentRates( tr_handle *, float *, float * );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* tr_close
|
|
|
|
***********************************************************************
|
|
|
|
* Frees memory allocated by tr_init.
|
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_close( tr_handle * );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-07-21 18:46:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Load all the torrents in tr_getTorrentsDirectory().
|
|
|
|
* This can be used at startup to kickstart all the torrents
|
|
|
|
* from the previous session.
|
|
|
|
*/
|
2007-09-20 16:32:01 +00:00
|
|
|
tr_torrent ** tr_loadTorrents ( tr_handle * h,
|
2007-10-26 03:02:23 +00:00
|
|
|
const char * fallback_destination,
|
2007-10-15 20:58:39 +00:00
|
|
|
int isPaused,
|
2007-09-20 16:32:01 +00:00
|
|
|
int * setmeCount );
|
2007-07-21 18:46:54 +00:00
|
|
|
|
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_torrentInit
|
|
|
|
***********************************************************************
|
2007-03-22 18:07:22 +00:00
|
|
|
* Opens and parses torrent file at 'path'. If the file exists and is
|
|
|
|
* a valid torrent file, returns an handle and adds it to the list of
|
2006-07-16 19:39:23 +00:00
|
|
|
* torrents (but doesn't start it). Returns NULL and sets *error
|
2007-03-22 18:07:22 +00:00
|
|
|
* otherwise. If hash is not NULL and the torrent is already loaded
|
|
|
|
* then it's 20-byte hash will be copied in. If the TR_FLAG_SAVE flag
|
|
|
|
* is passed then a copy of the torrent file will be saved.
|
2006-07-16 19:39:23 +00:00
|
|
|
**********************************************************************/
|
|
|
|
#define TR_EINVALID 1
|
|
|
|
#define TR_EUNSUPPORTED 2
|
|
|
|
#define TR_EDUPLICATE 3
|
|
|
|
#define TR_EOTHER 666
|
2007-10-15 20:58:39 +00:00
|
|
|
tr_torrent * tr_torrentInit( tr_handle * handle,
|
2007-09-20 16:32:01 +00:00
|
|
|
const char * metainfo_filename,
|
|
|
|
const char * destination,
|
2007-10-15 20:58:39 +00:00
|
|
|
int isPaused,
|
2007-09-20 16:32:01 +00:00
|
|
|
int * setme_error );
|
2007-06-27 14:54:31 +00:00
|
|
|
|
2007-10-26 03:02:23 +00:00
|
|
|
/* This is a stupid hack to fix #415. Probably I should fold all
|
|
|
|
* these torrent constructors into a single function that takes
|
|
|
|
* a function object to hold all these esoteric arguments. */
|
|
|
|
tr_torrent * tr_torrentLoad( tr_handle * handle,
|
|
|
|
const char * metainfo_filename,
|
|
|
|
const char * fallback_destination,
|
|
|
|
int isPaused,
|
|
|
|
int * setme_error );
|
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
typedef struct tr_info tr_info;
|
2007-06-27 05:14:38 +00:00
|
|
|
|
|
|
|
/**
|
2007-06-27 14:54:31 +00:00
|
|
|
* Parses the specified metainfo file.
|
|
|
|
*
|
2007-06-27 23:22:09 +00:00
|
|
|
* Returns TR_OK if it parsed and can be added to Transmission.
|
|
|
|
* Returns TR_INVALID if it couldn't be parsed.
|
|
|
|
* Returns TR_EDUPLICATE if it parsed but can't be added.
|
2007-06-27 14:54:31 +00:00
|
|
|
*
|
2007-06-27 23:22:09 +00:00
|
|
|
* "destination" can be NULL if you don't need to know whether
|
|
|
|
* or not the torrent can be added.
|
2007-06-27 14:54:31 +00:00
|
|
|
*
|
2007-06-27 23:22:09 +00:00
|
|
|
" "setme_info" can be NULL if you don't need the information.
|
|
|
|
* If the metainfo can be parsed and setme_info is non-NULL,
|
2007-06-28 01:20:10 +00:00
|
|
|
* it will be filled with the metadata's info. You'll need to
|
|
|
|
* call tr_metainfoFree( setme_info ) when done with it.
|
2007-06-27 05:14:38 +00:00
|
|
|
*/
|
2007-09-20 16:32:01 +00:00
|
|
|
int tr_torrentParse( const tr_handle * handle,
|
|
|
|
const char * metainfo_filename,
|
|
|
|
const char * destination,
|
|
|
|
tr_info * setme_info );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-06-28 23:35:02 +00:00
|
|
|
/**
|
|
|
|
* Parses the cached metainfo file that matches the given hash string.
|
|
|
|
* See tr_torrentParse() for a description of the arguments
|
|
|
|
*/
|
|
|
|
int
|
2007-09-20 16:32:01 +00:00
|
|
|
tr_torrentParseHash( const tr_handle * h,
|
|
|
|
const char * hashStr,
|
|
|
|
const char * destination,
|
|
|
|
tr_info * setme_info );
|
2007-06-28 23:35:02 +00:00
|
|
|
|
|
|
|
|
2007-04-02 20:38:23 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_torrentInitData
|
|
|
|
***********************************************************************
|
|
|
|
* Like tr_torrentInit, except the actual torrent data is passed in
|
|
|
|
* instead of the filename.
|
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
tr_torrent * tr_torrentInitData( tr_handle *,
|
|
|
|
const uint8_t * data, size_t size,
|
|
|
|
const char * destination,
|
2007-10-15 20:58:39 +00:00
|
|
|
int isPaused,
|
|
|
|
int * error );
|
2007-04-02 20:38:23 +00:00
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_torrentInitSaved
|
|
|
|
***********************************************************************
|
|
|
|
* Opens and parses a torrent file as with tr_torrentInit, only taking
|
2007-03-22 18:07:22 +00:00
|
|
|
* the hash string of a saved torrent file instead of a filename. There
|
2006-07-16 19:39:23 +00:00
|
|
|
* are currently no valid flags for this function.
|
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
tr_torrent * tr_torrentInitSaved( tr_handle *,
|
|
|
|
const char * hashStr,
|
|
|
|
const char * destination,
|
2007-10-15 20:58:39 +00:00
|
|
|
int isPaused,
|
|
|
|
int * error );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-03-31 19:19:09 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_torrentDisablePex
|
|
|
|
***********************************************************************
|
|
|
|
* Disable or enable peer exchange for this torrent. Peer exchange is
|
|
|
|
* enabled by default, except for private torrents where pex is
|
|
|
|
* disabled and cannot be enabled.
|
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_torrentDisablePex( tr_torrent *, int disable );
|
2007-10-14 22:01:55 +00:00
|
|
|
int tr_torrentIsPexEnabled( const tr_torrent * );
|
2007-03-31 19:19:09 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
const tr_info * tr_torrentInfo( const tr_torrent * );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_torrentSetFolder( tr_torrent *, const char * );
|
|
|
|
const char * tr_torrentGetFolder( const tr_torrent * );
|
2007-05-11 18:56:59 +00:00
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_torrentStart
|
|
|
|
***********************************************************************
|
|
|
|
* Starts downloading. The download is launched in a seperate thread,
|
|
|
|
* therefore tr_torrentStart returns immediately.
|
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_torrentStart( tr_torrent * );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* tr_torrentStop
|
|
|
|
***********************************************************************
|
|
|
|
* Stops downloading and notices the tracker that we are leaving. The
|
|
|
|
* thread keeps running while doing so.
|
|
|
|
* The thread will eventually be joined, either:
|
|
|
|
* - by tr_torrentStat when the tracker has been successfully noticed,
|
|
|
|
* - by tr_torrentStat if the tracker could not be noticed within 60s,
|
|
|
|
* - by tr_torrentClose if you choose to remove the torrent without
|
|
|
|
* waiting any further.
|
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_torrentStop( tr_torrent * );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-06-18 03:40:41 +00:00
|
|
|
|
2007-09-28 14:51:34 +00:00
|
|
|
/**
|
|
|
|
*** Register to be notified whenever a torrent's state changes.
|
|
|
|
**/
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
TR_CP_INCOMPLETE, /* doesn't have all the desired pieces */
|
|
|
|
TR_CP_DONE, /* has all the pieces but the DND ones */
|
|
|
|
TR_CP_COMPLETE /* has every piece */
|
|
|
|
}
|
|
|
|
cp_status_t;
|
|
|
|
|
|
|
|
typedef void (tr_torrent_status_func)(tr_torrent * torrent,
|
|
|
|
cp_status_t status,
|
|
|
|
void * user_data );
|
|
|
|
|
|
|
|
void tr_torrentSetStatusCallback( tr_torrent * torrent,
|
|
|
|
tr_torrent_status_func func,
|
|
|
|
void * user_data );
|
|
|
|
|
|
|
|
void tr_torrentClearStatusCallback( tr_torrent * torrent );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-07-30 17:11:00 +00:00
|
|
|
/**
|
|
|
|
* MANUAL ANNOUNCE
|
|
|
|
*
|
|
|
|
* Trackers usually set an announce interval of 15 or 30 minutes.
|
|
|
|
* Users can send one-time announce requests that override this
|
|
|
|
* interval by calling tr_manualUpdate().
|
|
|
|
*
|
|
|
|
* The wait interval for tr_manualUpdate() is much smaller.
|
|
|
|
* You can test whether or not a manual update is possible
|
|
|
|
* (for example, to desensitize the button) by calling
|
|
|
|
* tr_torrentCanManualUpdate().
|
|
|
|
*/
|
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_manualUpdate( tr_torrent * );
|
2006-12-26 18:40:51 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
int tr_torrentCanManualUpdate( const tr_torrent * );
|
2007-07-30 17:11:00 +00:00
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_torrentStat
|
|
|
|
***********************************************************************
|
2007-09-20 16:32:01 +00:00
|
|
|
* Returns a pointer to an tr_stat structure with updated information
|
2006-07-16 19:39:23 +00:00
|
|
|
* on the torrent. The structure belongs to libtransmission (do not
|
|
|
|
* free it) and is guaranteed to be unchanged until the next call to
|
|
|
|
* tr_torrentStat.
|
|
|
|
* The interface should call this function every second or so in order
|
|
|
|
* to update itself.
|
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
typedef struct tr_stat tr_stat;
|
|
|
|
const tr_stat * tr_torrentStat( tr_torrent * );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2006-08-13 21:16:18 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_torrentPeers
|
|
|
|
***********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
typedef struct tr_peer_stat tr_peer_stat;
|
|
|
|
tr_peer_stat * tr_torrentPeers( const tr_torrent *, int * peerCount );
|
|
|
|
void tr_torrentPeersFree( tr_peer_stat *, int peerCount );
|
2006-08-13 21:16:18 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
typedef struct tr_file_stat tr_file_stat;
|
|
|
|
tr_file_stat * tr_torrentFiles( const tr_torrent *, int * fileCount );
|
|
|
|
void tr_torrentFilesFree( tr_file_stat *, int fileCount );
|
2007-07-15 20:05:32 +00:00
|
|
|
|
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_torrentAvailability
|
|
|
|
***********************************************************************
|
|
|
|
* Use this to draw an advanced progress bar which is 'size' pixels
|
|
|
|
* wide. Fills 'tab' which you must have allocated: each byte is set
|
|
|
|
* to either -1 if we have the piece, otherwise it is set to the number
|
|
|
|
* of connected peers who have the piece.
|
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_torrentAvailability( const tr_torrent *, int8_t * tab, int size );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_torrentAmountFinished( const tr_torrent * tor, float * tab, int size );
|
2006-10-12 23:34:20 +00:00
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_torrentRemoveSaved
|
|
|
|
***********************************************************************
|
2007-01-27 22:37:10 +00:00
|
|
|
* Removes the saved copy of a torrent file for torrents which the
|
|
|
|
* TR_FLAG_SAVE flag is set.
|
2006-07-16 19:39:23 +00:00
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_torrentRemoveSaved( tr_torrent * );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_torrentRecheck( tr_torrent * );
|
2007-04-28 01:34:39 +00:00
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* tr_torrentClose
|
|
|
|
***********************************************************************
|
|
|
|
* Frees memory allocated by tr_torrentInit. If the torrent was running,
|
2007-06-26 18:45:03 +00:00
|
|
|
* it is stopped first.
|
2006-07-16 19:39:23 +00:00
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
void tr_torrentClose( tr_torrent * );
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
2007-09-20 16:32:01 +00:00
|
|
|
* tr_info
|
2006-07-16 19:39:23 +00:00
|
|
|
**********************************************************************/
|
2007-06-18 03:40:41 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
typedef struct tr_file
|
2006-07-16 19:39:23 +00:00
|
|
|
{
|
|
|
|
uint64_t length; /* Length of the file, in bytes */
|
|
|
|
char name[MAX_PATH_LENGTH]; /* Path to the file */
|
2007-07-10 03:12:46 +00:00
|
|
|
int8_t priority; /* TR_PRI_HIGH, _NORMAL, or _LOW */
|
|
|
|
int8_t dnd; /* nonzero if the file shouldn't be downloaded */
|
2007-06-18 03:40:41 +00:00
|
|
|
int firstPiece; /* We need pieces [firstPiece... */
|
|
|
|
int lastPiece; /* ...lastPiece] to dl this file */
|
|
|
|
uint64_t offset; /* file begins at the torrent's nth byte */
|
2006-07-16 19:39:23 +00:00
|
|
|
}
|
2007-09-20 16:32:01 +00:00
|
|
|
tr_file;
|
2007-06-18 03:40:41 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
typedef struct tr_piece
|
2007-06-18 03:40:41 +00:00
|
|
|
{
|
|
|
|
uint8_t hash[SHA_DIGEST_LENGTH]; /* pieces hash */
|
2007-07-10 03:12:46 +00:00
|
|
|
int8_t priority; /* TR_PRI_HIGH, _NORMAL, or _LOW */
|
2007-07-25 01:59:46 +00:00
|
|
|
int8_t dnd; /* nonzero if the piece shouldn't be downloaded */
|
2007-06-18 03:40:41 +00:00
|
|
|
}
|
2007-09-20 16:32:01 +00:00
|
|
|
tr_piece;
|
2007-06-18 03:40:41 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
struct tr_info
|
2006-07-16 19:39:23 +00:00
|
|
|
{
|
|
|
|
/* Path to torrent */
|
2006-12-17 16:36:27 +00:00
|
|
|
char torrent[MAX_PATH_LENGTH];
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
/* General info */
|
2006-12-17 16:36:27 +00:00
|
|
|
uint8_t hash[SHA_DIGEST_LENGTH];
|
|
|
|
char hashString[2*SHA_DIGEST_LENGTH+1];
|
|
|
|
char name[MAX_PATH_LENGTH];
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
/* Flags */
|
2007-10-15 20:58:39 +00:00
|
|
|
unsigned int isPrivate : 1;
|
|
|
|
unsigned int isMultifile : 1;
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
/* Tracker info */
|
2006-12-17 16:36:27 +00:00
|
|
|
struct
|
|
|
|
{
|
2007-09-20 16:32:01 +00:00
|
|
|
tr_tracker_info * list;
|
2006-12-17 16:36:27 +00:00
|
|
|
int count;
|
|
|
|
} * trackerList;
|
|
|
|
int trackerTiers;
|
2007-08-16 20:00:06 +00:00
|
|
|
char * primaryAddress;
|
2006-12-17 16:36:27 +00:00
|
|
|
|
2006-11-23 01:38:18 +00:00
|
|
|
/* Torrent info */
|
2006-12-17 16:36:27 +00:00
|
|
|
char comment[MAX_PATH_LENGTH];
|
|
|
|
char creator[MAX_PATH_LENGTH];
|
|
|
|
int dateCreated;
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
/* Pieces info */
|
2006-12-17 16:36:27 +00:00
|
|
|
int pieceSize;
|
|
|
|
int pieceCount;
|
|
|
|
uint64_t totalSize;
|
2007-09-20 16:32:01 +00:00
|
|
|
tr_piece * pieces;
|
2006-07-16 19:39:23 +00:00
|
|
|
|
|
|
|
/* Files info */
|
2006-12-17 16:36:27 +00:00
|
|
|
int fileCount;
|
2007-09-20 16:32:01 +00:00
|
|
|
tr_file * files;
|
2006-07-16 19:39:23 +00:00
|
|
|
};
|
|
|
|
|
2007-06-26 18:45:03 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
TR_STATUS_CHECK_WAIT = (1<<0), /* Waiting in queue to check files */
|
|
|
|
TR_STATUS_CHECK = (1<<1), /* Checking files */
|
|
|
|
TR_STATUS_DOWNLOAD = (1<<2), /* Downloading */
|
|
|
|
TR_STATUS_DONE = (1<<3), /* not at 100% so can't tell the tracker
|
|
|
|
we're a seeder, but due to DND files
|
|
|
|
there's nothing we want right now */
|
|
|
|
TR_STATUS_SEED = (1<<4), /* Seeding */
|
2007-10-20 21:17:37 +00:00
|
|
|
TR_STATUS_STOPPED = (1<<5) /* Torrent is stopped */
|
2007-06-26 18:45:03 +00:00
|
|
|
}
|
2007-10-20 21:07:11 +00:00
|
|
|
tr_torrent_status;
|
2007-06-26 18:45:03 +00:00
|
|
|
|
2007-10-20 22:07:21 +00:00
|
|
|
#define TR_STATUS_IS_ACTIVE(s) ((s) != TR_STATUS_STOPPED)
|
2007-06-26 18:45:03 +00:00
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
/***********************************************************************
|
2007-09-20 16:32:01 +00:00
|
|
|
* tr_stat
|
2006-07-16 19:39:23 +00:00
|
|
|
**********************************************************************/
|
2007-09-20 16:32:01 +00:00
|
|
|
struct tr_stat
|
2006-07-16 19:39:23 +00:00
|
|
|
{
|
2007-10-20 21:07:11 +00:00
|
|
|
tr_torrent_status status;
|
2006-07-16 19:39:23 +00:00
|
|
|
|
2006-08-13 19:43:15 +00:00
|
|
|
int error;
|
2007-01-14 12:00:21 +00:00
|
|
|
char errorString[128];
|
2007-02-27 04:00:38 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
const tr_tracker_info * tracker;
|
2006-08-13 19:43:15 +00:00
|
|
|
|
2007-07-24 01:33:59 +00:00
|
|
|
float recheckProgress;
|
2007-06-18 03:40:41 +00:00
|
|
|
float percentComplete;
|
|
|
|
float percentDone;
|
2006-08-13 19:43:15 +00:00
|
|
|
float rateDownload;
|
|
|
|
float rateUpload;
|
|
|
|
int eta;
|
2007-10-01 15:51:54 +00:00
|
|
|
int peersKnown;
|
2007-07-15 17:19:07 +00:00
|
|
|
int peersConnected;
|
2007-03-23 08:28:01 +00:00
|
|
|
int peersFrom[TR_PEER_FROM__MAX];
|
2007-07-16 00:50:43 +00:00
|
|
|
int peersSendingToUs;
|
|
|
|
int peersGettingFromUs;
|
2006-08-13 19:43:15 +00:00
|
|
|
int seeders;
|
|
|
|
int leechers;
|
2006-12-02 01:46:54 +00:00
|
|
|
int completedFromTracker;
|
2006-08-13 19:43:15 +00:00
|
|
|
|
2007-09-26 01:55:04 +00:00
|
|
|
/* Byte count of how much data is left to be downloaded until
|
|
|
|
* we're done -- that is, until we've got all the pieces we wanted. */
|
|
|
|
uint64_t leftUntilDone;
|
|
|
|
|
|
|
|
/* Byte count of all the corrupt data you've ever downloaded for
|
|
|
|
* this torrent. If you're on a poisoned torrent, this number can
|
|
|
|
* grow very large. */
|
|
|
|
uint64_t corruptEver;
|
|
|
|
|
|
|
|
/* Byte count of all data you've ever uploaded for this torrent. */
|
|
|
|
uint64_t uploadedEver;
|
|
|
|
|
|
|
|
/* Byte count of all the non-corrupt data you've ever downloaded
|
|
|
|
* for this torrent. If you deleted the files and downloaded a second time,
|
|
|
|
* this will be 2*totalSize.. */
|
|
|
|
uint64_t downloadedEver;
|
|
|
|
|
|
|
|
/* Byte count of all the checksum-verified data we have for this torrent. */
|
|
|
|
uint64_t haveValid;
|
|
|
|
|
|
|
|
/* Byte count of all the partial piece data we have for this torrent.
|
|
|
|
* As pieces become complete, this value may decrease as portions of it are
|
|
|
|
* moved to `corrupt' or `haveValid'. */
|
|
|
|
uint64_t haveUnchecked;
|
|
|
|
|
2007-09-27 03:03:38 +00:00
|
|
|
/* Byte count of all the non-DND piece data that either we already have,
|
2007-09-27 03:30:22 +00:00
|
|
|
* or that a peer we're connected to has. [0...desiredSize] */
|
|
|
|
uint64_t desiredAvailable;
|
2007-09-27 03:03:38 +00:00
|
|
|
|
2007-09-27 03:30:22 +00:00
|
|
|
/* Byte count of all the piece data we want, whether we currently
|
|
|
|
* have it nor not. [0...tr_info.totalSize] */
|
|
|
|
uint64_t desiredSize;
|
2007-09-27 03:03:38 +00:00
|
|
|
|
2006-08-16 19:21:09 +00:00
|
|
|
float swarmspeed;
|
2006-12-30 19:24:09 +00:00
|
|
|
|
|
|
|
#define TR_RATIO_NA -1
|
|
|
|
float ratio;
|
2007-05-25 19:14:42 +00:00
|
|
|
|
|
|
|
uint64_t startDate;
|
|
|
|
uint64_t activityDate;
|
2006-07-16 19:39:23 +00:00
|
|
|
};
|
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
struct tr_file_stat
|
2007-07-15 20:05:32 +00:00
|
|
|
{
|
|
|
|
uint64_t bytesCompleted;
|
|
|
|
float progress;
|
|
|
|
};
|
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
struct tr_peer_stat
|
2006-08-13 21:16:18 +00:00
|
|
|
{
|
2006-08-14 22:42:32 +00:00
|
|
|
char addr[INET_ADDRSTRLEN];
|
2007-04-03 18:22:58 +00:00
|
|
|
const char * client;
|
2006-08-13 21:16:18 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
unsigned int isEncrypted : 1;
|
|
|
|
unsigned int isDownloading : 1;
|
|
|
|
unsigned int isUploading : 1;
|
|
|
|
|
|
|
|
uint8_t from;
|
|
|
|
uint16_t port;
|
2006-12-18 05:04:35 +00:00
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
float progress;
|
|
|
|
float downloadFromRate;
|
|
|
|
float uploadToRate;
|
2006-08-13 21:16:18 +00:00
|
|
|
};
|
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
struct tr_msg_list
|
2006-08-22 02:12:58 +00:00
|
|
|
{
|
2007-09-25 22:37:23 +00:00
|
|
|
uint8_t level;
|
2007-09-20 16:32:01 +00:00
|
|
|
time_t when;
|
|
|
|
char * message;
|
|
|
|
struct tr_msg_list * next;
|
2006-08-22 02:12:58 +00:00
|
|
|
};
|
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
struct tr_tracker_info
|
2006-12-17 16:36:27 +00:00
|
|
|
{
|
|
|
|
char * address;
|
|
|
|
int port;
|
|
|
|
char * announce;
|
2007-02-27 04:00:38 +00:00
|
|
|
char * scrape;
|
2006-12-17 16:36:27 +00:00
|
|
|
};
|
|
|
|
|
2007-09-20 16:32:01 +00:00
|
|
|
struct tr_handle_status
|
2007-02-06 04:26:40 +00:00
|
|
|
{
|
|
|
|
#define TR_NAT_TRAVERSAL_MAPPING 1
|
|
|
|
#define TR_NAT_TRAVERSAL_MAPPED 2
|
|
|
|
#define TR_NAT_TRAVERSAL_NOTFOUND 3
|
|
|
|
#define TR_NAT_TRAVERSAL_ERROR 4
|
|
|
|
#define TR_NAT_TRAVERSAL_UNMAPPING 5
|
|
|
|
#define TR_NAT_TRAVERSAL_DISABLED 6
|
|
|
|
#define TR_NAT_TRAVERSAL_IS_DISABLED( st ) \
|
|
|
|
( TR_NAT_TRAVERSAL_DISABLED == (st) || TR_NAT_TRAVERSAL_UNMAPPING == (st) )
|
|
|
|
int natTraversalStatus;
|
|
|
|
int publicPort;
|
|
|
|
};
|
|
|
|
|
2006-07-16 19:39:23 +00:00
|
|
|
#ifdef __TRANSMISSION__
|
|
|
|
# include "internal.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|