summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-02-02 15:51:01 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-02-02 15:51:01 +0100
commit38cb3926727c0ad29f3950db43ba12248e867b89 (patch)
tree5062cb4f81766ab983971126974a914e3fb4f360 /runtime
parentacda58b561b92d21df685d03cc703b5792d9d72b (diff)
downloadrsyslog-38cb3926727c0ad29f3950db43ba12248e867b89.tar.gz
rsyslog-38cb3926727c0ad29f3950db43ba12248e867b89.tar.xz
rsyslog-38cb3926727c0ad29f3950db43ba12248e867b89.zip
replaced data type "bool" by "sbool" because this created some portability issues
Diffstat (limited to 'runtime')
-rw-r--r--runtime/msg.c22
-rw-r--r--runtime/msg.h10
-rw-r--r--runtime/parser.c6
-rw-r--r--runtime/parser.h4
-rw-r--r--runtime/queue.h10
-rw-r--r--runtime/rsyslog.h2
-rw-r--r--runtime/rule.h2
-rw-r--r--runtime/stream.c4
-rw-r--r--runtime/stream.h18
-rw-r--r--runtime/wti.c4
-rw-r--r--runtime/wti.h6
11 files changed, 44 insertions, 44 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index 755f78cb..e21603f0 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -279,7 +279,7 @@ static char *syslog_number_names[24] = { "0", "1", "2", "3", "4", "5", "6", "7",
"15", "16", "17", "18", "19", "20", "21", "22", "23" };
/* some forward declarations */
-static int getAPPNAMELen(msg_t *pM, bool bLockMutex);
+static int getAPPNAMELen(msg_t *pM, sbool bLockMutex);
static inline int getProtocolVersion(msg_t *pM)
@@ -1543,7 +1543,7 @@ finalize_it:
* This must be called WITHOUT the message lock being held.
* rgerhards, 2009-06-26
*/
-static inline void preparePROCID(msg_t *pM, bool bLockMutex)
+static inline void preparePROCID(msg_t *pM, sbool bLockMutex)
{
if(pM->pCSPROCID == NULL) {
if(bLockMutex == LOCK_MUTEX)
@@ -1560,7 +1560,7 @@ static inline void preparePROCID(msg_t *pM, bool bLockMutex)
#if 0
/* rgerhards, 2005-11-24
*/
-static inline int getPROCIDLen(msg_t *pM, bool bLockMutex)
+static inline int getPROCIDLen(msg_t *pM, sbool bLockMutex)
{
assert(pM != NULL);
preparePROCID(pM, bLockMutex);
@@ -1571,7 +1571,7 @@ static inline int getPROCIDLen(msg_t *pM, bool bLockMutex)
/* rgerhards, 2005-11-24
*/
-char *getPROCID(msg_t *pM, bool bLockMutex)
+char *getPROCID(msg_t *pM, sbool bLockMutex)
{
ISOBJ_TYPE_assert(pM, msg);
preparePROCID(pM, bLockMutex);
@@ -1650,7 +1650,7 @@ void MsgSetTAG(msg_t *pMsg, uchar* pszBuf, size_t lenBuf)
* if there is a TAG and, if not, if it can emulate it.
* rgerhards, 2005-11-24
*/
-static inline void tryEmulateTAG(msg_t *pM, bool bLockMutex)
+static inline void tryEmulateTAG(msg_t *pM, sbool bLockMutex)
{
size_t lenTAG;
uchar bufTAG[CONF_TAG_MAXSIZE];
@@ -1795,7 +1795,7 @@ static inline char *getStructuredData(msg_t *pM)
/* check if we have a ProgramName, and, if not, try to aquire/emulate it.
* rgerhards, 2009-06-26
*/
-static inline void prepareProgramName(msg_t *pM, bool bLockMutex)
+static inline void prepareProgramName(msg_t *pM, sbool bLockMutex)
{
if(pM->pCSProgName == NULL) {
if(bLockMutex == LOCK_MUTEX)
@@ -1814,7 +1814,7 @@ static inline void prepareProgramName(msg_t *pM, bool bLockMutex)
/* get the length of the "programname" sz string
* rgerhards, 2005-10-19
*/
-int getProgramNameLen(msg_t *pM, bool bLockMutex)
+int getProgramNameLen(msg_t *pM, sbool bLockMutex)
{
assert(pM != NULL);
prepareProgramName(pM, bLockMutex);
@@ -1825,7 +1825,7 @@ int getProgramNameLen(msg_t *pM, bool bLockMutex)
/* get the "programname" as sz string
* rgerhards, 2005-10-19
*/
-uchar *getProgramName(msg_t *pM, bool bLockMutex)
+uchar *getProgramName(msg_t *pM, sbool bLockMutex)
{
prepareProgramName(pM, bLockMutex);
return (pM->pCSProgName == NULL) ? UCHAR_CONSTANT("") : rsCStrGetSzStrNoNULL(pM->pCSProgName);
@@ -1855,7 +1855,7 @@ static void tryEmulateAPPNAME(msg_t *pM)
* This must be called WITHOUT the message lock being held.
* rgerhards, 2009-06-26
*/
-static inline void prepareAPPNAME(msg_t *pM, bool bLockMutex)
+static inline void prepareAPPNAME(msg_t *pM, sbool bLockMutex)
{
if(pM->pCSAPPNAME == NULL) {
if(bLockMutex == LOCK_MUTEX)
@@ -1872,7 +1872,7 @@ static inline void prepareAPPNAME(msg_t *pM, bool bLockMutex)
/* rgerhards, 2005-11-24
*/
-char *getAPPNAME(msg_t *pM, bool bLockMutex)
+char *getAPPNAME(msg_t *pM, sbool bLockMutex)
{
assert(pM != NULL);
prepareAPPNAME(pM, bLockMutex);
@@ -1881,7 +1881,7 @@ char *getAPPNAME(msg_t *pM, bool bLockMutex)
/* rgerhards, 2005-11-24
*/
-static int getAPPNAMELen(msg_t *pM, bool bLockMutex)
+static int getAPPNAMELen(msg_t *pM, sbool bLockMutex)
{
assert(pM != NULL);
prepareAPPNAME(pM, bLockMutex);
diff --git a/runtime/msg.h b/runtime/msg.h
index 366dce64..b4b6d9f8 100644
--- a/runtime/msg.h
+++ b/runtime/msg.h
@@ -59,7 +59,7 @@ struct msg {
flowControl_t flowCtlType; /**< type of flow control we can apply, for enqueueing, needs not to be persisted because
once data has entered the queue, this property is no longer needed. */
pthread_mutex_t mut;
- bool bDoLock; /* use the mutex? */
+ sbool bDoLock; /* use the mutex? */
short iRefCount; /* reference counter (0 = unused) */
short iSeverity; /* the severity 0..7 */
short iFacility; /* Facility code 0 .. 23*/
@@ -170,14 +170,14 @@ uchar *getRcvFrom(msg_t *pM);
/* TODO: remove these five (so far used in action.c) */
uchar *getMSG(msg_t *pM);
char *getHOSTNAME(msg_t *pM);
-char *getPROCID(msg_t *pM, bool bLockMutex);
-char *getAPPNAME(msg_t *pM, bool bLockMutex);
+char *getPROCID(msg_t *pM, sbool bLockMutex);
+char *getAPPNAME(msg_t *pM, sbool bLockMutex);
int getMSGLen(msg_t *pM);
char *getHOSTNAME(msg_t *pM);
int getHOSTNAMELen(msg_t *pM);
-uchar *getProgramName(msg_t *pM, bool bLockMutex);
-int getProgramNameLen(msg_t *pM, bool bLockMutex);
+uchar *getProgramName(msg_t *pM, sbool bLockMutex);
+int getProgramNameLen(msg_t *pM, sbool bLockMutex);
uchar *getRcvFrom(msg_t *pM);
rsRetVal propNameToID(cstr_t *pCSPropName, propid_t *pPropID);
uchar *propIDToName(propid_t propID);
diff --git a/runtime/parser.c b/runtime/parser.c
index cbeb01e2..ca31b35d 100644
--- a/runtime/parser.c
+++ b/runtime/parser.c
@@ -310,7 +310,7 @@ SanitizeMsg(msg_t *pMsg)
size_t iDst;
size_t iMaxLine;
size_t maxDest;
- bool bUpdatedLen = FALSE;
+ sbool bUpdatedLen = FALSE;
uchar szSanBuf[32*1024]; /* buffer used for sanitizing a string */
assert(pMsg != NULL);
@@ -464,8 +464,8 @@ ParseMsg(msg_t *pMsg)
rsRetVal localRet;
parserList_t *pParserList;
parser_t *pParser;
- bool bIsSanitized;
- bool bPRIisParsed;
+ sbool bIsSanitized;
+ sbool bPRIisParsed;
static int iErrMsgRateLimiter = 0;
DEFiRet;
diff --git a/runtime/parser.h b/runtime/parser.h
index c4f63021..bdd572cb 100644
--- a/runtime/parser.h
+++ b/runtime/parser.h
@@ -38,8 +38,8 @@ struct parser_s {
BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */
uchar *pName; /* name of this parser */
modInfo_t *pModule; /* pointer to parser's module */
- bool bDoSanitazion; /* do standard message sanitazion before calling parser? */
- bool bDoPRIParsing; /* do standard PRI parsing before calling parser? */
+ sbool bDoSanitazion; /* do standard message sanitazion before calling parser? */
+ sbool bDoPRIParsing; /* do standard PRI parsing before calling parser? */
};
/* interfaces */
diff --git a/runtime/queue.h b/runtime/queue.h
index 93573dae..38c0d491 100644
--- a/runtime/queue.h
+++ b/runtime/queue.h
@@ -60,9 +60,9 @@ struct queue_s {
queueType_t qType;
int nLogDeq; /* number of elements currently logically dequeued */
int bShutdownImmediate; /* should all workers cease processing messages? */
- bool bEnqOnly; /* does queue run in enqueue-only mode (1) or not (0)? */
- bool bSaveOnShutdown;/* persists everthing on shutdown (if DA!)? 1-yes, 0-no */
- bool bQueueStarted; /* has queueStart() been called on this queue? 1-yes, 0-no */
+ sbool bEnqOnly; /* does queue run in enqueue-only mode (1) or not (0)? */
+ sbool bSaveOnShutdown;/* persists everthing on shutdown (if DA!)? 1-yes, 0-no */
+ sbool bQueueStarted; /* has queueStart() been called on this queue? 1-yes, 0-no */
int iQueueSize; /* Current number of elements in the queue */
int iMaxQueueSize; /* how large can the queue grow? */
int iNumWorkerThreads;/* number of worker threads to use */
@@ -73,14 +73,14 @@ struct queue_s {
void *pUsr; /* a global, user-supplied pointer. Is passed back to consumer. */
int iUpdsSincePersist;/* nbr of queue updates since the last persist call */
int iPersistUpdCnt; /* persits queue info after this nbr of updates - 0 -> persist only on shutdown */
- bool bSyncQueueFiles;/* if working with files, sync them after each write? */
+ sbool bSyncQueueFiles;/* if working with files, sync them after each write? */
int iHighWtrMrk; /* high water mark for disk-assisted memory queues */
int iLowWtrMrk; /* low water mark for disk-assisted memory queues */
int iDiscardMrk; /* if the queue is above this mark, low-severity messages are discarded */
int iFullDlyMrk; /* if the queue is above this mark, FULL_DELAYable message are put on hold */
int iLightDlyMrk; /* if the queue is above this mark, LIGHT_DELAYable message are put on hold */
int iDiscardSeverity;/* messages of this severity above are discarded on too-full queue */
- bool bNeedDelQIF; /* does the QIF file need to be deleted when queue becomes empty? */
+ sbool bNeedDelQIF; /* does the QIF file need to be deleted when queue becomes empty? */
int toQShutdown; /* timeout for regular queue shutdown in ms */
int toActShutdown; /* timeout for long-running action shutdown in ms */
int toWrkShutdown; /* timeout for idle workers in ms, -1 means indefinite (0 is immediate) */
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index 1431c684..57c37417 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -153,7 +153,7 @@ typedef int socklen_t;
typedef struct epoll_event epoll_event_t;
-typedef char bool; /* I intentionally use char, to keep it slim so that many fit into the CPU cache! */
+typedef char sbool; /* (small bool) I intentionally use char, to keep it slim so that many fit into the CPU cache! */
/* settings for flow control
* TODO: is there a better place for them? -- rgerhards, 2008-03-14
diff --git a/runtime/rule.h b/runtime/rule.h
index 99ac44e7..7b607637 100644
--- a/runtime/rule.h
+++ b/runtime/rule.h
@@ -47,7 +47,7 @@ struct rule_s {
fiop_t operation;
regex_t *regex_cache; /* cache for compiled REs, if such are used */
cstr_t *pCSCompValue; /* value to "compare" against */
- bool isNegated;
+ sbool isNegated;
propid_t propID; /* ID of the requested property */
} prop;
expr_t *f_expr; /* expression object */
diff --git a/runtime/stream.c b/runtime/stream.c
index 81f8e89b..f565dc90 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -902,7 +902,7 @@ asyncWriterThread(void *pPtr)
{
int iDeq;
struct timespec t;
- bool bTimedOut = 0;
+ sbool bTimedOut = 0;
strm_t *pThis = (strm_t*) pPtr;
ISOBJ_TYPE_assert(pThis, strm);
@@ -1068,7 +1068,7 @@ doZipWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf)
{
z_stream zstrm;
int zRet; /* zlib return state */
- bool bzInitDone = FALSE;
+ sbool bzInitDone = FALSE;
DEFiRet;
assert(pThis != NULL);
assert(pBuf != NULL);
diff --git a/runtime/stream.h b/runtime/stream.h
index 1dc92807..5e3324c5 100644
--- a/runtime/stream.h
+++ b/runtime/stream.h
@@ -102,12 +102,12 @@ typedef struct strm_s {
int64 iMaxFileSize;/* maximum size a file may grow to */
int iMaxFiles; /* maximum number of files if a circular mode is in use */
int iFileNumDigits;/* min number of digits to use in file number (only in circular mode) */
- bool bDeleteOnClose; /* set to 1 to auto-delete on close -- be careful with that setting! */
+ sbool bDeleteOnClose; /* set to 1 to auto-delete on close -- be careful with that setting! */
int64 iCurrOffs;/* current offset */
int64 *pUsrWCntr; /* NULL or a user-provided counter that receives the nbr of bytes written since the last CntrSet() */
/* dynamic properties, valid only during file open, not to be persistet */
- bool bDisabled; /* should file no longer be written to? (currently set only if omfile file size limit fails) */
- bool bSync; /* sync this file after every write? */
+ sbool bDisabled; /* should file no longer be written to? (currently set only if omfile file size limit fails) */
+ sbool bSync; /* sync this file after every write? */
size_t sIOBufSize;/* size of IO buffer */
uchar *pszDir; /* Directory */
int lenDir;
@@ -118,14 +118,14 @@ typedef struct strm_s {
size_t iBufPtrMax; /* current max Ptr in Buffer (if partial read!) */
size_t iBufPtr; /* pointer into current buffer */
int iUngetC; /* char set via UngetChar() call or -1 if none set */
- bool bInRecord; /* if 1, indicates that we are currently writing a not-yet complete record */
- bool bInClose; /* used to break "deadly close loops", tells us we are already inside a close */
+ sbool bInRecord; /* if 1, indicates that we are currently writing a not-yet complete record */
+ sbool bInClose; /* used to break "deadly close loops", tells us we are already inside a close */
int iZipLevel; /* zip level (0..9). If 0, zip is completely disabled */
Bytef *pZipBuf;
/* support for async flush procesing */
- bool bAsyncWrite; /* do asynchronous writes (always if a flush interval is given) */
- bool bStopWriter; /* shall writer thread terminate? */
- bool bDoTimedWait; /* instruct writer thread to do a times wait to support flush timeouts */
+ sbool bAsyncWrite; /* do asynchronous writes (always if a flush interval is given) */
+ sbool bStopWriter; /* shall writer thread terminate? */
+ sbool bDoTimedWait; /* instruct writer thread to do a times wait to support flush timeouts */
int iFlushInterval; /* flush in which interval - 0, no flushing */
apc_id_t apcID; /* id of current Apc request (used for cancelling) */
pthread_mutex_t mut;/* mutex for flush in async mode */
@@ -144,7 +144,7 @@ typedef struct strm_s {
/* support for omfile size-limiting commands, special counters, NOT persisted! */
off_t iSizeLimit; /* file size limit, 0 = no limit */
uchar *pszSizeLimitCmd; /* command to carry out when size limit is reached */
- bool bIsTTY; /* is this a tty file? */
+ sbool bIsTTY; /* is this a tty file? */
} strm_t;
diff --git a/runtime/wti.c b/runtime/wti.c
index 288670b6..14964fb0 100644
--- a/runtime/wti.c
+++ b/runtime/wti.c
@@ -79,7 +79,7 @@ wtiGetDbgHdr(wti_t *pThis)
/* return the current worker processing state. For the sake of
* simplicity, we do not use the iRet interface. -- rgerhards, 2009-07-17
*/
-bool
+sbool
wtiGetState(wti_t *pThis)
{
return ATOMIC_FETCH_32BIT(pThis->bIsRunning);
@@ -102,7 +102,7 @@ wtiSetAlwaysRunning(wti_t *pThis)
* is inside wti). -- rgerhards, 2009-07-17
*/
rsRetVal
-wtiSetState(wti_t *pThis, bool bNewVal)
+wtiSetState(wti_t *pThis, sbool bNewVal)
{
ISOBJ_TYPE_assert(pThis, wti);
if(bNewVal)
diff --git a/runtime/wti.h b/runtime/wti.h
index f466a053..e587c69e 100644
--- a/runtime/wti.h
+++ b/runtime/wti.h
@@ -35,7 +35,7 @@ struct wti_s {
BEGINobjInstance;
pthread_t thrdID; /* thread ID */
int bIsRunning; /* is this thread currently running? (must be int for atomic op!) */
- bool bAlwaysRunning; /* should this thread always run? */
+ sbool bAlwaysRunning; /* should this thread always run? */
wtp_t *pWtp; /* my worker thread pool (important if only the work thread instance is passed! */
batch_t batch; /* pointer to an object array meaningful for current user pointer (e.g. queue pUsr data elemt) */
uchar *pszDbgHdr; /* header string for debug messages */
@@ -50,8 +50,8 @@ rsRetVal wtiWorker(wti_t *pThis);
rsRetVal wtiSetDbgHdr(wti_t *pThis, uchar *pszMsg, size_t lenMsg);
rsRetVal wtiCancelThrd(wti_t *pThis);
rsRetVal wtiSetAlwaysRunning(wti_t *pThis);
-rsRetVal wtiSetState(wti_t *pThis, bool bNew);
-bool wtiGetState(wti_t *pThis);
+rsRetVal wtiSetState(wti_t *pThis, sbool bNew);
+sbool wtiGetState(wti_t *pThis);
PROTOTYPEObjClassInit(wti);
PROTOTYPEpropSetMeth(wti, pszDbgHdr, uchar*);
PROTOTYPEpropSetMeth(wti, pWtp, wtp_t*);