(trunk) add #include guards to prevent non-libtransmission files from #including implementation headers

This commit is contained in:
Charles Kerr
2009-12-15 00:51:39 +00:00
parent e0d2b59931
commit ed6e95eef3
5 changed files with 29 additions and 9 deletions

View File

@@ -36,7 +36,6 @@
#include <libtransmission/transmission.h>
#include <libtransmission/bencode.h>
#include <libtransmission/platform.h>
#include "conf.h"
#include "tr-prefs.h"

View File

@@ -1,3 +1,7 @@
#ifndef __TRANSMISSION__
#error only libtransmission should #include this header.
#endif
#ifndef JSON_PARSER_H
#define JSON_PARSER_H

View File

@@ -10,10 +10,16 @@
* $Id$
*/
#ifndef __TRANSMISSION__
#error only libtransmission should #include this header.
#endif
#ifndef TR_CLIENTS_H
#define TR_CLIENTS_H
/**
* @ingroup utils
*/
void tr_clientForId( char * buf,
size_t buflen,
const void * peer_id );
void tr_clientForId( char * buf, size_t buflen, const void * peer_id );
#endif

View File

@@ -13,6 +13,10 @@
#ifndef TR_PLATFORM_H
#define TR_PLATFORM_H
#ifndef __TRANSMISSION__
#error only libtransmission should #include this header.
#endif
#if defined( WIN32 )
#define TR_PATH_DELIMITER '\\'
#define TR_PATH_DELIMITER_STR "\\"

View File

@@ -20,11 +20,18 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#define TR_DHT_STOPPED 0
#define TR_DHT_BROKEN 1
#define TR_DHT_POOR 2
#define TR_DHT_FIREWALLED 3
#define TR_DHT_GOOD 4
#ifndef __TRANSMISSION__
#error only libtransmission should #include this header.
#endif
enum
{
TR_DHT_STOPPED = 0,
TR_DHT_BROKEN = 1,
TR_DHT_POOR = 2,
TR_DHT_FIREWALLED = 3,
TR_DHT_GOOD = 4
};
int tr_dhtInit( tr_session *, const tr_address * );
void tr_dhtUninit( tr_session * );