include(LargeFileSupport)
set(NEEDED_HEADERS
- stdbool.h
sys/statvfs.h
xfs/xfs.h
xlocale.h)
AC_HEADER_STDC
AC_HEADER_TIME
-AC_CHECK_HEADERS([stdbool.h xlocale.h])
+AC_CHECK_HEADERS([xlocale.h])
AC_CHECK_FUNCS([iconv pread pwrite lrintf strlcpy daemon dirname basename canonicalize_file_name strcasecmp localtime_r fallocate64 posix_fallocate memmem strsep strtold syslog valloc getpagesize posix_memalign statvfs htonll ntohll mkdtemp uselocale _configthreadlocale])
AC_PROG_INSTALL
AC_PROG_MAKE_SET
void tr_blocklistFileSetEnabled(tr_blocklistFile* b, bool isEnabled)
{
assert(b != NULL);
- assert(tr_isBool(isEnabled));
b->isEnabled = isEnabled;
}
void tr_logSetQueueEnabled(bool isEnabled)
{
- assert(tr_isBool(isEnabled));
-
myQueueEnabled = isEnabled;
}
{
tr_lock* lock;
- assert(tr_isBool(isPrivate));
-
/* free any variables from a previous run */
for (int i = 0; i < builder->trackerCount; ++i)
{
assert(session != NULL);
assert(session->events != NULL);
- assert(tr_isBool(isIncoming));
- assert(tr_isBool(isSeed));
assert(tr_amInEventThread(session));
assert((socket == TR_BAD_SOCKET) == (utp_socket != NULL));
#ifndef WITH_UTP
atom->blocklisted = tr_sessionIsAddressBlocked(session, &atom->addr);
}
- assert(tr_isBool(atom->blocklisted));
return atom->blocklisted;
}
tr_swarm* s;
assert(io != NULL);
- assert(tr_isBool(ok));
s = tr_peerIoHasTorrentHash(io) ? getExistingSwarm(manager, tr_peerIoGetTorrentHash(io)) : NULL;
struct evbuffer* out = msgs->outMessages;
assert(msgs != NULL);
- assert(tr_isBool(b));
msgs->client_is_interested = b;
dbgmsg(msgs, "Sending %s", b ? "Interested" : "Not Interested");
void tr_peerMsgsSetInterested(tr_peerMsgs* msgs, bool b)
{
- assert(tr_isBool(b));
-
if (msgs->client_is_interested != b)
{
sendInterest(msgs, b);
time_t const fibrillationTime = now - MIN_CHOKE_PERIOD_SEC;
assert(msgs != NULL);
- assert(tr_isBool(peer_is_choked));
if (msgs->chokeChangedAt > fibrillationTime)
{
void tr_rpcSetWhitelistEnabled(tr_rpc_server* server, bool isEnabled)
{
- assert(tr_isBool(isEnabled));
-
server->isWhitelistEnabled = isEnabled;
}
void tr_sessionSetIncompleteFileNamingEnabled(tr_session* session, bool b)
{
assert(tr_isSession(session));
- assert(tr_isBool(b));
session->isIncompleteFileNamingEnabled = b;
}
void tr_sessionSetIncompleteDirEnabled(tr_session* session, bool b)
{
assert(tr_isSession(session));
- assert(tr_isBool(b));
session->isIncompleteDirEnabled = b;
}
{
assert(tr_isSession(s));
assert(t != NULL);
- assert(tr_isBool(enabled));
- assert(tr_isBool(byUser));
if (t->isEnabled != enabled)
{
{
assert(tr_isSession(s));
assert(tr_isDirection(d));
- assert(tr_isBool(b));
s->speedLimitEnabled[d] = b;
struct tr_turtle_info* t = &s->turtle;
assert(tr_isSession(s));
- assert(tr_isBool(b));
if (t->isClockEnabled != b)
{
void tr_sessionSetPexEnabled(tr_session* session, bool enabled)
{
assert(tr_isSession(session));
- assert(tr_isBool(enabled));
session->isPexEnabled = enabled;
}
void tr_sessionSetDHTEnabled(tr_session* session, bool enabled)
{
assert(tr_isSession(session));
- assert(tr_isBool(enabled));
if (enabled != session->isDHTEnabled)
{
void tr_sessionSetUTPEnabled(tr_session* session, bool enabled)
{
assert(tr_isSession(session));
- assert(tr_isBool(enabled));
if (enabled != session->isUTPEnabled)
{
void tr_sessionSetLPDEnabled(tr_session* session, bool enabled)
{
assert(tr_isSession(session));
- assert(tr_isBool(enabled));
if (enabled != session->isLPDEnabled)
{
void tr_blocklistSetEnabled(tr_session* session, bool isEnabled)
{
assert(tr_isSession(session));
- assert(tr_isBool(isEnabled));
session->isBlocklistEnabled = isEnabled;
void tr_sessionSetTorrentDoneScriptEnabled(tr_session* session, bool isEnabled)
{
assert(tr_isSession(session));
- assert(tr_isBool(isEnabled));
session->isTorrentDoneScriptEnabled = isEnabled;
}
{
assert(tr_isSession(session));
assert(tr_isDirection(dir));
- assert(tr_isBool(is_enabled));
session->queueEnabled[dir] = is_enabled;
}
void tr_sessionSetQueueStalledEnabled(tr_session* session, bool is_enabled)
{
assert(tr_isSession(session));
- assert(tr_isBool(is_enabled));
session->stalledEnabled = is_enabled;
}
void tr_ctorSetDeleteSource(tr_ctor* ctor, bool deleteSource)
{
- assert(tr_isBool(deleteSource));
-
ctor->doDelete = deleteSource;
ctor->isSet_delete = true;
}
void tr_ctorSetSave(tr_ctor* ctor, bool saveInOurTorrentsDir)
{
- assert(tr_isBool(saveInOurTorrentsDir));
-
ctor->saveInOurTorrentsDir = saveInOurTorrentsDir;
}
assert(ctor != NULL);
assert(mode == TR_FALLBACK || mode == TR_FORCE);
- assert(tr_isBool(isPaused));
args = &ctor->optionalArgs[mode];
args->isSet_paused = true;
static void torrentSetQueued(tr_torrent* tor, bool queued)
{
assert(tr_isTorrent(tor));
- assert(tr_isBool(queued));
if (tr_torrentIsQueued(tor) != queued)
{
***/
#include <inttypes.h> /* uintN_t */
+#include <stdbool.h> /* bool */
#include <time.h> /* time_t */
-#if !defined(__cplusplus)
-#ifdef HAVE_STDBOOL_H
-#include <stdbool.h>
-#elif !defined(__bool_true_false_are_defined)
-#define bool uint8_t
-#define true 1
-#define false 0
-#endif
-#endif
-
#define SHA_DIGEST_LENGTH 20
#define TR_INET6_ADDRSTRLEN 46
return d == TR_UP || d == TR_DOWN;
}
-/** @brief Sanity checker to test that a bool is true or false */
-static inline bool tr_isBool(bool b)
-{
- return b == 1 || b == 0;
-}
-
#ifdef __cplusplus
}
#endif