]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Massive fxBool patch
authorRobert Colquhoun <rjc@trump.net.au>
Sun, 13 Jun 1999 07:40:57 +0000 (07:40 +0000)
committerRobert Colquhoun <rjc@trump.net.au>
Sun, 13 Jun 1999 07:40:57 +0000 (07:40 +0000)
12,000 line patch removes the fxBool class from the source tree.
Replaces with the C++ standard type 'bool'.  Also replaced the 'TRUE' &
'FALSE' defines with C++ standard true & false.

179 files changed:
config.h.in
faxalter/faxalter.c++
faxd/Class0.c++
faxd/Class0.h
faxd/Class1.c++
faxd/Class1.h
faxd/Class1Poll.c++
faxd/Class1Recv.c++
faxd/Class1Send.c++
faxd/Class2.c++
faxd/Class2.h
faxd/Class20.c++
faxd/Class20.h
faxd/Class2Ersatz.c++
faxd/Class2Ersatz.h
faxd/Class2Poll.c++
faxd/Class2Recv.c++
faxd/Class2Send.c++
faxd/ClassModem.c++
faxd/ClassModem.h
faxd/CopyQuality.c++
faxd/DestControl.c++
faxd/DestControl.h
faxd/DestInfo.c++
faxd/DestInfo.h
faxd/FaxAcctInfo.c++
faxd/FaxAcctInfo.h
faxd/FaxFont.c++
faxd/FaxFont.h
faxd/FaxMachineInfo.c++
faxd/FaxMachineInfo.h
faxd/FaxModem.c++
faxd/FaxModem.h
faxd/FaxPoll.c++
faxd/FaxRecv.c++
faxd/FaxRequest.c++
faxd/FaxRequest.h
faxd/FaxSend.c++
faxd/FaxServer.c++
faxd/FaxServer.h
faxd/G3Decoder.c++
faxd/G3Decoder.h
faxd/G3Encoder.c++
faxd/G3Encoder.h
faxd/Getty.c++
faxd/Getty.h
faxd/GettySysV.c++
faxd/GettySysV.h
faxd/HDLCFrame.c++
faxd/HDLCFrame.h
faxd/HylaClient.c++
faxd/HylaClient.h
faxd/Job.c++
faxd/Job.h
faxd/Modem.c++
faxd/Modem.h
faxd/ModemConfig.c++
faxd/ModemConfig.h
faxd/ModemServer.c++
faxd/ModemServer.h
faxd/PCFFont.c++
faxd/PCFFont.h
faxd/QLink.h
faxd/ServerConfig.c++
faxd/ServerConfig.h
faxd/TagLine.c++
faxd/Trigger.c++
faxd/Trigger.h
faxd/UUCPLock.c++
faxd/UUCPLock.h
faxd/choptest.c++
faxd/cqtest.c++
faxd/faxApp.c++
faxd/faxApp.h
faxd/faxGettyApp.c++
faxd/faxGettyApp.h
faxd/faxQCleanApp.c++
faxd/faxQueueApp.c++
faxd/faxQueueApp.h
faxd/faxRequest.c++
faxd/faxRequest.h
faxd/faxSendApp.c++
faxd/faxSendApp.h
faxd/pageSendApp.c++
faxd/pageSendApp.h
faxd/tagtest.c++
faxd/trigtest.c++
faxd/tsitest.c++
faxmail/MIMEState.c++
faxmail/MIMEState.h
faxmail/MsgFmt.c++
faxmail/MsgFmt.h
faxmail/faxmail.c++
faxrm/faxrm.c++
faxstat/faxstat.c++
hfaxd/FIFO.c++
hfaxd/FileCache.c++
hfaxd/FileCache.h
hfaxd/FileSystem.c++
hfaxd/FileTransfer.c++
hfaxd/HylaFAXServer.c++
hfaxd/HylaFAXServer.h
hfaxd/InetFaxServer.c++
hfaxd/InetFaxServer.h
hfaxd/Jobs.c++
hfaxd/Login.c++
hfaxd/OldProtocol.c++
hfaxd/OldProtocol.h
hfaxd/Parser.c++
hfaxd/RecvQueue.c++
hfaxd/SNPPServer.c++
hfaxd/SNPPServer.h
hfaxd/Status.c++
hfaxd/SuperServer.h
hfaxd/Trigger.c++
hfaxd/UnixFaxServer.c++
hfaxd/UnixFaxServer.h
hfaxd/User.c++
hfaxd/main.c++
sendfax/sendfax.c++
sendpage/sendpage.c++
util/Array.h
util/AtSyntax.c++
util/BoolArray.c++
util/BoolArray.h
util/Class2Params.c++
util/Class2Params.h
util/DialRules.c++
util/DialRules.h
util/Dictionary.c++
util/Dictionary.h
util/Dispatcher.c++
util/Dispatcher.h
util/FaxClient.c++
util/FaxClient.h
util/FaxConfig.c++
util/FaxConfig.h
util/FaxDB.c++
util/FaxDB.h
util/FaxRecvInfo.c++
util/FaxRecvInfo.h
util/FaxSendInfo.c++
util/FaxSendInfo.h
util/InetTransport.c++
util/InetTransport.h
util/ModemExt.h
util/PageSize.c++
util/PageSize.h
util/RegEx.c++
util/RegEx.h
util/SNPPClient.c++
util/SNPPClient.h
util/SNPPJob.c++
util/SNPPJob.h
util/SendFaxClient.c++
util/SendFaxClient.h
util/SendFaxJob.c++
util/SendFaxJob.h
util/Str.c++
util/Str.h
util/Sys.c++
util/Sys.h
util/TextFmt.c++
util/TextFmt.h
util/Timeout.c++
util/Timeout.h
util/Transport.c++
util/Transport.h
util/TypeRules.c++
util/TypeRules.h
util/Types.h
util/UnixTransport.c++
util/UnixTransport.h
util/dialtest.c++
util/faxfetch.c++
util/faxinfo.c++
util/faxwatch.c++
util/textfmt.c++
util/typetest.c++

index d2428b84fdaa9b76ebeb7afb459e51fdb4d41887..30a12a55054accdfe4a8ee5746da4eaa8cd5824b 100644 (file)
 #define        SNPP_DEFPORT    444             /* port to use if service is unknown */
 #define        SNPP_DEFHOST    "localhost"     /* default host for SNPP service */
 /* default values for SNPP job scheduling and handling */
-#define        SNPP_DEFQUEUE   FALSE           /* default is synchronous delivery */
+#define        SNPP_DEFQUEUE   false           /* default is synchronous delivery */
 #define        SNPP_DEFLEVEL   1               /* default service level */
 #define        SNPP_DEFRETRIES 3               /* number times to retry send */
 #define        SNPP_DEFREDIALS 12              /* number times to dial phone */
index b07d810ddb713783add34c93d344e70ae4c912e4..667478ab236f34813938b068def310e987195d8f 100644 (file)
@@ -32,7 +32,7 @@ parseAtSyntax(const char* s, const struct tm& ref, struct tm& at0, fxStr& emsg);
 
 class faxAlterApp : public FaxClient {
 private:
-    fxBool     groups;                 // group or job id's
+    bool       groups;                 // group or job id's
     fxStr      script;                 // commands to send for each job
 
     void addToScript(const char* fmt ...);
@@ -44,7 +44,7 @@ public:
 
     void run(int argc, char** argv);
 };
-faxAlterApp::faxAlterApp() { groups = FALSE; }
+faxAlterApp::faxAlterApp() { groups = false; }
 faxAlterApp::~faxAlterApp() {}
 
 void
@@ -90,7 +90,7 @@ faxAlterApp::run(int argc, char** argv)
                addToScript("SENDTIME NOW");
            break;
        case 'g':                       // apply to groups, not jobs
-           groups = TRUE;
+           groups = true;
            break;
        case 'h':                       // server's host
            setHost(optarg);
@@ -132,7 +132,7 @@ faxAlterApp::run(int argc, char** argv)
            addToScript("MAXDIALS %s", optarg);
            break;
        case 'v':                       // trace protocol
-           setVerbose(TRUE);
+           setVerbose(true);
            break;
        case '?':
            usage();
index 57ca91e1541a25641354f1454efe20f9c1013c30..eb5d316197cc83a8ef12fed8e823153c9bbecbe6 100644 (file)
@@ -40,17 +40,17 @@ Class0Modem::~Class0Modem()
 {
 }
 
-fxBool
+bool
 Class0Modem::setupModem()
 {
     if (!selectBaudRate(conf.maxRate, conf.flowControl, conf.flowControl))
-       return (FALSE);
+       return (false);
     // Query service support information
     fxStr s;
     if (doQuery(conf.classQueryCmd, s, 500) && parseRange(s, modemServices))
        traceBits(modemServices & SERVICE_ALL, serviceNames);
     if ((modemServices & SERVICE_DATA) == 0)
-       return (FALSE);
+       return (false);
     atCmd(conf.class0Cmd);
     setupFlowControl(flowControl);
 
@@ -70,14 +70,14 @@ Class0Modem::setupModem()
     if (modemRevision != "")
        modemCapability("Revision " | modemRevision);
 
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Send the modem any commands needed to force use of
  * the specified flow control scheme.
  */
-fxBool
+bool
 Class0Modem::setupFlowControl(FlowControl fc)
 {
     switch (fc) {
@@ -85,7 +85,7 @@ Class0Modem::setupFlowControl(FlowControl fc)
     case FLOW_XONXOFF: return atCmd(conf.softFlowCmd);
     case FLOW_RTSCTS:  return atCmd(conf.hardFlowCmd);
     }
-    return (TRUE);
+    return (true);
 }
 
 CallStatus
@@ -117,4 +117,4 @@ Class0Modem::dialResponse(fxStr&)
     return (FAILURE);
 }
 
-fxBool Class0Modem::isFaxModem() const         { return FALSE; }
+bool Class0Modem::isFaxModem() const           { return false; }
index 3ed1716d3e0aeff6bcd5113ddf8a4cce4f9a675e..d15de3cd8cab51a0aac20091189c6b82c33ce63d 100644 (file)
@@ -35,11 +35,11 @@ public:
     Class0Modem(ModemServer&, const ModemConfig&);
     ~Class0Modem();
 
-    fxBool setupModem();
-    virtual fxBool setupFlowControl(FlowControl fc);
+    bool setupModem();
+    virtual bool setupFlowControl(FlowControl fc);
     CallStatus dial(const char* number, fxStr& emsg);
     CallStatus dialResponse(fxStr& emsg);
 
-    fxBool isFaxModem() const;                 // XXX safe to cast
+    bool isFaxModem() const;                   // XXX safe to cast
 };
 #endif /* _Class0Modem_ */
index 826be14f3fc1a9791dadf86800700fa778bfca2e..0bfeba5c79385d9ba40ac63d909c931cef95052a 100644 (file)
@@ -54,21 +54,21 @@ const char* Class1Modem::modulationNames[6] = {
  *     least at 12000 and 14400.
  */
 const Class1Cap Class1Modem::basicCaps[15] = {
-    {  3,  0,          0,                   V21,   FALSE }, // v.21
-    {  24, BR_2400,    DCSSIGRATE_2400V27,  V27FB, FALSE }, // v.27 ter
-    {  48, BR_4800,    DCSSIGRATE_4800V27,  V27,   FALSE }, // v.27 ter
-    {  72, BR_7200,    DCSSIGRATE_7200V29,  V29,   FALSE }, // v.29
-    {  73, BR_7200,    DCSSIGRATE_7200V17,  V17,   FALSE }, // v.17
-    {  74, BR_7200,    DCSSIGRATE_7200V17,  V17,   FALSE }, // v.17 w/st
-    {  96, BR_9600,    DCSSIGRATE_9600V29,  V29,   FALSE }, // v.29
-    {  97, BR_9600,    DCSSIGRATE_9600V17,  V17,   FALSE }, // v.17
-    {  98, BR_9600,    DCSSIGRATE_9600V17,  V17,   FALSE }, // v.17 w/st
-    { 121, BR_12000,   DCSSIGRATE_12000V33, V33,   FALSE }, // v.33
-    { 121, BR_12000,   DCSSIGRATE_12000V17, V17,   FALSE }, // v.17
-    { 122, BR_12000,   DCSSIGRATE_12000V17, V17,   FALSE }, // v.17 w/st
-    { 145, BR_14400,   DCSSIGRATE_14400V33, V33,   FALSE }, // v.33
-    { 145, BR_14400,   DCSSIGRATE_14400V17, V17,   FALSE }, // v.17
-    { 146, BR_14400,   DCSSIGRATE_14400V17, V17,   FALSE }, // v.17 w/st
+    {  3,  0,          0,                   V21,   false }, // v.21
+    {  24, BR_2400,    DCSSIGRATE_2400V27,  V27FB, false }, // v.27 ter
+    {  48, BR_4800,    DCSSIGRATE_4800V27,  V27,   false }, // v.27 ter
+    {  72, BR_7200,    DCSSIGRATE_7200V29,  V29,   false }, // v.29
+    {  73, BR_7200,    DCSSIGRATE_7200V17,  V17,   false }, // v.17
+    {  74, BR_7200,    DCSSIGRATE_7200V17,  V17,   false }, // v.17 w/st
+    {  96, BR_9600,    DCSSIGRATE_9600V29,  V29,   false }, // v.29
+    {  97, BR_9600,    DCSSIGRATE_9600V17,  V17,   false }, // v.17
+    {  98, BR_9600,    DCSSIGRATE_9600V17,  V17,   false }, // v.17 w/st
+    { 121, BR_12000,   DCSSIGRATE_12000V33, V33,   false }, // v.33
+    { 121, BR_12000,   DCSSIGRATE_12000V17, V17,   false }, // v.17
+    { 122, BR_12000,   DCSSIGRATE_12000V17, V17,   false }, // v.17 w/st
+    { 145, BR_14400,   DCSSIGRATE_14400V33, V33,   false }, // v.33
+    { 145, BR_14400,   DCSSIGRATE_14400V17, V17,   false }, // v.17
+    { 146, BR_14400,   DCSSIGRATE_14400V17, V17,   false }, // v.17 w/st
 };
 #define        NCAPS   (sizeof (basicCaps) / sizeof (basicCaps[0]))
 
@@ -92,17 +92,17 @@ Class1Modem::~Class1Modem()
  * Check if the modem is a Class 1 modem and,
  * if so, configure it for use.
  */
-fxBool
+bool
 Class1Modem::setupModem()
 {
     if (!selectBaudRate(conf.maxRate, conf.flowControl, conf.flowControl))
-       return (FALSE);
+       return (false);
     // Query service support information
     fxStr s;
     if (doQuery(conf.classQueryCmd, s, 500) && FaxModem::parseRange(s, modemServices))
        traceBits(modemServices & SERVICE_ALL, serviceNames);
     if ((modemServices & SERVICE_CLASS1) == 0)
-       return (FALSE);
+       return (false);
     atCmd(conf.class1Cmd);
 
     /*
@@ -128,7 +128,7 @@ Class1Modem::setupModem()
      */
     if (!class1Query("AT+FTM=?", xmitCaps)) {
        serverTrace("Error parsing \"+FTM\" query response: \"%s\"", rbuf);
-       return (FALSE);
+       return (false);
     }
     modemParams.br = 0;
     u_int i;
@@ -150,7 +150,7 @@ Class1Modem::setupModem()
      */ 
     if (!class1Query("AT+FRM=?", recvCaps)) {
        serverTrace("Error parsing \"+FRM\" query response: \"%s\"", rbuf);
-       return (FALSE);
+       return (false);
     }
     u_int mods = 0;
     for (i = 1; i < NCAPS; i++)
@@ -189,13 +189,13 @@ Class1Modem::setupModem()
     frameRev = TIFFGetBitRevTable(conf.frameFillOrder == FILLORDER_LSB2MSB);
 
     setupClass1Parameters();
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Send the modem the Class 1 configuration commands.
  */
-fxBool
+bool
 Class1Modem::setupClass1Parameters()
 {
     if (modemServices & SERVICE_CLASS1) {
@@ -203,23 +203,23 @@ Class1Modem::setupClass1Parameters()
        setupFlowControl(flowControl);
        atCmd(conf.setupAACmd);
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Setup receive-specific parameters.
  */
-fxBool
+bool
 Class1Modem::setupReceive()
 {
-    return (TRUE);                     // nothing to do
+    return (true);                     // nothing to do
 }
 
 /*
  * Send the modem any commands needed to force use of
  * the specified flow control scheme.
  */
-fxBool
+bool
 Class1Modem::setupFlowControl(FlowControl fc)
 {
     switch (fc) {
@@ -227,14 +227,14 @@ Class1Modem::setupFlowControl(FlowControl fc)
     case FLOW_XONXOFF: return atCmd(conf.class1SFLOCmd);
     case FLOW_RTSCTS:  return atCmd(conf.class1HFLOCmd);
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Place the modem into the appropriate state
  * for sending/received facsimile.
  */
-fxBool
+bool
 Class1Modem::faxService()
 {
     return (atCmd(conf.class1Cmd) && setupFlowControl(flowControl));
@@ -249,10 +249,10 @@ Class1Modem::setLID(const fxStr& number)
     encodeTSI(lid, number);
 }
 
-fxBool
+bool
 Class1Modem::supportsPolling() const
 {
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -303,7 +303,7 @@ Class1Modem::decodeTSI(fxStr& ascii, const HDLCFrame& binary)
        n = 20;
     ascii.resize(n);
     u_int d = 0;
-    fxBool seenDigit = FALSE;
+    bool seenDigit = false;
     for (const u_char* cp = binary.getFrameData() + n-1; n > 0; cp--, n--) {
        /*
         * Accept any printable ascii.
@@ -311,7 +311,7 @@ Class1Modem::decodeTSI(fxStr& ascii, const HDLCFrame& binary)
        u_char c = frameRev[*cp];
         if (isprint(c) || c == ' ') {
            if (c != ' ')
-               seenDigit = TRUE;
+               seenDigit = true;
            if (seenDigit)
                ascii[d++] = c;
        }
@@ -355,19 +355,19 @@ Class1Modem::decodePWD(fxStr& ascii, const HDLCFrame& binary)
  * optionally including the end-of-data
  * marker <DLE><ETX>.
  */
-fxBool
+bool
 Class1Modem::sendClass1Data(const u_char* data, u_int cc,
-    const u_char* bitrev, fxBool eod)
+    const u_char* bitrev, bool eod)
 {
     if (!putModemDLEData(data, cc, bitrev, getDataTimeout()))
-       return (FALSE);
+       return (false);
     if (eod) {
        u_char buf[2];
        buf[0] = DLE;
        buf[1] = ETX;
        return (putModemData(buf, 2));
     } else
-       return (TRUE);
+       return (true);
 }
 
 /*
@@ -377,7 +377,7 @@ Class1Modem::sendClass1Data(const u_char* data, u_int cc,
 void
 Class1Modem::abortReceive()
 {
-    fxBool b = wasTimeout();
+    bool b = wasTimeout();
     char c = CAN;                      // anything other than DC1/DC3
     putModem(&c, 1, 1);
     /*
@@ -403,7 +403,7 @@ Class1Modem::abortReceive()
  * is not received before the timeout, the receive
  * is aborted.
  */
-fxBool
+bool
 Class1Modem::recvRawFrame(HDLCFrame& frame)
 {
     int c;
@@ -434,7 +434,7 @@ Class1Modem::recvRawFrame(HDLCFrame& frame)
     }
     if (wasTimeout()) {
        abortReceive();
-       return (FALSE);
+       return (false);
     }
     traceHDLCFrame("-->", frame);
     /*
@@ -445,18 +445,18 @@ Class1Modem::recvRawFrame(HDLCFrame& frame)
     if (!waitFor(AT_OK)) {
        if (lastResponse == AT_ERROR)
            protoTrace("FCS error");
-       return (FALSE);
+       return (false);
     }
     if (frame.getFrameDataLength() < 1) {
        protoTrace("HDLC frame too short (%u bytes)", frame.getLength());
-       return (FALSE);
+       return (false);
     }
     if ((frame[1]&0xf7) != 0xc0) {
        protoTrace("HDLC frame with bad control field %#x", frame[1]);
-       return (FALSE);
+       return (false);
     }
-    frame.setOK(TRUE);
-    return (TRUE);
+    frame.setOK(true);
+    return (true);
 }
 
 #include "StackBuffer.h"
@@ -489,21 +489,21 @@ Class1Modem::traceHDLCFrame(const char* direction, const HDLCFrame& frame)
  * The T.30 max frame length is enforced with a 3 second
  * timeout on the send.
  */
-fxBool
+bool
 Class1Modem::sendRawFrame(HDLCFrame& frame)
 {
     traceHDLCFrame("<--", frame);
     if (frame.getLength() < 3) {
        protoTrace("HDLC frame too short (%u bytes)", frame.getLength());
-       return (FALSE);
+       return (false);
     }
     if (frame[0] != 0xff) {
        protoTrace("HDLC frame with bad address field %#x", frame[0]);
-       return (FALSE);
+       return (false);
     }
     if ((frame[1]&0xf7) != 0xc0) {
        protoTrace("HDLC frame with bad control field %#x", frame[1]);
-       return (FALSE);
+       return (false);
     }
     static u_char buf[2] = { DLE, ETX };
     return (putModemDLEData(frame, frame.getLength(), frameRev, 0) &&
@@ -514,8 +514,8 @@ Class1Modem::sendRawFrame(HDLCFrame& frame)
 /*
  * Send a single byte frame.
  */
-fxBool
-Class1Modem::sendFrame(u_char fcf, fxBool lastFrame)
+bool
+Class1Modem::sendFrame(u_char fcf, bool lastFrame)
 {
     HDLCFrame frame(conf.class1FrameOverhead);
     frame.put(0xff);
@@ -527,8 +527,8 @@ Class1Modem::sendFrame(u_char fcf, fxBool lastFrame)
 /*
  * Send a frame with DCS/DIS.
  */
-fxBool
-Class1Modem::sendFrame(u_char fcf, u_int dcs, u_int xinfo, fxBool lastFrame)
+bool
+Class1Modem::sendFrame(u_char fcf, u_int dcs, u_int xinfo, bool lastFrame)
 {
     HDLCFrame frame(conf.class1FrameOverhead);
     frame.put(0xff);
@@ -554,8 +554,8 @@ Class1Modem::sendFrame(u_char fcf, u_int dcs, u_int xinfo, fxBool lastFrame)
 /*
  * Send a frame with TSI/CSI/PWD/SUB/SEP.
  */
-fxBool
-Class1Modem::sendFrame(u_char fcf, const fxStr& tsi, fxBool lastFrame)
+bool
+Class1Modem::sendFrame(u_char fcf, const fxStr& tsi, bool lastFrame)
 {
     HDLCFrame frame(conf.class1FrameOverhead);
     frame.put(0xff);
@@ -565,11 +565,11 @@ Class1Modem::sendFrame(u_char fcf, const fxStr& tsi, fxBool lastFrame)
     return (sendRawFrame(frame));
 }
 
-fxBool
-Class1Modem::transmitFrame(u_char fcf, fxBool lastFrame)
+bool
+Class1Modem::transmitFrame(u_char fcf, bool lastFrame)
 {
     startTimeout(2550);                        // 3.0 - 15% = 2.55 secs
-    fxBool frameSent =
+    bool frameSent =
        atCmd(thCmd, AT_NOTHING) &&
        atResponse(rbuf, 0) == AT_CONNECT &&
        sendFrame(fcf, lastFrame);
@@ -577,8 +577,8 @@ Class1Modem::transmitFrame(u_char fcf, fxBool lastFrame)
     return (frameSent);
 }
 
-fxBool
-Class1Modem::transmitFrame(u_char fcf, u_int dcs, u_int xinfo, fxBool lastFrame)
+bool
+Class1Modem::transmitFrame(u_char fcf, u_int dcs, u_int xinfo, bool lastFrame)
 {
     /*
      * The T.30 spec says no frame can take more than 3 seconds
@@ -586,7 +586,7 @@ Class1Modem::transmitFrame(u_char fcf, u_int dcs, u_int xinfo, fxBool lastFrame)
      * and guard against the send exceeding the lower bound.
      */
     startTimeout(2550);                        // 3.0 - 15% = 2.55 secs
-    fxBool frameSent =
+    bool frameSent =
        atCmd(thCmd, AT_NOTHING) &&
        atResponse(rbuf, 0) == AT_CONNECT &&
        sendFrame(fcf, dcs, xinfo, lastFrame);
@@ -594,11 +594,11 @@ Class1Modem::transmitFrame(u_char fcf, u_int dcs, u_int xinfo, fxBool lastFrame)
     return (frameSent);
 }
 
-fxBool
-Class1Modem::transmitFrame(u_char fcf, const fxStr& tsi, fxBool lastFrame)
+bool
+Class1Modem::transmitFrame(u_char fcf, const fxStr& tsi, bool lastFrame)
 {
     startTimeout(3000);                        // give more time than others
-    fxBool frameSent =
+    bool frameSent =
        atCmd(thCmd, AT_NOTHING) &&
        atResponse(rbuf, 0) == AT_CONNECT &&
        sendFrame(fcf, tsi, lastFrame);
@@ -609,16 +609,16 @@ Class1Modem::transmitFrame(u_char fcf, const fxStr& tsi, fxBool lastFrame)
 /*
  * Send data using the specified signalling rate.
  */
-fxBool
+bool
 Class1Modem::transmitData(int br, u_char* data, u_int cc,
-    const u_char* bitrev, fxBool eod)
+    const u_char* bitrev, bool eod)
 {
     if (flowControl == FLOW_XONXOFF)
        setXONXOFF(FLOW_XONXOFF, FLOW_NONE, ACT_FLUSH);
     fxStr tmCmd(br, tmCmdFmt);
-    fxBool ok = (atCmd(tmCmd, AT_CONNECT) &&
+    bool ok = (atCmd(tmCmd, AT_CONNECT) &&
        sendClass1Data(data, cc, bitrev, eod) &&
-       (eod ? waitFor(AT_OK) : TRUE));
+       (eod ? waitFor(AT_OK) : true));
     if (flowControl == FLOW_XONXOFF)
        setXONXOFF(FLOW_NONE, FLOW_NONE, ACT_DRAIN);
     return (ok);
@@ -632,24 +632,24 @@ Class1Modem::transmitData(int br, u_char* data, u_int cc,
  * is not received before the timeout, the receive
  * is aborted.
  */
-fxBool
+bool
 Class1Modem::recvFrame(HDLCFrame& frame, long ms)
 {
     frame.reset();
     startTimeout(ms);
-    fxBool readPending = atCmd(rhCmd, AT_NOTHING);
+    bool readPending = atCmd(rhCmd, AT_NOTHING);
     if (readPending && waitFor(AT_CONNECT,0))
        return recvRawFrame(frame);             // NB: stops inherited timeout
     stopTimeout("waiting for v.21 carrier");
     if (readPending && wasTimeout())
        abortReceive();
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Receive TCF data using the specified signalling rate.
  */
-fxBool
+bool
 Class1Modem::recvTCF(int br, HDLCFrame& buf, const u_char* bitrev, long ms)
 {
     buf.reset();
@@ -659,7 +659,7 @@ Class1Modem::recvTCF(int br, HDLCFrame& buf, const u_char* bitrev, long ms)
     /*
      * Loop waiting for carrier or timeout.
      */
-    fxBool readPending, gotCarrier;
+    bool readPending, gotCarrier;
     fxStr rmCmd(br, rmCmdFmt);
     do {
        readPending = atCmd(rmCmd, AT_NOTHING);
@@ -668,7 +668,7 @@ Class1Modem::recvTCF(int br, HDLCFrame& buf, const u_char* bitrev, long ms)
     /*
      * If carrier was recognized, collect the data.
      */
-    fxBool gotData = FALSE;
+    bool gotData = false;
     if (gotCarrier) {
        int c = getModemChar(0);                // NB: timeout is to first byte
        stopTimeout("receiving TCF");
@@ -684,7 +684,7 @@ Class1Modem::recvTCF(int br, HDLCFrame& buf, const u_char* bitrev, long ms)
                if (c == DLE) {
                    c = getModemChar(0);
                    if (c == ETX) {
-                       gotData = TRUE;
+                       gotData = true;
                        break;
                    }
                }
@@ -710,7 +710,7 @@ Class1Modem::recvTCF(int br, HDLCFrame& buf, const u_char* bitrev, long ms)
 /*
  * Reset a Class 1 modem.
  */
-fxBool
+bool
 Class1Modem::reset(long ms)
 {
     return (FaxModem::reset(ms) && setupClass1Parameters());
@@ -727,13 +727,13 @@ Class1Modem::atResponse(char* buf, long ms)
 /*
  * Wait (carefully) for some response from the modem.
  */
-fxBool
+bool
 Class1Modem::waitFor(ATResponse wanted, long ms)
 {
     for (;;) {
        ATResponse response = atResponse(rbuf, ms);
        if (response == wanted)
-           return (TRUE);
+           return (true);
        switch (response) {
        case AT_TIMEOUT:
        case AT_EMPTYLINE:
@@ -745,7 +745,7 @@ Class1Modem::waitFor(ATResponse wanted, long ms)
            modemTrace("MODEM %s", ATresponses[response]);
            /* fall thru... */
        case AT_FCERROR:
-           return (FALSE);
+           return (false);
        }
     }
 }
@@ -753,7 +753,7 @@ Class1Modem::waitFor(ATResponse wanted, long ms)
 /*
  * Send <what>=? and get a range response.
  */
-fxBool
+bool
 Class1Modem::class1Query(const char* what, Class1Cap caps[])
 {
     char response[1024];
@@ -761,7 +761,7 @@ Class1Modem::class1Query(const char* what, Class1Cap caps[])
        sync(5000);
        return (parseQuery(response, caps));
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -846,7 +846,7 @@ const char SPACE = ' ';
 /*
  * Parse a Class 1 parameter string.
  */
-fxBool
+bool
 Class1Modem::parseQuery(const char* cp, Class1Cap caps[])
 {
     while (cp[0]) {
@@ -855,18 +855,18 @@ Class1Modem::parseQuery(const char* cp, Class1Cap caps[])
            continue;
        }
        if (!isdigit(cp[0]))
-           return (FALSE);
+           return (false);
        int v = 0;
        do {
            v = v*10 + (cp[0] - '0');
        } while (isdigit((++cp)[0]));
        for (u_int i = 0; i < NCAPS; i++)
            if (caps[i].value == v) {
-               caps[i].ok = TRUE;
+               caps[i].ok = true;
                break;
            }
        if (cp[0] == COMMA)             // <item>,<item>...
            cp++;
     }
-    return (TRUE);
+    return (true);
 }
index 41409d678aa057c86f3297a9ddea8a42c9c027e1..e3333eb47eba681dced14a6b5b38c0119f9188f0 100644 (file)
@@ -40,7 +40,7 @@ typedef struct {
     u_char     br;     // Class 2 bit rate parameter
     u_short    sr;     // T.30 DCS signalling rate
     u_char     mod;    // modulation technique
-    fxBool     ok;     // true if modem is capable
+    bool       ok;     // true if modem is capable
 } Class1Cap;
 #define        HasShortTraining(c) \
     ((c)->mod == V17 && ((c)->value & 1) && (c)[1].ok)
@@ -59,10 +59,10 @@ protected:
     Class1Cap  recvCaps[15];           // modem recv capabilities
     const Class1Cap* curcap;           // capabilities being used
     u_int      discap;                 // DIS signalling rate capabilities
-    fxBool     prevPage;               // a previous page was received
-    fxBool     pageGood;               // quality of last page received
-    fxBool     recvdDCN;               // received DCN frame
-    fxBool     messageReceived;        // expect/don't expect message carrier
+    bool       prevPage;               // a previous page was received
+    bool       pageGood;               // quality of last page received
+    bool       recvdDCN;               // received DCN frame
+    bool       messageReceived;        // expect/don't expect message carrier
     u_int      lastPPM;                // last PPM during receive
 
     static const u_int modemPFMCodes[8];// map T.30 FCF to Class 2 PFM
@@ -82,32 +82,32 @@ protected:
     static const char* modulationNames[6];
 
 // modem setup stuff
-    virtual fxBool setupModem();
-    virtual fxBool setupClass1Parameters();
-    virtual fxBool setupFlowControl(FlowControl fc);
+    virtual bool setupModem();
+    virtual bool setupClass1Parameters();
+    virtual bool setupFlowControl(FlowControl fc);
 // transmission support
-    fxBool     sendPrologue(u_int dcs, u_int xinfo, const fxStr& tsi);
-    fxBool     dropToNextBR(Class2Params&);
-    fxBool     raiseToNextBR(Class2Params&);
-    fxBool     sendTraining(Class2Params&, int, fxStr& emsg);
-    fxBool     sendTCF(const Class2Params&, u_int ms);
-    fxBool     sendPage(TIFF* tif, const Class2Params&, u_int, fxStr& emsg);
-    fxBool     sendPageData(u_char* data, u_int cc, const u_char* bitrev);
-    fxBool     sendRTC(fxBool is2D);
-    fxBool     sendPPM(u_int ppm, HDLCFrame& mcf, fxStr& emsg);
-    fxBool     decodePPM(const fxStr& pph, u_int& ppm, fxStr& emsg);
+    bool       sendPrologue(u_int dcs, u_int xinfo, const fxStr& tsi);
+    bool       dropToNextBR(Class2Params&);
+    bool       raiseToNextBR(Class2Params&);
+    bool       sendTraining(Class2Params&, int, fxStr& emsg);
+    bool       sendTCF(const Class2Params&, u_int ms);
+    bool       sendPage(TIFF* tif, const Class2Params&, u_int, fxStr& emsg);
+    bool       sendPageData(u_char* data, u_int cc, const u_char* bitrev);
+    bool       sendRTC(bool is2D);
+    bool       sendPPM(u_int ppm, HDLCFrame& mcf, fxStr& emsg);
+    bool       decodePPM(const fxStr& pph, u_int& ppm, fxStr& emsg);
 // reception support
     const AnswerMsg* findAnswer(const char*);
-    fxBool     recvIdentification(
+    bool       recvIdentification(
                    u_int f1, const fxStr& pwd,
                    u_int f2, const fxStr& addr,
                    u_int f3, const fxStr& id,
                    u_int f4, u_int dics, u_int xinfo,
                    u_int timer, fxStr& emsg);
-    fxBool     recvDCSFrames(HDLCFrame& frame);
-    fxBool     recvTraining();
-    fxBool     recvPPM(int& ppm, fxStr& emsg);
-    fxBool     recvPageData(TIFF*, fxStr& emsg);
+    bool       recvDCSFrames(HDLCFrame& frame);
+    bool       recvTraining();
+    bool       recvPPM(int& ppm, fxStr& emsg);
+    bool       recvPageData(TIFF*, fxStr& emsg);
     void       recvData(TIFF*, u_char* buf, int n);
     void       processDCSFrame(const HDLCFrame& frame);
     void       abortPageRecv();
@@ -116,7 +116,7 @@ protected:
        AT_FCERROR      = 100   // "+FCERROR"
     };
     virtual ATResponse atResponse(char* buf, long ms = 30*1000);
-    virtual fxBool waitFor(ATResponse wanted, long ms = 30*1000);
+    virtual bool waitFor(ATResponse wanted, long ms = 30*1000);
     void       encodeTSI(fxStr& binary, const fxStr& ascii);
     const fxStr& decodeTSI(fxStr& ascii, const HDLCFrame& binary);
     void       encodePWD(fxStr& binary, const fxStr& ascii);
@@ -124,33 +124,33 @@ protected:
     const Class1Cap* findSRCapability(u_short sr, const Class1Cap[]);
     const Class1Cap* findBRCapability(u_short br, const Class1Cap[]);
 // class 1 HDLC frame support
-    fxBool     transmitFrame(u_char fcf, fxBool lastFrame = TRUE);
-    fxBool     transmitFrame(u_char fcf, u_int, u_int, fxBool lastFrame = TRUE);
-    fxBool     transmitFrame(u_char fcf, const fxStr&, fxBool lastFrame=TRUE);
-    fxBool     transmitData(int br, u_char* data, u_int cc,
-                   const u_char* bitrev, fxBool eod);
-    fxBool     sendFrame(u_char fcf, fxBool lastFrame = TRUE);
-    fxBool     sendFrame(u_char fcf, u_int, u_int, fxBool lastFrame = TRUE);
-    fxBool     sendFrame(u_char fcf, const fxStr&, fxBool lastFrame = TRUE);
-    fxBool     sendRawFrame(HDLCFrame& frame);
-    fxBool     sendClass1Data(const u_char* data, u_int cc,
-                   const u_char* bitrev, fxBool eod);
-    fxBool     recvFrame(HDLCFrame& frame, long ms = 10*1000);
-    fxBool     recvTCF(int br, HDLCFrame&, const u_char* bitrev, long ms);
-    fxBool     recvRawFrame(HDLCFrame& frame);
+    bool       transmitFrame(u_char fcf, bool lastFrame = true);
+    bool       transmitFrame(u_char fcf, u_int, u_int, bool lastFrame = true);
+    bool       transmitFrame(u_char fcf, const fxStr&, bool lastFrame=true);
+    bool       transmitData(int br, u_char* data, u_int cc,
+                   const u_char* bitrev, bool eod);
+    bool       sendFrame(u_char fcf, bool lastFrame = true);
+    bool       sendFrame(u_char fcf, u_int, u_int, bool lastFrame = true);
+    bool       sendFrame(u_char fcf, const fxStr&, bool lastFrame = true);
+    bool       sendRawFrame(HDLCFrame& frame);
+    bool       sendClass1Data(const u_char* data, u_int cc,
+                   const u_char* bitrev, bool eod);
+    bool       recvFrame(HDLCFrame& frame, long ms = 10*1000);
+    bool       recvTCF(int br, HDLCFrame&, const u_char* bitrev, long ms);
+    bool       recvRawFrame(HDLCFrame& frame);
     void       abortReceive();
     void       traceHDLCFrame(const char* direction, const HDLCFrame& frame);
 // class 1 command support routines
-    fxBool     class1Query(const char* what, Class1Cap caps[]);
-    fxBool     parseQuery(const char*, Class1Cap caps[]);
+    bool       class1Query(const char* what, Class1Cap caps[]);
+    bool       parseQuery(const char*, Class1Cap caps[]);
 public:
     Class1Modem(FaxServer&, const ModemConfig&);
     virtual ~Class1Modem();
 
 // send support
-    fxBool     sendSetup(FaxRequest&, const Class2Params&, fxStr& emsg);
+    bool       sendSetup(FaxRequest&, const Class2Params&, fxStr& emsg);
     CallStatus dialResponse(fxStr& emsg);
-    FaxSendStatus getPrologue(Class2Params&, fxBool&, fxStr&);
+    FaxSendStatus getPrologue(Class2Params&, bool&, fxStr&);
     void       sendBegin();
     void       sendSetupPhaseB(const fxStr& pwd, const fxStr& sub);
     FaxSendStatus sendPhaseB(TIFF* tif, Class2Params&, FaxMachineInfo&,
@@ -162,21 +162,21 @@ public:
     CallType   answerCall(AnswerType, fxStr& emsg);
     u_int      modemDIS() const;
     u_int      modemXINFO() const;
-    fxBool     setupReceive();
-    fxBool     recvBegin(fxStr& emsg);
-    fxBool     recvPage(TIFF*, int& ppm, fxStr& emsg);
-    fxBool     recvEnd(fxStr& emsg);
+    bool       setupReceive();
+    bool       recvBegin(fxStr& emsg);
+    bool       recvPage(TIFF*, int& ppm, fxStr& emsg);
+    bool       recvEnd(fxStr& emsg);
     void       recvAbort();
 
 // polling support
-    fxBool     requestToPoll(fxStr&);
-    fxBool     pollBegin(const fxStr& cig, const fxStr& sep, const fxStr& pwd,
+    bool       requestToPoll(fxStr&);
+    bool       pollBegin(const fxStr& cig, const fxStr& sep, const fxStr& pwd,
                    fxStr& emsg);
 
 // miscellaneous
-    fxBool     faxService();                   // switch to fax mode
-    fxBool     reset(long ms);                 // reset modem
+    bool       faxService();                   // switch to fax mode
+    bool       reset(long ms);                 // reset modem
     void       setLID(const fxStr& number);    // set local id string
-    fxBool     supportsPolling() const;        // modem capability
+    bool       supportsPolling() const;        // modem capability
 };
 #endif /* _CLASS1_ */
index 22c0349ab227eac4221a0dc3dcdccfd954d315bd..40c6816ebe398c5611b0da0cc39788a7896f9545 100644 (file)
 #include "HDLCFrame.h"
 #include "t.30.h"
 
-fxBool
+bool
 Class1Modem::requestToPoll(fxStr&)
 {
-    return TRUE;
+    return true;
 }
 
-fxBool
+bool
 Class1Modem::pollBegin(const fxStr& cig0,
     const fxStr& sep0, const fxStr& pwd0, fxStr& emsg)
 {
@@ -54,9 +54,9 @@ Class1Modem::pollBegin(const fxStr& cig0,
        send |= DIS_PWD;
     }
 
-    setInputBuffering(FALSE);
-    prevPage = FALSE;                          // no previous page received
-    pageGood = FALSE;                          // quality of received page
+    setInputBuffering(false);
+    prevPage = false;                          // no previous page received
+    pageGood = false;                          // quality of received page
 
     return atCmd(thCmd, AT_NOTHING) &&
        atResponse(rbuf, 2550) == AT_CONNECT &&
index a4f54ffc82bf733d9eee34e39a7df78865e7093b..c90b84f283c51e376fa5a27deb687fdfea189ad1 100644 (file)
@@ -77,14 +77,14 @@ Class1Modem::findAnswer(const char* s)
 /*
  * Begin the receive protocol.
  */
-fxBool
+bool
 Class1Modem::recvBegin(fxStr& emsg)
 {
-    setInputBuffering(FALSE);
-    prevPage = FALSE;                          // no previous page received
-    pageGood = FALSE;                          // quality of received page
-    messageReceived = FALSE;                   // expect message carrier
-    recvdDCN = FALSE;                          // haven't seen DCN
+    setInputBuffering(false);
+    prevPage = false;                          // no previous page received
+    pageGood = false;                          // quality of received page
+    messageReceived = false;                   // expect message carrier
+    recvdDCN = false;                          // haven't seen DCN
     lastPPM = FCF_DCN;                         // anything will do
 
     return FaxModem::recvBegin(emsg) && recvIdentification(
@@ -99,7 +99,7 @@ Class1Modem::recvBegin(fxStr& emsg)
  * Transmit local identification and wait for the
  * remote side to respond with their identification.
  */
-fxBool
+bool
 Class1Modem::recvIdentification(
     u_int f1, const fxStr& pwd,
     u_int f2, const fxStr& addr,
@@ -111,7 +111,7 @@ Class1Modem::recvIdentification(
     u_int trecovery = howmany(conf.class1TrainingRecovery, 1000);
     time_t start = Sys::now();
     HDLCFrame frame(conf.class1FrameOverhead);
-    fxBool framesSent;
+    bool framesSent;
 
     emsg = "No answer (T.30 T1 timeout)";
     /*
@@ -120,27 +120,27 @@ Class1Modem::recvIdentification(
      */
     if (f1) {
        startTimeout(3000);
-       framesSent = sendFrame(f1, pwd, FALSE);
+       framesSent = sendFrame(f1, pwd, false);
        stopTimeout("sending PWD frame");
     } else if (f2) {
        startTimeout(3000);
-       framesSent = sendFrame(f2, addr, FALSE);
+       framesSent = sendFrame(f2, addr, false);
        stopTimeout("sending SUB/SEP frame");
     } else {
        startTimeout(3000);
-       framesSent = sendFrame(f3, id, FALSE);
+       framesSent = sendFrame(f3, id, false);
        stopTimeout("sending CSI/CIG frame");
     }
     for (;;) {
        if (framesSent) {
            if (f1) {
                startTimeout(2550);
-               framesSent = sendFrame(f2, addr, FALSE);
+               framesSent = sendFrame(f2, addr, false);
                stopTimeout("sending SUB/SEP frame");
            }
            if (framesSent && f2) {
                startTimeout(2550);
-               framesSent = sendFrame(f3, id, FALSE);
+               framesSent = sendFrame(f3, id, false);
                stopTimeout("sending CSI/CIG frame");
            }
            if (framesSent) {
@@ -162,14 +162,14 @@ Class1Modem::recvIdentification(
                    if (!recvDCSFrames(frame)) {
                        if (frame.getFCF() == FCF_DCN) {
                            emsg = "RSPREC error/got DCN";
-                           recvdDCN = TRUE;
+                           recvdDCN = true;
                        } else                  // XXX DTC/DIS not handled
                            emsg = "RSPREC invalid response received";
                        break;
                    }
                    if (recvTraining()) {
                        emsg = "";
-                       return (TRUE);
+                       return (true);
                    }
                    emsg = "Failure to train modems";
                    /*
@@ -203,19 +203,19 @@ Class1Modem::recvIdentification(
         * Retransmit ident frames.
         */
        if (f1)
-           framesSent = transmitFrame(f1, pwd, FALSE);
+           framesSent = transmitFrame(f1, pwd, false);
        else if (f2)
-           framesSent = transmitFrame(f2, addr, FALSE);
+           framesSent = transmitFrame(f2, addr, false);
        else
-           framesSent = transmitFrame(f3, id, FALSE);
+           framesSent = transmitFrame(f3, id, false);
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Receive DCS preceded by any optional frames.
  */
-fxBool
+bool
 Class1Modem::recvDCSFrames(HDLCFrame& frame)
 {
     fxStr s;
@@ -241,14 +241,14 @@ Class1Modem::recvDCSFrames(HDLCFrame& frame)
 /*
  * Receive training and analyze TCF.
  */
-fxBool
+bool
 Class1Modem::recvTraining()
 {
     protoTrace("RECV training at %s %s",
        modulationNames[curcap->mod],
        Class2Params::bitRateNames[curcap->br]);
     HDLCFrame buf(conf.class1FrameOverhead);
-    fxBool ok = recvTCF(curcap->value, buf, frameRev, conf.class1TCFRecvTimeout);
+    bool ok = recvTCF(curcap->value, buf, frameRev, conf.class1TCFRecvTimeout);
     if (ok) {                                  // check TCF data
        u_int n = buf.getLength();
        u_int nonzero = 0;
@@ -293,11 +293,11 @@ Class1Modem::recvTraining()
        if (nonzero > conf.class1TCFMaxNonZero) {
            protoTrace("RECV: reject TCF (too many non-zero, max %u%%)",
                conf.class1TCFMaxNonZero);
-           ok = FALSE;
+           ok = false;
        }
        if (zerorun < minrun) {
            protoTrace("RECV: reject TCF (zero run too short, min %u)", minrun);
-           ok = FALSE;
+           ok = false;
        }
        (void) waitFor(AT_NOCARRIER);   // wait for message carrier to drop
     }
@@ -346,7 +346,7 @@ const u_int Class1Modem::modemPPMCodes[8] = {
  * This routine is called after receiving training or after
  * sending a post-page response in a multi-page document.
  */
-fxBool
+bool
 Class1Modem::recvPage(TIFF* tif, int& ppm, fxStr& emsg)
 {
 top:
@@ -356,7 +356,7 @@ top:
            /*
             * Look for message carrier and receive Phase C data.
             */
-           setInputBuffering(TRUE);
+           setInputBuffering(true);
            if (flowControl == FLOW_XONXOFF)
                (void) setXONXOFF(FLOW_NONE, FLOW_XONXOFF, ACT_FLUSH);
            /*
@@ -384,13 +384,13 @@ top:
                     */
                    messageReceived = waitFor(AT_NOCARRIER, 2*1000);
                    if (messageReceived)
-                       prevPage = TRUE;
+                       prevPage = true;
                    timer = conf.t1Timer;               // wait longer for PPM
                }
            }
            if (flowControl == FLOW_XONXOFF)
                (void) setXONXOFF(FLOW_NONE, FLOW_NONE, ACT_DRAIN);
-           setInputBuffering(FALSE);
+           setInputBuffering(false);
            if (!messageReceived && rmResponse != AT_FCERROR) {
                /*
                 * One of many things may have happened:
@@ -419,7 +419,7 @@ top:
        if (abortRequested()) {
            // XXX no way to purge TIFF directory
            emsg = "Receive aborted due to operator intervention";
-           return (FALSE);
+           return (false);
        }
        /*
         * Do command received logic.
@@ -430,7 +430,7 @@ top:
            case FCF_DIS:                       // XXX no support
                protoTrace("RECV DIS/DTC");
                emsg = "Can not continue after DIS/DTC";
-               return (FALSE);
+               return (false);
            case FCF_PWD:
            case FCF_SUB:
            case FCF_NSS:
@@ -456,7 +456,7 @@ top:
                     * was received--this violates the protocol.
                     */
                    emsg = "COMREC invalid response received";
-                   return (FALSE);
+                   return (false);
                }
                /*
                 * [Re]transmit post page response.
@@ -478,7 +478,7 @@ top:
                         */
                        messageReceived = (lastPPM == FCF_EOM);
                        ppm = modemPPMCodes[lastPPM&7];
-                       return (TRUE);
+                       return (true);
                    }
                } else {
                    /*
@@ -492,17 +492,17 @@ top:
                     * writes will overwrite the previous data.
                     */
                    recvResetPage(tif);
-                   messageReceived = TRUE;     // expect DCS next
+                   messageReceived = true;     // expect DCS next
                }
                break;
            case FCF_DCN:                       // DCN
                protoTrace("RECV recv DCN");
                emsg = "COMREC received DCN";
-               recvdDCN = TRUE;
-               return (FALSE);
+               recvdDCN = true;
+               return (false);
            default:
                emsg = "COMREC invalid response received";
-               return (FALSE);
+               return (false);
            }
        }
     } while (!wasTimeout() && lastResponse != AT_EMPTYLINE);
@@ -517,7 +517,7 @@ top:
            goto top;
     } else
        emsg = "T.30 T2 timeout, expected page not received";
-    return (FALSE);
+    return (false);
 }
 
 void
@@ -530,10 +530,10 @@ Class1Modem::abortPageRecv()
 /*
  * Receive Phase C data w/ or w/o copy quality checking.
  */
-fxBool
+bool
 Class1Modem::recvPageData(TIFF* tif, fxStr& emsg)
 {
-    fxBool pageRecvd = recvPageDLEData(tif, checkQuality(), params, emsg);
+    bool pageRecvd = recvPageDLEData(tif, checkQuality(), params, emsg);
     TIFFSetField(tif, TIFFTAG_IMAGELENGTH, getRecvEOLCount());
     TIFFSetField(tif, TIFFTAG_CLEANFAXDATA, getRecvBadLineCount() ?
        CLEANFAXDATA_REGENERATED : CLEANFAXDATA_CLEAN);
@@ -548,7 +548,7 @@ Class1Modem::recvPageData(TIFF* tif, fxStr& emsg)
 /*
  * Complete a receive session.
  */
-fxBool
+bool
 Class1Modem::recvEnd(fxStr&)
 {
     if (!recvdDCN) {
@@ -583,8 +583,8 @@ Class1Modem::recvEnd(fxStr&)
        } while (Sys::now()-start < t1 &&
            (!frame.isOK() || frame.getFCF() == FCF_EOP));
     }
-    setInputBuffering(TRUE);
-    return (TRUE);
+    setInputBuffering(true);
+    return (true);
 }
 
 /*
@@ -594,5 +594,5 @@ void
 Class1Modem::recvAbort()
 {
     transmitFrame(FCF_DCN|FCF_RCVR);
-    recvdDCN = TRUE;                           // don't hang around in recvEnd
+    recvdDCN = true;                           // don't hang around in recvEnd
 }
index b20cf146257c55235210740a738969216291ea86..d67578bb7918ea1fed73fbd69838e43c1f03d54a 100644 (file)
@@ -38,7 +38,7 @@
 /*
  * Force the tty into a known flow control state.
  */
-fxBool
+bool
 Class1Modem::sendSetup(FaxRequest& req, const Class2Params& dis, fxStr& emsg)
 {
     if (flowControl == FLOW_XONXOFF)
@@ -88,7 +88,7 @@ void
 Class1Modem::sendBegin()
 {
     FaxModem::sendBegin();
-    setInputBuffering(FALSE);
+    setInputBuffering(false);
     // polling accounting?
     params.br = (u_int) -1;                    // force initial training
 }
@@ -97,14 +97,14 @@ Class1Modem::sendBegin()
  * Get the initial DIS command.
  */
 FaxSendStatus
-Class1Modem::getPrologue(Class2Params& params, fxBool& hasDoc, fxStr& emsg)
+Class1Modem::getPrologue(Class2Params& params, bool& hasDoc, fxStr& emsg)
 {
     u_int t1 = howmany(conf.t1Timer, 1000);            // T1 timer in seconds
     time_t start = Sys::now();
     HDLCFrame frame(conf.class1FrameOverhead);
 
     startTimeout(conf.t2Timer);
-    fxBool framerecvd = recvRawFrame(frame);
+    bool framerecvd = recvRawFrame(frame);
     stopTimeout("receiving id frame");
     for (;;) {
        if (framerecvd) {
@@ -198,14 +198,14 @@ const u_int Class1Modem::modemPFMCodes[8] = {
     FCF_EOP,           // 7 ??? XXX
 };
 
-fxBool
+bool
 Class1Modem::decodePPM(const fxStr& pph, u_int& ppm, fxStr& emsg)
 {
     if (FaxModem::decodePPM(pph, ppm, emsg)) {
        ppm = modemPFMCodes[ppm];
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 /*
@@ -218,7 +218,7 @@ Class1Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info,
     fxStr& pph, fxStr& emsg)
 {
     int ntrys = 0;                     // # retraining/command repeats
-    fxBool morePages = TRUE;           // more pages still to send
+    bool morePages = true;             // more pages still to send
     HDLCFrame frame(conf.class1FrameOverhead);
 
     do {
@@ -319,7 +319,7 @@ Class1Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info,
                }
                if (!sendTraining(params, 3, emsg))
                    return (send_retry);
-               morePages = TRUE;       // force continuation
+               morePages = true;       // force continuation
                next = params;          // avoid retraining above
                break;
            case FCF_PIN:               // nak, retry w/ operator intervention
@@ -346,13 +346,13 @@ Class1Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info,
  * Note that we send real zero data here rather than using
  * the Class 1 modem facility to do zero fill.
  */
-fxBool
+bool
 Class1Modem::sendTCF(const Class2Params& params, u_int ms)
 {
     u_int tcfLen = params.transferSize(ms);
     u_char* tcf = new u_char[tcfLen];
     memset(tcf, 0, tcfLen);
-    fxBool ok = transmitData(curcap->value, tcf, tcfLen, frameRev, TRUE);
+    bool ok = transmitData(curcap->value, tcf, tcfLen, frameRev, true);
     delete tcf;
     return ok;
 }
@@ -364,34 +364,34 @@ Class1Modem::sendTCF(const Class2Params& params, u_int ms)
  *     TSI     transmitter subscriber id
  *     DCS     digital command signal
  */
-fxBool
+bool
 Class1Modem::sendPrologue(u_int dcs, u_int dcs_xinfo, const fxStr& tsi)
 {
-    fxBool frameSent = (
+    bool frameSent = (
        atCmd(thCmd, AT_NOTHING) &&
        atResponse(rbuf, 2550) == AT_CONNECT
     );
     if (!frameSent)
-       return (FALSE);
+       return (false);
     if (pwd != fxStr::null) {
        startTimeout(2550);             // 3.0 - 15% = 2.55 secs
-       fxBool frameSent = sendFrame(FCF_PWD|FCF_SNDR, pwd, FALSE);
+       bool frameSent = sendFrame(FCF_PWD|FCF_SNDR, pwd, false);
        stopTimeout("sending PWD frame");
        if (!frameSent)
-           return (FALSE);
+           return (false);
     }
     if (sub != fxStr::null) {
        startTimeout(2550);             // 3.0 - 15% = 2.55 secs
-       fxBool frameSent = sendFrame(FCF_SUB|FCF_SNDR, sub, FALSE);
+       bool frameSent = sendFrame(FCF_SUB|FCF_SNDR, sub, false);
        stopTimeout("sending SUB frame");
        if (!frameSent)
-           return (FALSE);
+           return (false);
     }
     startTimeout(2550);                        // 3.0 - 15% = 2.55 secs
-    frameSent = sendFrame(FCF_TSI|FCF_SNDR, tsi, FALSE);
+    frameSent = sendFrame(FCF_TSI|FCF_SNDR, tsi, false);
     stopTimeout("sending TSI frame");
     if (!frameSent)
-       return (FALSE);
+       return (false);
     startTimeout(2550);                        // 3.0 - 15% = 2.55 secs
     frameSent = sendFrame(FCF_DCS|FCF_SNDR, dcs, dcs_xinfo);
     stopTimeout("sending DCS frame");
@@ -402,14 +402,14 @@ Class1Modem::sendPrologue(u_int dcs, u_int dcs_xinfo, const fxStr& tsi)
  * Return whether or not the previously received DIS indicates
  * the remote side is capable of the T.30 DCS signalling rate.
  */
-static fxBool
+static bool
 isCapable(u_int sr, u_int dis)
 {
     dis = (dis & DIS_SIGRATE) >> 10;
     switch (sr) {
     case DCSSIGRATE_2400V27:
        if (dis == DISSIGRATE_V27FB)
-           return (TRUE);
+           return (true);
        /* fall thru... */
     case DCSSIGRATE_4800V27:
        return ((dis & DISSIGRATE_V27) != 0);
@@ -419,7 +419,7 @@ isCapable(u_int sr, u_int dis)
     case DCSSIGRATE_14400V33:
     case DCSSIGRATE_12000V33:
        if (dis == DISSIGRATE_V33)
-           return (TRUE);
+           return (true);
        /* fall thru... */
     case DCSSIGRATE_14400V17:
     case DCSSIGRATE_12000V17:
@@ -427,18 +427,18 @@ isCapable(u_int sr, u_int dis)
     case DCSSIGRATE_7200V17:
        return (dis == DISSIGRATE_V17);
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Send capabilities and do training.
  */
-fxBool
+bool
 Class1Modem::sendTraining(Class2Params& params, int tries, fxStr& emsg)
 {
     if (tries == 0) {
        emsg = "DIS/DTC received 3 times; DCS not recognized";
-       return (FALSE);
+       return (false);
     }
     u_int dcs = params.getDCS();               // NB: 24-bit DCS and
     u_int dcs_xinfo = params.getXINFO();       //     32-bit extension
@@ -514,7 +514,7 @@ Class1Modem::sendTraining(Class2Params& params, int tries, fxStr& emsg)
                case FCF_CFR:           // training confirmed
                    protoTrace("TRAINING succeeded");
                    setDataTimeout(60, params.br);
-                   return (TRUE);
+                   return (true);
                case FCF_FTT:           // failure to train, retry
                    break;
                case FCF_DIS:           // new capabilities, maybe
@@ -548,26 +548,26 @@ failed:
     emsg = "Failure to train remote modem at 2400 bps or minimum speed";
 done:
     protoTrace("TRAINING failed");
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Select the next lower signalling rate that's
  * acceptable to both local and remote machines.
  */
-fxBool
+bool
 Class1Modem::dropToNextBR(Class2Params& params)
 {
     for (;;) {
        if (params.br == minsp)
-           return (FALSE);
+           return (false);
        // get ``best capability'' of modem at this baud rate
        curcap = findBRCapability(--params.br, xmitCaps);
        if (curcap) {
            // hunt for compatibility with remote at this baud rate
            do {
                if (isCapable(curcap->sr, dis))
-                   return (TRUE);
+                   return (true);
                curcap--;
            } while (curcap->br == params.br);
        }
@@ -579,19 +579,19 @@ Class1Modem::dropToNextBR(Class2Params& params)
  * Select the next higher signalling rate that's
  * acceptable to both local and remote machines.
  */
-fxBool
+bool
 Class1Modem::raiseToNextBR(Class2Params& params)
 {
     for (;;) {
        if (params.br == BR_14400)      // highest speed
-           return (FALSE);
+           return (false);
        // get ``best capability'' of modem at this baud rate
        curcap = findBRCapability(++params.br, xmitCaps);
        if (curcap) {
            // hunt for compatibility with remote at this baud rate
            do {
                if (isCapable(curcap->sr, dis))
-                   return (TRUE);
+                   return (true);
                curcap--;
            } while (curcap->br == params.br);
        }
@@ -602,11 +602,11 @@ Class1Modem::raiseToNextBR(Class2Params& params)
 /*
  * Send data for the current page.
  */
-fxBool
+bool
 Class1Modem::sendPageData(u_char* data, u_int cc, const u_char* bitrev)
 {
     beginTimedTransfer();
-    fxBool rc = sendClass1Data(data, cc, bitrev, FALSE);
+    bool rc = sendClass1Data(data, cc, bitrev, false);
     endTimedTransfer();
     protoTrace("SENT %u bytes of data", cc);
     return rc;
@@ -618,8 +618,8 @@ Class1Modem::sendPageData(u_char* data, u_int cc, const u_char* bitrev)
  * seems that some Class 1 modems do not immediately
  * send all the data they are presented.
  */
-fxBool
-Class1Modem::sendRTC(fxBool is2D)
+bool
+Class1Modem::sendRTC(bool is2D)
 {
     static const u_char RTC1D[9+20] =
        { 0x00,0x10,0x01,0x00,0x10,0x01,0x00,0x10,0x01 };
@@ -627,13 +627,13 @@ Class1Modem::sendRTC(fxBool is2D)
        { 0x00,0x18,0x00,0xC0,0x06,0x00,0x30,0x01,0x80,0x0C };
     protoTrace("SEND %s RTC", is2D ? "2D" : "1D");
     if (is2D)
-       return sendClass1Data(RTC2D, sizeof (RTC2D), frameRev, TRUE);
+       return sendClass1Data(RTC2D, sizeof (RTC2D), frameRev, true);
     else
-       return sendClass1Data(RTC1D, sizeof (RTC1D), frameRev, TRUE);
+       return sendClass1Data(RTC1D, sizeof (RTC1D), frameRev, true);
 }
 
 #define        EOLcheck(w,mask,code) \
-    if ((w & mask) == code) { w |= mask; return (TRUE); }
+    if ((w & mask) == code) { w |= mask; return (true); }
 
 /*
  * Check the last 24 bits of received T.4-encoded
@@ -642,7 +642,7 @@ Class1Modem::sendRTC(fxBool is2D)
  * to insure future calls do not re-recognize an
  * EOL code.
  */
-static fxBool
+static bool
 EOLcode(u_long& w)
 {
     if ((w & 0x00f00f) == 0) {
@@ -663,14 +663,14 @@ EOLcode(u_long& w)
        EOLcheck(w, 0xfc3f00, 0x002000);
        EOLcheck(w, 0xfe1f00, 0x001000);
     }
-    return (FALSE);
+    return (false);
 }
 #undef EOLcheck
 
 /*
  * Send a page of data.
  */
-fxBool
+bool
 Class1Modem::sendPage(TIFF* tif, const Class2Params& params, u_int pageChop, fxStr& emsg)
 {
     /*
@@ -682,9 +682,9 @@ Class1Modem::sendPage(TIFF* tif, const Class2Params& params, u_int pageChop, fxS
     fxStr tmCmd(curcap[HasShortTraining(curcap)].value, tmCmdFmt);
     if (!atCmd(tmCmd, AT_CONNECT)) {
        emsg = "Unable to establish message carrier";
-       return (FALSE);
+       return (false);
     }
-    fxBool rc = TRUE;
+    bool rc = true;
     protoTrace("SEND begin page");
     if (flowControl == FLOW_XONXOFF)
        setXONXOFF(FLOW_XONXOFF, FLOW_NONE, ACT_FLUSH);
@@ -701,7 +701,7 @@ Class1Modem::sendPage(TIFF* tif, const Class2Params& params, u_int pageChop, fxS
        /*
         * Setup tag line processing.
         */
-       fxBool doTagLine = setupTagLineSlop(params);
+       bool doTagLine = setupTagLineSlop(params);
        u_int ts = getTagLineSlop();
        /*
         * Calculate total amount of space needed to read
@@ -834,18 +834,18 @@ Class1Modem::sendPage(TIFF* tif, const Class2Params& params, u_int pageChop, fxS
 /*
  * Send the post-page-message and wait for a response.
  */
-fxBool
+bool
 Class1Modem::sendPPM(u_int ppm, HDLCFrame& mcf, fxStr& emsg)
 {
     for (int t = 0; t < 3; t++) {
        tracePPM("SEND send", ppm);
        if (transmitFrame(ppm|FCF_SNDR) && recvFrame(mcf, conf.t4Timer))
-           return (TRUE);
+           return (true);
        if (abortRequested())
-           return (FALSE);
+           return (false);
     }
     emsg = "No response to MPS or EOP repeated 3 tries";
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -855,7 +855,7 @@ void
 Class1Modem::sendEnd()
 {
     transmitFrame(FCF_DCN|FCF_SNDR);           // disconnect
-    setInputBuffering(TRUE);
+    setInputBuffering(true);
 }
 
 /*
index 28524402873937977de7b0a0bde68de361ebd96d..ec31dfb982325c206bfd208e5ecf16d0290fbb54 100644 (file)
@@ -54,17 +54,17 @@ Class2Modem::setupDefault(fxStr& s, const fxStr& configured, const char* def)
  * the manufacturer-specific bogosity here and leave
  * the remainder of the Class 2 support fairly generic.
  */
-fxBool
+bool
 Class2Modem::setupModem()
 {
     if (!selectBaudRate(conf.maxRate, conf.flowControl, conf.flowControl))
-       return (FALSE);
+       return (false);
     // Query service support information
     fxStr s;
     if (doQuery(conf.classQueryCmd, s, 500) && FaxModem::parseRange(s, modemServices))
        traceBits(modemServices & SERVICE_ALL, serviceNames);
     if ((modemServices & serviceType) == 0)
-       return (FALSE);
+       return (false);
     atCmd(classCmd);
 
     /*
@@ -91,7 +91,7 @@ Class2Modem::setupModem()
     fxStr t30parms;
     if (!doQuery(dccQueryCmd, t30parms, 500)) {
        serverTrace("Error getting modem capabilities");
-       return (FALSE);
+       return (false);
     }
     /*
      * Syntax: (vr),(br),(wd),(ln),(df),(ec),(bf),(st)
@@ -108,7 +108,7 @@ Class2Modem::setupModem()
     if (!parseRange(t30parms, modemParams)) {
        serverTrace("Error parsing " | dccQueryCmd | " response: "
            "\"" | t30parms | "\"");
-       return (FALSE);
+       return (false);
     }
     traceModemParams();
     /*
@@ -177,15 +177,15 @@ Class2Modem::setupModem()
      * during a transmission.  This went away in SP-2388-B and in
      * the final Class 2.0 spec.  Consequently we configure the
      * modem either to ignore it (Class 2.0) or to use whatever
-     * is configured (it defaults to TRUE).
+     * is configured (it defaults to true).
      */
     if (serviceType == SERVICE_CLASS20)
-       xmitWaitForXON = FALSE;
+       xmitWaitForXON = false;
     else
        xmitWaitForXON = conf.class2XmitWaitForXON;
 
     setupClass2Parameters();                   // send parameters to the modem
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -197,7 +197,7 @@ Class2Modem::setupModem()
  * 0.  This interface is used only for outbound use or when
  * followed by setup of receive-specific parameters.
  */
-fxBool
+bool
 Class2Modem::setupClass2Parameters()
 {
     if (modemServices & serviceType) {         // when resetting at startup
@@ -227,13 +227,13 @@ Class2Modem::setupClass2Parameters()
         */
        setupDCC();
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Setup receive-specific parameters.
  */
-fxBool
+bool
 Class2Modem::setupReceive()
 {
     /*
@@ -270,7 +270,7 @@ Class2Modem::setupReceive()
  * Send the modem any commands needed to force use of
  * the specified flow control scheme.
  */
-fxBool
+bool
 Class2Modem::setupFlowControl(FlowControl fc)
 {
     switch (fc) {
@@ -278,13 +278,13 @@ Class2Modem::setupFlowControl(FlowControl fc)
     case FLOW_XONXOFF: return atCmd(softFlowCmd);
     case FLOW_RTSCTS:  return atCmd(hardFlowCmd);
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Setup DCC to reflect best capabilities of the server.
  */
-fxBool
+bool
 Class2Modem::setupDCC()
 {
     params.vr = getBestVRes();
@@ -302,7 +302,7 @@ Class2Modem::setupDCC()
  * Parse a ``capabilities'' string from the modem and
  * return the values through the params parameter.
  */
-fxBool
+bool
 Class2Modem::parseClass2Capabilities(const char* cap, Class2Params& params)
 {
     int n = sscanf(cap, "%d,%d,%d,%d,%d,%d,%d,%d",
@@ -323,10 +323,10 @@ Class2Modem::parseClass2Capabilities(const char* cap, Class2Params& params)
        if (params.bf > BF_ENABLE)
            params.bf = BF_DISABLE;
        params.st = fxmin(params.st, (u_int) ST_40MS);
-       return (TRUE);
+       return (true);
     } else {
        protoTrace("MODEM protocol botch, can not parse \"%s\"", cap);
-       return (FALSE);
+       return (false);
     }
 }
 
@@ -334,13 +334,13 @@ Class2Modem::parseClass2Capabilities(const char* cap, Class2Params& params)
  * Place the modem into the appropriate state
  * for sending/received facsimile.
  */
-fxBool
+bool
 Class2Modem::faxService()
 {
     return setupClass2Parameters() && class2Cmd(lidCmd, lid);
 }
 
-fxBool
+bool
 Class2Modem::setupRevision(fxStr& revision)
 {
     if (FaxModem::setupRevision(revision)) {
@@ -355,12 +355,12 @@ Class2Modem::setupRevision(fxStr& revision)
                modemRevision.remove(0, pos);
            }
        }
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
-fxBool
+bool
 Class2Modem::setupModel(fxStr& model)
 {
     if (FaxModem::setupModel(model)) {
@@ -370,12 +370,12 @@ Class2Modem::setupModel(fxStr& model)
         */
        if (modemMfr == "ZYXEL")
            modemModel.resize(modemModel.next(0, ' ')); // model is first word
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
-fxBool
+bool
 Class2Modem::supportsPolling() const
 {
     return (hasPolling);
@@ -425,7 +425,7 @@ Class2Modem::setLID(const fxStr& number)
 /*
  * Reset a Class 2 modem.
  */
-fxBool
+bool
 Class2Modem::reset(long ms)
 {
     return (FaxModem::reset(ms) && setupClass2Parameters());
@@ -439,13 +439,13 @@ Class2Modem::reset(long ms)
  * us an unsolicited NO CARRIER message.  Isn't life
  * wondeful?
  */
-fxBool
+bool
 Class2Modem::waitFor(ATResponse wanted, long ms)
 {
     for (;;) {
        ATResponse response = atResponse(rbuf, ms);
        if (response == wanted)
-           return (TRUE);
+           return (true);
        switch (response) {
        case AT_TIMEOUT:
        case AT_EMPTYLINE:
@@ -454,7 +454,7 @@ Class2Modem::waitFor(ATResponse wanted, long ms)
        case AT_NODIALTONE:
        case AT_NOANSWER:
            modemTrace("MODEM %s", ATresponses[response]);
-           return (FALSE);
+           return (false);
        case AT_FHNG:
            // return hangup status, but try to wait for requested response
            { char buf[1024]; (void) atResponse(buf, 2*1000); }
@@ -470,7 +470,7 @@ Class2Modem::waitFor(ATResponse wanted, long ms)
 /*
  * Send <cmd>=<a0> and wait for response.
  */
-fxBool
+bool
 Class2Modem::class2Cmd(const fxStr& cmd, int a0, ATResponse r, long ms)
 {
     return atCmd(cmd | fxStr(a0, "=%u"), r, ms);
@@ -479,7 +479,7 @@ Class2Modem::class2Cmd(const fxStr& cmd, int a0, ATResponse r, long ms)
 /*
  * Send <cmd>=<t.30 parameters> and wait response.
  */
-fxBool
+bool
 Class2Modem::class2Cmd(const fxStr& cmd, const Class2Params& p, ATResponse r, long ms)
 {
     return atCmd(cmd | "=" | p.cmd(), r, ms);
@@ -488,7 +488,7 @@ Class2Modem::class2Cmd(const fxStr& cmd, const Class2Params& p, ATResponse r, lo
 /*
  * Send <cmd>="<s>" and wait for response.
  */
-fxBool
+bool
 Class2Modem::class2Cmd(const fxStr& cmd, const fxStr& s, ATResponse r, long ms)
 {
     return atCmd(cmd | "=\"" | s | "\"", r, ms);       // XXX handle escapes
@@ -498,11 +498,11 @@ Class2Modem::class2Cmd(const fxStr& cmd, const fxStr& s, ATResponse r, long ms)
  * Parse a Class 2 parameter specification
  * and return the resulting bit masks.
  */
-fxBool
+bool
 Class2Modem::parseRange(const char* cp, Class2Params& p)
 {
     if (!vparseRange(cp, 8, &p.vr,&p.br,&p.wd,&p.ln,&p.df,&p.ec,&p.bf,&p.st))
-       return (FALSE);
+       return (false);
     p.vr &= VR_ALL;
     p.br &= BR_ALL;
     p.wd &= WD_ALL;
@@ -511,7 +511,7 @@ Class2Modem::parseRange(const char* cp, Class2Params& p)
     p.ec &= EC_ALL;
     p.bf &= BF_ALL;
     p.st &= ST_ALL;
-    return TRUE;
+    return true;
 }
 
 const char*
@@ -652,7 +652,7 @@ Class2Modem::processHangup(const char* cp)
  * that the remote side hung up the phone in a
  * "normal and proper way".
  */
-fxBool
+bool
 Class2Modem::isNormalHangup()
 {
     // normal hangup is "", "0", or "00"
index d92b65269ecc8e60e2d779502ae71f626e5ed551..02b1e8baef5854907a3e2d5b0f5f119f92dbacb3 100644 (file)
@@ -61,36 +61,36 @@ protected:
     u_int      serviceType;            // modem service required
     u_int      modemCQ;                // copy quality capabilities mask
 
-    fxBool     xmitWaitForXON;         // if true, wait for XON when sending
-    fxBool     hostDidCQ;              // if true, copy quality done on host
-    fxBool     hasPolling;             // if true, modem does polled recv
+    bool       xmitWaitForXON;         // if true, wait for XON when sending
+    bool       hostDidCQ;              // if true, copy quality done on host
+    bool       hasPolling;             // if true, modem does polled recv
     char       recvDataTrigger;        // char to send to start recv'ing data
     char       hangupCode[4];          // hangup reason (from modem)
-    fxBool     hadHangup;              // true if +FHNG:/+FHS: received
+    bool       hadHangup;              // true if +FHNG:/+FHS: received
     const u_char* rtcRev;              // bit reversal table for RTC
     fxStr      lid;                    // prepared local identifier string
 
 // modem setup stuff
     void setupDefault(fxStr&, const fxStr&, const char*);
-    virtual fxBool setupModem();
-    virtual fxBool setupModel(fxStr& model);
-    virtual fxBool setupRevision(fxStr& rev);
-    virtual fxBool setupDCC();
-    virtual fxBool setupClass2Parameters();
-    virtual fxBool setupFlowControl(FlowControl fc);
+    virtual bool setupModem();
+    virtual bool setupModel(fxStr& model);
+    virtual bool setupRevision(fxStr& rev);
+    virtual bool setupDCC();
+    virtual bool setupClass2Parameters();
+    virtual bool setupFlowControl(FlowControl fc);
 // transmission support
-    fxBool     dataTransfer();
-    fxBool     sendRTC(fxBool is2D);
-    fxBool     sendPageData(TIFF* tif, u_int pageChop);
+    bool       dataTransfer();
+    bool       sendRTC(bool is2D);
+    bool       sendPageData(TIFF* tif, u_int pageChop);
 
-    virtual fxBool sendPage(TIFF* tif, u_int pageChop) = 0;
-    virtual fxBool pageDone(u_int ppm, u_int& ppr) = 0;
+    virtual bool sendPage(TIFF* tif, u_int pageChop) = 0;
+    virtual bool pageDone(u_int ppm, u_int& ppr) = 0;
 // reception support
     const AnswerMsg* findAnswer(const char*);
-    fxBool     recvDCS(const char*);
-    fxBool     recvPageData(TIFF*, fxStr& emsg);
-    fxBool     recvPPM(TIFF*, int& ppr);
-    fxBool     parseFPTS(TIFF*, const char* cp, int& ppr);
+    bool       recvDCS(const char*);
+    bool       recvPageData(TIFF*, fxStr& emsg);
+    bool       recvPPM(TIFF*, int& ppr);
+    bool       parseFPTS(TIFF*, const char* cp, int& ppr);
     void       abortPageRecv();
 // miscellaneous
     enum {                     // Class 2-specific AT responses
@@ -111,24 +111,24 @@ protected:
        AT_FPW          = 114   // password status
     };
     virtual ATResponse atResponse(char* buf, long ms = 30*1000) = 0;
-    fxBool     waitFor(ATResponse wanted, long ms = 30*1000);
+    bool       waitFor(ATResponse wanted, long ms = 30*1000);
     fxStr      stripQuotes(const char*);
 // hangup processing
     void       processHangup(const char*);
-    fxBool     isNormalHangup();
+    bool       isNormalHangup();
     const char*        hangupCause(const char* code);
     void       tracePPR(const char* dir, u_int ppr);
     void       tracePPM(const char* dir, u_int ppm);
 // class 2 command support routines
-    fxBool     class2Cmd(const fxStr& cmd, int a0,
+    bool       class2Cmd(const fxStr& cmd, int a0,
                    ATResponse = AT_OK, long ms = 30*1000);
-    fxBool     class2Cmd(const fxStr& cmd, const fxStr& a0,
+    bool       class2Cmd(const fxStr& cmd, const fxStr& a0,
                    ATResponse = AT_OK, long ms = 30*1000);
-    fxBool     class2Cmd(const fxStr& cmd, const Class2Params&,
+    bool       class2Cmd(const fxStr& cmd, const Class2Params&,
                    ATResponse =AT_OK, long ms = 30*1000);
 // parsing routines for capability&parameter strings
-    fxBool     parseClass2Capabilities(const char* cap, Class2Params&);
-    fxBool     parseRange(const char*, Class2Params&);
+    bool       parseClass2Capabilities(const char* cap, Class2Params&);
+    bool       parseRange(const char*, Class2Params&);
     const char* skipStatus(const char*);
 
     Class2Modem(FaxServer&, const ModemConfig&);
@@ -136,29 +136,29 @@ public:
     virtual ~Class2Modem();
 
 // send support
-    fxBool     sendSetup(FaxRequest&, const Class2Params&, fxStr& emsg);
+    bool       sendSetup(FaxRequest&, const Class2Params&, fxStr& emsg);
     CallStatus dialResponse(fxStr& emsg);
-    FaxSendStatus getPrologue(Class2Params&, fxBool&, fxStr&);
+    FaxSendStatus getPrologue(Class2Params&, bool&, fxStr&);
     FaxSendStatus sendPhaseB(TIFF* tif, Class2Params&, FaxMachineInfo&,
                    fxStr& pph, fxStr& emsg);
     void       sendAbort();
 
 // receive support
-    fxBool     setupReceive();
-    fxBool     recvBegin(fxStr& emsg);
-    fxBool     recvPage(TIFF*, int& ppm, fxStr& emsg);
-    fxBool     recvEnd(fxStr& emsg);
+    bool       setupReceive();
+    bool       recvBegin(fxStr& emsg);
+    bool       recvPage(TIFF*, int& ppm, fxStr& emsg);
+    bool       recvEnd(fxStr& emsg);
     void       recvAbort();
 
 // polling support
-    fxBool     requestToPoll(fxStr& emsg);
-    fxBool     pollBegin(const fxStr& cig, const fxStr& sep, const fxStr& pwd,
+    bool       requestToPoll(fxStr& emsg);
+    bool       pollBegin(const fxStr& cig, const fxStr& sep, const fxStr& pwd,
                    fxStr& emsg);
 
 // miscellaneous
-    fxBool     faxService();                   // switch to fax mode
-    fxBool     reset(long ms);                 // reset modem
+    bool       faxService();                   // switch to fax mode
+    bool       reset(long ms);                 // reset modem
     void       setLID(const fxStr& number);    // set local id string
-    fxBool     supportsPolling() const;        // modem capability
+    bool       supportsPolling() const;        // modem capability
 };
 #endif /* _CLASS2_ */
index 749cdb48e557c24d706ab5db9b04d18251f6626b..b72e3665d9799985303d71810dc0bcf7678e2eaf 100644 (file)
@@ -75,7 +75,7 @@ Class20Modem::atResponse(char* buf, long ms)
        if (strneq(buf, "+FHS:", 5)) {
            processHangup(buf+5);
            lastResponse = AT_FHNG;
-           hadHangup = TRUE;
+           hadHangup = true;
        } else if (strneq(buf, "+FCO", 4))
            lastResponse = AT_FCON;
        else if (strneq(buf, "+FPO", 4))
@@ -122,13 +122,13 @@ Class20Modem::abortDataTransfer()
 /*
  * Send a page of data using the ``stream interface''.
  */
-fxBool
+bool
 Class20Modem::sendPage(TIFF* tif, u_int pageChop)
 {
     protoTrace("SEND begin page");
     if (flowControl == FLOW_XONXOFF)
        setXONXOFF(FLOW_XONXOFF, FLOW_NONE, ACT_FLUSH);
-    fxBool rc = sendPageData(tif, pageChop);
+    bool rc = sendPageData(tif, pageChop);
     if (!rc)
        abortDataTransfer();
     else
@@ -146,7 +146,7 @@ Class20Modem::sendPage(TIFF* tif, u_int pageChop)
  * instead synthesize codes, ignoring whether or not the
  * modem does retraining on the next page transfer.
  */
-fxBool
+bool
 Class20Modem::pageDone(u_int ppm, u_int& ppr)
 {
     static char ppmCodes[3] = { 0x2C, 0x3B, 0x2E };
@@ -161,14 +161,14 @@ Class20Modem::pageDone(u_int ppm, u_int& ppr)
            switch (atResponse(rbuf, conf.pageDoneTimeout)) {
            case AT_FHNG:
                if (!isNormalHangup())
-                   return (FALSE);
+                   return (false);
                /* fall thru... */
            case AT_OK:                         // page data good
                ppr = PPR_MCF;                  // could be PPR_RTP/PPR_PIP
-               return (TRUE);
+               return (true);
            case AT_ERROR:                      // page data bad
                ppr = PPR_RTN;                  // could be PPR_PIN
-               return (TRUE);
+               return (true);
            case AT_EMPTYLINE:
            case AT_TIMEOUT:
            case AT_NOCARRIER:
@@ -180,7 +180,7 @@ Class20Modem::pageDone(u_int ppm, u_int& ppr)
     }
 bad:
     processHangup("50");                       // Unspecified Phase D error
-    return (FALSE);
+    return (false);
 }
 
 /*
index ec722673a92452ccf5802f61f70da67f0fbbe03c..2f5cc305c4dca747a7d658b167a801998b8bec15 100644 (file)
@@ -33,8 +33,8 @@
 class Class20Modem : public Class2Modem {
 protected:
 // transmission support
-    fxBool     sendPage(TIFF* tif, u_int pageChop);
-    fxBool     pageDone(u_int ppm, u_int& ppr);
+    bool       sendPage(TIFF* tif, u_int pageChop);
+    bool       pageDone(u_int ppm, u_int& ppr);
 
     void       abortDataTransfer();
 // reception support
index 7f26280498e62e1890abe176859d49f1eeb17b58..eb409f3a1a0a873aecf9b8496c0a302fe9f7b017 100644 (file)
@@ -70,7 +70,7 @@ Class2ErsatzModem::atResponse(char* buf, long ms)
        if (strneq(buf, "+FHNG:", 6)) {
            processHangup(buf+6);
            lastResponse = AT_FHNG;
-           hadHangup = TRUE;
+           hadHangup = true;
        } else if (strneq(buf, "+FCON", 5))
            lastResponse = AT_FCON;
        else if (strneq(buf, "+FPOLL", 6))
@@ -104,7 +104,7 @@ Class2ErsatzModem::atResponse(char* buf, long ms)
 /*
  * Handle the page-end protocol.
  */
-fxBool
+bool
 Class2ErsatzModem::pageDone(u_int ppm, u_int& ppr)
 {
     ppr = 0;                   // something invalid
@@ -115,7 +115,7 @@ Class2ErsatzModem::pageDone(u_int ppm, u_int& ppr)
                if (sscanf(rbuf+6, "%u", &ppr) != 1) {
                    protoTrace("MODEM protocol botch (\"%s\"), %s",
                        rbuf, "can not parse PPR");
-                   return (FALSE);             // force termination
+                   return (false);             // force termination
                }
                /*
                 * (In some firmware revisions...) The ZyXEL modem
@@ -129,11 +129,11 @@ Class2ErsatzModem::pageDone(u_int ppm, u_int& ppr)
                 * page is good (i.e. we would hang up immediately anyway).
                 */
                if (ppm == PPM_EOP && ppr == PPR_MCF)
-                   return (TRUE);
+                   return (true);
                break;
            case AT_OK:                         // normal result code
            case AT_ERROR:                      // possible if page retransmit
-               return (TRUE);
+               return (true);
            case AT_FHNG:
                /*
                 * Certain modems respond +FHNG:0 on the final page
@@ -144,7 +144,7 @@ Class2ErsatzModem::pageDone(u_int ppm, u_int& ppr)
                 */
                if (ppm == PPM_EOP && ppr == 0 && isNormalHangup()) {
                    ppr = PPR_MCF;
-                   return (TRUE);
+                   return (true);
                }
                return (isNormalHangup());
            case AT_EMPTYLINE:
@@ -158,7 +158,7 @@ Class2ErsatzModem::pageDone(u_int ppm, u_int& ppr)
     }
 bad:
     processHangup("50");                       // Unspecified Phase D error
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -175,7 +175,7 @@ Class2ErsatzModem::abortDataTransfer()
 /*
  * Send an end-of-transmission signal to the modem.
  */
-fxBool
+bool
 Class2ErsatzModem::sendEOT()
 {
     static char EOT[] = { DLE, ETX };
@@ -185,13 +185,13 @@ Class2ErsatzModem::sendEOT()
 /*
  * Send a page of data using the ``stream interface''.
  */
-fxBool
+bool
 Class2ErsatzModem::sendPage(TIFF* tif, u_int pageChop)
 {
     protoTrace("SEND begin page");
     if (flowControl == FLOW_XONXOFF)
        setXONXOFF(FLOW_XONXOFF, FLOW_NONE, ACT_FLUSH);
-    fxBool rc = sendPageData(tif, pageChop);
+    bool rc = sendPageData(tif, pageChop);
     if (rc && conf.class2SendRTC)
        rc = sendRTC(params.is2D());
     if (rc)
index f6cf53c0b8d59707fc1f2759d346fac3093f39ba..e0854920112bc423cdacb03e82751ce1c568b461 100644 (file)
 class Class2ErsatzModem : public Class2Modem {
 protected:
 // transmission support
-    fxBool     sendPage(TIFF* tif, u_int pageChop);
-    fxBool     pageDone(u_int ppm, u_int& ppr);
+    bool       sendPage(TIFF* tif, u_int pageChop);
+    bool       pageDone(u_int ppm, u_int& ppr);
 
-    fxBool     sendEOT();
+    bool       sendEOT();
     void       abortDataTransfer();
 // miscellaneous
     virtual ATResponse atResponse(char* buf, long ms = 30*1000);
index ab791cfbaa1600a92b46227de060ec5e8561214a..96e93ae105f8f6d00153cb1796b8ed760348f14b 100644 (file)
 /*
  * Request to poll remote documents.
  */
-fxBool
+bool
 Class2Modem::requestToPoll(fxStr& emsg)
 {
     if (!class2Cmd(splCmd, 1)) {
        emsg = "Unable to request polling operation"
            " (modem may not support polling)";
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 /*
  * Startup a polled receive operation.
  */
-fxBool
+bool
 Class2Modem::pollBegin(const fxStr& cig, const fxStr& sep, const fxStr& pwd, fxStr& emsg)
 {
     const char* cmdFailed = "Unable to setup %s (modem command failed)";
 
     if (!class2Cmd(cigCmd, cig)) {             // set polling ID
        emsg = fxStr::format(cmdFailed, "polling identifer");
-       return (FALSE);
+       return (false);
     }
     if (sep != "" && paCmd != "" && !class2Cmd(paCmd, sep)) {
        emsg = fxStr::format(cmdFailed, "selective polling address");
-       return (FALSE);
+       return (false);
     }
     if (pwd != "" && pwCmd != "" && !class2Cmd(pwCmd, pwd)) {
        emsg = fxStr::format(cmdFailed, "polling password");
-       return (FALSE);
+       return (false);
     }
-    return (TRUE);
+    return (true);
 }
index afaf87398fcb5e7b2c4f013918407f35e4b603ce..3fdb2f55e82cb37775d986d400eddaaf10c803a5 100644 (file)
@@ -56,12 +56,12 @@ Class2Modem::findAnswer(const char* s)
 /*
  * Begin a fax receive session.
  */
-fxBool
+bool
 Class2Modem::recvBegin(fxStr& emsg)
 {
-    fxBool status = FALSE;
+    bool status = false;
     hangupCode[0] = '\0';
-    hadHangup = FALSE;
+    hadHangup = false;
     ATResponse r;
     do {
        switch (r = atResponse(rbuf, 3*60*1000)) {
@@ -73,7 +73,7 @@ Class2Modem::recvBegin(fxStr& emsg)
        case AT_EMPTYLINE:
            processHangup("70");
            emsg = hangupCause(hangupCode);
-           return (FALSE);
+           return (false);
        case AT_FNSS:
            // XXX parse and pass on to server
            break;
@@ -95,7 +95,7 @@ Class2Modem::recvBegin(fxStr& emsg)
            status = recvDCS(rbuf);
            break;
        case AT_FHNG:
-           status = FALSE;
+           status = false;
            break;
        }
     } while (r != AT_OK);
@@ -107,16 +107,16 @@ Class2Modem::recvBegin(fxStr& emsg)
 /*
  * Process a received DCS.
  */
-fxBool
+bool
 Class2Modem::recvDCS(const char* cp)
 {
     if (parseClass2Capabilities(skipStatus(cp), params)) {
        setDataTimeout(60, params.br);
        FaxModem::recvDCS(params);      // announce session params
-       return (TRUE);
+       return (true);
     } else {                           // protocol botch
        processHangup("72");            // XXX "COMREC error"
-       return (FALSE);
+       return (false);
     }
 }
 
@@ -125,7 +125,7 @@ Class2Modem::recvDCS(const char* cp)
  * and then collect the data.  Return the
  * received post-page-message.
  */
-fxBool
+bool
 Class2Modem::recvPage(TIFF* tif, int& ppm, fxStr& emsg)
 {
     int ppr;
@@ -201,7 +201,7 @@ Class2Modem::recvPage(TIFF* tif, int& ppm, fxStr& emsg)
        if (abortRequested()) {
            // XXX no way to purge TIFF directory
            emsg = "Receive aborted due to operator intervention";
-           return (FALSE);
+           return (false);
        }
        // XXX deal with PRI interrupts
        /*
@@ -218,13 +218,13 @@ Class2Modem::recvPage(TIFF* tif, int& ppm, fxStr& emsg)
            recvResetPage(tif);         // reset to overwrite data
        tracePPR("RECV send", ppr);
        if (ppr & 1)                    // page good, work complete
-           return (TRUE);
+           return (true);
     } while (!hostDidCQ || class2Cmd(ptsCmd, ppr));
 bad:
     if (hangupCode[0] == 0)
        processHangup("90");                    // "Unspecified Phase C error"
     emsg = hangupCause(hangupCode);
-    return (FALSE);
+    return (false);
 }
 
 void
@@ -237,7 +237,7 @@ Class2Modem::abortPageRecv()
 /*
  * Receive Phase C data using the Class 2 ``stream interface''.
  */
-fxBool
+bool
 Class2Modem::recvPageData(TIFF* tif, fxStr& emsg)
 {
     if (flowControl == FLOW_XONXOFF)
@@ -251,7 +251,7 @@ Class2Modem::recvPageData(TIFF* tif, fxStr& emsg)
      * parameters indicate CQ checking is to be done.
      */
     hostDidCQ = (modemCQ && BIT(params.df)) == 0 && checkQuality();
-    fxBool pageRecvd = recvPageDLEData(tif, hostDidCQ, params, emsg);
+    bool pageRecvd = recvPageDLEData(tif, hostDidCQ, params, emsg);
 
     // be careful about flushing here -- otherwise we lose +FPTS codes
     if (flowControl == FLOW_XONXOFF)
@@ -262,7 +262,7 @@ Class2Modem::recvPageData(TIFF* tif, fxStr& emsg)
     return (pageRecvd);
 }
 
-fxBool
+bool
 Class2Modem::recvPPM(TIFF* tif, int& ppr)
 {
     for (;;) {
@@ -277,21 +277,21 @@ Class2Modem::recvPPM(TIFF* tif, int& ppr)
        case AT_NOANSWER:
        case AT_ERROR:
            processHangup("50");
-           return (FALSE);
+           return (false);
        case AT_FPTS:
            return parseFPTS(tif, skipStatus(rbuf), ppr);
        case AT_FET:
            protoTrace("MODEM protocol botch: +FET: without +FPTS:");
            processHangup("100");               // "Unspecified Phase D error"
-           return (FALSE);
+           return (false);
        case AT_FHNG:
            waitFor(AT_OK);                     // resynchronize modem
-           return (FALSE);
+           return (false);
        }
     }
 }
 
-fxBool
+bool
 Class2Modem::parseFPTS(TIFF* tif, const char* cp, int& ppr)
 {
     int lc = 0;
@@ -307,19 +307,19 @@ Class2Modem::parseFPTS(TIFF* tif, const char* cp, int& ppr)
            TIFFSetField(tif, TIFFTAG_BADFAXLINES, (u_long) blc);
            TIFFSetField(tif, TIFFTAG_CONSECUTIVEBADFAXLINES, cblc);
        }
-       return (TRUE);
+       return (true);
     } else {
        protoTrace("MODEM protocol botch: \"%s\"; can not parse line count",
            cp);
        processHangup("100");           // "Unspecified Phase D error"
-       return (FALSE);
+       return (false);
     }
 }
 
 /*
  * Complete a receive session.
  */
-fxBool
+bool
 Class2Modem::recvEnd(fxStr&)
 {
     if (!hadHangup) {
@@ -329,7 +329,7 @@ Class2Modem::recvEnd(fxStr&)
        } else
            (void) atCmd(abortCmd);             // abort session
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
index be90577b654bf60477a4e3acba2fd9666aa941aa..70a65faa4bc8a6de10c123179b760d481b28eabc 100644 (file)
@@ -32,7 +32,7 @@
  * Send Protocol for Class-2-style modems.
  */
 
-fxBool
+bool
 Class2Modem::sendSetup(FaxRequest& req, const Class2Params& dis, fxStr& emsg)
 {
     const char* cmdFailed = " (modem command failed)";
@@ -48,26 +48,26 @@ Class2Modem::sendSetup(FaxRequest& req, const Class2Params& dis, fxStr& emsg)
      */
     if (req.passwd != "" && pwCmd != "" && !class2Cmd(pwCmd, req.passwd)) {
        emsg = fxStr::format("Unable to send password%s", cmdFailed);
-       return (FALSE);
+       return (false);
     }
     if (req.subaddr != "" && saCmd != "" && !class2Cmd(saCmd, req.subaddr)) {
        emsg = fxStr::format("Unable to send subaddress%s", cmdFailed);
-       return (FALSE);
+       return (false);
     }
     if (minsp != BR_2400 && !class2Cmd(minspCmd, minsp)) {
        emsg = fxStr::format("Unable to restrict minimum transmit speed to %s",
            Class2Params::bitRateNames[req.minsp], cmdFailed);
-       return (FALSE);
+       return (false);
     }
     if (conf.class2DDISCmd != "") {
        if (!class2Cmd(conf.class2DDISCmd, dis)) {
            emsg = fxStr::format("Unable to setup session parameters "
                "prior to call%s", cmdFailed);
-           return (FALSE);
+           return (false);
        }
        params = dis;
     }
-    hadHangup = FALSE;
+    hadHangup = false;
     return (FaxModem::sendSetup(req, dis, emsg));
 }
 
@@ -117,14 +117,14 @@ Class2Modem::dialResponse(fxStr& emsg)
  * sent to the caller on connecting to a fax machine.
  */
 FaxSendStatus
-Class2Modem::getPrologue(Class2Params& dis, fxBool& hasDoc, fxStr& emsg)
+Class2Modem::getPrologue(Class2Params& dis, bool& hasDoc, fxStr& emsg)
 {
-    fxBool gotParams = FALSE;
-    hasDoc = FALSE;
+    bool gotParams = false;
+    hasDoc = false;
     for (;;) {
        switch (atResponse(rbuf, conf.t1Timer)) {
        case AT_FPOLL:
-           hasDoc = TRUE;
+           hasDoc = true;
            protoTrace("REMOTE has document to POLL");
            break;
        case AT_FDIS:
@@ -161,10 +161,10 @@ Class2Modem::getPrologue(Class2Params& dis, fxBool& hasDoc, fxStr& emsg)
  * wait for an XON from the modem in response to the +FDT,
  * before actually sending any data.
  */
-fxBool
+bool
 Class2Modem::dataTransfer()
 {
-    fxBool status;
+    bool status;
     if (xmitWaitForXON) {
        /*
         * Wait for XON (DC1) from the modem after receiving
@@ -195,7 +195,7 @@ Class2Modem::dataTransfer()
     return (status);
 }
 
-static fxBool
+static bool
 pageInfoChanged(const Class2Params& a, const Class2Params& b)
 {
     return (a.vr != b.vr || a.wd != b.wd || a.ln != b.ln || a.df != b.df || a.br != b.br);
@@ -215,10 +215,10 @@ Class2Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info,
     setDataTimeout(60, next.br);       // 60 seconds for 1024 byte writes
     hangupCode[0] = '\0';
 
-    fxBool transferOK;
-    fxBool morePages = FALSE;
+    bool transferOK;
+    bool morePages = false;
     do {
-       transferOK = FALSE;
+       transferOK = false;
        if (abortRequested())
             goto failed;
        /*
@@ -273,7 +273,7 @@ Class2Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info,
                            return (status);
                        }
                    }
-                   transferOK = TRUE;
+                   transferOK = true;
                    break;
                case PPR_RTN:           // page bad, retrain requested
                    if (++ntrys >= 3) {
@@ -287,8 +287,8 @@ Class2Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info,
                        break;
                    }
                    next.br--;
-                   morePages = TRUE;   // retransmit page
-                   transferOK = TRUE;
+                   morePages = true;   // retransmit page
+                   transferOK = true;
                    break;
                case PPR_PIN:           // page bad, interrupt requested
                    emsg = "Unable to transmit page"
@@ -316,7 +316,7 @@ Class2Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info,
         * +FHNG:0).  Setup an error return so that the job will
         * be retried.
         */
-       transferOK = FALSE;
+       transferOK = false;
        emsg = "Communication failure during Phase B/C (modem protocol botch)";
     }
     return (transferOK ? send_ok : send_retry);
@@ -336,10 +336,10 @@ failed:
  * is done to avoid timing problems when the document
  * is comprised of multiple strips.
  */
-fxBool
+bool
 Class2Modem::sendPageData(TIFF* tif, u_int pageChop)
 {
-    fxBool rc = TRUE;
+    bool rc = true;
 
     tstrip_t nstrips = TIFFNumberOfStrips(tif);
     if (nstrips > 0) {
@@ -353,7 +353,7 @@ Class2Modem::sendPageData(TIFF* tif, u_int pageChop)
        /*
         * Setup tag line processing.
         */
-       fxBool doTagLine = setupTagLineSlop(params);
+       bool doTagLine = setupTagLineSlop(params);
        u_int ts = getTagLineSlop();
        /*
         * Calculate total amount of space needed to read
@@ -400,8 +400,8 @@ Class2Modem::sendPageData(TIFF* tif, u_int pageChop)
 /*
  * Send RTC to terminate a page.
  */
-fxBool
-Class2Modem::sendRTC(fxBool is2D)
+bool
+Class2Modem::sendRTC(bool is2D)
 {
     static const u_char RTC1D[9] =
        { 0x00,0x10,0x01,0x00,0x10,0x01,0x00,0x10,0x01 };
index dede86c9bbe64350b1537cb93d557b7de36be753..c3dbb81fce0212529ae9ea583a07c097972c26a0 100644 (file)
@@ -158,7 +158,7 @@ ClassModem::~ClassModem()
  * Default methods for modem driver interface.
  */
 
-fxBool
+bool
 ClassModem::dataService()
 {
     return atCmd(conf.class0Cmd);
@@ -180,7 +180,7 @@ ClassModem::dial(const char* number, fxStr& emsg)
 /*
  * Status messages to ignore when dialing.
  */
-fxBool
+bool
 ClassModem::isNoise(const char* s)
 {
     static const char* noiseMsgs[] = {
@@ -194,8 +194,8 @@ ClassModem::isNoise(const char* s)
 
     for (u_int i = 0; i < NNOISE; i++)
        if (strneq(s, noiseMsgs[i], strlen(noiseMsgs[i])))
-           return (TRUE);
-    return (FALSE);
+           return (true);
+    return (false);
 }
 #undef NNOISE
 
@@ -462,13 +462,13 @@ ClassModem::getModemLine(char buf[], u_int bufSize, long ms)
 int ClassModem::getModemChar(long ms) { return server.getModemChar(ms); }
 int ClassModem::getModemDataChar()    { return server.getModemChar(dataTimeout); }
 
-fxBool
+bool
 ClassModem::putModemDLEData(const u_char* data, u_int cc, const u_char* bitrev, long ms)
 {
     u_char dlebuf[2*1024];
     while (cc > 0) {
        if (wasTimeout() || abortRequested())
-           return (FALSE);
+           return (false);
        /*
         * Copy to temp buffer, doubling DLE's.
         */
@@ -480,21 +480,21 @@ ClassModem::putModemDLEData(const u_char* data, u_int cc, const u_char* bitrev,
                dlebuf[++j] = DLE;
        }
        if (!putModem(dlebuf, j, ms))
-           return (FALSE);
+           return (false);
        data += n;
        cc -= n;
     }
-    return (TRUE);
+    return (true);
 }
 
 void ClassModem::flushModemInput()
     { server.modemFlushInput(); }
-fxBool ClassModem::putModem(void* d, int n, long ms)
+bool ClassModem::putModem(void* d, int n, long ms)
     { return server.putModem(d, n, ms); }
-fxBool ClassModem::putModemData(void* d, int n)
+bool ClassModem::putModemData(void* d, int n)
     { return server.putModem(d, n, dataTimeout); }
 
-fxBool
+bool
 ClassModem::putModemLine(const char* cp)
 {
     u_int cc = strlen(cp);
@@ -528,7 +528,7 @@ ClassModem::pause(u_int ms)
 /*
  * Reset the modem and set the DTE-DCE rate.
  */
-fxBool
+bool
 ClassModem::selectBaudRate(BaudRate br, FlowControl i, FlowControl o)
 {
     rate = br;
@@ -537,19 +537,19 @@ ClassModem::selectBaudRate(BaudRate br, FlowControl i, FlowControl o)
     return (reset(5*1000) || reset(5*1000));   // NB: try at most twice
 }
 
-fxBool ClassModem::sendBreak(fxBool pause)
+bool ClassModem::sendBreak(bool pause)
     { return server.sendBreak(pause); }
-fxBool
+bool
 ClassModem::setBaudRate(BaudRate r)
 {
     if (server.setBaudRate(r)) {
        if (conf.baudRateDelay)
            pause(conf.baudRateDelay);
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
-fxBool
+bool
 ClassModem::setBaudRate(BaudRate r, FlowControl i, FlowControl o)
 {
     iFlow = i;
@@ -558,11 +558,11 @@ ClassModem::setBaudRate(BaudRate r, FlowControl i, FlowControl o)
     if (server.setBaudRate(r,i,o)) {
        if (conf.baudRateDelay)
            pause(conf.baudRateDelay);
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
-fxBool
+bool
 ClassModem::setXONXOFF(FlowControl i, FlowControl o, SetAction a)
 {
     iFlow = i;
@@ -570,24 +570,24 @@ ClassModem::setXONXOFF(FlowControl i, FlowControl o, SetAction a)
     return server.setXONXOFF(i, o, a);
 }
 
-fxBool ClassModem::setDTR(fxBool onoff)
+bool ClassModem::setDTR(bool onoff)
     { return server.setDTR(onoff); }
-fxBool ClassModem::setInputBuffering(fxBool onoff)
+bool ClassModem::setInputBuffering(bool onoff)
     { return server.setInputBuffering(onoff); }
-fxBool ClassModem::modemStopOutput()
+bool ClassModem::modemStopOutput()
     { return server.modemStopOutput(); }
 
 /*
  * Miscellaneous server interfaces hooks.
  */
 
-fxBool ClassModem::abortRequested()
+bool ClassModem::abortRequested()
     { return server.abortRequested(); }
 
-void ClassModem::beginTimedTransfer()          { server.timeout = FALSE; }
+void ClassModem::beginTimedTransfer()          { server.timeout = false; }
 void ClassModem::endTimedTransfer()            {}
-fxBool ClassModem::wasTimeout()                        { return server.timeout; }
-void ClassModem::setTimeout(fxBool b)          { server.timeout = b; }
+bool ClassModem::wasTimeout()                  { return server.timeout; }
+void ClassModem::setTimeout(bool b)            { server.timeout = b; }
 
 /*
  * Parsing support routines.
@@ -633,12 +633,12 @@ ClassModem::trimModemLine(char buf[], int& cc)
 /* 
  * Hayes-style modem manipulation support.
  */
-fxBool
+bool
 ClassModem::reset(long ms)
 {
-    setDTR(FALSE);
+    setDTR(false);
     pause(conf.resetDelay);            // pause so modem can do reset
-    setDTR(TRUE);
+    setDTR(true);
 #ifndef CONFIG_NOREOPEN
     /*
      * On some systems lowering and raising DTR is not done
@@ -648,12 +648,12 @@ ClassModem::reset(long ms)
     server.reopenDevice();
 #endif
     if (!setBaudRate(rate, iFlow, oFlow))
-       return (FALSE);
+       return (false);
     flushModemInput();
     return atCmd(resetCmds, AT_OK, ms);
 }
 
-fxBool
+bool
 ClassModem::sync(long ms)
 {
     return waitFor(AT_OK, ms);
@@ -662,7 +662,7 @@ ClassModem::sync(long ms)
 ATResponse
 ClassModem::atResponse(char* buf, long ms)
 {
-    fxBool prevTimeout = wasTimeout();
+    bool prevTimeout = wasTimeout();
     int n = getModemLine(buf, sizeof (rbuf), ms);
     if (!prevTimeout && wasTimeout())
        lastResponse = AT_TIMEOUT;
@@ -718,12 +718,12 @@ ClassModem::atResponse(char* buf, long ms)
  * changing the DCE-DTE communication rate and/or host-modem
  * flow control scheme are also recognized and handled.
  */
-fxBool
+bool
 ClassModem::atCmd(const fxStr& cmd, ATResponse r, long ms)
 {
     u_int cmdlen = cmd.length();
     u_int pos = 0;
-    fxBool respPending = FALSE;
+    bool respPending = false;
 
     /*
      * Scan string for line breaks and escape codes (byte w/ 0x80 set).
@@ -743,16 +743,16 @@ ClassModem::atCmd(const fxStr& cmd, ATResponse r, long ms)
            if (conf.atCmdDelay)
                pause(conf.atCmdDelay);
            if (!putModemLine(cmd.extract(pos, i-pos)))
-               return (FALSE);
+               return (false);
            pos = ++i;                  // next segment starts after line break
            if (r != AT_NOTHING) {
                if (!waitFor(r, ms))
-                   return (FALSE);
+                   return (false);
            } else {
                if (!waitFor(AT_OK, ms))
-                   return (FALSE);
+                   return (false);
            }
-           respPending = FALSE;
+           respPending = false;
        } else if (isEscape(cmd[i])) {
            /*
             * Escape code; flush any partial line, process
@@ -773,7 +773,7 @@ ClassModem::atCmd(const fxStr& cmd, ATResponse r, long ms)
                     * translated to \r).
                     */
                    if (!putModemLine(cmd.extract(pos, i-1-pos)))
-                       return (FALSE);
+                       return (false);
                    // setup for expected response
                    resp = (r != AT_NOTHING ? r : AT_OK);
                } else {
@@ -787,9 +787,9 @@ ClassModem::atCmd(const fxStr& cmd, ATResponse r, long ms)
                    const char* cp = &cmd[pos];
                    server.traceStatus(FAXTRACE_MODEMCOM, "<-- [%u:%s]", cc,cp);
                    if (!server.putModem1(cp, cc))
-                       return (FALSE);
+                       return (false);
                }
-               respPending = TRUE;
+               respPending = true;
            }
            /*
             * Process escape codes.
@@ -823,7 +823,7 @@ ClassModem::atCmd(const fxStr& cmd, ATResponse r, long ms)
                    if (resp != AT_NOTHING) {
                        // XXX check return?
                        (void) waitFor(resp, ms);       // XXX ms
-                       respPending = FALSE;
+                       respPending = false;
                    }
                    break;
                case ESC_FLUSH:                 // flush input
@@ -840,8 +840,8 @@ ClassModem::atCmd(const fxStr& cmd, ATResponse r, long ms)
                 * does not get lost.
                 */
                if (resp != AT_NOTHING && !waitFor(resp, ms))
-                   return (FALSE);
-               respPending = FALSE;
+                   return (false);
+               respPending = false;
            }
        } else
            i++;
@@ -853,17 +853,17 @@ ClassModem::atCmd(const fxStr& cmd, ATResponse r, long ms)
        if (conf.atCmdDelay)
            pause(conf.atCmdDelay);
        if (!putModemLine(cmd.extract(pos, i-pos)))
-           return (FALSE);
-       respPending = TRUE;
+           return (false);
+       respPending = true;
     }
     /*
      * Wait for any pending response.
      */
     if (respPending) {
        if (r != AT_NOTHING && !waitFor(r, ms))
-           return (FALSE);
+           return (false);
     }
-    return (TRUE);
+    return (true);
 }
 #undef isEscape
 #undef isLineBreak
@@ -871,13 +871,13 @@ ClassModem::atCmd(const fxStr& cmd, ATResponse r, long ms)
 /*
  * Wait (carefully) for some response from the modem.
  */
-fxBool
+bool
 ClassModem::waitFor(ATResponse wanted, long ms)
 {
     for (;;) {
        ATResponse response = atResponse(rbuf, ms);
        if (response == wanted)
-           return (TRUE);
+           return (true);
        switch (response) {
        case AT_TIMEOUT:
        case AT_EMPTYLINE:
@@ -887,7 +887,7 @@ ClassModem::waitFor(ATResponse wanted, long ms)
        case AT_NOANSWER:
        case AT_OFFHOOK:
            modemTrace("MODEM %s", ATresponses[response]);
-           return (FALSE);
+           return (false);
        }
     }
 }
@@ -895,18 +895,18 @@ ClassModem::waitFor(ATResponse wanted, long ms)
 /*
  * Process a manufacturer/model/revision query.
  */
-fxBool
+bool
 ClassModem::doQuery(const fxStr& queryCmd, fxStr& result, long ms)
 {
     if (queryCmd == "")
-       return (TRUE);
+       return (true);
     if (queryCmd[0] == '!') {
        /*
         * ``!mumble'' is interpreted as "return mumble";
         * this means that you can't send ! to the modem.
         */
        result = queryCmd.tail(queryCmd.length()-1);
-       return (TRUE);
+       return (true);
     }
     return (atQuery(queryCmd, result, ms));
 }
@@ -914,7 +914,7 @@ ClassModem::doQuery(const fxStr& queryCmd, fxStr& result, long ms)
 /*
  * Return modem manufacturer.
  */
-fxBool
+bool
 ClassModem::setupManufacturer(fxStr& mfr)
 {
     return doQuery(mfrQueryCmd, mfr);
@@ -923,7 +923,7 @@ ClassModem::setupManufacturer(fxStr& mfr)
 /*
  * Return modem model identification.
  */
-fxBool
+bool
 ClassModem::setupModel(fxStr& model)
 {
     return doQuery(modelQueryCmd, model);
@@ -932,7 +932,7 @@ ClassModem::setupModel(fxStr& model)
 /*
  * Return modem firmware revision.
  */
-fxBool
+bool
 ClassModem::setupRevision(fxStr& rev)
 {
     return doQuery(revQueryCmd, rev);
@@ -941,7 +941,7 @@ ClassModem::setupRevision(fxStr& rev)
 /*
  * Send AT<what>? and get a string response.
  */
-fxBool
+bool
 ClassModem::atQuery(const char* what, fxStr& v, long ms)
 {
     ATResponse r = AT_ERROR;
@@ -961,7 +961,7 @@ ClassModem::atQuery(const char* what, fxStr& v, long ms)
 /*
  * Send AT<what>? and get a range response.
  */
-fxBool
+bool
 ClassModem::atQuery(const char* what, u_int& v, long ms)
 {
     char response[1024];
@@ -969,7 +969,7 @@ ClassModem::atQuery(const char* what, u_int& v, long ms)
        sync(ms);
        return parseRange(response, v);
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -992,26 +992,26 @@ const char SPACE = ' ';
  *     in the parsed range so that modems like the ZyXEL 2864
  *     that indicate they support ``Class Z'' are handled.
  */
-fxBool
+bool
 ClassModem::vparseRange(const char* cp, int nargs ... )
 {
-    fxBool b = TRUE;
+    bool b = true;
     va_list ap;
     va_start(ap, nargs);
     while (nargs-- > 0) {
        while (cp[0] == SPACE)
            cp++;
        char matchc;
-       fxBool acceptList;
+       bool acceptList;
        if (cp[0] == OPAREN) {                          // (<items>)
            matchc = CPAREN;
-           acceptList = TRUE;
+           acceptList = true;
            cp++;
        } else if (isalnum(cp[0])) {                    // <item>
            matchc = COMMA;
            acceptList = (nargs == 0);
        } else {                                        // skip to comma
-           b = FALSE;
+           b = false;
            break;
        }
        int mask = 0;
@@ -1021,7 +1021,7 @@ ClassModem::vparseRange(const char* cp, int nargs ... )
                continue;
            }
            if (!isalnum(cp[0])) {
-               b = FALSE;
+               b = false;
                goto done;
            }
            int v;
@@ -1039,7 +1039,7 @@ ClassModem::vparseRange(const char* cp, int nargs ... )
            if (cp[0] == '-') {                         // <low>-<high>
                cp++;
                if (!isdigit(cp[0])) {
-                   b = FALSE;
+                   b = false;
                    goto done;
                }
                r = 0;
@@ -1075,7 +1075,7 @@ done:
  * Parse a single Class X range specification
  * and return the resulting bit mask.
  */
-fxBool
+bool
 ClassModem::parseRange(const char* cp, u_int& a0)
 {
     return vparseRange(cp, 1, &a0);
@@ -1093,7 +1093,7 @@ ClassModem::hangup()
     atCmd(conf.onHookCmd, AT_OK, 5000);
 }
 
-fxBool
+bool
 ClassModem::waitForRings(u_int n, CallType& type, CallerID& cinfo)
 {
     if (n > 0) {
@@ -1120,7 +1120,7 @@ ClassModem::waitForRings(u_int n, CallType& type, CallerID& cinfo)
            case AT_NOCARRIER:
            case AT_NODIALTONE:
            case AT_ERROR:
-               return (FALSE);
+               return (false);
            }
        } while (n > 0 && Sys::now()-start < timeout);
     }
index fa689c4459109e2cda83afa36f1929f6e951c133..fa6eceec686134f562b665b4434d0c0c5219e7fe 100644 (file)
@@ -195,17 +195,17 @@ protected:
     ClassModem(ModemServer&, const ModemConfig&);
 
 // setup and configuration
-    virtual fxBool selectBaudRate(BaudRate max, FlowControl i, FlowControl o);
-    virtual fxBool setupManufacturer(fxStr& mfr);
-    virtual fxBool setupModel(fxStr& model);
-    virtual fxBool setupRevision(fxStr& rev);
+    virtual bool selectBaudRate(BaudRate max, FlowControl i, FlowControl o);
+    virtual bool setupManufacturer(fxStr& mfr);
+    virtual bool setupModel(fxStr& model);
+    virtual bool setupRevision(fxStr& rev);
 
-    fxBool doQuery(const fxStr& queryCmd, fxStr& result, long ms = 30*1000);
+    bool doQuery(const fxStr& queryCmd, fxStr& result, long ms = 30*1000);
 // dial/answer interactions with derived classes
     virtual const AnswerMsg* findAnswer(const char* s);
     virtual CallType answerResponse(fxStr& emsg);
     virtual CallStatus dialResponse(fxStr& emsg) = 0;
-    virtual fxBool isNoise(const char*);
+    virtual bool isNoise(const char*);
 // miscellaneous
     void       modemSupports(const char* fmt, ...);
     void       modemCapability(const char* fmt, ...);
@@ -213,11 +213,11 @@ protected:
 public:
     virtual ~ClassModem();
 
-    virtual fxBool setupModem() = 0;
-    virtual fxBool isFaxModem() const = 0;     // XXX safe to cast
+    virtual bool setupModem() = 0;
+    virtual bool isFaxModem() const = 0;       // XXX safe to cast
 
-    virtual fxBool sync(long ms = 0);          // synchronize (wait for "OK")
-    virtual fxBool reset(long ms = 5*1000);    // reset modem state
+    virtual bool sync(long ms = 0);            // synchronize (wait for "OK")
+    virtual bool reset(long ms = 5*1000);      // reset modem state
     virtual void hangup();                     // hangup the phone
 
 // configuration controls
@@ -241,38 +241,38 @@ public:
 // support to write to modem w/ timeout
     void       beginTimedTransfer();
     void       endTimedTransfer();
-    fxBool     wasTimeout();
-    void       setTimeout(fxBool);
+    bool       wasTimeout();
+    void       setTimeout(bool);
     void       flushModemInput();
-    fxBool     putModem(void* data, int n, long ms = 0);
-    fxBool     putModemData(void* data, int n);
-    fxBool     putModemDLEData(const u_char* data, u_int,
+    bool       putModem(void* data, int n, long ms = 0);
+    bool       putModemData(void* data, int n);
+    bool       putModemDLEData(const u_char* data, u_int,
                    const u_char* brev, long ms);
-    fxBool     putModemLine(const char* cp);
+    bool       putModemLine(const char* cp);
     int                getModemChar(long ms = 0);
     int                getModemDataChar();
     void       startTimeout(long ms);
     void       stopTimeout(const char* whichdir);
 // host-modem protocol parsing support
     virtual ATResponse atResponse(char* buf, long ms = 30*1000);
-    fxBool     waitFor(ATResponse wanted, long ms = 30*1000);
-    fxBool     atCmd(const fxStr& cmd, ATResponse = AT_OK, long ms = 30*1000);
-    fxBool     atQuery(const char* what, fxStr& v, long ms = 30*1000);
-    fxBool     atQuery(const char* what, u_int& v, long ms = 30*1000);
-    fxBool     parseRange(const char*, u_int&);
-    fxBool     vparseRange(const char*, int nargs ...);
+    bool       waitFor(ATResponse wanted, long ms = 30*1000);
+    bool       atCmd(const fxStr& cmd, ATResponse = AT_OK, long ms = 30*1000);
+    bool       atQuery(const char* what, fxStr& v, long ms = 30*1000);
+    bool       atQuery(const char* what, u_int& v, long ms = 30*1000);
+    bool       parseRange(const char*, u_int&);
+    bool       vparseRange(const char*, int nargs ...);
 // modem line control
-    fxBool     sendBreak(fxBool pause);
-    fxBool     setBaudRate(BaudRate rate);
-    fxBool     setBaudRate(BaudRate rate, FlowControl i, FlowControl o);
-    fxBool     setXONXOFF(FlowControl i, FlowControl o, SetAction);
-    fxBool     setDTR(fxBool on);
-    fxBool     setInputBuffering(fxBool on);
-    fxBool     modemStopOutput();
+    bool       sendBreak(bool pause);
+    bool       setBaudRate(BaudRate rate);
+    bool       setBaudRate(BaudRate rate, FlowControl i, FlowControl o);
+    bool       setXONXOFF(FlowControl i, FlowControl o, SetAction);
+    bool       setDTR(bool on);
+    bool       setInputBuffering(bool on);
+    bool       modemStopOutput();
     FlowControl        getInputFlow();
     FlowControl        getOutputFlow();
 // server-related stuff
-    fxBool     abortRequested();
+    bool       abortRequested();
 
     /*
      * Send support:
@@ -282,7 +282,7 @@ public:
      * }
      * hangup();
      */
-    virtual fxBool dataService();
+    virtual bool dataService();
     virtual CallStatus dial(const char* number, fxStr& emsg);
 
     /*
@@ -305,7 +305,7 @@ public:
      * with recvAbort available to abort a receive
      * at any time in this procedure.
      */
-    virtual fxBool waitForRings(u_int rings, CallType&, CallerID&);
+    virtual bool waitForRings(u_int rings, CallType&, CallerID&);
     virtual CallType answerCall(AnswerType, fxStr& emsg);
     virtual void answerCallCmd(CallType);
 };
index 9e4654f7e753e8b7d42056f135f88044f9f4ee85..4778a0377f2e553a5fd068e92d2b3846a2f7a829 100644 (file)
@@ -44,8 +44,8 @@ static        void setupCompression(TIFF*, u_int, uint32);
  * Receive Phase C data with or without copy
  * quality checking and erroneous row fixup.
  */
-fxBool
-FaxModem::recvPageDLEData(TIFF* tif, fxBool checkQuality,
+bool
+FaxModem::recvPageDLEData(TIFF* tif, bool checkQuality,
     const Class2Params& params, fxStr& emsg)
 {
     setupDecoder(conf.recvFillOrder, params.is2D());
@@ -74,7 +74,7 @@ FaxModem::recvPageDLEData(TIFF* tif, fxBool checkQuality,
        abortPageRecv();
        emsg = "Missing EOL after 5 seconds";
        recvTrace("%s", (const char*) emsg);
-       return (FALSE);
+       return (false);
     }
     if (checkQuality) {
        /*
@@ -122,7 +122,7 @@ FaxModem::recvPageDLEData(TIFF* tif, fxBool checkQuality,
        u_char* curGood = buf;                  // last good row
        memset(curGood, 0, rowSize);            // initialize to all white
        recvBuf = NULL;                         // don't need raw data
-       lastRowBad = FALSE;                     // no previous row
+       lastRowBad = false;                     // no previous row
        cblc = 0;                               // current bad line run
        if (!RTCraised()) {
            for (;;) {
@@ -134,13 +134,13 @@ FaxModem::recvPageDLEData(TIFF* tif, fxBool checkQuality,
                 * later for deciding whether or not the page quality
                 * is acceptable.
                 */
-               fxBool decodeOK = decodeRow(recvRow, rowpixels);
+               bool decodeOK = decodeRow(recvRow, rowpixels);
                if (seenRTC())                  // seen RTC, flush everything
                    continue;
                if (decodeOK) {
                    curGood = recvRow;          // reset last good
                    if (lastRowBad) {           // reset run statistics
-                       lastRowBad = FALSE;
+                       lastRowBad = false;
                        if (cblc > recvConsecutiveBadLineCount)
                            recvConsecutiveBadLineCount = cblc;
                        cblc = 0;
@@ -149,7 +149,7 @@ FaxModem::recvPageDLEData(TIFF* tif, fxBool checkQuality,
                    memcpy(recvRow, curGood, rowSize);// replicate last good
                    recvBadLineCount++;
                    cblc++;
-                   lastRowBad = TRUE;
+                   lastRowBad = true;
                }
                /*
                 * Advance forward a scanline and if necessary
@@ -274,7 +274,7 @@ FaxModem::recvPageDLEData(TIFF* tif, fxBool checkQuality,
     TIFFSetField(tif, TIFFTAG_FAXRECVTIME,
        (uint32) server.getPageTransferTime());
 #endif
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -360,7 +360,7 @@ FaxModem::flushRawData(TIFF* tif, tstrip_t strip, u_char* buf, u_int cc)
  * Check if the configuration parameters indicate if
  * copy quality checking should be done on recvd pages.
  */
-fxBool
+bool
 FaxModem::checkQuality()
 {
     return (conf.percentGoodLines != 0 && conf.maxConsecutiveBadLines != 0);
@@ -371,7 +371,7 @@ FaxModem::checkQuality()
  * against the configuration parameters and return an
  * indication of whether or not the page quality is acceptable.
  */
-fxBool
+bool
 FaxModem::isQualityOK(const Class2Params& params)
 {
     if (conf.percentGoodLines != 0 && recvEOLCount != 0) {
@@ -379,7 +379,7 @@ FaxModem::isQualityOK(const Class2Params& params)
        if (percent < conf.percentGoodLines) {
            serverTrace("RECV: REJECT page quality, %u%% good lines (%u%% required)",
                percent, conf.percentGoodLines);
-           return (FALSE);
+           return (false);
        }
     }
     u_int cblc = conf.maxConsecutiveBadLines;
@@ -389,10 +389,10 @@ FaxModem::isQualityOK(const Class2Params& params)
        if (recvConsecutiveBadLineCount > cblc) {
            serverTrace("RECV: REJECT page quality, %u-line run (max %u)",
                recvConsecutiveBadLineCount, cblc);
-           return (FALSE);
+           return (false);
        }
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
index 6abc1559ee54111007b096302a9b10e6a293b196..ca0df23a79b5c4e2b038f306e644ee28dc5633a9 100644 (file)
@@ -187,26 +187,26 @@ DestControl::readContents()
     }
 }
 
-fxBool
+bool
 DestControl::readLine(FILE* fp, char line[], u_int cc)
 {
     if (fgets(line, cc, fp) == NULL)
-       return (FALSE);
+       return (false);
     lineno++;
     char* cp;
     if (cp = strchr(line, '#'))
        *cp = '\0';
     if (cp = strchr(line, '\n'))
        *cp = '\0';
-    return (TRUE);
+    return (true);
 }
 
-static fxBool
+static bool
 isContinued(FILE* fp)
 {
     int c = getc(fp);
     if (c == EOF)
-       return (FALSE);
+       return (false);
     ungetc(c, fp);
     return (isspace(c) || c == '#');
 }
@@ -238,13 +238,13 @@ crackArgv(fxStr& s)
     s.resize(cp - (char*) s);
 }
 
-fxBool
+bool
 DestControl::parseEntry(FILE* fp)
 {
     char line[1024];
     for (;;) {
        if (!readLine(fp, line, sizeof (line)-1))
-           return (FALSE);
+           return (false);
        char* cp;
        for (cp = line; *cp && !isspace(*cp); cp++)
            ;
@@ -253,7 +253,7 @@ DestControl::parseEntry(FILE* fp)
        if (cp == line) {
            parseError("Missing regular expression.");
            skipEntry(fp, line, sizeof (line)-1);
-           return (TRUE);
+           return (true);
        }
        *cp++ = '\0';
        DestControlInfo dci(line);
@@ -263,7 +263,7 @@ DestControl::parseEntry(FILE* fp)
            re.getError(emsg);
            parseError("Bad regular expression: %s: " | emsg, re.pattern());
            skipEntry(fp, line, sizeof (line)-1);
-           return (TRUE);
+           return (true);
        }
        for (;;) {
            while (isspace(*cp))
@@ -272,11 +272,11 @@ DestControl::parseEntry(FILE* fp)
                crackArgv(dci.args);
                if (!isContinued(fp)) {
                    info.append(dci);
-                   return (TRUE);
+                   return (true);
                }
                if (!readLine(fp, line, sizeof (line)-1)) {
                    info.append(dci);
-                   return (FALSE);
+                   return (false);
                }
                cp = line;
                continue;                       // go back and skip whitespace
index b4931ada65bd12113d300f8e456580a885c7eed5..476283f6638542306c37289b79b0df38426d4e4b 100644 (file)
@@ -86,8 +86,8 @@ private:
     DestControlInfoArray info;         // control information
 
     void       readContents();
-    fxBool     parseEntry(FILE* fp);
-    fxBool     readLine(FILE* fp, char line[], u_int cc);
+    bool       parseEntry(FILE* fp);
+    bool       readLine(FILE* fp, char line[], u_int cc);
     void       skipEntry(FILE*, char line[], u_int cc);
     void       parseError(const char* fmt ...);
 public:
index 2bc68a1131fdd1f24ce09100d85ccb6c96381bae..463946402a70a512b94de2b30d56cea5f81432fa 100644 (file)
@@ -58,18 +58,18 @@ DestInfo::updateConfig()
     info.writeConfig();                                // update as necessary
 }
 
-fxBool
+bool
 DestInfo::isActive(Job& job) const
 {
     if (running == NULL)
-       return (FALSE);
+       return (false);
     else if (running == &job)
-       return (TRUE);
+       return (true);
     else {
        for (Job* jp = running->dnext; jp != NULL; jp = jp->dnext)
            if (jp == &job)
-               return (TRUE);
-       return (FALSE);
+               return (true);
+       return (false);
     }
 }
 
index 26226d3bbf2f94edfe902942cb4e4c66153f8eaa..cd0166fdf0b3ab486ff0fd4ea0b4698405f6926d 100644 (file)
@@ -60,9 +60,9 @@ public:
 
     u_int getActive() const;           // return count of active jobs
     u_int getCount() const;            // return count of active+blocked jobs
-    fxBool isEmpty() const;            // TRUE if any jobs referenced
+    bool isEmpty() const;              // true if any jobs referenced
 
-    fxBool isActive(Job&) const;       // TRUE if job is considered active
+    bool isActive(Job&) const; // true if job is considered active
     void active(Job&);                 // set job active to destination
     void done(Job&);                   // remove job from active set
     void block(Job&);                  // add job to blocked queue
@@ -76,7 +76,7 @@ public:
 inline u_int DestInfo::getActive() const       { return activeCount; }
 inline u_int DestInfo::getCount() const
     { return activeCount + blockedCount; }
-inline fxBool DestInfo::isEmpty() const                { return getCount() == 0; }
+inline bool DestInfo::isEmpty() const          { return getCount() == 0; }
 
 fxDECLARE_StrKeyDictionary(DestInfoDict, DestInfo)
 #endif /* _DestInfo_ */
index 1ad2021dd03e15c62a33e1bac50f635ea5735552..143a75d4a849685c9c7b166d6eafae179fa1cdff 100644 (file)
@@ -35,10 +35,10 @@ extern      const char* fmtTime(time_t);
 /*
  * Record an activity in the transfer log file.
  */
-fxBool
+bool
 FaxAcctInfo::record(const char* cmd) const
 {
-    fxBool ok = FALSE;
+    bool ok = false;
     int fd = Sys::open(FAX_XFERLOG, O_RDWR|O_CREAT|O_APPEND, 0644);
     if (fd >= 0) {
        fxStackBuffer record;
index 1074d39c34bac4ba582f1f514785a7bac996f1e2..0aa8edae0167950f8b5b5037d5e8a496b38170e9 100644 (file)
@@ -44,6 +44,6 @@ struct FaxAcctInfo {
     u_int      params;         // encoded transfer parameters
     const char*        status;         // status info (optional)
 
-    fxBool record(const char* cmd) const;
+    bool record(const char* cmd) const;
 };
 #endif /* _FaxAcctInfo_ */
index 89dff2326389489ae49c20de2f43e87eb6032a27..3baa8ab809bb17a33c0c4153bd21dc8aa3951e6f 100644 (file)
@@ -28,7 +28,7 @@
 
 FaxFont::FaxFont()
 {
-    ready = FALSE;             // font not ready for use
+    ready = false;             // font not ready for use
     fontAscent = fontDescent = 0;
 }
 
index 6c6a62319d02ef838014907241e5ff34ab2ae57c..93c8181097cd82e11452429721378e455620045c 100644 (file)
@@ -32,7 +32,7 @@
 
 class FaxFont {
 protected:
-    fxBool     ready;          // font ready to use
+    bool       ready;          // font ready to use
     short      fontAscent;     // font ascent metric
     short      fontDescent;    // font descent metric
 
@@ -40,9 +40,9 @@ protected:
 public:
     virtual ~FaxFont();
 
-    virtual fxBool read(const char* filename) = 0;
+    virtual bool read(const char* filename) = 0;
 
-    fxBool     isReady() const;
+    bool       isReady() const;
     u_int      fontHeight() const;
     virtual u_int charWidth(u_int) const = 0;
     virtual void strWidth(const char* text, u_int& w, u_int& h) const = 0;
@@ -52,6 +52,6 @@ public:
     virtual void print(FILE*) const = 0;
 };
 
-inline fxBool FaxFont::isReady() const  { return ready; }
+inline bool FaxFont::isReady() const    { return ready; }
 inline u_int FaxFont::fontHeight() const { return fontAscent+fontDescent; }
 #endif /* _Font_ */
index a7a5a4bfec70f2d6065a6e39fce939c745b6c3f3..74a350afb814545f6dfca6234665443a7d40ece3 100644 (file)
@@ -37,7 +37,7 @@ const fxStr FaxMachineInfo::infoDir(FAX_INFODIR);
 
 FaxMachineInfo::FaxMachineInfo()
 {
-    changed = FALSE;
+    changed = false;
     resetConfig();
 }
 FaxMachineInfo::FaxMachineInfo(const FaxMachineInfo& other)
@@ -79,7 +79,7 @@ FaxMachineInfo::getMaxPageWidthInMM() const
 
 #include <ctype.h>
 
-fxBool
+bool
 FaxMachineInfo::updateConfig(const fxStr& number)
 {
     fxStr canon(number);
@@ -98,10 +98,10 @@ FaxMachineInfo::updateConfig(const fxStr& number)
 void
 FaxMachineInfo::resetConfig()
 {
-    supportsHighRes = TRUE;            // assume 196 lpi support
-    supports2DEncoding = TRUE;         // assume 2D-encoding support
-    supportsPostScript = FALSE;                // no support for Adobe protocol
-    calledBefore = FALSE;              // never called before
+    supportsHighRes = true;            // assume 196 lpi support
+    supports2DEncoding = true;         // assume 2D-encoding support
+    supportsPostScript = false;                // no support for Adobe protocol
+    calledBefore = false;              // never called before
     maxPageWidth = 2432;               // max required width
     maxPageLength = -1;                        // infinite page length
     maxSignallingRate = BR_14400;      // T.17 14.4KB
@@ -169,7 +169,7 @@ static const char* stnames[] =
 
 #define        setLocked(b,ix) locked |= b<<ix
 
-fxBool
+bool
 FaxMachineInfo::setConfigItem(const char* tag, const char* value)
 {
     int b = (tag[0] == '&' ? 1 : 0);   // locked down indicator
@@ -226,8 +226,8 @@ FaxMachineInfo::setConfigItem(const char* tag, const char* value)
     } else if (streq(tag, "pagersetupcmds")) {
        pagerSetupCmds = value;
     } else
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 
 #define        isLocked(b)     (locked & (1<<b))
@@ -235,14 +235,14 @@ FaxMachineInfo::setConfigItem(const char* tag, const char* value)
 #define        checkLock(ix, member, value)    \
     if (!isLocked(ix)) {               \
        member = value;                 \
-       changed = TRUE;                 \
+       changed = true;                 \
     }
 
-void FaxMachineInfo::setSupportsHighRes(fxBool b)
+void FaxMachineInfo::setSupportsHighRes(bool b)
     { checkLock(HIRES, supportsHighRes, b); }
-void FaxMachineInfo::setSupports2DEncoding(fxBool b)
+void FaxMachineInfo::setSupports2DEncoding(bool b)
     { checkLock(G32D, supports2DEncoding, b); }
-void FaxMachineInfo::setSupportsPostScript(fxBool b)
+void FaxMachineInfo::setSupportsPostScript(bool b)
     { checkLock(PS, supportsPostScript, b); }
 void FaxMachineInfo::setMaxPageWidthInPixels(int v)
     { checkLock(WD, maxPageWidth, v); }
@@ -254,16 +254,16 @@ void FaxMachineInfo::setMinScanlineTime(int v)
     { checkLock(ST, minScanlineTime, v); }
 
 void
-FaxMachineInfo::setCalledBefore(fxBool b)
+FaxMachineInfo::setCalledBefore(bool b)
 {
     calledBefore = b;
-    changed = TRUE;
+    changed = true;
 }
 
 #define        checkChanged(member, value)     \
     if (member != value) {             \
        member = value;                 \
-       changed = TRUE;                 \
+       changed = true;                 \
     }
 
 void FaxMachineInfo::setCSI(const fxStr& v)
@@ -300,30 +300,30 @@ FaxMachineInfo::writeConfig()
            Sys::close(fd);
        } else
            error("open: %m");
-       changed = FALSE;
+       changed = false;
     }
 }
 
 static void
-putBoolean(fxStackBuffer& buf, const char* tag, fxBool locked, fxBool b)
+putBoolean(fxStackBuffer& buf, const char* tag, bool locked, bool b)
 {
     buf.fput("%s%s:%s\n", locked ? "&" : "", tag, b ? "yes" : "no");
 }
 
 static void
-putDecimal(fxStackBuffer& buf, const char* tag, fxBool locked, int v)
+putDecimal(fxStackBuffer& buf, const char* tag, bool locked, int v)
 {
     buf.fput("%s%s:%d\n", locked ? "&" : "", tag, v);
 }
 
 static void
-putString(fxStackBuffer& buf, const char* tag, fxBool locked, const char* v)
+putString(fxStackBuffer& buf, const char* tag, bool locked, const char* v)
 {
     buf.fput("%s%s:\"%s\"\n", locked ? "&" : "", tag, v);
 }
 
 static void
-putIfString(fxStackBuffer& buf, const char* tag, fxBool locked, const char* v)
+putIfString(fxStackBuffer& buf, const char* tag, bool locked, const char* v)
 {
     if (*v != '\0')
        buf.fput("%s%s:\"%s\"\n", locked ? "&" : "", tag, v);
@@ -335,23 +335,23 @@ FaxMachineInfo::writeConfig(fxStackBuffer& buf)
     putBoolean(buf, "supportsHighRes", isLocked(HIRES), supportsHighRes);
     putBoolean(buf, "supports2DEncoding", isLocked(G32D),supports2DEncoding);
     putBoolean(buf, "supportsPostScript", isLocked(PS), supportsPostScript);
-    putBoolean(buf, "calledBefore", FALSE, calledBefore);
+    putBoolean(buf, "calledBefore", false, calledBefore);
     putDecimal(buf, "maxPageWidth", isLocked(WD), maxPageWidth);
     putDecimal(buf, "maxPageLength", isLocked(LN), maxPageLength);
     putString(buf, "maxSignallingRate", isLocked(BR),
        brnames[fxmin(maxSignallingRate, BR_14400)]);
     putString(buf, "minScanlineTime", isLocked(ST),
        stnames[fxmin(minScanlineTime, ST_40MS)]);
-    putString(buf, "remoteCSI", FALSE, csi);
-    putDecimal(buf, "sendFailures", FALSE, sendFailures);
-    putIfString(buf, "lastSendFailure", FALSE, lastSendFailure);
-    putDecimal(buf, "dialFailures", FALSE, dialFailures);
-    putIfString(buf, "lastDialFailure", FALSE, lastDialFailure);
+    putString(buf, "remoteCSI", false, csi);
+    putDecimal(buf, "sendFailures", false, sendFailures);
+    putIfString(buf, "lastSendFailure", false, lastSendFailure);
+    putDecimal(buf, "dialFailures", false, dialFailures);
+    putIfString(buf, "lastDialFailure", false, lastDialFailure);
     if (pagerMaxMsgLength != (u_int) -1)
-       putDecimal(buf, "pagerMaxMsgLength", TRUE, pagerMaxMsgLength);
-    putIfString(buf, "pagerPassword", TRUE, pagerPassword);
-    putIfString(buf, "pagerTTYParity", TRUE, pagerTTYParity);
-    putIfString(buf, "pagingProtocol", TRUE, pagingProtocol);
-    putIfString(buf, "pageSource", TRUE, pageSource);
-    putIfString(buf, "pagerSetupCmds", TRUE, pagerSetupCmds);
+       putDecimal(buf, "pagerMaxMsgLength", true, pagerMaxMsgLength);
+    putIfString(buf, "pagerPassword", true, pagerPassword);
+    putIfString(buf, "pagerTTYParity", true, pagerTTYParity);
+    putIfString(buf, "pagingProtocol", true, pagingProtocol);
+    putIfString(buf, "pageSource", true, pageSource);
+    putIfString(buf, "pagerSetupCmds", true, pagerSetupCmds);
 }
index aaddd42adb2910b376ff3244ef67914cadc9ebf8..179e291e74837e4f68c4ce3ed6758837d967d111 100644 (file)
@@ -48,11 +48,11 @@ class FaxMachineInfo : public FaxConfig {
 private:
     fxStr      file;                   // pathname to info file
     u_int      locked;                 // bit vector of locked items
-    fxBool     changed;                // changed since restore
-    fxBool     supportsHighRes;        // capable of 7.7 line/mm vres
-    fxBool     supports2DEncoding;     // handles Group 3 2D
-    fxBool     supportsPostScript;     // handles Adobe NSF protocol
-    fxBool     calledBefore;           // successfully called before
+    bool       changed;                // changed since restore
+    bool       supportsHighRes;        // capable of 7.7 line/mm vres
+    bool       supports2DEncoding;     // handles Group 3 2D
+    bool       supportsPostScript;     // handles Adobe NSF protocol
+    bool       calledBefore;           // successfully called before
     int                maxPageWidth;           // max capable page width
     int                maxPageLength;          // max capable page length
     int                maxSignallingRate;      // max capable signalling rate
@@ -73,7 +73,7 @@ private:
 
     void writeConfig(fxStackBuffer&);
 
-    fxBool setConfigItem(const char* tag, const char* value);
+    bool setConfigItem(const char* tag, const char* value);
     void vconfigError(const char* fmt0, va_list ap);
     void configError(const char* fmt0 ...);
     void configTrace(const char* fmt0 ...);
@@ -83,14 +83,14 @@ public:
     FaxMachineInfo(const FaxMachineInfo& other);
     virtual ~FaxMachineInfo();
 
-    virtual fxBool updateConfig(const fxStr& filename);
+    virtual bool updateConfig(const fxStr& filename);
     virtual void writeConfig();
     virtual void resetConfig();
 
-    fxBool getSupportsHighRes() const;
-    fxBool getSupports2DEncoding() const;
-    fxBool getSupportsPostScript() const;
-    fxBool getCalledBefore() const;
+    bool getSupportsHighRes() const;
+    bool getSupports2DEncoding() const;
+    bool getSupportsPostScript() const;
+    bool getCalledBefore() const;
     int getMaxPageWidthInPixels() const;
     int getMaxPageWidthInMM() const;
     int getMaxPageLengthInMM() const;
@@ -103,10 +103,10 @@ public:
     const fxStr& getLastSendFailure() const;
     const fxStr& getLastDialFailure() const;
 
-    void setSupportsHighRes(fxBool);
-    void setSupports2DEncoding(fxBool);
-    void setSupportsPostScript(fxBool);
-    void setCalledBefore(fxBool);
+    void setSupportsHighRes(bool);
+    void setSupports2DEncoding(bool);
+    void setSupportsPostScript(bool);
+    void setCalledBefore(bool);
     void setMaxPageWidthInPixels(int);
     void setMaxPageLengthInMM(int);
     void setMaxSignallingRate(int);
@@ -126,13 +126,13 @@ public:
     const fxStr& getPagerSetupCmds() const;
 };
 
-inline fxBool FaxMachineInfo::getSupportsHighRes() const
+inline bool FaxMachineInfo::getSupportsHighRes() const
     { return supportsHighRes; }
-inline fxBool FaxMachineInfo::getSupports2DEncoding() const
+inline bool FaxMachineInfo::getSupports2DEncoding() const
     { return supports2DEncoding; }
-inline fxBool FaxMachineInfo::getSupportsPostScript() const
+inline bool FaxMachineInfo::getSupportsPostScript() const
     { return supportsPostScript; }
-inline fxBool FaxMachineInfo::getCalledBefore() const  
+inline bool FaxMachineInfo::getCalledBefore() const    
     { return calledBefore; }
 inline int FaxMachineInfo::getMaxPageWidthInPixels() const
     { return maxPageWidth; }
index b6c1ee41874157d41dc4ff36adb7bc88a30fd038..da7989933555f8a968f95f3f9cb93829a47ad8f4 100644 (file)
@@ -57,7 +57,7 @@ u_int FaxModem::getTagLineSlop() const                { return tagLineSlop; }
 /*
  * Do setup work prior to placing the call.
  */
-fxBool
+bool
 FaxModem::sendSetup(FaxRequest& req, const Class2Params&, fxStr&)
 {
     minsp = fxmax((u_int) req.minsp, conf.minSpeed);
@@ -67,7 +67,7 @@ FaxModem::sendSetup(FaxRequest& req, const Class2Params&, fxStr&)
     else
        setupTagLine(req, req.tagline);
     curreq = &req;
-    return (TRUE);
+    return (true);
 }
 /*
  * Do work at the beginning of a send operation;
@@ -83,18 +83,18 @@ FaxModem::sendBegin()
 void FaxModem::sendSetupPhaseB(const fxStr&, const fxStr&){}
 void FaxModem::sendEnd()       {}
 
-fxBool
+bool
 FaxModem::recvBegin(fxStr&)
 {
     optFrames = 0;
-    return (TRUE);
+    return (true);
 }
 
-fxBool
+bool
 FaxModem::pollBegin(const fxStr&, const fxStr&, const fxStr&, fxStr&)
 {
     optFrames = 0;
-    return (TRUE);
+    return (true);
 }
 
 static void
@@ -120,16 +120,16 @@ FaxModem::recvCSI(const fxStr& s)
     protoTrace("REMOTE CSI \"%s\"", (const char*) tsi);
     optFrames |= 0x1;
 }
-fxBool
+bool
 FaxModem::getRecvTSI(fxStr& s)
 {
     if (optFrames & 0x1) {
        s = tsi;
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
-fxBool FaxModem::getSendCSI(fxStr& s)  { return getRecvTSI(s); }
+bool FaxModem::getSendCSI(fxStr& s)    { return getRecvTSI(s); }
 
 void
 FaxModem::recvPWD(const fxStr& s)
@@ -138,14 +138,14 @@ FaxModem::recvPWD(const fxStr& s)
     protoTrace("REMOTE PWD \"%s\"", (const char*) pwd);
     optFrames |= 0x2;
 }
-fxBool
+bool
 FaxModem::getRecvPWD(fxStr& s)
 {
     if (optFrames & 0x2) {
        s = pwd;
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 void
 FaxModem::recvSUB(const fxStr& s)
@@ -154,14 +154,14 @@ FaxModem::recvSUB(const fxStr& s)
     protoTrace("REMOTE SUB \"%s\"", (const char*) sub);
     optFrames |= 0x4;
 }
-fxBool
+bool
 FaxModem::getRecvSUB(fxStr& s)
 {
     if (optFrames & 0x4) {
        s = sub;
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 void
 FaxModem::recvNSF(const fxStr& s)
@@ -169,14 +169,14 @@ FaxModem::recvNSF(const fxStr& s)
     nsf = s;
     protoTrace("REMOTE NSF \"%s\"", (const char*) nsf);
 }
-fxBool
+bool
 FaxModem::getSendNSF(fxStr& s)
 {
     if (optFrames & 0x8) {
        s = nsf;
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 void
@@ -237,22 +237,22 @@ FaxModem::decodePageChop(const fxStr& pph, const Class2Params& params)
  * the next page.  See FaxServer::sendPrepareFax for the
  * construction of this string.
  */ 
-fxBool
+bool
 FaxModem::decodePPM(const fxStr& pph, u_int& ppm, fxStr& emsg)
 {
     const char* what;
     if (pph.length() >= 3 && (pph[2] != 'Z' || pph.length() >= 2+5+1)) {
        switch (pph[pph[2] == 'Z' ? 2+5 : 2+0]) {
-       case 'P': ppm = PPM_EOP; return (TRUE);
-       case 'M': ppm = PPM_EOM; return (TRUE);
-       case 'S': ppm = PPM_MPS; return (TRUE);
+       case 'P': ppm = PPM_EOP; return (true);
+       case 'M': ppm = PPM_EOM; return (true);
+       case 'S': ppm = PPM_MPS; return (true);
        }
        what = "unknown";
     } else
        what = "bad";
     emsg = fxStr::format( "Internal botch; %s post-page handling string \"%s\"",
        what, (const char*) pph);
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -371,7 +371,7 @@ FaxModem::getBestECM() const
 /*
  * Return whether or not the modem supports 2DMR.
  */
-fxBool
+bool
 FaxModem::supports2D() const
 {
     return (modemParams.df & BIT(DF_2DMR)) != 0;
@@ -380,26 +380,26 @@ FaxModem::supports2D() const
 /*
  * Return whether or not received EOLs are byte aligned.
  */
-fxBool
+bool
 FaxModem::supportsEOLPadding() const
 {
-    return FALSE;
+    return false;
 }
 
 /*
  * Return whether or not the modem is capable of polling.
  */
-fxBool
+bool
 FaxModem::supportsPolling() const
 {
-    return FALSE;
+    return false;
 }
 
 /*
  * Return whether or not the modem supports
  * the optional Error Correction Mode (ECM).
  */
-fxBool
+bool
 FaxModem::supportsECM() const
 {
     return (modemParams.ec &~ BIT(EC_DISABLE)) != 0;
@@ -412,7 +412,7 @@ FaxModem::supportsECM() const
  * problems and general sloppiness on the part of
  * applications writing TIFF files.
  */
-fxBool
+bool
 FaxModem::supportsVRes(float res) const
 {
     if (3.0 <= res && res < 4.75)
@@ -420,14 +420,14 @@ FaxModem::supportsVRes(float res) const
     else if (5.9 <= res && res < 9.8)
        return (modemParams.vr & BIT(VR_FINE)) != 0;
     else
-       return FALSE;
+       return false;
 }
 
 /*
  * Return whether or not the modem supports the
  * specified page width.
  */
-fxBool
+bool
 FaxModem::supportsPageWidth(u_int w) const
 {
     switch (w) {
@@ -437,7 +437,7 @@ FaxModem::supportsPageWidth(u_int w) const
     case 1216: return (modemParams.wd & BIT(WD_1216)) != 0;
     case 864:  return (modemParams.wd & BIT(WD_864)) != 0;
     }
-    return FALSE;
+    return false;
 }
 
 /*
@@ -445,7 +445,7 @@ FaxModem::supportsPageWidth(u_int w) const
  * specified page length.  As above for vertical
  * resolution we're lenient in what we accept.
  */
-fxBool
+bool
 FaxModem::supportsPageLength(u_int l) const
 {
     // XXX probably need to be more forgiving with values
@@ -564,9 +564,9 @@ FaxModem::tracePPR(const char* dir, u_int ppr)
 /*
  * Miscellaneous server interfaces hooks.
  */
-fxBool FaxModem::isFaxModem() const            { return TRUE; }
+bool FaxModem::isFaxModem() const              { return true; }
 
-fxBool FaxModem::getHDLCTracing()
+bool FaxModem::getHDLCTracing()
     { return (server.getSessionTracing() & FAXTRACE_HDLC) != 0; }
 
 FaxSendStatus
index c8cf3fe6a2f24118de80906b50cf46eb9f4f2e6f..44c1a768fe90252bc5afce1714c253cae7c9d827 100644 (file)
@@ -61,7 +61,7 @@ private:
     void       setupTagLine(const FaxRequest&, const fxStr& tagLineFmt);
 // phase c data receive & copy quality checking
     u_int      cblc;           // current count of consecutive bad lines
-    fxBool     lastRowBad;     // last decoded row was bad
+    bool       lastRowBad;     // last decoded row was bad
 
     u_long     recvEOLCount;   // EOL count for received page
     u_long     recvBadLineCount;
@@ -102,7 +102,7 @@ protected:
     void       tracePPR(const char* dir, u_int ppr);
     void       tracePPM(const char* dir, u_int ppm);
 // server-related stuff
-    fxBool     getHDLCTracing();
+    bool       getHDLCTracing();
     FaxSendStatus sendSetupParams(TIFF*, Class2Params&,
                    FaxMachineInfo&, fxStr&);
     void       recvTSI(const fxStr&);
@@ -115,39 +115,39 @@ protected:
     void       recvStartPage(TIFF* tif);
     void       recvResetPage(TIFF* tif);
     u_int      decodePageChop(const fxStr& pph, const Class2Params&);
-    fxBool     decodePPM(const fxStr& pph, u_int& ppm, fxStr& emsg);
+    bool       decodePPM(const fxStr& pph, u_int& ppm, fxStr& emsg);
     void       notifyPageSent(TIFF*);
 // phase c data receive & copy quality checking
-    fxBool     recvPageDLEData(TIFF* tif, fxBool checkQuality,
+    bool       recvPageDLEData(TIFF* tif, bool checkQuality,
                    const Class2Params& params, fxStr& emsg);
     virtual void abortPageRecv() = 0;
     virtual int nextByte();
 
-    fxBool     checkQuality();
-    fxBool     isQualityOK(const Class2Params&);
+    bool       checkQuality();
+    bool       isQualityOK(const Class2Params&);
     u_long     getRecvEOLCount() const;
     u_long     getRecvBadLineCount() const;
     u_long     getRecvConsecutiveBadLineCount() const;
 // tag line support
-    fxBool     setupTagLineSlop(const Class2Params&);
+    bool       setupTagLineSlop(const Class2Params&);
     u_int      getTagLineSlop() const;
     u_char*    imageTagLine(u_char* buf, u_int fillorder, const Class2Params&);
 public:
     virtual ~FaxModem();
 
-    fxBool isFaxModem() const;
+    bool isFaxModem() const;
 
 // configuration controls
     virtual void setLID(const fxStr& number) = 0;
     u_int getCapabilities() const;
 // methods for querying modem capabilities
-    virtual fxBool supports2D() const;
-    virtual fxBool supportsEOLPadding() const;
-    virtual fxBool supportsVRes(float res) const;
-    virtual fxBool supportsPageWidth(u_int w) const;
-    virtual fxBool supportsPageLength(u_int l) const;
-    virtual fxBool supportsPolling() const;
-    virtual fxBool supportsECM() const;
+    virtual bool supports2D() const;
+    virtual bool supportsEOLPadding() const;
+    virtual bool supportsVRes(float res) const;
+    virtual bool supportsPageWidth(u_int w) const;
+    virtual bool supportsPageLength(u_int l) const;
+    virtual bool supportsPolling() const;
+    virtual bool supportsECM() const;
 
     virtual int selectSignallingRate(int br) const;
     u_int getBestSignallingRate() const;
@@ -184,19 +184,19 @@ public:
      * for doing things like keeping cover pages & documents in a
      * single T.30 document.
      */
-    virtual fxBool faxService() = 0;
-    virtual fxBool sendSetup(FaxRequest&, const Class2Params& dis, fxStr& emsg);
+    virtual bool faxService() = 0;
+    virtual bool sendSetup(FaxRequest&, const Class2Params& dis, fxStr& emsg);
     virtual void sendBegin();
     virtual FaxSendStatus getPrologue(Class2Params&,
-       fxBool& hasDoc, fxStr& emsg) = 0;
+       bool& hasDoc, fxStr& emsg) = 0;
     virtual void sendSetupPhaseB(const fxStr& pwd, const fxStr& sub);
     virtual FaxSendStatus sendPhaseB(TIFF*, Class2Params&, FaxMachineInfo&,
        fxStr& pph, fxStr& emsg) = 0;
     virtual void sendEnd();
     virtual void sendAbort() = 0;
     // query interfaces for optional state
-    virtual fxBool getSendCSI(fxStr&);
-    virtual fxBool getSendNSF(fxStr&);
+    virtual bool getSendCSI(fxStr&);
+    virtual bool getSendNSF(fxStr&);
 
     /*
      * Fax receive protocol.  The expected sequence is:
@@ -226,15 +226,15 @@ public:
      *    }
      * }
      */
-    virtual fxBool setupReceive() = 0;
-    virtual fxBool recvBegin(fxStr& emsg);
-    virtual fxBool recvPage(TIFF*, int& ppm, fxStr& em) = 0;
-    virtual fxBool recvEnd(fxStr& emsg) = 0;
+    virtual bool setupReceive() = 0;
+    virtual bool recvBegin(fxStr& emsg);
+    virtual bool recvPage(TIFF*, int& ppm, fxStr& em) = 0;
+    virtual bool recvEnd(fxStr& emsg) = 0;
     virtual void recvAbort() = 0;
     // query interfaces for optional state
-    virtual fxBool getRecvPWD(fxStr&);
-    virtual fxBool getRecvTSI(fxStr&);
-    virtual fxBool getRecvSUB(fxStr&);
+    virtual bool getRecvPWD(fxStr&);
+    virtual bool getRecvTSI(fxStr&);
+    virtual bool getRecvSUB(fxStr&);
     virtual const Class2Params& getRecvParams() const;
 
     /*
@@ -252,8 +252,8 @@ public:
      *
      * (i.e. it's just like a receive operation.)
      */
-    virtual fxBool requestToPoll(fxStr& emsg) = 0;
-    virtual fxBool pollBegin(
+    virtual bool requestToPoll(fxStr& emsg) = 0;
+    virtual bool pollBegin(
        const fxStr& cig, const fxStr& sep, const fxStr& pwd,
        fxStr& emsg);
 };
index d2a85ce0f8becbaec5a2cf5e9bfdb1010ec91b16..764c4b80112276dc9f44f21a011d22247b577d20 100644 (file)
 /*
  * Initiate a polling receive and invoke the receiving protocol.
  */
-fxBool
+bool
 FaxServer::pollFaxPhaseB(const fxStr& sep, const fxStr& pwd, FaxRecvInfoArray& docs, fxStr& emsg)
 {
-    fxBool pollOK = FALSE;
+    bool pollOK = false;
     changeState(RECEIVING);
     traceProtocol("POLL FAX: begin (SEP \"%s\", PWD \"%s\")",
        (const char*) sep, (const char*) pwd);
index 7431b5c567df6f806468bfbd79d9635bb7cef6ad..4bcc476cde6a09773dc2b3343d4338e4450ba3e8 100644 (file)
@@ -41,7 +41,7 @@
  * FAX Server Reception Protocol.
  */
 
-fxBool
+bool
 FaxServer::recvFax()
 {
     traceProtocol("RECV FAX: begin");
@@ -49,8 +49,8 @@ FaxServer::recvFax()
     fxStr emsg;
     FaxRecvInfoArray docs;
     FaxRecvInfo info;
-    fxBool faxRecognized = FALSE;
-    abortCall = FALSE;
+    bool faxRecognized = false;
+    abortCall = false;
 
     /*
      * Create the first file ahead of time to avoid timing
@@ -180,10 +180,10 @@ FaxServer::setupForRecv(FaxRecvInfo& ri, FaxRecvInfoArray& docs, fxStr& emsg)
 /*
  * Receive one or more documents.
  */
-fxBool
+bool
 FaxServer::recvDocuments(TIFF* tif, FaxRecvInfo& info, FaxRecvInfoArray& docs, fxStr& emsg)
 {
-    fxBool recvOK;
+    bool recvOK;
     int ppm;
     pageStart = Sys::now();
     for (;;) {
@@ -201,7 +201,7 @@ FaxServer::recvDocuments(TIFF* tif, FaxRecvInfo& info, FaxRecvInfoArray& docs, f
             * NB: Caller-ID access control is done elsewhere; prior
             *     to answering a call.
             */
-           fxBool okToRecv = isTSIOk(info.sender);
+           bool okToRecv = isTSIOk(info.sender);
            traceServer("%s TSI \"%s\"", okToRecv ? "ACCEPT" : "REJECT",
                (const char*) info.sender);
            if (!okToRecv) {
@@ -210,7 +210,7 @@ FaxServer::recvDocuments(TIFF* tif, FaxRecvInfo& info, FaxRecvInfoArray& docs, f
                info.reason = emsg;
                notifyDocumentRecvd(info);
                TIFFClose(tif);
-               return (FALSE);
+               return (false);
            }
        }
        setServerStatus("Receiving from \"%s\"", (const char*) info.sender);
@@ -227,7 +227,7 @@ FaxServer::recvDocuments(TIFF* tif, FaxRecvInfo& info, FaxRecvInfoArray& docs, f
         */
        tif = setupForRecv(info, docs, emsg);
        if (tif == NULL)
-           return (FALSE);
+           return (false);
        fileStart = pageStart = Sys::now();
     }
     /*NOTREACHED*/
@@ -236,28 +236,28 @@ FaxServer::recvDocuments(TIFF* tif, FaxRecvInfo& info, FaxRecvInfoArray& docs, f
 /*
  * Receive Phase B protocol processing.
  */
-fxBool
+bool
 FaxServer::recvFaxPhaseD(TIFF* tif, FaxRecvInfo& info, int& ppm, fxStr& emsg)
 {
     ppm = PPM_EOP;
     do {
        if (++recvPages > maxRecvPages) {
            emsg = "Maximum receive page count exceeded, job terminated";
-           return (FALSE);
+           return (false);
        }
        if (!modem->recvPage(tif, ppm, emsg))
-           return (FALSE);
+           return (false);
        info.npages++;
        info.time = (u_int) getPageTransferTime();
        info.params = modem->getRecvParams();
        notifyPageRecvd(tif, info, ppm);
        if (PPM_PRI_MPS <= ppm && ppm <= PPM_PRI_EOP) {
            emsg = "Procedure interrupt received, job terminated";
-           return (FALSE);
+           return (false);
        }
        pageStart = Sys::now();                 // reset for next page
     } while (ppm == PPM_MPS || ppm == PPM_PRI_MPS);
-    return (TRUE);
+    return (true);
 }
 
 void
index f32c8266235a9479fecbfcceb018cb8a14e5984d..26ff5a0ab39495aa63488c6e10038f8d3f2be1df 100644 (file)
@@ -67,7 +67,7 @@ FaxRequest::reset(void)
     desiredtl = 0;
     totdials = 0, maxdials = (u_short) FAX_REDIALS;
     tottries = 0, maxtries = (u_short) FAX_RETRIES;
-    useccover = TRUE;
+    useccover = true;
     pagechop = chop_default;
     chopthreshold = -1;
     notify = no_notice;
@@ -162,10 +162,10 @@ const char* FaxRequest::chopVals[4] = {
 /*
  * Parse the contents of a job description file.
  */
-fxBool
-FaxRequest::readQFile(fxBool& rejectJob)
+bool
+FaxRequest::readQFile(bool& rejectJob)
 {
-    rejectJob = FALSE;
+    rejectJob = false;
     lineno = 0;
     lseek(fd, 0L, SEEK_SET);                   // XXX should only for re-read
     /*
@@ -184,7 +184,7 @@ FaxRequest::readQFile(fxBool& rejectJob)
     Sys::fstat(fd, sb);
     if (sb.st_size < 2) {
        error("Corrupted file (too small)");
-       return (FALSE);
+       return (false);
     }
     char stackbuf[2048];
     char* buf = stackbuf;
@@ -195,7 +195,7 @@ FaxRequest::readQFile(fxBool& rejectJob)
        error("Read error: %s", strerror(errno));
        if (bp != buf)
            delete bp;
-       return (FALSE);
+       return (false);
     }
     /*
      * Force \n-termination of the last line in the
@@ -362,12 +362,12 @@ FaxRequest::readQFile(fxBool& rejectJob)
      */
     if (state < state_suspended || state > state_done) {
        error("Invalid scheduler state %u in job request", state);
-       rejectJob = TRUE;
+       rejectJob = true;
     }
 #define        isNull(s)       ((s).length() == 0)
     if (isNull(number) || isNull(mailaddr) || isNull(sender) || isNull(jobid)
      || isNull(modem)  || isNull(client)   || isNull(owner)) {
-       rejectJob = TRUE;
+       rejectJob = true;
        error("Null or missing %s in job request",
            isNull(number)   ? "number" :
            isNull(mailaddr) ? "mailaddr" :
@@ -385,7 +385,7 @@ FaxRequest::readQFile(fxBool& rejectJob)
     if (desireddf > DF_2DMMR)  desireddf = DF_2DMMR;
     if (buf != stackbuf)                       // dynamically allocated buffer
        delete buf;
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -400,8 +400,8 @@ FaxRequest::readQFile(fxBool& rejectJob)
  * allocated and appended to.  If you don't believe
  * this, enable the code notdef'd out below.
  */
-fxBool
-FaxRequest::reReadQFile(fxBool& rejectJob)
+bool
+FaxRequest::reReadQFile(bool& rejectJob)
 {
 #ifdef notdef
     reset();                                   // non-string items
@@ -516,32 +516,32 @@ FaxRequest::renameSaved(u_int fi)
  * Does the specified document (assumed to be send_fax)
  * appear to have any potential source references?
  */
-fxBool
+bool
 FaxRequest::isUnreferenced(u_int fi)
 {
     if (fi > 0 && requests[fi-1].isSavedOp()) {
        struct stat sb;
        if (Sys::stat(mkbasedoc(requests[fi-1].item), sb) < 0 ||
          sb.st_nlink == 1)
-           return (TRUE);
+           return (true);
     }
-    return (FALSE);
+    return (false);
 }
 
-static fxBool
+static bool
 hasDotDot(const char* pathname)
 {
     const char* cp = pathname;
     while (cp) {
        if (cp[0] == '.')               // NB: good enough
-           return (TRUE);
+           return (true);
        if (cp = strchr(cp, '/'))
            cp++;
     }
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 FaxRequest::checkDocument(const char* pathname)
 {
     /*
@@ -550,16 +550,16 @@ FaxRequest::checkDocument(const char* pathname)
      */
     if (pathname[0] == '/' || hasDotDot(pathname)) {
        error("Invalid document file \"%s\"", pathname);
-       return (FALSE);
+       return (false);
     }
     int fd = Sys::open(pathname, 0);
     if (fd == -1) {
        error("Can not access document file \"%s\": %s",
            pathname, strerror(errno));
-       return (FALSE);
+       return (false);
     }
     Sys::close(fd);
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -591,7 +591,7 @@ FaxRequest::addRequest(FaxSendOp op, char* tag)
  * Add a request entry and verify the document is valid.
  */
 void
-FaxRequest::addRequest(FaxSendOp op, char* tag, fxBool& rejectJob)
+FaxRequest::addRequest(FaxSendOp op, char* tag, bool& rejectJob)
 {
     char* cp = tag;
     while (*cp && *cp != ':')
@@ -609,31 +609,31 @@ FaxRequest::addRequest(FaxSendOp op, char* tag, fxBool& rejectJob)
     else
        cp = tag, tag = "";
     if (!checkDocument(cp))
-       rejectJob = TRUE;
+       rejectJob = true;
     else
        requests.append(faxRequest(op, dirnum, tag, cp));
 }
 
-fxBool
+bool
 FaxRequest::isStrCmd(const char* cmd, u_int& ix)
 {
     for (int i = N(strvals)-1; i >= 0; i--)
        if (strcmp(strvals[i].name, cmd) == 0) {
            ix = i;
-           return (TRUE);
+           return (true);
        }
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 FaxRequest::isShortCmd(const char* cmd, u_int& ix)
 {
     for (int i = N(shortvals)-1; i >= 0; i--)
        if (strcmp(shortvals[i].name, cmd) == 0) {
            ix = i;
-           return (TRUE);
+           return (true);
        }
-    return (FALSE);
+    return (false);
 }
 
 void
index 1dfa1cad76bc680c8ff057f126c6acab005a7066..79e3150e18b2c8a7b55cdc83229b5e0d3c601cf5 100644 (file)
@@ -45,7 +45,7 @@ class Class2Params;
 class FaxRequest {
 protected:
     void reset(void);
-    virtual fxBool checkDocument(const char* pathname);
+    virtual bool checkDocument(const char* pathname);
     virtual void error(const char* fmt, ...);
 public:
     enum {
@@ -160,26 +160,26 @@ public:
 
     FaxRequest(const fxStr& qf, int fd = -1);
     virtual ~FaxRequest();
-    fxBool readQFile(fxBool& rejectJob);
-    fxBool reReadQFile(fxBool& rejectJob);
+    bool readQFile(bool& rejectJob);
+    bool reReadQFile(bool& rejectJob);
     void writeQFile();
     u_int findRequest(FaxSendOp, u_int start = 0) const;
 
-    fxBool isNotify(u_int what) const;
+    bool isNotify(u_int what) const;
 
-    static fxBool isStrCmd(const char* cmd, u_int& ix);
-    static fxBool isShortCmd(const char* cmd, u_int& ix);
+    static bool isStrCmd(const char* cmd, u_int& ix);
+    static bool isShortCmd(const char* cmd, u_int& ix);
 
     void insertFax(u_int ix, const fxStr& file);
     void addRequest(FaxSendOp op, char* tag);
-    void addRequest(FaxSendOp op, char* tag, fxBool& rejectJob);
+    void addRequest(FaxSendOp op, char* tag, bool& rejectJob);
     void checkNotifyValue(const char* tag);
     void checkChopValue(const char* tag);
 
     static fxStr mkbasedoc(const fxStr& file);
     void renameSaved(u_int fi);
-    fxBool isUnreferenced(u_int fi);
+    bool isUnreferenced(u_int fi);
 };
-inline fxBool FaxRequest::isNotify(u_int what) const
+inline bool FaxRequest::isNotify(u_int what) const
     { return (notify & (u_short) what) != 0; }
 #endif /* _FaxRequest_ */
index 1cc032a546f4234c5c7b3be3bbf924dfdc23e653..42165d658a725dc5cc1a78665230d5beeb3b5a6a 100644 (file)
@@ -73,11 +73,11 @@ FaxServer::sendFax(FaxRequest& fax, FaxMachineInfo& clientInfo, FaxAcctInfo& ai)
             * time to settle.  We want a handle on the modem so that we
             * can be prepared to answer incoming phone calls.
             */
-           discardModem(TRUE);
+           discardModem(true);
            changeState(MODEMWAIT, 5);
        } else {
            sendFailed(fax, send_retry, "Can not setup modem", 4*pollModemWait);
-           discardModem(TRUE);
+           discardModem(true);
            changeState(MODEMWAIT, pollModemWait);
        }
        endSession();
@@ -174,10 +174,10 @@ FaxServer::sendFax(FaxRequest& fax, FaxMachineInfo& clientInfo, const fxStr& num
        fax.ndials = 0;                         // consec. failed dial attempts
        fax.tottries++;                         // total answered calls
        fax.totdials++;                         // total attempted calls
-       clientInfo.setCalledBefore(TRUE);
+       clientInfo.setCalledBefore(true);
        clientInfo.setDialFailures(0);
        modem->sendBegin();
-       fxBool remoteHasDoc = FALSE;
+       bool remoteHasDoc = false;
        notifyConnected(fax);
        FaxSendStatus status = modem->getPrologue(
            clientCapabilities, remoteHasDoc, notice);
@@ -268,7 +268,7 @@ FaxServer::sendFax(FaxRequest& fax, FaxMachineInfo& clientInfo, const fxStr& num
            break;
        case ClassModem::NOFCON:        // carrier seen, but handshake failed
        case ClassModem::DATACONN:      // data connection established
-           clientInfo.setCalledBefore(TRUE);
+           clientInfo.setCalledBefore(true);
            /* fall thru... */
        case ClassModem::BUSY:          // busy signal
        case ClassModem::NOANSWER:      // no answer or ring back
@@ -322,7 +322,7 @@ FaxServer::sendFax(FaxRequest& fax, FaxMachineInfo& clientInfo, const fxStr& num
  * Process a polling request.
  */
 void
-FaxServer::sendPoll(FaxRequest& fax, fxBool remoteHasDoc)
+FaxServer::sendPoll(FaxRequest& fax, bool remoteHasDoc)
 {
     u_int ix = fax.findRequest(FaxRequest::send_poll);
     if (ix == fx_invalidArrayIndex) {
@@ -359,7 +359,7 @@ FaxServer::sendPoll(FaxRequest& fax, fxBool remoteHasDoc)
 /*
  * Phase B of Group 3 protocol.
  */
-fxBool
+bool
 FaxServer::sendFaxPhaseB(FaxRequest& fax, faxRequest& freq, FaxMachineInfo& clientInfo)
 {
     fax.status = send_failed;                  // assume failure
@@ -411,7 +411,7 @@ FaxServer::sendFaxPhaseB(FaxRequest& fax, faxRequest& freq, FaxMachineInfo& clie
  * Check client's capabilities (DIS) against those of the
  * modem and select the parameters that are best for us.
  */
-fxBool
+bool
 FaxServer::sendClientCapabilitiesOK(FaxRequest& fax, FaxMachineInfo& clientInfo, fxStr& emsg)
 {
     /*
@@ -425,7 +425,7 @@ FaxServer::sendClientCapabilitiesOK(FaxRequest& fax, FaxMachineInfo& clientInfo,
            fxmin(clientInfo.getMaxSignallingRate(), fax.desiredbr));
     if (signallingRate == -1) {
        emsg = "Modem does not support negotiated signalling rate";
-       return (FALSE);
+       return (false);
     }
     clientParams.br = signallingRate;
 
@@ -435,7 +435,7 @@ FaxServer::sendClientCapabilitiesOK(FaxRequest& fax, FaxMachineInfo& clientInfo,
            fxmax(clientInfo.getMinScanlineTime(), fax.desiredst));
     if (minScanlineTime == -1) {
        emsg = "Modem does not support negotiated min scanline time";
-       return (FALSE);
+       return (false);
     }
     clientParams.st = minScanlineTime;
 
@@ -476,7 +476,7 @@ FaxServer::sendClientCapabilitiesOK(FaxRequest& fax, FaxMachineInfo& clientInfo,
     traceProtocol("USE %s", clientParams.scanlineTimeName());
     if (clientParams.ec == EC_ENABLE)
        traceProtocol("USE error correction mode");
-    return (TRUE);
+    return (true);
 }
 
 /*
index 9b0d767c35e7b87317f06a9a6991a884eae17439..eaab50856d8924428ac3d814549bffc4f6f342c5 100644 (file)
@@ -83,21 +83,21 @@ void FaxServer::notifyConnected(const FaxRequest&) {}
  * just by yanking the cable and then swapping the
  * config file before hooking up the new modem.
  */
-fxBool
+bool
 FaxServer::setupModem()
 {
     modem = NULL;
     if (!ModemServer::setupModem())
-       return (FALSE);
+       return (false);
     if (getModem()->isFaxModem()) {
        modem = (FaxModem*) ModemServer::getModem();
        modem->setLID(localIdentifier);
     }
-    return (TRUE);
+    return (true);
 }
 
 void
-FaxServer::discardModem(fxBool dropDTR)
+FaxServer::discardModem(bool dropDTR)
 {
     ModemServer::discardModem(dropDTR);
     modem = NULL;
@@ -151,19 +151,19 @@ FaxServer::deduceModem()
  * are selected so that any imaged facsimile should
  * still be sendable.
  */
-fxBool FaxServer::modemSupports2D() const
-    { return modem ? modem->supports2D() : FALSE; }
-fxBool FaxServer::modemSupportsEOLPadding() const
-    { return modem ? modem->supportsEOLPadding() : FALSE; }
-fxBool FaxServer::modemSupportsVRes(float res) const
-    { return modem ? modem->supportsVRes(res) : TRUE; }
-fxBool FaxServer::modemSupportsPageWidth(u_int w) const
-    { return modem ? modem->supportsPageWidth(w) : TRUE; }
-fxBool FaxServer::modemSupportsPageLength(u_int l) const
-    { return modem ? modem->supportsPageLength(l) : TRUE; }
-
-fxBool FaxServer::modemSupportsPolling() const
-    { return modem ? modem->supportsPolling() : FALSE; }
+bool FaxServer::modemSupports2D() const
+    { return modem ? modem->supports2D() : false; }
+bool FaxServer::modemSupportsEOLPadding() const
+    { return modem ? modem->supportsEOLPadding() : false; }
+bool FaxServer::modemSupportsVRes(float res) const
+    { return modem ? modem->supportsVRes(res) : true; }
+bool FaxServer::modemSupportsPageWidth(u_int w) const
+    { return modem ? modem->supportsPageWidth(w) : true; }
+bool FaxServer::modemSupportsPageLength(u_int l) const
+    { return modem ? modem->supportsPageLength(l) : true; }
+
+bool FaxServer::modemSupportsPolling() const
+    { return modem ? modem->supportsPolling() : false; }
 
 fxStr
 FaxServer::getModemCapabilities() const
index 7a08e59841216809bd47af06e4d21d5973ebdd83..4030d67237a2785ed94d6ad2249ab17e39945d61 100644 (file)
@@ -62,9 +62,9 @@ private:
 
 // FAX transmission protocol support
     void       sendFax(FaxRequest& fax, FaxMachineInfo&, const fxStr& number);
-    fxBool     sendClientCapabilitiesOK(FaxRequest&, FaxMachineInfo&, fxStr&);
-    fxBool     sendFaxPhaseB(FaxRequest&, faxRequest&, FaxMachineInfo&);
-    void       sendPoll(FaxRequest& fax, fxBool remoteHasDoc);
+    bool       sendClientCapabilitiesOK(FaxRequest&, FaxMachineInfo&, fxStr&);
+    bool       sendFaxPhaseB(FaxRequest&, faxRequest&, FaxMachineInfo&);
+    void       sendPoll(FaxRequest& fax, bool remoteHasDoc);
     FaxSendStatus sendSetupParams(TIFF*,
                    Class2Params&, const FaxMachineInfo&, fxStr&);
     FaxSendStatus sendSetupParams1(TIFF*,
@@ -74,24 +74,24 @@ private:
 // FAX reception support
     int                getRecvFile(fxStr& qfile, fxStr& emsg);
     TIFF*      setupForRecv(FaxRecvInfo&, FaxRecvInfoArray&, fxStr& emsg);
-    fxBool     recvDocuments(TIFF*, FaxRecvInfo&, FaxRecvInfoArray&,
+    bool       recvDocuments(TIFF*, FaxRecvInfo&, FaxRecvInfoArray&,
                    fxStr& emsg);
-    fxBool     recvFaxPhaseD(TIFF* tif, FaxRecvInfo&, int& ppm, fxStr& emsg);
-    fxBool     pollFaxPhaseB(const fxStr& sep, const fxStr& pwd,
+    bool       recvFaxPhaseD(TIFF* tif, FaxRecvInfo&, int& ppm, fxStr& emsg);
+    bool       pollFaxPhaseB(const fxStr& sep, const fxStr& pwd,
                    FaxRecvInfoArray&, fxStr& emsg);
 protected:
     FaxServer(const fxStr& deviceName, const fxStr& devID);
 
-    fxBool     setupModem();
+    bool       setupModem();
     ClassModem*        deduceModem();
-    void       discardModem(fxBool dropDTR);
+    void       discardModem(bool dropDTR);
     fxStr      getModemCapabilities() const;
 
     void       readConfig(const fxStr& filename);
     void       setLocalIdentifier(const fxStr& lid);
 
     void       sendFax(FaxRequest&, FaxMachineInfo&, FaxAcctInfo&);
-    fxBool     recvFax();
+    bool       recvFax();
 
     time_t     getFileTransferTime() const;
     time_t     getPageTransferTime() const;
@@ -116,11 +116,11 @@ public:
 
     const fxStr& getLocalIdentifier() const;
 
-    fxBool modemSupports2D() const;
-    fxBool modemSupportsEOLPadding() const;
-    fxBool modemSupportsVRes(float res) const;
-    fxBool modemSupportsPageWidth(u_int w) const;
-    fxBool modemSupportsPageLength(u_int l) const;
-    fxBool modemSupportsPolling() const;
+    bool modemSupports2D() const;
+    bool modemSupportsEOLPadding() const;
+    bool modemSupportsVRes(float res) const;
+    bool modemSupportsPageWidth(u_int w) const;
+    bool modemSupportsPageLength(u_int l) const;
+    bool modemSupportsPolling() const;
 };
 #endif /* _FaxServer_ */
index 6840efd472e1264aac181de46e9969d2ebd950db..6ac3088019a7fb982de05dd565177503fd43f71e 100644 (file)
@@ -93,7 +93,7 @@ G3Decoder::G3Decoder() {}
 G3Decoder::~G3Decoder() {}
 
 void
-G3Decoder::setupDecoder(u_int recvFillOrder, fxBool is2d)
+G3Decoder::setupDecoder(u_int recvFillOrder, bool is2d)
 {
     /*
      * The G3 decoding state tables are constructed for
@@ -150,20 +150,20 @@ G3Decoder::decode(void* raster, u_int w, u_int h)
     }
 }
 
-fxBool
+bool
 G3Decoder::isNextRow1D()
 {
     DECLARE_STATE_EOL();
 
     CACHE_STATE();
     SYNC_EOL(Nop);
-    fxBool is1D;
+    bool is1D;
     if (is2D) {
        NeedBits8(1, Nop);
        is1D = (GetBits(1) != 0);       // 1D/2D-encoding tag bit
        // NB: we don't clear the tag bit
     } else {
-       is1D = TRUE;
+       is1D = true;
     }
     // now reset state for next decoded row
     BitAcc = (BitAcc<<1)|1;            // EOL bit
@@ -175,11 +175,11 @@ G3Decoder::isNextRow1D()
 
 #define        unexpected(table, a0) do {              \
     invalidCode(table, a0);                    \
-    rowgood = FALSE;                           \
+    rowgood = false;                           \
 } while (0)
 #define        extension(a0) do {                      \
     invalidCode("2D", a0);                     \
-    rowgood = FALSE;                           \
+    rowgood = false;                           \
 } while (0)
 #define        prematureEOF(a0)        // never happens 'cuz of longjmp
 #define        SWAP(t,a,b)     { t x; x = (a); (a) = (b); (b) = x; }
@@ -188,31 +188,31 @@ G3Decoder::isNextRow1D()
  * Decode a single row of pixels and return
  * the decoded data in the scanline buffer.
  */
-fxBool
+bool
 G3Decoder::decodeRow(void* scanline, u_int lastx)
 {
     DECLARE_STATE_2D();
-    fxBool rowgood = TRUE;
-    fxBool nullrow = FALSE;
+    bool rowgood = true;
+    bool nullrow = false;
 
     CACHE_STATE();
     a0 = 0;
     RunLength = 0;
     pa = thisrun = curruns;
     SYNC_EOL(Nop);
-    fxBool is1D;
+    bool is1D;
     if (is2D) {
        NeedBits8(1, Nop);
        is1D = (GetBits(1) != 0);       // 1D/2D-encoding tag bit
        ClrBits(1);
     } else
-       is1D = TRUE;
+       is1D = true;
     if (!is1D) {
        pb = refruns;
        b1 = *pb++;
 #define        badlength(a0,lastx) do {                        \
     badPixelCount("2D", a0, lastx);                    \
-    rowgood = FALSE;                                   \
+    rowgood = false;                                   \
 } while (0)
        EXPAND2D(Nop2d);
     Nop2d:;
@@ -223,7 +223,7 @@ G3Decoder::decodeRow(void* scanline, u_int lastx)
     if (nullrow && ++RTCrun == 6 && RTCrow == -1)      \
        RTCrow = rowref-6;                              \
     badPixelCount("1D", a0, lastx);                    \
-    rowgood = FALSE;                                   \
+    rowgood = false;                                   \
 } while (0)
        EXPAND1D(Nop1d);
     Nop1d:;
index fdff9e51f419b779045ba340c8a18378dfd13c01..fcb3d79946ff5bead93df0b45d78c88b13beac46 100644 (file)
@@ -36,7 +36,7 @@ extern "C" {
 
 class G3Decoder {
 private:
-    fxBool     is2D;           // whether or not data is 2d-encoded
+    bool       is2D;           // whether or not data is 2d-encoded
     uint32     data;           // current input/output byte
     int                bit;            // current bit in input/output byte
     int                EOLcnt;         // EOL code recognized during decoding (1/0)
@@ -67,17 +67,17 @@ public:
 
     virtual ~G3Decoder();
 
-    void       setupDecoder(u_int fillorder, fxBool is2D);
+    void       setupDecoder(u_int fillorder, bool is2D);
     void       setRuns(uint16*, uint16*, int);
     uint16*    lastRuns();
 
     void       decode(void* raster, u_int w, u_int h);
-    fxBool     decodeRow(void* scanline, u_int w);
-    fxBool     isNextRow1D();
+    bool       decodeRow(void* scanline, u_int w);
+    bool       isNextRow1D();
 
     int                getPendingBits() const;
 
-    fxBool     seenRTC() const;
+    bool       seenRTC() const;
     int                getRTCRow() const;
     int                getReferenceRow() const;
 };
@@ -95,7 +95,7 @@ public:
 inline uint16* G3Decoder::lastRuns()   { return is2D ? refruns : curruns; }
 inline const u_char* G3Decoder::getBitmap()    { return bitmap; }
 inline int G3Decoder::getPendingBits() const   { return bit; }
-inline fxBool G3Decoder::seenRTC() const       { return (RTCrow != -1); }
+inline bool G3Decoder::seenRTC() const { return (RTCrow != -1); }
 inline int G3Decoder::getRTCRow() const                { return RTCrow; }
 inline int G3Decoder::getReferenceRow() const  { return rowref; }
 #endif /* _G3Decoder_ */
index ff970f85887b7501d5df6122e0ccd516e0a38243..41b323b022645c4f8990694f8cfc066bccb2c191 100644 (file)
@@ -39,7 +39,7 @@ G3Encoder::~G3Encoder() {}
  * Reset encoding state.
  */
 void
-G3Encoder::setupEncoder(u_int fillOrder, fxBool is2d)
+G3Encoder::setupEncoder(u_int fillOrder, bool is2d)
 {
     is2D = is2d;
     /*
index cd4e6a543f8060dfed8ed773b0b8c1a0aecd65b9..ddb571ec18ce983fff5425b10425479657748549 100644 (file)
@@ -35,7 +35,7 @@ struct tableentry;
 
 class G3Encoder {
 private:
-    fxBool     is2D;           // data is to be 1d/2d-encoded
+    bool       is2D;           // data is to be 1d/2d-encoded
     const u_char* bitmap;      // bit reversal table
     short      data;           // current input/output byte
     short      bit;            // current bit in input/output byte
@@ -55,7 +55,7 @@ public:
     G3Encoder(fxStackBuffer&);
     virtual ~G3Encoder();
 
-    void       setupEncoder(u_int fillOrder, fxBool);
+    void       setupEncoder(u_int fillOrder, bool);
     void       encode(const void* raster, u_int w, u_int h);
 };
 #endif /* _G3Encoder_ */
index 48dc04f69703653c4babd3e78c0bf89bad15d0de..5aefc6b1e38d7710b7bca7f44ffef7bc8189b804 100644 (file)
@@ -149,7 +149,7 @@ Getty::addEnvVar(int& envc, char* env[], fxStr& var)
  * the child.
  */
 void
-Getty::run(int fd, fxBool parentIsInit)
+Getty::run(int fd, bool parentIsInit)
 {
     if (Sys::chdir(_PATH_DEV) < 0)
        fatal("chdir: %m");
@@ -206,8 +206,8 @@ Getty::setupSession(int fd)
        fatal("Unable to dup stdin to stderr: %m");
 }
 
-fxBool
-Getty::wait(int& status, fxBool block)
+bool
+Getty::wait(int& status, bool block)
 {
     return (Sys::waitpid(pid, status, block ? 0 : WNOHANG) == pid);
 }
index 692e1e39274bd3578a7fb738eb2710e0142aadf5..17bfe2758ac3854491235b6059b5d7e39b10a06e 100644 (file)
@@ -55,8 +55,8 @@ public:
 
     void setupArgv(const char* args);  // setup arguments for getty process
                                        // run getty process
-    virtual void run(int fd, fxBool parentIsInit);
-    virtual fxBool wait(int& status, fxBool block = FALSE);
+    virtual void run(int fd, bool parentIsInit);
+    virtual bool wait(int& status, bool block = false);
     virtual void hangup();             // cleanup state after hangup
 
     pid_t getPID() const;              // getty pid
index 981503f9af9b0b0d027310763c77585d7888f326..6b4fad66c137624f2bbf19b388ef45b7a863b809 100644 (file)
@@ -221,14 +221,14 @@ SysVGetty::hangup()
     Getty::hangup();
 }
 
-fxBool
-SysVGetty::wait(int& status, fxBool block)
+bool
+SysVGetty::wait(int& status, bool block)
 {
     if (Getty::wait(status, block)) {
        exitStatus = status;
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 /*
index 354dbb1e150b2f9262de0fc07034844e51a14f7c..e1d865273d42b75dd4480209557580aa51a60c68 100644 (file)
@@ -54,6 +54,6 @@ public:
     ~SysVGetty();
 
     void hangup();
-    fxBool wait(int& status, fxBool block = FALSE);
+    bool wait(int& status, bool block = false);
 };
 #endif /* _SYSVGETTY_ */
index 79b56e71885c85173eeb2b14d647b254edbed8aa..e6c7cf1f72baa402def4e02f33be8e60093df8b8 100644 (file)
@@ -37,7 +37,7 @@ HDLCFrame::HDLCFrame(u_int fo)
     base = next = buf;
     end = &buf[sizeof(buf)];
     amountToGrowBy = 1024;
-    ok = FALSE;
+    ok = false;
 }
 
 HDLCFrame::~HDLCFrame()
index fbe620577f3e165fe4b951ffcb360b8211ff62c0..643e7109f9af4caa8b791a38a05debe8c2f1b3c5 100644 (file)
@@ -45,9 +45,9 @@ public:
     u_char& operator[](u_int i) const; // NB: no bounds checking
     u_char& operator[](int i) const;   // NB: no bounds checking
 
-    fxBool moreFrames() const;         // more frames follow
-    fxBool isOK() const;               // frame has good FCS
-    void setOK(fxBool b);              // set frame FCS indicator
+    bool moreFrames() const;           // more frames follow
+    bool isOK() const;         // frame has good FCS
+    void setOK(bool b);                // set frame FCS indicator
     u_int getRawFCF() const;           // raw FCF in frame
     u_int getFCF() const;              // FCF &~ (FCF_SNDR|FCF_RCVR)
     const u_char* getFrameData() const;        // data following FCF
@@ -62,7 +62,7 @@ protected:
     u_char*    base;
     u_short    amountToGrowBy;
     u_short    frameOverhead;          // # bytes for leader & FCS
-    fxBool     ok;                     // FCS correct
+    bool       ok;                     // FCS correct
 
     void addc(u_char c);               // make room & add a char to the buffer
     void grow(u_int amount);           // make more room in the buffer
@@ -70,17 +70,17 @@ protected:
 
 inline void HDLCFrame::put(u_char c)
     { if (next < end) *next++ = c; else addc(c); }
-inline void HDLCFrame::reset()                     { next = base; ok = FALSE; }
+inline void HDLCFrame::reset()                     { next = base; ok = false; }
 inline u_int HDLCFrame::getLength() const          { return next - base; }
 
 inline HDLCFrame::operator u_char*()               { return base; }
 inline u_char& HDLCFrame::operator[](u_int i) const { return base[i]; }
 inline u_char& HDLCFrame::operator[](int i) const   { return base[i]; }
 
-inline fxBool HDLCFrame::moreFrames() const
+inline bool HDLCFrame::moreFrames() const
     { return ((*this)[1]&0x08) == 0; }
-inline fxBool HDLCFrame::isOK() const               { return ok; }
-inline void HDLCFrame::setOK(fxBool b)              { ok = b; }
+inline bool HDLCFrame::isOK() const                 { return ok; }
+inline void HDLCFrame::setOK(bool b)                { ok = b; }
 inline u_int HDLCFrame::getRawFCF() const           { return (*this)[2]; }
 inline u_int HDLCFrame::getFCF() const              { return (*this)[2]&0x7f; }
 inline const u_char* HDLCFrame::getFrameData() const { return &((*this)[3]); }
index deaf162c5442ef7cd81978d619aebe4f863471ac..33542f68c6d6833a11303c9c40435f9d3d9468c7 100644 (file)
@@ -44,7 +44,7 @@ HylaClient::HylaClient(const fxStr& fn) : fifoName(fn)
     refs = 0;
     seqnum = 0;
     lrunum = lruseq;
-    reap = FALSE;
+    reap = false;
 
     clients[fn] = this;
 }
@@ -75,11 +75,11 @@ HylaClient::getClient(const fxStr& name)
  * client is scheduled to be purged at the next
  * opportune time.
  */
-fxBool
+bool
 HylaClient::send(const char* msg, u_int msgLen)
 {
      if (reap)                                 // ignore if marked for reaping
-       return (FALSE);
+       return (false);
      seqnum++;                                 // count message
 again:
     if (fifo < 0) {
@@ -105,7 +105,7 @@ again:
            logError("HylaClient::send: %s: Cannot open FIFO: %m",
                (const char*) fifoName);
            schedReap();
-           return (FALSE);
+           return (false);
        }
        /*
         * NB: We mark the descriptor for non-blocking i/o; this
@@ -122,7 +122,7 @@ again:
        if (n == -1 && (errno == EBADF || errno == EPIPE)) {
            Sys::close(fifo), fifo = -1;
            schedReap();
-           return (FALSE);
+           return (false);
        }
        if (n != msgLen)
            logError(
@@ -130,7 +130,7 @@ again:
                (const char*) fifoName, seqnum, n);
        lrunum = lruseq++;                      // update last use seqnum
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -139,7 +139,7 @@ again:
  * the oldest trigger with an open descriptor and
  * reclaim it.
  */
-fxBool
+bool
 HylaClient::reapFIFO()
 {
     HylaClient* cand = NULL;
@@ -162,9 +162,9 @@ HylaClient::reapFIFO()
     if (cand) {
        Sys::close(cand->fifo);
        cand->fifo = -1;
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 void
@@ -185,7 +185,7 @@ HylaClient::purge()
 void
 HylaClient::schedReap()
 {
-    reap = TRUE;
+    reap = true;
     schedReaper.start();
 }
 
@@ -197,13 +197,13 @@ HylaClient::schedReap()
  * "delete this".
  */
 
-HylaClient::SchedReaper::SchedReaper() { started = FALSE; }
+HylaClient::SchedReaper::SchedReaper() { started = false; }
 HylaClient::SchedReaper::~SchedReaper() {}
 
 void
 HylaClient::SchedReaper::timerExpired(long, long)
 {
-    started = FALSE;
+    started = false;
     /*
      * Reclaim clients that have gone away.
      *
@@ -230,6 +230,6 @@ HylaClient::SchedReaper::start()
 {
     if (!started) {
        Dispatcher::instance().startTimer(0,1, this);
-       started = TRUE;
+       started = true;
     }
 }
index def4651c349632d076c024f6d26f512d24b81106..37391cdbe1f9992dc93fc703b406ce323256c306 100644 (file)
@@ -41,7 +41,7 @@ class HylaClient {
 public:
     class SchedReaper : public IOHandler {
     private:
-       fxBool  started;
+       bool    started;
     public:
        SchedReaper();
        ~SchedReaper();
@@ -55,7 +55,7 @@ private:
     u_short    refs;           // # of Triggers referencing this client
     tseq_t     seqnum;         // per-client message sequence number
     tseq_t     lrunum;         // sequence number for LRU reclaim of fd's
-    fxBool     reap;           // client should be reaped
+    bool       reap;           // client should be reaped
 
     static tseq_t lruseq;              // master sequence # generator for LRU
     static HylaClientDict clients;     // master table of clients
@@ -66,7 +66,7 @@ private:
 
     HylaClient(const fxStr& fifoName);
 
-    static fxBool reapFIFO();
+    static bool reapFIFO();
     void schedReap();
 public:
     ~HylaClient();
@@ -78,7 +78,7 @@ public:
     void dec();
 
     tseq_t getSeqnum() const;
-    fxBool send(const char* msg, u_int msgLen);
+    bool send(const char* msg, u_int msgLen);
 };
 inline void HylaClient::inc()          { refs++; }
 inline void HylaClient::dec()          { if (--refs == 0) delete this; }
index b3bae759a8a4b0f94dffb13d6468790d6dfa279c..357189ea1b03cadeab8a9772c7583d9d4b2a3b05 100644 (file)
@@ -69,7 +69,7 @@ Job::Job(const FaxRequest& req)
 
     dnext = NULL;
     modem = NULL;
-    suspendPending = FALSE;
+    suspendPending = false;
     registry[jobid] = this;
 }
 
index c62fa1e31da3bdcfa3cfe9e3db3ef226a947bccc..716513208c6b40517f6ab0084b5ce9caef4601e1 100644 (file)
@@ -116,8 +116,8 @@ public:
     u_short    pagewidth;      // desired output page width (mm)
     u_short    pagelength;     // desired output page length (mm)
     u_short    resolution;     // desired vertical resolution (lpi)
-    fxBool     willpoll;       // job has polling request
-    fxBool     suspendPending; // suspend state change pending for job
+    bool       willpoll;       // job has polling request
+    bool       suspendPending; // suspend state change pending for job
 
     fxStr      file;           // queue file name
     fxStr      jobid;          // job identifier
@@ -165,6 +165,6 @@ public:
     operator Job&() const      { return *(Job*)ql; }
     operator Job*() const      { return (Job*) ql; }
     Job& job() const           { return *(Job*)ql; }
-    fxBool notDone()           { return ql != head; }
+    bool notDone()             { return ql != head; }
 };
 #endif /* _Job_ */
index 94df82127d36be971fc31236ad483c175b9aad7e..4f8c9aca7e4d35f383c99439e097abd4c04bdf20 100644 (file)
@@ -72,7 +72,7 @@ Modem::Modem(const fxStr& id)
     , lockHandler(*this)
 {
     state = DOWN;                      // modem down until notified otherwise
-    canpoll = TRUE;                    // be optimistic
+    canpoll = true;                    // be optimistic
     fd = -1;                           // force open on first use
     priority = 255;                    // lowest priority
     insert(list);                      // place at end of master list
@@ -117,18 +117,18 @@ Modem::getModemByID(const fxStr& id)
 /*
  * Is the modem capable of handling the job.
  */ 
-fxBool
+bool
 Modem::isCapable(const Job& job) const
 {
     if (job.willpoll && !canpoll)
-       return (FALSE);
+       return (false);
     if (job.pagewidth && !supportsPageWidthInMM(job.pagewidth))
-       return (FALSE);
+       return (false);
     if (job.pagelength && !supportsPageLengthInMM(job.pagelength))
-       return (FALSE);
+       return (false);
     if (job.resolution && !supportsVRes(job.resolution))
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 
 /*
@@ -173,13 +173,13 @@ Modem::findModem(const Job& job)
 /*
  * Assign a modem for use by a job.
  */
-fxBool
+bool
 Modem::assign(Job& job)
 {
     if (lock->lock()) {                // lock modem for use
        state = BUSY;           // mark in use
        job.modem = this;       // assign modem to job
-       return (TRUE);
+       return (true);
     } else {
        /*
         * Modem is locked for use by an outbound task.
@@ -192,7 +192,7 @@ Modem::assign(Job& job)
         * to re-assign it in findModem.
         */
        state = BUSY;           // mark in use
-       return (FALSE);
+       return (false);
     }
 }
 
@@ -277,7 +277,7 @@ void Modem::setState(ModemState s)          { state = s; }
  * (but then the caller would need to know in order
  * to pad the image to the appropriate width).
  */
-fxBool
+bool
 Modem::supportsPageWidthInMM(u_int w) const
 {
     if (w <= 110)              // 864 pixels + slop
@@ -291,10 +291,10 @@ Modem::supportsPageWidthInMM(u_int w) const
     else if (w <= 306)         // 2432 pixels + slop
        return caps.wd & BIT(WD_2432);
     else
-       return FALSE;
+       return false;
 }
 
-fxBool
+bool
 Modem::supportsPageWidthInPixels(u_int w) const
 {
     if (w <= 880)              // 864 pixels + slop
@@ -308,7 +308,7 @@ Modem::supportsPageWidthInPixels(u_int w) const
     else if (w <= 2448)                // 2432 pixels + slop
        return caps.wd & BIT(WD_2432);
     else
-       return FALSE;
+       return false;
 }
 
 /*
@@ -318,7 +318,7 @@ Modem::supportsPageWidthInPixels(u_int w) const
  * problems and general sloppiness on the part of
  * applications writing TIFF files.
  */
-fxBool
+bool
 Modem::supportsVRes(float res) const
 {
     if (75 <= res && res < 120)
@@ -326,13 +326,13 @@ Modem::supportsVRes(float res) const
     else if (150 <= res && res < 250)
        return caps.vr & BIT(VR_FINE);
     else
-       return FALSE;
+       return false;
 }
 
 /*
  * Return whether or not the modem supports 2DMR.
  */
-fxBool
+bool
 Modem::supports2D() const
 {
     return caps.df & BIT(DF_2DMR);
@@ -343,7 +343,7 @@ Modem::supports2D() const
  * specified page length.  As above for vertical
  * resolution we're lenient in what we accept.
  */
-fxBool
+bool
 Modem::supportsPageLengthInMM(u_int l) const
 {
     // XXX probably need to be more forgiving with values
@@ -366,17 +366,17 @@ Modem::broadcast(const fxStr& msg)
         * NB: We rarely send msgs, so for now close after each use.
         *     +1 here is so the \0 is included in the message.
         */
-       iter.modem().send(msg, msg.length()+1, FALSE);
+       iter.modem().send(msg, msg.length()+1, false);
     }
 }
 
 /*
  * Send a message to the process managing a modem.
  */
-fxBool
-Modem::send(const char* msg, u_int msgLen, fxBool cacheFd)
+bool
+Modem::send(const char* msg, u_int msgLen, bool cacheFd)
 {
-    fxBool retry = TRUE;
+    bool retry = true;
 again:
     if (fd < 0) {
        fd = Sys::open(fifoName, O_WRONLY|O_NDELAY);
@@ -388,13 +388,13 @@ again:
             */
            logError("MODEM " | devID | ": Cannot open FIFO: %m");
 #endif
-           return (FALSE);
+           return (false);
        }
     }
     int n = Sys::write(fd, msg, msgLen);
     if (n == -1) {
        if (errno == EBADF && retry) {          // cached descriptor bad, retry
-           retry = FALSE;
+           retry = false;
            Sys::close(fd), fd = -1;
            goto again;
        }
index 47a63e438b08d9696dbb130fe6aae7429102a284..7322234208723e95299eaa18768083360913588a 100644 (file)
@@ -84,7 +84,7 @@ private:
     fxStr      number;         // modem phone number
     fxStr      commid;         // communication identifier
     ModemState state;          // modem state
-    fxBool     canpoll;        // modem is capable of polling
+    bool       canpoll;        // modem is capable of polling
     u_short    priority;       // modem priority
     Class2Params caps;         // modem capabilities
     UUCPLock*  lock;           // UUCP lockfile support
@@ -109,7 +109,7 @@ public:
     static Modem* modemExists(const fxStr& id);
     static Modem* findModem(const Job& job);
 
-    fxBool assign(Job&);               // assign modem
+    bool assign(Job&);         // assign modem
     void release();                    // release modem
 
     void startLockPolling(long sec);   // initiate polling thread
@@ -122,23 +122,23 @@ public:
     u_int getPriority() const;         // return modem scheduling priority
     const fxStr& getCommID() const;    // return communication ID
 
-    fxBool isCapable(const Job& job) const;
-    fxBool supports2D() const;         // modem supports 2D-encoded fax
-    fxBool supportsVRes(float) const;  // modem supports vertical resolution
+    bool isCapable(const Job& job) const;
+    bool supports2D() const;           // modem supports 2D-encoded fax
+    bool supportsVRes(float) const;    // modem supports vertical resolution
     // modem support fax page width
-    fxBool supportsPageWidthInMM(u_int) const;
-    fxBool supportsPageWidthInPixels(u_int) const;
+    bool supportsPageWidthInMM(u_int) const;
+    bool supportsPageWidthInPixels(u_int) const;
     // modem supports fax page length
-    fxBool supportsPageLengthInMM(u_int) const;
-    fxBool supportsPolling() const;    // modem supports fax polling
+    bool supportsPageLengthInMM(u_int) const;
+    bool supportsPolling() const;      // modem supports fax polling
 
     // send message to modem FIFO
-    fxBool send(const char* msg, u_int len, fxBool cacheFd = TRUE);
+    bool send(const char* msg, u_int len, bool cacheFd = true);
     static void broadcast(const fxStr&);       // broadcast msg to all FIFOs
 
     void encode(fxStackBuffer&) const; // encode for ModemExt
 };
-inline fxBool Modem::supportsPolling() const   { return canpoll; }
+inline bool Modem::supportsPolling() const     { return canpoll; }
 inline const fxStr& Modem::getDeviceID() const { return devID; }
 inline const fxStr& Modem::getNumber() const   { return number; }
 inline ModemState Modem::getState() const      { return state; }
@@ -164,6 +164,6 @@ public:
     operator Modem&() const    { return *(Modem*)ql; }
     operator Modem*() const    { return (Modem*) ql; }
     Modem& modem() const       { return *(Modem*)ql; }
-    fxBool notDone()           { return ql != head; }
+    bool notDone()             { return ql != head; }
 };
 #endif /* _Modem_ */
index a5fb3c486c31818642b4e9adbcd89bd8be926d20..53a4f4b77a9aeb0206321e4e09278f307ff5dae3 100644 (file)
@@ -209,9 +209,9 @@ ModemConfig::setupConfig()
     flowControl                = ClassModem::FLOW_NONE;// no flow control
     maxRate            = ClassModem::BR19200;  // reasonable for most modems
     minSpeed           = BR_2400;              // minimum transmit speed
-    waitForConnect     = FALSE;                // unique modem answer response
-    class2XmitWaitForXON = TRUE;               // default per Class 2 spec
-    class2SendRTC      = FALSE;                // default per Class 2 spec
+    waitForConnect     = false;                // unique modem answer response
+    class2XmitWaitForXON = true;               // default per Class 2 spec
+    class2SendRTC      = false;                // default per Class 2 spec
     setVolumeCmds("ATM0 ATL0M1 ATL1M1 ATL2M1 ATL3M1");
     recvDataFormat     = DF_ALL;               // default to no transcoding
 }
@@ -225,7 +225,7 @@ ModemConfig::resetConfig()
 
 #define        valeq(a,b)      (strcasecmp(a,b)==0)
 
-fxBool
+bool
 ModemConfig::findRate(const char* cp, BaudRate& br)
 {
     static const struct {
@@ -246,9 +246,9 @@ ModemConfig::findRate(const char* cp, BaudRate& br)
     for (int i = N(rates)-1; i >= 0; i--)
        if (streq(cp, rates[i].name)) {
            br = rates[i].b;
-           return (TRUE);
+           return (true);
        }
-    return (FALSE);
+    return (false);
 }
 
 BaudRate
@@ -262,7 +262,7 @@ ModemConfig::getRate(const char* cp)
     return (br);
 }
 
-fxBool
+bool
 ModemConfig::findATResponse(const char* cp, ATResponse& resp)
 {
     static const struct {
@@ -284,9 +284,9 @@ ModemConfig::findATResponse(const char* cp, ATResponse& resp)
     for (u_int i = 0; i < N(responses); i++)
        if (valeq(cp, responses[i].name)) {
            resp = responses[i].r;
-           return (TRUE);
+           return (true);
        }
-    return (FALSE);
+    return (false);
 }
 
 u_int
@@ -302,7 +302,7 @@ ModemConfig::getFill(const char* cp)
     }
 }
 
-fxBool
+bool
 ModemConfig::findFlow(const char* cp, FlowControl& fc)
 {
     static const struct {
@@ -318,9 +318,9 @@ ModemConfig::findFlow(const char* cp, FlowControl& fc)
     for (u_int i = 0; i < N(fcnames); i++)
        if (valeq(cp, fcnames[i].name)) {
            fc = fcnames[i].f;
-           return (TRUE);
+           return (true);
        }
-    return (FALSE);
+    return (false);
 }
 
 FlowControl
@@ -421,7 +421,7 @@ ModemConfig::getSpeed(const char* value)
     return (BR_2400);
 }
 
-fxBool
+bool
 ModemConfig::findDataFormat(const char* cp, u_int& df)
 {
     static const struct {
@@ -447,9 +447,9 @@ ModemConfig::findDataFormat(const char* cp, u_int& df)
     for (i = 0; i < N(dfnames); i++)
        if (valeq(v, dfnames[i].name)) {
            df = dfnames[i].d;
-           return (TRUE);
+           return (true);
        }
-    return (FALSE);
+    return (false);
 }
 
 u_int
@@ -472,7 +472,7 @@ ModemConfig::parseCID(const char* rbuf, CallerID& cid) const
        cid.number = rbuf+cidNumber.length();
 }
 
-fxBool
+bool
 ModemConfig::setConfigItem(const char* tag, const char* value)
 {
     u_int ix;
@@ -502,7 +502,7 @@ ModemConfig::setConfigItem(const char* tag, const char* value)
     else if (streq(tag, "recvdataformat"))
        recvDataFormat = getDataFormat(value);
     else
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 #undef N
index 9a9d8ae77a1028e77297b98449ed540b8158895d..413d1f684aa649d573a8ea107e3f3d61f604bdee 100644 (file)
@@ -40,17 +40,17 @@ private:
     u_int      getSpeed(const char* value);
     u_int      getDataFormat(const char* value);
 
-    static fxBool findRate(const char*, BaudRate&);
-    static fxBool findATResponse(const char*, ATResponse&);
-    static fxBool findFlow(const char*, FlowControl&);
-    static fxBool findDataFormat(const char*, u_int&);
+    static bool findRate(const char*, BaudRate&);
+    static bool findATResponse(const char*, ATResponse&);
+    static bool findFlow(const char*, FlowControl&);
+    static bool findDataFormat(const char*, u_int&);
 protected:
     ModemConfig();
 
     void setupConfig();
     virtual void resetConfig();
 
-    virtual fxBool setConfigItem(const char* tag, const char* value);
+    virtual bool setConfigItem(const char* tag, const char* value);
     virtual void configError(const char* fmt, ...) = 0;
     virtual void configTrace(const char* fmt, ...) = 0;
     fxStr parseATCmd(const char*);
@@ -142,8 +142,8 @@ public:
     fxStr      class2HFLOCmd;          // cmd to setup hardware flow control
     fxStr      class2MINSPCmd;         // cmd to setup min transmit speed
     fxStr      class2RecvDataTrigger;  // send to start recv
-    fxBool     class2XmitWaitForXON;   // wait for XON before send
-    fxBool     class2SendRTC;          // append RTC to page data on transmit
+    bool       class2XmitWaitForXON;   // wait for XON before send
+    bool       class2SendRTC;          // append RTC to page data on transmit
                                        // for class 2.0:
     fxStr      class2PIECmd;           // cmd to set proc interrupt handling
     fxStr      class2NRCmd;            // cmd to set status reporting
@@ -165,7 +165,7 @@ public:
     u_int      percentGoodLines;       // required % of good lines in page
     u_int      maxConsecutiveBadLines; // max consecutive bad lines in page
     u_int      minSpeed;               // minimum speed for fax transmits
-    fxBool     waitForConnect;         // modem sends multiple answer responses
+    bool       waitForConnect;         // modem sends multiple answer responses
     fxStr      tagLineFmt;             // format string for tag lines
     fxStr      tagLineFontFile;        // font file for imaging tag lines
     u_int      recvDataFormat;         // received facsimile data format
index 2bf4d1821fdb396481d43205e25982aa1d814fd0..bd865e8ed633cb37a37f5f31563f65e38f6eec4d 100644 (file)
@@ -79,10 +79,10 @@ ModemServer::ModemServer(const fxStr& devName, const fxStr& devID)
 {
     state = BASE;
     statusFile = NULL;
-    abortCall = FALSE;
-    deduceComplain = TRUE;             // first failure causes complaint
-    changePriority = TRUE;
-    delayConfig = FALSE;
+    abortCall = false;
+    deduceComplain = true;             // first failure causes complaint
+    changePriority = true;
+    delayConfig = false;
 
     modemFd = -1;
     modem = NULL;
@@ -93,7 +93,7 @@ ModemServer::ModemServer(const fxStr& devName, const fxStr& devID)
     setupAttempts = 0;
 
     rcvCC = rcvNext = 0;
-    timeout = FALSE;
+    timeout = false;
     log = NULL;
 }
 
@@ -115,7 +115,7 @@ ModemServer::initialize(int argc, char** argv)
     for (GetoptIter iter(argc, argv, faxApp::getOpts()); iter.notDone(); iter++)
        switch (iter.option()) {
        case 'p':
-           changePriority = FALSE;
+           changePriority = false;
            break;
        case 'x':
            tracingMask &= ~(FAXTRACE_MODEMIO|FAXTRACE_TIMEOUTS);
@@ -145,7 +145,7 @@ void
 ModemServer::open()
 {
     if (lockModem()) {
-       fxBool modemReady = setupModem();
+       bool modemReady = setupModem();
        unlockModem();
        if (!modemReady)
            changeState(MODEMWAIT, pollModemWait);
@@ -166,7 +166,7 @@ ModemServer::close()
     if (lockModem()) {
        if (modem)
            modem->hangup();
-       discardModem(TRUE);
+       discardModem(true);
        unlockModem();
     }
 }
@@ -391,7 +391,7 @@ void
 ModemServer::resetConfig()
 {
     if (modem)
-       discardModem(TRUE);
+       discardModem(true);
     ServerConfig::resetConfig();
 }
 
@@ -400,13 +400,13 @@ const fxStr& ModemServer::getConfigFile() const { return configFile; }
 /*
  * Setup the modem; if needed.
  */
-fxBool
+bool
 ModemServer::setupModem()
 {
     if (!modem) {
        const char* dev = modemDevice;
        if (!openDevice(dev))
-           return (FALSE);
+           return (false);
        /*
         * Deduce modem type and setup configuration info.
         * The deduceComplain cruft is just to reduce the
@@ -414,14 +414,14 @@ ModemServer::setupModem()
         */
        modem = deduceModem();
        if (!modem) {
-           discardModem(TRUE);
+           discardModem(true);
            if (deduceComplain) {
                traceServer("%s: Can not initialize modem.", dev);
-               deduceComplain = FALSE;
+               deduceComplain = false;
            }
-           return (FALSE);
+           return (false);
        } else {
-           deduceComplain = TRUE;
+           deduceComplain = true;
            traceServer("MODEM "
                | modem->getManufacturer() | " "
                | modem->getModel() | "/"
@@ -441,7 +441,7 @@ ModemServer::setupModem()
      * business in the modem class.
      */
     modem->setSpeakerVolume(speakerVolume);
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -472,7 +472,7 @@ ModemServer::getModemCapabilities() const
  * and change the device file to be owned by us
  * and with a protected file mode.
  */
-fxBool
+bool
 ModemServer::openDevice(const char* dev)
 {
     /*
@@ -483,7 +483,7 @@ ModemServer::openDevice(const char* dev)
     uid_t euid = geteuid();
     if (seteuid(0) < 0) {
         traceServer("%s: seteuid root failed (%m)", dev);
-        return (FALSE);
+        return (false);
     }
 #ifdef O_NDELAY
     /*
@@ -494,13 +494,13 @@ ModemServer::openDevice(const char* dev)
     if (modemFd < 0) {
        seteuid(euid);
        traceServer("%s: Can not open modem (%m)", dev);
-       return (FALSE);
+       return (false);
     }
     int flags = fcntl(modemFd, F_GETFL, 0);
     if (fcntl(modemFd, F_SETFL, flags &~ O_NDELAY) < 0) {
         traceServer("%s: fcntl: %m", dev);
         Sys::close(modemFd), modemFd = -1;
-        return (FALSE);
+        return (false);
     }
 #else
     startTimeout(3*1000);
@@ -512,7 +512,7 @@ ModemServer::openDevice(const char* dev)
                "%s: Can not open modem (timed out)." :
                "%s: Can not open modem (%m)."),
            dev, errno);
-       return (FALSE);
+       return (false);
     }
 #endif
     /*
@@ -535,10 +535,10 @@ ModemServer::openDevice(const char* dev)
 #endif
        traceServer("%s: chmod: %m", dev);
     seteuid(euid);
-    return (TRUE);
+    return (true);
 }
 
-fxBool
+bool
 ModemServer::reopenDevice()
 {
     if (modemFd >= 0)
@@ -550,11 +550,11 @@ ModemServer::reopenDevice()
  * Discard any handle on the modem.
  */
 void
-ModemServer::discardModem(fxBool dropDTR)
+ModemServer::discardModem(bool dropDTR)
 {
     if (modemFd >= 0) {
        if (dropDTR)
-           (void) setDTR(FALSE);                       // force hangup
+           (void) setDTR(false);                       // force hangup
        Sys::close(modemFd), modemFd = -1;              // discard open file
     }
     delete modem, modem = NULL;
@@ -637,7 +637,7 @@ ModemServer::endSession()
  * abort request was made or if an external abort
  * message is dispatched during our processing.
  */
-fxBool
+bool
 ModemServer::abortRequested()
 {
 #ifndef SERVERABORTBUG
@@ -658,7 +658,7 @@ ModemServer::abortRequested()
 void
 ModemServer::abortSession()
 {
-    abortCall = TRUE;
+    abortCall = true;
     traceServer("ABORT: job abort requested");
 }
 
@@ -682,7 +682,7 @@ ModemServer::timerExpired(long, long)
         * so cause jobs to be requeued).
         */
        if (lockModem()) {
-           fxBool modemReady = setupModem();
+           bool modemReady = setupModem();
            unlockModem();
            if (modemReady)
                changeState(RUNNING, 0);
@@ -700,13 +700,13 @@ ModemServer::timerExpired(long, long)
  * are selected so that any imaged facsimile should
  * still be sendable.
  */
-fxBool ModemServer::modemReady() const
+bool ModemServer::modemReady() const
     { return modem != NULL; }
 
-fxBool ModemServer::serverBusy() const
+bool ModemServer::serverBusy() const
     { return state != RUNNING; }
 
-fxBool ModemServer::modemWaitForRings(u_int rings, CallType& type, CallerID& cid)
+bool ModemServer::modemWaitForRings(u_int rings, CallType& type, CallerID& cid)
     { return modem->waitForRings(rings, type, cid); }
 CallType ModemServer::modemAnswerCall(AnswerType atype, fxStr& emsg)
     { return modem->answerCall(atype, emsg); }
@@ -732,9 +732,9 @@ void
 ModemServer::readConfig(const fxStr& filename)
 {
     dialRulesFile = "";
-    delayConfig = TRUE;
+    delayConfig = true;
     ServerConfig::readConfig(filename);
-    delayConfig = FALSE;
+    delayConfig = false;
     if (dialRulesFile != "")
        setDialRules(dialRulesFile);
     if (localIdentifier == "")
@@ -964,10 +964,10 @@ ModemServer::setParity(termios& term, Parity parity)
     }
 }
 
-fxBool
+bool
 ModemServer::tcsetattr(int op, struct termios& term)
 {
-    fxBool ok;
+    bool ok;
     if (clocalAsRoot) {
        /*
         * Gag, IRIX 5.2 and beyond permit only the super-user to
@@ -988,20 +988,20 @@ ModemServer::tcsetattr(int op, struct termios& term)
     return ok;
 }
 
-fxBool
+bool
 ModemServer::tcgetattr(const char* method, struct termios& term)
 {
     if (::tcgetattr(modemFd, &term) != 0) {
        traceModemOp("%s::tcgetattr: %m", method);
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 /*
  * Set tty port baud rate and flow control.
  */
-fxBool
+bool
 ModemServer::setBaudRate(BaudRate rate, FlowControl iFlow, FlowControl oFlow)
 {
     if (rate >= NBAUDS)
@@ -1010,7 +1010,7 @@ ModemServer::setBaudRate(BaudRate rate, FlowControl iFlow, FlowControl oFlow)
        baudRates[rate], flowNames[iFlow], flowNames[oFlow]);
     struct termios term;
     if (!tcgetattr("setBaudRate", term))
-       return (FALSE);
+       return (false);
     curRate = rate;                            // NB: for use elsewhere
     term.c_oflag = 0;
     term.c_lflag = 0;
@@ -1067,7 +1067,7 @@ ModemServer::setBaudRate(BaudRate rate, FlowControl iFlow, FlowControl oFlow)
 /*
  * Set tty port baud rate and leave flow control state unchanged.
  */
-fxBool
+bool
 ModemServer::setBaudRate(BaudRate rate)
 {
     if (rate >= NBAUDS)
@@ -1076,7 +1076,7 @@ ModemServer::setBaudRate(BaudRate rate)
        baudRates[rate]);
     struct termios term;
     if (!tcgetattr("setBaudRate", term))
-       return (FALSE);
+       return (false);
     curRate = rate;                            // NB: for use elsewhere
     term.c_oflag = 0;
     term.c_lflag = 0;
@@ -1095,13 +1095,13 @@ ModemServer::setBaudRate(BaudRate rate)
 /*
  * Set tty port parity and number of data bits
  */
-fxBool
+bool
 ModemServer::setParity(Parity parity)
 {
     traceModemOp("set parity: %s", parityNames[parity]);
     struct termios term;
     if (!tcgetattr("setParity", term))
-       return (FALSE);
+       return (false);
     setParity(term, parity);
     curParity = parity;                                // used above
     flushModemInput();
@@ -1120,8 +1120,8 @@ ModemServer::setParity(Parity parity)
  *     setting the baud rate to zero on some systems can cause
  *     strange side effects.
  */
-fxBool
-ModemServer::setDTR(fxBool onoff)
+bool
+ModemServer::setDTR(bool onoff)
 {
     traceModemOp("set DTR %s", onoff ? "ON" : "OFF");
 #if defined(MCGETA) && defined(MCSETAF) && defined(MDTR)
@@ -1135,7 +1135,7 @@ ModemServer::setDTR(fxBool onoff)
        else
            mstat &= ~MDTR;
        if (ioctl(modemFd, MCSETAF, &mstat) >= 0)
-           return (TRUE);
+           return (true);
     }
 #elif defined(TIOCMBIS)
     int mctl = TIOCM_DTR;
@@ -1148,7 +1148,7 @@ ModemServer::setDTR(fxBool onoff)
 #else
     if (ioctl(modemFd, onoff ? TIOCMBIS : TIOCMBIC, (char *)mctl) >= 0)
 #endif
-       return (TRUE);
+       return (true);
     /*
      * Sigh, Sun seems to support this ioctl only on *some*
      * devices (e.g. on-board duarts, but not the ALM-2 card);
@@ -1156,7 +1156,7 @@ ModemServer::setDTR(fxBool onoff)
      * on the usual way of doing things...
      */
 #endif /* TIOCMBIS */
-    return (onoff ? TRUE : setBaudRate(ClassModem::BR0));
+    return (onoff ? true : setBaudRate(ClassModem::BR0));
 }
 
 static const char* actNames[] = { "NOW", "DRAIN", "FLUSH" };
@@ -1173,7 +1173,7 @@ static u_int actCode[] = { TCSANOW, TCSADRAIN, TCSAFLUSH };
  * XON/XOFF handling should be enabled so that any
  * XON/XOFF from/to the modem will be interpreted.
  */
-fxBool
+bool
 ModemServer::setXONXOFF(FlowControl iFlow, FlowControl oFlow, SetAction act)
 {
     traceModemOp("set XON/XOFF/%s: input %s, output %s",
@@ -1183,7 +1183,7 @@ ModemServer::setXONXOFF(FlowControl iFlow, FlowControl oFlow, SetAction act)
     );
     struct termios term;
     if (!tcgetattr("setXONXOFF", term))
-       return (FALSE);
+       return (false);
     setFlow(term, iFlow, oFlow);
     if (act == ClassModem::ACT_FLUSH)
        flushModemInput();
@@ -1205,8 +1205,8 @@ ModemServer::setXONXOFF(FlowControl iFlow, FlowControl oFlow, SetAction act)
  * that delays the delivery of input data from the UART module
  * upstream to the tty module.
  */
-fxBool
-ModemServer::setInputBuffering(fxBool on)
+bool
+ModemServer::setInputBuffering(bool on)
 {
     traceModemOp("input buffering %s", on ? "enabled" : "disabled");
 #ifdef SIOC_ITIMER
@@ -1245,8 +1245,8 @@ ModemServer::setInputBuffering(fxBool on)
      * the ALM-2, however, you are just plain out of luck unless
      * you have source code.
      */
-    static fxBool zsunbuf_push_tried = FALSE;
-    static fxBool zsunbuf_push_ok = FALSE;
+    static bool zsunbuf_push_tried = false;
+    static bool zsunbuf_push_ok = false;
     if (on) {                  // pop zsunbuf if present to turn on buffering
        char topmodule[FMNAMESZ+1];
         if (zsunbuf_push_ok && ioctl(modemFd, I_LOOK, topmodule) >= 0 &&
@@ -1259,7 +1259,7 @@ ModemServer::setInputBuffering(fxBool on)
             zsunbuf_push_ok = (ioctl(modemFd, I_PUSH, "zsunbuf") >= 0);
             traceModemOp("initial push zsunbuf %s",
                 zsunbuf_push_ok ? "succeeded" : "failed");
-            zsunbuf_push_tried = TRUE;
+            zsunbuf_push_tried = true;
         } else if (zsunbuf_push_ok) {
             if (ioctl(modemFd, I_PUSH, "zsunbuf") < 0)
                 traceModemOp("push zsunbuf failed: %m");
@@ -1280,8 +1280,8 @@ ModemServer::setInputBuffering(fxBool on)
     return (tcsetattr(TCSANOW, term));
 }
 
-fxBool
-ModemServer::sendBreak(fxBool pause)
+bool
+ModemServer::sendBreak(bool pause)
 {
     traceModemOp("send break%s", pause ? " (pause)" : "");
     flushModemInput();
@@ -1294,16 +1294,16 @@ ModemServer::sendBreak(fxBool pause)
     }
     if (tcsendbreak(modemFd, 0) != 0) {
        traceModemOp("tcsendbreak: %m");
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 void
 ModemServer::startTimeout(long ms)
 {
     timer.startTimeout(ms);
-    timeout = FALSE;
+    timeout = false;
 }
 
 void
@@ -1365,14 +1365,14 @@ ModemServer::modemFlushInput()
        traceModemOp("tcflush: %m");
 }
 
-fxBool
+bool
 ModemServer::modemStopOutput()
 {
     if (tcflow(modemFd, TCOOFF) != 0) {
        traceModemOp("tcflow: %m");
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 void
@@ -1381,20 +1381,20 @@ ModemServer::flushModemInput()
     rcvCC = rcvNext = 0;
 }
 
-fxBool
+bool
 ModemServer::putModem(const void* data, int n, long ms)
 {
     traceStatus(FAXTRACE_MODEMCOM, "<-- data [%d]", n);
     return (putModem1(data, n, ms));
 }
 
-fxBool
+bool
 ModemServer::putModem1(const void* data, int n, long ms)
 {
     if (ms)
        startTimeout(ms);
     else
-       timeout = FALSE;
+       timeout = false;
     int cc = Sys::write(modemFd, (const char*) data, n);
     if (ms)
        stopTimeout("writing to modem");
index 674bdb3497a8066b9269edee976a89e02992c903..52f6997e6c685ca8ef909cb6ec5e53fa89bacd55 100644 (file)
@@ -62,9 +62,9 @@ protected:
     };
 private:
     FILE*      statusFile;             // server status file
-    fxBool     deduceComplain;         // if true, complain when can't deduce
-    fxBool     changePriority;         // change process priority by state
-    fxBool     delayConfig;            // suppress effects while reading config
+    bool       deduceComplain;         // if true, complain when can't deduce
+    bool       changePriority;         // change process priority by state
+    bool       delayConfig;            // suppress effects while reading config
     fxStr      dialRulesFile;          // dial string rules filename
     fxStr      commid;                 // communication ID
 // generic modem-related stuff
@@ -73,7 +73,7 @@ private:
     fxStr      modemDevID;             // device identifier
     ClassModem*        modem;                  // modem driver
     Timeout    timer;                  // timeout support class
-    fxBool     timeout;                // timeout during i/o operations
+    bool       timeout;                // timeout during i/o operations
     fxStr      configFile;             // pathname to configuration file
     BaudRate   curRate;                // current termio baud rate
     Parity     curParity;              // current termio parity setting
@@ -94,10 +94,10 @@ private:
     static const char* stateNames[9];
     static const char* stateStatus[9];
 
-    fxBool     openDevice(const char* dev);
-    fxBool     reopenDevice();
-    fxBool     tcsetattr(int op, struct termios& term);
-    fxBool     tcgetattr(const char* method, struct termios& term);
+    bool       openDevice(const char* dev);
+    bool       reopenDevice();
+    bool       tcsetattr(int op, struct termios& term);
+    bool       tcgetattr(const char* method, struct termios& term);
     static void setFlow(struct termios&, FlowControl iflow, FlowControl oflow);
     static void setParity(struct termios&, Parity);
 
@@ -116,15 +116,15 @@ protected:
        LISTENING       = 8
     };
     ModemServerState state;
-    fxBool     abortCall;              // abort current send/receive
+    bool       abortCall;              // abort current send/receive
 // logging and tracing
     FaxMachineLog* log;                        // current log device
 
     ModemServer(const fxStr& deviceName, const fxStr& devID);
 
 // modem driver setup+teardown interfaces
-    virtual fxBool setupModem();
-    virtual void discardModem(fxBool dropDTR);
+    virtual bool setupModem();
+    virtual void discardModem(bool dropDTR);
     virtual ClassModem* deduceModem();
 // low-level modem interfaces
     int                getModemFd();                           // XXX
@@ -135,21 +135,21 @@ protected:
     int                getModemLine(char buf[], u_int bufSize, long ms = 0);
     int                getModemChar(long ms = 0);
     void       flushModemInput();
-    fxBool     putModem(const void* data, int n, long ms = 0);
-    fxBool     putModem1(const void* data, int n, long ms = 0);
+    bool       putModem(const void* data, int n, long ms = 0);
+    bool       putModem1(const void* data, int n, long ms = 0);
     void       startTimeout(long ms);
     void       stopTimeout(const char* whichdir);
 // modem line control
-    fxBool     sendBreak(fxBool pause);
-    fxBool     setBaudRate(BaudRate rate);
-    fxBool     setBaudRate(BaudRate rate, FlowControl i, FlowControl o);
-    fxBool     setParity(Parity parity);
-    fxBool     setXONXOFF(FlowControl i, FlowControl o, SetAction act);
-    fxBool     setDTR(fxBool on);
-    fxBool     setInputBuffering(fxBool on);
-    fxBool     modemStopOutput();
+    bool       sendBreak(bool pause);
+    bool       setBaudRate(BaudRate rate);
+    bool       setBaudRate(BaudRate rate, FlowControl i, FlowControl o);
+    bool       setParity(Parity parity);
+    bool       setXONXOFF(FlowControl i, FlowControl o, SetAction act);
+    bool       setDTR(bool on);
+    bool       setInputBuffering(bool on);
+    bool       modemStopOutput();
 // modem driver interfaces
-    fxBool     modemWaitForRings(u_int rings, CallType&, CallerID&);
+    bool       modemWaitForRings(u_int rings, CallType&, CallerID&);
     CallType   modemAnswerCall(AnswerType, fxStr&);
     void       modemAnswerCallCmd(CallType);
     void       modemFlushInput();
@@ -164,7 +164,7 @@ protected:
     void       traceModemOp(const char* fmt ...);
     void       traceStatus(int kind, const char* fmt ...);
 // modem locking interfaces implemented in derived class
-    virtual fxBool lockModem() = 0;
+    virtual bool lockModem() = 0;
     virtual void unlockModem() = 0;
 // notification interfaces implemented in derived class
     virtual void notifyModemReady() = 0;
@@ -181,7 +181,7 @@ protected:
     void       endSession();
 // abort send/receive session
     virtual void abortSession();
-    fxBool     abortRequested();
+    bool       abortRequested();
 public:
     virtual ~ModemServer();
 
@@ -199,8 +199,8 @@ public:
     int                getServerTracing() const;
     void       vtraceStatus(int kind, const char* fmt, va_list ap);
 
-    fxBool     modemReady() const;
-    fxBool     serverBusy() const;
+    bool       modemReady() const;
+    bool       serverBusy() const;
 };
 inline ClassModem* ModemServer::getModem()             { return modem; }
 inline int ModemServer::getModemFd()                   { return modemFd; }
index b0824d15964ecc6a43d9e274a7c9cc98aef2946c..7d922e92d9c968d39f950106b9396c9a08b7424a 100644 (file)
@@ -75,7 +75,7 @@ struct charInfo {
 #define        CONFIG_GLYPH    2               // glyphs must be word-aligned
 #define        CONFIG_GLYPH_IX 1               // index for word-aligned glyphs
 
-inline fxBool PCFFont::isFormat(u_long f) const
+inline bool PCFFont::isFormat(u_long f) const
     { return ((format&PCF_FORMAT_MASK) == f); }
 inline u_int PCFFont::byteOrder() const
     { return ((format&PCF_BYTE_MASK) ? MSBFirst : LSBFirst); }
@@ -110,7 +110,7 @@ PCFFont::cleanup()
 {
     if (file != NULL)
        fclose(file), file = NULL;
-    ready = FALSE;
+    ready = false;
     delete toc, toc = NULL;
     delete encoding, encoding = NULL;
     delete bitmaps, bitmaps = NULL;
@@ -123,7 +123,7 @@ PCFFont::cleanup()
  * font metrics, font bitmaps, font encoding, and
  * some of the accelerator info.
  */
-fxBool
+bool
 PCFFont::read(const char* name)
 {
     cleanup();
@@ -131,10 +131,10 @@ PCFFont::read(const char* name)
     file = fopen(filename, "r");
     if (file == NULL) {
        error("Can not open file");
-       return (FALSE);
+       return (false);
     }
     if (!readTOC())
-       return (FALSE);
+       return (false);
     if (seekToTable(PCF_METRICS)) {
        format = getLSB32();
        if (isFormat(PCF_DEFAULT_FORMAT))
@@ -143,12 +143,12 @@ PCFFont::read(const char* name)
            numGlyphs = getINT16();
        else {
            error("Bad font metric format 0x%lx", format);
-           return (FALSE);
+           return (false);
        }
        metrics = new charInfo[numGlyphs];
        if (!metrics) {
            error("No space for font metric information");
-           return (FALSE);
+           return (false);
        }
        for (int i = 0; i < numGlyphs; i++) {
            if (isFormat(PCF_DEFAULT_FORMAT))
@@ -158,20 +158,20 @@ PCFFont::read(const char* name)
        }
     } else {
        error("Can not seek to font metric information");
-       return (FALSE);
+       return (false);
     }
 
     if (seekToTable(PCF_BITMAPS)) {
        format = getLSB32();
        if (!isFormat(PCF_DEFAULT_FORMAT)) {
            error("Bad bitmap data format 0x%lx", format);
-           return (FALSE);
+           return (false);
        }
        u_long nbitmaps = getINT32();
        u_long* offsets = new u_long[nbitmaps];
        if (!offsets) {
            error("No space for bitmap offsets array");
-           return (FALSE);
+           return (false);
        }
        int i;
        for (i = 0; i < nbitmaps; i++)
@@ -186,12 +186,12 @@ PCFFont::read(const char* name)
        if (!bitmaps) {
            error("No space for bitmap data array");
            delete offsets;
-           return (FALSE);
+           return (false);
        }
        if (fread(bitmaps, (u_int) sizebitmaps, 1, file) != 1) {
            error("Error reading bitmap data");
            delete offsets;
-           return (FALSE);
+           return (false);
        }
        if (bitOrder() != CONFIG_BIT)
            TIFFReverseBits(bitmaps, sizebitmaps);
@@ -216,7 +216,7 @@ PCFFont::read(const char* name)
            if (!padbitmaps) {
                error("No space for padded bitmap data array");
                delete offsets;
-               return (FALSE);
+               return (false);
            }
            int newoff = 0;
            for (i = 0; i < nbitmaps; i++) {
@@ -236,20 +236,20 @@ PCFFont::read(const char* name)
            if ((unsigned) metrics[i].bits & 1) {
                error("Internal error, bitmap data not word-aligned");
                delete offsets;
-               return (FALSE);
+               return (false);
            }
        }
        delete offsets;
     } else {
        error("Can not seek to bitmap data");
-       return (FALSE);
+       return (false);
     }
 
     if (seekToTable(PCF_BDF_ENCODINGS)) {
        format = getLSB32();
        if (!isFormat(PCF_DEFAULT_FORMAT)) {
            error("Bad encodings format 0x%lx", format);
-           return (FALSE);
+           return (false);
        }
        firstCol = getINT16();
        lastCol = getINT16();
@@ -261,7 +261,7 @@ PCFFont::read(const char* name)
        encoding = new charInfo*[nencoding];
        if (!encoding) {
            error("No space for character encoding vector");
-           return (FALSE);
+           return (false);
        }
        for (int i = 0; i < nencoding; i++) {
            int encodingOffset = getINT16();
@@ -280,7 +280,7 @@ PCFFont::read(const char* name)
        }
     } else {
        error("Can not seek to encoding data");
-       return (FALSE);
+       return (false);
     }
 
     if (seekToTable(PCF_BDF_ACCELERATORS)) {
@@ -288,7 +288,7 @@ PCFFont::read(const char* name)
        if (!isFormat(PCF_DEFAULT_FORMAT) &&
            !isFormat(PCF_ACCEL_W_INKBOUNDS)) {
            error("Bad BDF accelerator format 0x%lx", format);
-           return (FALSE);
+           return (false);
        }
        fseek(file, 8, SEEK_CUR);       // skip a bunch of junk
        fontAscent = (short) getINT32();
@@ -296,11 +296,11 @@ PCFFont::read(const char* name)
        // more stuff...
     } else {
        error("Can not seek to BDF accelerator information");
-       return (FALSE);
+       return (false);
     }
     fclose(file), file = NULL;
     filename = NULL;
-    return (ready = TRUE);
+    return (ready = true);
 }
 
 u_long
@@ -377,38 +377,38 @@ PCFFont::getCompressedMetric(charInfo& metric)
 /*
  * Position to the begining of the specified table.
  */
-fxBool
+bool
 PCFFont::seekToTable(u_long type)
 {
     for (int i = 0; i < tocSize; i++)
        if (toc[i].type == type) {
            if (fseek(file, toc[i].offset, SEEK_SET) == -1) {
                error("Can not seek; fseek failed");
-               return (FALSE);
+               return (false);
            }
            format = toc[i].format;
-           return (TRUE);
+           return (true);
        }
     error("Can not seek; no such entry in the TOC");
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Read the table-of-contents for the font file.
  */
-fxBool
+bool
 PCFFont::readTOC()
 {
     u_long version = getLSB32();
     if (version != PCF_FILE_VERSION) {
        error("Cannot read TOC; bad version number %lu", version);
-       return (FALSE);
+       return (false);
     }
     tocSize = getLSB32();
     toc = new PCFTableRec[tocSize];
     if (!toc) {
        error("Cannot read TOC; no space for %lu records", tocSize);
-       return (FALSE);
+       return (false);
     }
     for (int i = 0; i < tocSize; i++) {
        toc[i].type = getLSB32();
@@ -416,7 +416,7 @@ PCFFont::readTOC()
        toc[i].size = getLSB32();
        toc[i].offset = getLSB32();
     }
-    return (TRUE);
+    return (true);
 }
 
 int
index 905bcd40f83920e24c8357a9955cb99204407802..22e4dcfa6ae2f274789bd8756fe11b605240ddcb 100644 (file)
@@ -52,11 +52,11 @@ private:
     u_long     format;         // format for current portion being read
     PCFTableRec* toc;          // table of contents
     u_long     tocSize;        // number of entries in TOC
-    fxBool     isBigEndian;    // host byte order
+    bool       isBigEndian;    // host byte order
 
     void       cleanup();
-    fxBool     readTOC();
-    fxBool     seekToTable(u_long type);
+    bool       readTOC();
+    bool       seekToTable(u_long type);
     void       getMetric(charInfo& metric);
     void       getCompressedMetric(charInfo& metric);
     int                repadBitmap(u_char* src, u_char* dst,
@@ -66,7 +66,7 @@ private:
     int                getINT16();
     int                getINT8();
 
-    fxBool     isFormat(u_long f) const;
+    bool       isFormat(u_long f) const;
     u_int      byteOrder() const;
     u_int      bitOrder() const;
     u_int      glyphPadIndex() const;
@@ -78,7 +78,7 @@ public:
     PCFFont();
     ~PCFFont();
 
-    fxBool     read(const char* filename);
+    bool       read(const char* filename);
 
     u_int      charWidth(u_int) const;
     void       strWidth(const char* text, u_int& w, u_int& h) const;
index c1675522c38f36916f5f924d5a9e05e97d0b8889..032e792687ecc093a6325f857a8540a9504d852a 100644 (file)
@@ -39,8 +39,8 @@ struct QLink {
     void remove(void);
     void insert(QLink& after);
 
-    int isEmpty(void) const;           // TRUE if list is empty (used on head)
-    int isOnList(void) const;          // TRUE if item is on list
+    int isEmpty(void) const;           // true if list is empty (used on head)
+    int isOnList(void) const;          // true if item is on list
 };
 inline int QLink::isEmpty(void) const  { return next == this; }
 inline int QLink::isOnList(void) const { return next != this; }
index ddbedb409c242e127622d9958ec052cf16a45c16..f746e38c69351f6a17096a4e3ba1402ba3f3127a 100644 (file)
@@ -119,9 +119,9 @@ ServerConfig::setupConfig()
 
     speakerVolume = ClassModem::QUIET; // default speaker volume
 #ifdef sgi
-    clocalAsRoot = TRUE;               // under IRIX must be root to set CLOCAL
+    clocalAsRoot = true;               // under IRIX must be root to set CLOCAL
 #else
-    clocalAsRoot = FALSE;              // everywhere else anyone can do it
+    clocalAsRoot = false;              // everywhere else anyone can do it
 #endif
     requeueTTS[ClassModem::OK]         = 0;
     requeueTTS[ClassModem::BUSY]       = FAX_REQBUSY;
@@ -276,7 +276,7 @@ ServerConfig::getUUCPLock(const fxStr& deviceName)
        uucpLockDir, deviceName, uucpLockMode);
 }
 
-fxBool
+bool
 ServerConfig::checkACL(const fxStr& id, RegExArray* pats, fxBoolArray& accept)
 {
     if (pats != NULL) {
@@ -284,14 +284,14 @@ ServerConfig::checkACL(const fxStr& id, RegExArray* pats, fxBoolArray& accept)
            if ((*pats)[i]->Find(id))
                return (accept[i]);
     }
-    return (FALSE);                    // NB: reject if no patterns!
+    return (false);                    // NB: reject if no patterns!
 }
 
-fxBool
+bool
 ServerConfig::isTSIOk(const fxStr& tsi)
 {
     updatePatterns(qualifyTSI, tsiPats, acceptTSI, lastTSIModTime);
-    return (qualifyTSI == "" ? TRUE : checkACL(tsi, tsiPats, *acceptTSI));
+    return (qualifyTSI == "" ? true : checkACL(tsi, tsiPats, *acceptTSI));
 }
 
 /*
@@ -354,10 +354,10 @@ ServerConfig::readPatterns(FILE* fp, RegExArray*& pats, fxBoolArray*& accept)
            continue;
        RegEx* re;
        if (line[0] == '!') {
-           accept->append(FALSE);
+           accept->append(false);
            pats->append(re = new RegEx(line+1));
        } else {
-           accept->append(TRUE);
+           accept->append(true);
            pats->append(re = new RegEx(line));
        }
        if (re->getErrorCode() > REG_NOMATCH) {
@@ -390,7 +390,7 @@ tiffWarningHandler(const char* module, const char* fmt0, va_list ap)
     vlogWarning(fmt, ap);
 }
 
-fxBool
+bool
 ServerConfig::setConfigItem(const char* tag, const char* value)
 {
     u_int ix;
@@ -440,6 +440,6 @@ ServerConfig::setConfigItem(const char* tag, const char* value)
        requeueTTS[ClassModem::DATACONN] = getNumber(value);
     else
        return ModemConfig::setConfigItem(tag, value);
-    return (TRUE);
+    return (true);
 }
 #undef N
index 544d065cd8b49f724bfcd98e09c008a95feec0fc..d96ae7fce29105d2aed933f6ac1bba9f5de1e55c 100644 (file)
@@ -79,14 +79,14 @@ protected:
     ServerConfig();
 
     void       setupConfig();
-    virtual fxBool setConfigItem(const char* tag, const char* value);
+    virtual bool setConfigItem(const char* tag, const char* value);
 
 // pattern access control list support
     void       updatePatterns(const fxStr& file,
                    RegExArray*& pats, fxBoolArray*& accept,
                    time_t& lastModTime);
     void       readPatterns(FILE*, RegExArray*&, fxBoolArray*&);
-    fxBool     checkACL(const fxStr& id, RegExArray*, fxBoolArray&);
+    bool       checkACL(const fxStr& id, RegExArray*, fxBoolArray&);
 // methods for parameters whose assignment may have side effects
     virtual void setDialRules(const char* name);
     virtual void setLocalIdentifier(const fxStr& lid);
@@ -101,7 +101,7 @@ public:
     u_int      tracingLevel;           // tracing level w/o session
     u_int      logTracingLevel;        // tracing level during session
     u_int      tracingMask;            // tracing level control mask
-    fxBool     clocalAsRoot;           // set CLOCAL as root
+    bool       clocalAsRoot;           // set CLOCAL as root
     u_int      requeueTTS[9];          // requeue intervals[CallStatus code]
     u_int      requeueProto;           // requeue interval after protocol error
     u_int      requeueOther;           // requeue interval after other problem
@@ -122,7 +122,7 @@ public:
 
     UUCPLock*  getUUCPLock(const fxStr& deviceName);
 
-    fxBool     isTSIOk(const fxStr& tsi);
+    bool       isTSIOk(const fxStr& tsi);
 
     virtual void vconfigError(const char* fmt, va_list ap) = 0;
     virtual void vconfigTrace(const char* fmt, va_list ap) = 0;
index bb5f2b0c00aaf37ffc3778ab27255c365f4c59f6..4ac22a20b1ad23bd7cdff8e9d8aeaca1ec29e67f 100644 (file)
@@ -98,16 +98,16 @@ FaxModem::setupTagLine(const FaxRequest& req, const fxStr& tagLineFmt)
  * being cropped at the bottom; probably together with a decoding
  * error of one row at the receiver.
  */
-fxBool
+bool
 FaxModem::setupTagLineSlop(const Class2Params& params)
 {
     if (tagLineFont->isReady() && tagLineFields > 0) {
        tagLineSlop = (tagLineFont->fontHeight()+MARGIN_TOP+MARGIN_BOT+3) * 
            howmany(params.pageWidth(),8);
-       return (TRUE);
+       return (true);
     } else {
        tagLineSlop = 0;
-       return (FALSE);
+       return (false);
     }
 }
 
index a937e3433386a42c2c427c3b586e22dfa0255f79..eabfe7aa3e6d4b7e64d2d9e5ef18c3f12395b260 100644 (file)
@@ -219,7 +219,7 @@ Trigger::tidNextFree()
  * notified when job 1932 is requeued or completes one would
  * use ``J<1932>4c60''.
  */
-fxBool
+bool
 Trigger::parse(const char* spec0)
 {
     const char* spec = spec0;
@@ -239,7 +239,7 @@ Trigger::parse(const char* spec0)
            for (tp = ++cp; *tp != '>'; tp++)
                if (*tp == '\0') {                      // XXX syntax error
                    syntaxError(spec0, "missing '>'");
-                   return (FALSE);
+                   return (false);
                }
            id = fxStr(cp, tp-cp);
            cp = tp+1;
@@ -248,7 +248,7 @@ Trigger::parse(const char* spec0)
        u_short& m = interests[base>>4];
        if (m != 0) {
            syntaxError(spec0, "interests conflict");
-           return (FALSE);
+           return (false);
        }
        if (c == '*') {
            m = 0xffff;
@@ -263,7 +263,7 @@ Trigger::parse(const char* spec0)
            m = v;
        } else {
             syntaxError(spec0, "non-hex event mask");
-            return (FALSE);
+            return (false);
        }
        TriggerRef* tr = new TriggerRef(*this);
        /*
@@ -285,13 +285,13 @@ Trigger::parse(const char* spec0)
            Job* job = Job::getJobByID(id);
            if (!job) {
                logError("TRIGGER: job %s does not exist", (const char*) id);
-               return (FALSE);
+               return (false);
            }
            tr->insert(job->triggers);
        }
        spec = cp;
     }
-    return (TRUE);
+    return (true);
 }
 void
 Trigger::syntaxError(const char* spec, const char* msg)
@@ -302,7 +302,7 @@ Trigger::syntaxError(const char* spec, const char* msg)
 /*
  * Cancel (delete) the trigger with the specified id.
  */
-fxBool
+bool
 Trigger::cancel(const char* cp)
 {
     trid_t tid = (trid_t) strtoul(cp, NULL, 10);
@@ -311,10 +311,10 @@ Trigger::cancel(const char* cp)
        if (t) {
            if (t->cancel())
                delete t;
-           return (TRUE);
+           return (true);
        }
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -326,12 +326,12 @@ Trigger::cancel(const char* cp)
  * posted to the client) and wait for the object holding
  * the reference to go away.
  */
-fxBool
+bool
 Trigger::cancel()
 {
     purgeWildRefs();                   // wildcard references
     if (refs == 0)
-       return (TRUE);
+       return (true);
     if (interests[MODEM_BASE>>4] != 0) {
        /*
         * Must explicitly search and purge references
@@ -341,12 +341,12 @@ Trigger::cancel()
        for (ModemIter iter(Modem::list); iter.notDone(); iter++) {
            TriggerRef::purge(iter.modem().triggers, this);
            if (refs == 0)
-               return (TRUE);
+               return (true);
        }
     }
     // clear interests so no more messages are sent
     memset(interests, 0, sizeof (interests));
-    return (FALSE);
+    return (false);
 }
 
 /*
index b58891aaaabbc56dc8173c82b35015aad2ab3a5a..3c3132d18b8ec2012df2795745e20978023b2cfd 100644 (file)
@@ -140,11 +140,11 @@ private:
 
     Trigger(trid_t, const fxStr& fifoName);
 
-    fxBool parse(const char*);         // parse trigger spec
+    bool parse(const char*);           // parse trigger spec
     static void syntaxError(const char* spec, const char* msg);
 
     void purgeWildRefs();              // purge all wildcard references
-    fxBool cancel();
+    bool cancel();
 
     static void post(TriggerEvent, const QLink&, const QLink&, fxStackBuffer&);
     void send(const char* fmt ...);
@@ -154,7 +154,7 @@ public:
     static void purgeClient(HylaClient*);// purge all triggers for client
 
     static void create(const fxStr& id, const char* spec);
-    static fxBool cancel(const char* tid);
+    static bool cancel(const char* tid);
 
     static void post(TriggerEvent, const Job&, const char* = NULL);
     static void post(TriggerEvent, const Modem&, const char* = NULL);
index 2ae5821e70a74336757862ad02a9d027aee1027c..f586a8647da5ffcecf15f373e30ca614eb40ce2b 100644 (file)
@@ -52,8 +52,8 @@ private:
     fxStr      data;                   // data to write record in lock file
 
     void setPID(pid_t);
-    fxBool writeData(int fd);
-    fxBool readData(int fd, pid_t& pid);
+    bool writeData(int fd);
+    bool readData(int fd, pid_t& pid);
 public:
     AsciiUUCPLock(const fxStr&, mode_t);
     ~AsciiUUCPLock();
@@ -67,8 +67,8 @@ private:
     pid_t      data;                   // data to write record in lock file
 
     void setPID(pid_t);
-    fxBool writeData(int fd);
-    fxBool readData(int fd, pid_t& pid);
+    bool writeData(int fd);
+    bool readData(int fd, pid_t& pid);
 public:
     BinaryUUCPLock(const fxStr&, mode_t);
     ~BinaryUUCPLock();
@@ -125,7 +125,7 @@ UUCPLock::newLock(const char* type,
 UUCPLock::UUCPLock(const fxStr& pathname, mode_t m) : file(pathname)
 {
     mode = m;
-    locked = FALSE;
+    locked = false;
 
     setupIDs();
 }
@@ -159,7 +159,7 @@ void UUCPLock::setLockTimeout(time_t t) { lockTimeout = t; }
 /*
  * Create a lock file.
  */
-fxBool
+bool
 UUCPLock::create()
 {      
     /*
@@ -192,11 +192,11 @@ UUCPLock::create()
  * Check if the lock file is
  * newer than the specified age.
  */
-fxBool
+bool
 UUCPLock::isNewer(time_t age)
 {
     struct stat sb;
-    return (Sys::stat(file, sb) != 0 ? FALSE : Sys::now() - sb.st_mtime < age);
+    return (Sys::stat(file, sb) != 0 ? false : Sys::now() - sb.st_mtime < age);
 }
 
 /*
@@ -205,14 +205,14 @@ UUCPLock::isNewer(time_t age)
  * If it is older, an attempt is made to unlink it and
  * create a new one.
  */
-fxBool
+bool
 UUCPLock::lock()
 {
     if (locked)
-       return (FALSE);
+       return (false);
     uid_t ouid = geteuid();
     seteuid(0);                                // need to be root
-    fxBool ok = create();
+    bool ok = create();
     if (!ok)
        ok = check() && create();
     seteuid(ouid);
@@ -230,7 +230,7 @@ UUCPLock::unlock()
        seteuid(0);                     // need to be root
        Sys::unlink(file);
        seteuid(ouid);
-       locked = FALSE;
+       locked = false;
     }
 }
 
@@ -238,10 +238,10 @@ UUCPLock::unlock()
  * Set a particular owner process
  * pid for an already locked device.
  */
-fxBool
+bool
 UUCPLock::setOwner(pid_t pid)
 {
-    fxBool ok = FALSE;
+    bool ok = false;
     if (locked) {
        uid_t ouid = geteuid();
        seteuid(0);                     // need to be root
@@ -260,7 +260,7 @@ UUCPLock::setOwner(pid_t pid)
 /*
  * Check if the owning process exists.
  */
-fxBool
+bool
 UUCPLock::ownerExists(int fd)
 {
     pid_t pid;
@@ -273,7 +273,7 @@ UUCPLock::ownerExists(int fd)
  * UUCPLock::lockTimeout seconds if the process owner
  * is no longer around.
  */
-fxBool
+bool
 UUCPLock::check()
 {
     int fd = Sys::open(file, O_RDONLY);
@@ -281,17 +281,17 @@ UUCPLock::check()
        if (lockTimeout > 0) {
            if (isNewer(lockTimeout) || ownerExists(fd)) {
                Sys::close(fd);
-               return (FALSE);
+               return (false);
            }
            Sys::close(fd);
            logInfo("Purge stale UUCP lock %s", (const char*) file);
            return (Sys::unlink(file) == 0);
        } else {
            Sys::close(fd);
-           return (FALSE);
+           return (false);
        }
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -310,22 +310,22 @@ AsciiUUCPLock::setPID(pid_t pid)
     sprintf((char*) data, "%*d\n", UUCP_PIDDIGITS, pid);
 }
 
-fxBool
+bool
 AsciiUUCPLock::writeData(int fd)
 {
     return (Sys::write(fd, data, UUCP_PIDDIGITS+1) == (UUCP_PIDDIGITS+1));
 }
 
-fxBool
+bool
 AsciiUUCPLock::readData(int fd, pid_t& pid)
 {
     char buf[UUCP_PIDDIGITS+1];
     if (Sys::read(fd, buf, UUCP_PIDDIGITS) == UUCP_PIDDIGITS) {
        buf[UUCP_PIDDIGITS] = '\0';
        pid = atol(buf);        // NB: assumes pid_t is <= 32-bits
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 /*
@@ -342,19 +342,19 @@ BinaryUUCPLock::setPID(pid_t pid)
     data = pid;                        // binary pid of lock holder
 }
 
-fxBool
+bool
 BinaryUUCPLock::writeData(int fd)
 {
     return (Sys::write(fd, (char*) &data, sizeof (data)) == sizeof (data));
 }
 
-fxBool
+bool
 BinaryUUCPLock::readData(int fd, pid_t& pid)
 {
     pid_t data;
     if (Sys::read(fd, (char*) &data, sizeof (data)) == sizeof (data)) {
        pid = data;
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
index 0c552d41bbc4c1cefa72729a8ffb11e146351168..8e233d6607b27c098d766b3dbe3ef90dcf578607 100644 (file)
@@ -35,7 +35,7 @@ class UUCPLock {
 private:
     fxStr      file;                   // lock file pathname
     mode_t     mode;                   // lock file mode
-    fxBool     locked;                 // is lock currently held
+    bool       locked;                 // is lock currently held
 
     static uid_t UUCPuid;
     static gid_t UUCPgid;
@@ -43,15 +43,15 @@ private:
 
     static time_t lockTimeout;
 
-    fxBool     create();               // create lock file
-    fxBool     isNewer(time_t age);    // is lock file newer than age
-    fxBool     ownerExists(int fd);    // does owning process exist
+    bool       create();               // create lock file
+    bool       isNewer(time_t age);    // is lock file newer than age
+    bool       ownerExists(int fd);    // does owning process exist
 protected:
     UUCPLock(const fxStr& pathname, mode_t mode);
 
     virtual void setPID(pid_t) = 0;
-    virtual fxBool writeData(int fd) = 0;
-    virtual fxBool readData(int fd, pid_t& pid) = 0;
+    virtual bool writeData(int fd) = 0;
+    virtual bool readData(int fd, pid_t& pid) = 0;
 public:
     virtual ~UUCPLock();
 
@@ -65,12 +65,12 @@ public:
        const fxStr& device,            // device pathname
        mode_t mode);                   // file creation mode
 
-    fxBool     isLocked() const;       // device is locked
-    fxBool     lock();                 // lock device
+    bool       isLocked() const;       // device is locked
+    bool       lock();                 // lock device
     void       unlock();               // unlock device
-    fxBool     check();                // check if lock exists
-    fxBool     setOwner(pid_t);        // force process owner identity
+    bool       check();                // check if lock exists
+    bool       setOwner(pid_t);        // force process owner identity
 };
 
-inline fxBool UUCPLock::isLocked() const       { return locked; }
+inline bool UUCPLock::isLocked() const { return locked; }
 #endif /* _UUCPLOCK_ */
index 097c5fe00d7caeda063d739219f16b84fd8a699c..13aabfaac57745f17e5ee9ab4f5612171d5dcb7b 100644 (file)
@@ -69,7 +69,7 @@ MemoryDecoder::decodeNextByte()
     return (*bp++);
 }
 
-static fxBool
+static bool
 isBlank(uint16* runs, u_int rowpixels)
 {
     u_int x = 0;
@@ -77,11 +77,11 @@ isBlank(uint16* runs, u_int rowpixels)
        if ((x += *runs++) >= rowpixels)
            break;
        if (runs[0] != 0)
-           return (FALSE);
+           return (false);
        if ((x += *runs++) >= rowpixels)
            break;
     }
-    return (TRUE);
+    return (true);
 }
 
 void
@@ -153,14 +153,14 @@ main(int argc, char* argv[])
     extern char* optarg;
     float minChop = 3.0;               // chop if >= 3" white space at bottom
     u_int minRows;
-    fxBool doAll = FALSE;
+    bool doAll = false;
     int c;
 
     appName = argv[0];
     while ((c = getopt(argc, argv, "t:a")) != -1)
        switch (c) {
        case 'a':
-           doAll = TRUE;
+           doAll = true;
            break;
        case 't':
            minChop = atof(optarg);
index d5df16cccfcda994f7551af19f8403c0f5527e23..9ae7eb4fea8ec280cbf5550a0d7de6b3024d6219 100644 (file)
@@ -41,7 +41,7 @@
 
 struct CQDecoder : public G3Decoder {
     u_int      cblc;           // current count of consecutive bad lines
-    fxBool     lastRowBad;     // last decoded row was bad
+    bool       lastRowBad;     // last decoded row was bad
 
     u_long     recvEOLCount;   // EOL count for received page
     u_long     recvBadLineCount;
@@ -69,13 +69,13 @@ struct CQDecoder : public G3Decoder {
     void       serverTrace(const char* fmt ...);
     void       copyQualityTrace(const char* fmt, ...);
 
-    fxBool     recvPageDLEData(TIFF* tif, fxBool checkQuality,
+    bool       recvPageDLEData(TIFF* tif, bool checkQuality,
                    const Class2Params& params, fxStr& emsg);
     void       abortPageRecv();
     int                nextByte();
 
-    fxBool     checkQuality();
-    fxBool     isQualityOK(const Class2Params&);
+    bool       checkQuality();
+    bool       isQualityOK(const Class2Params&);
 
     CQDecoder();
     ~CQDecoder();
@@ -138,8 +138,8 @@ CQDecoder::recvSetupTIFF(TIFF* tif, long, int fillOrder, const Class2Params& par
  * Receive Phase C data with or without copy
  * quality checking and erroneous row fixup.
  */
-fxBool
-CQDecoder::recvPageDLEData(TIFF* tif, fxBool checkQuality,
+bool
+CQDecoder::recvPageDLEData(TIFF* tif, bool checkQuality,
     const Class2Params& params, fxStr& emsg)
 {
     setupDecoder(recvFillOrder, params.is2D());
@@ -167,7 +167,7 @@ CQDecoder::recvPageDLEData(TIFF* tif, fxBool checkQuality,
        abortPageRecv();
        emsg = "Missing EOL after 5 seconds";
        recvTrace("%s", (const char*) emsg);
-       return (FALSE);
+       return (false);
     }
     if (checkQuality) {
        /*
@@ -204,7 +204,7 @@ CQDecoder::recvPageDLEData(TIFF* tif, fxBool checkQuality,
        memset(curGood, 0, rowSize);            // initialize to all white
        recvBuf = NULL;                         // don't need raw data
 
-       lastRowBad = FALSE;                     // no previous row
+       lastRowBad = false;                     // no previous row
        cblc = 0;                               // current bad line run
        if (!RTCraised()) {
            for (;;) {
@@ -216,13 +216,13 @@ CQDecoder::recvPageDLEData(TIFF* tif, fxBool checkQuality,
                 * later for deciding whether or not the page quality
                 * is acceptable.
                 */
-               fxBool decodeOK = decodeRow(recvRow, rowpixels);
+               bool decodeOK = decodeRow(recvRow, rowpixels);
                if (seenRTC())                  // seen RTC, flush everything
                    continue;
                if (decodeOK) {
                    curGood = recvRow;          // reset last good
                    if (lastRowBad) {           // reset run statistics
-                       lastRowBad = FALSE;
+                       lastRowBad = false;
                        if (cblc > recvConsecutiveBadLineCount)
                            recvConsecutiveBadLineCount = cblc;
                        cblc = 0;
@@ -231,7 +231,7 @@ CQDecoder::recvPageDLEData(TIFF* tif, fxBool checkQuality,
                    memcpy(recvRow, curGood, rowSize);// replicate last good
                    recvBadLineCount++;
                    cblc++;
-                   lastRowBad = TRUE;
+                   lastRowBad = true;
                }
                /*
                 * Advance forward a scanline and if necessary
@@ -350,7 +350,7 @@ CQDecoder::recvPageDLEData(TIFF* tif, fxBool checkQuality,
            recvEOLCount = getRTCRow();
        }
     }
-    return (TRUE);
+    return (true);
 }
 
 void
@@ -376,7 +376,7 @@ CQDecoder::flushRawData(TIFF* tif, tstrip_t strip, u_char* buf, u_int cc)
  * Check if the configuration parameters indicate if
  * copy quality checking should be done on recvd pages.
  */
-fxBool
+bool
 CQDecoder::checkQuality()
 {
     return (percentGoodLines != 0 && maxConsecutiveBadLines != 0);
@@ -387,7 +387,7 @@ CQDecoder::checkQuality()
  * against the configuration parameters and return an
  * indication of whether or not the page quality is acceptable.
  */
-fxBool
+bool
 CQDecoder::isQualityOK(const Class2Params& params)
 {
     if (percentGoodLines != 0 && recvEOLCount != 0) {
@@ -395,7 +395,7 @@ CQDecoder::isQualityOK(const Class2Params& params)
        if (percent < percentGoodLines) {
            serverTrace("RECV: REJECT page quality, %u%% good lines (%u%% required)",
                percent, percentGoodLines);
-           return (FALSE);
+           return (false);
        }
     }
     u_int cblc = maxConsecutiveBadLines;
@@ -405,10 +405,10 @@ CQDecoder::isQualityOK(const Class2Params& params)
        if (recvConsecutiveBadLineCount > cblc) {
            serverTrace("RECV: REJECT page quality, %u-line run (max %u)",
                recvConsecutiveBadLineCount, cblc);
-           return (FALSE);
+           return (false);
        }
     }
-    return (TRUE);
+    return (true);
 }
 
 int
index fa851c619455f040d29cc0da428d7c878f8fcb36..bfc5d9216594c47bd8a189b654cb0f0931187c5c 100644 (file)
@@ -63,7 +63,7 @@ const char* GetoptIter::nextArg()
 
 faxApp::faxApp()
 {
-    running = FALSE;
+    running = false;
     faxqfifo = -1;
     setLogFacility(LOG_FAX);                   // default
 #ifdef LC_CTYPE
@@ -81,11 +81,11 @@ faxApp::initialize(int, char**)
 {
     openFIFOs();
 }
-void faxApp::open(void) { running = TRUE; }
+void faxApp::open(void) { running = true; }
 void
 faxApp::close(void)
 {
-    running = FALSE;
+    running = false;
     if (faxqfifo != -1)
        Sys::close(faxqfifo);
 }
@@ -126,7 +126,7 @@ faxApp::closeFIFOs(void)
  * Open the specified FIFO file.
  */
 int
-faxApp::openFIFO(const char* fifoName, int mode, fxBool okToExist)
+faxApp::openFIFO(const char* fifoName, int mode, bool okToExist)
 {
     if (Sys::mkfifo(fifoName, mode & 0777) < 0) {
        if (errno != EEXIST || !okToExist)
@@ -202,7 +202,7 @@ faxApp::FIFOMessage(const char* cp)
 /*
  * Send a message to the central queuer process.
  */
-fxBool
+bool
 faxApp::vsendQueuer(const char* fmt, va_list ap)
 {
     if (faxqfifo == -1) {
@@ -223,7 +223,7 @@ faxApp::vsendQueuer(const char* fmt, va_list ap)
        faxqfifo = Sys::open(fifoName, O_WRONLY|O_NDELAY);
 #endif
        if (faxqfifo == -1)
-           return (FALSE);
+           return (false);
        /*
         * Turn off O_NDELAY so that write will block if FIFO is full.
         */
@@ -238,20 +238,20 @@ faxApp::vsendQueuer(const char* fmt, va_list ap)
            Sys::close(faxqfifo), faxqfifo = -1;
        else
            logError("FIFO write failed: %m");
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 /*
  * Send a message to the central queuer process.
  */
-fxBool
+bool
 faxApp::sendQueuer(const char* fmt ...)
 {
     va_list ap;
     va_start(ap, fmt);
-    fxBool ok = vsendQueuer(fmt, ap);
+    bool ok = vsendQueuer(fmt, ap);
     va_end(ap);
     return (ok);
 }
@@ -259,14 +259,14 @@ faxApp::sendQueuer(const char* fmt ...)
 /*
  * Send a modem status message to the central queuer process.
  */
-fxBool
+bool
 faxApp::sendModemStatus(const char* devid, const char* fmt0 ...)
 {
     char fmt[2*1024];
     sprintf(fmt, "+%s:%s", devid, fmt0);
     va_list ap;
     va_start(ap, fmt0);
-    fxBool ok = vsendQueuer(fmt, ap);
+    bool ok = vsendQueuer(fmt, ap);
     va_end(ap);
     return (ok);
 }
@@ -274,14 +274,14 @@ faxApp::sendModemStatus(const char* devid, const char* fmt0 ...)
 /*
  * Send a job status message to the central queuer process.
  */
-fxBool
+bool
 faxApp::sendJobStatus(const char* jobid, const char* fmt0 ...)
 {
     char fmt[2*1024];
     sprintf(fmt, "*%s:%s", jobid, fmt0);
     va_list ap;
     va_start(ap, fmt0);
-    fxBool ok = vsendQueuer(fmt, ap);
+    bool ok = vsendQueuer(fmt, ap);
     va_end(ap);
     return (ok);
 }
@@ -289,14 +289,14 @@ faxApp::sendJobStatus(const char* jobid, const char* fmt0 ...)
 /*
  * Send a receive status message to the central queuer process.
  */
-fxBool
+bool
 faxApp::sendRecvStatus(const char* devid, const char* fmt0 ...)
 {
     char fmt[2*1024];
     sprintf(fmt, "@%s:%s", devid, fmt0);
     va_list ap;
     va_start(ap, fmt0);
-    fxBool ok = vsendQueuer(fmt, ap);
+    bool ok = vsendQueuer(fmt, ap);
     va_end(ap);
     return (ok);
 }
@@ -376,8 +376,8 @@ const fxStr faxApp::enquote = "\"";
  * is so that programs like sendmail show an informative
  * from address.
  */
-fxBool
-faxApp::runCmd(const char* cmd, fxBool changeIDs)
+bool
+faxApp::runCmd(const char* cmd, bool changeIDs)
 {
     pid_t pid = fork();
     switch (pid) {
@@ -390,16 +390,16 @@ faxApp::runCmd(const char* cmd, fxBool changeIDs)
        _exit(127);
     case -1:
        logError("Can not fork for \"%s\"", cmd);
-       return (FALSE);
+       return (false);
     default:
        { int status = 0;
          Sys::waitpid(pid, status);
          if (status != 0) {
            logError("Bad exit status %#o for \"%s\"", status, cmd);
-           return (FALSE);
+           return (false);
          }
        }
-       return (TRUE);
+       return (true);
     }
 }
 
index d952f20627c65fa3db818668c5e49e63eb7accc6..9a83b43d840a39c3b7037614b7bd2b1870d5f283 100644 (file)
@@ -36,11 +36,11 @@ class faxApp : public Syslog {
 private:
     static fxStr getopts;              // main arguments
 
-    fxBool     running;                // server running
+    bool       running;                // server running
     int                faxqfifo;               // cached descriptor to faxq
 protected:
     int                openFIFO(const char* fifoName, int mode,
-                   fxBool okToExist = FALSE);
+                   bool okToExist = false);
 public:
     faxApp();
     virtual ~faxApp();
@@ -56,18 +56,18 @@ public:
     virtual void open(void);
     virtual void close(void);
 
-    fxBool isRunning(void) const;
+    bool isRunning(void) const;
 
     virtual void openFIFOs(void);
     virtual void closeFIFOs(void);
     virtual int FIFOInput(int);
     virtual void FIFOMessage(const char* mesage);
 
-    fxBool sendModemStatus(const char* devid, const char* fmt ...);
-    fxBool sendJobStatus(const char* jobid, const char* fmt ...);
-    fxBool sendRecvStatus(const char* devid, const char* fmt ...);
-    fxBool sendQueuer(const char* fmt ...);
-    fxBool vsendQueuer(const char* fmt, va_list ap);
+    bool sendModemStatus(const char* devid, const char* fmt ...);
+    bool sendJobStatus(const char* jobid, const char* fmt ...);
+    bool sendRecvStatus(const char* devid, const char* fmt ...);
+    bool sendQueuer(const char* fmt ...);
+    bool vsendQueuer(const char* fmt, va_list ap);
 
     static void setOpts(const char*);
     static const fxStr& getOpts(void);
@@ -78,9 +78,9 @@ public:
     static const fxStr quote;
     static const fxStr enquote;
 
-    fxBool runCmd(const char* cmd, fxBool changeIDs = FALSE);
+    bool runCmd(const char* cmd, bool changeIDs = false);
 };
-inline fxBool faxApp::isRunning(void) const    { return running; }
+inline bool faxApp::isRunning(void) const      { return running; }
 
 class GetoptIter {
 private:
@@ -95,13 +95,13 @@ public:
     void operator++();
     void operator++(int);
     int option() const;
-    fxBool notDone() const;
+    bool notDone() const;
     const char* optArg() const;
     const char* getArg();
     const char* nextArg();
 };
 inline int GetoptIter::option() const          { return c; }
-inline fxBool GetoptIter::notDone() const      { return c != -1; }
+inline bool GetoptIter::notDone() const        { return c != -1; }
 
 extern const char* fmtTime(time_t);
 #endif
index 2dede5ee0fa6c4fc35744f3126ed198bdf4f013c..8d0622ef84583057171dc6635ad508c9bbaf8f08 100644 (file)
@@ -124,11 +124,11 @@ faxGettyApp::close()
     }
 }
 
-fxBool faxGettyApp::lockModem()                { return modemLock->lock(); }
+bool faxGettyApp::lockModem()          { return modemLock->lock(); }
 void faxGettyApp::unlockModem()                { modemLock->unlock(); }
-fxBool faxGettyApp::isModemLocked()    { return modemLock->isLocked(); }
+bool faxGettyApp::isModemLocked()      { return modemLock->isLocked(); }
 
-fxBool
+bool
 faxGettyApp::setupModem()
 {
     /*
@@ -150,16 +150,16 @@ faxGettyApp::setupModem()
         * If the server is configured, listen for incoming calls.
         */
        setRingsBeforeAnswer(ringsBeforeAnswer);
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 /*
  * Discard any handle on the modem.
  */
 void
-faxGettyApp::discardModem(fxBool dropDTR)
+faxGettyApp::discardModem(bool dropDTR)
 {
     int fd = getModemFd();
     if (fd >= 0) {
@@ -193,7 +193,7 @@ faxGettyApp::listenBegin()
         * state where we wait for the modem to come available again.
         */
        traceServer("ANSWER: Can not lock modem device");
-       discardModem(FALSE);
+       discardModem(false);
        changeState(LOCKWAIT, pollLockWait);
        sendModemStatus("U");
     }
@@ -261,7 +261,7 @@ faxGettyApp::answerPhoneCmd(AnswerType atype)
         * Discard our handle on the modem and change to LOCKWAIT
         * state where we wait for the modem to come available again.
         */
-       discardModem(FALSE);
+       discardModem(false);
        changeState(LOCKWAIT, pollLockWait);
        sendModemStatus("U");
     }
@@ -284,16 +284,16 @@ faxGettyApp::answerPhone(AnswerType atype, CallType ctype, const CallerID& cid)
      * adaptive-answer is enabled and ``any'' is requested,
      * then rotate through the set of possibilities.
      */
-    fxBool callResolved;
-    fxBool advanceRotary = TRUE;
+    bool callResolved;
+    bool advanceRotary = true;
     fxStr emsg;
     if (!isCIDOk(cid.number)) {                // check Caller ID if present
        /*
         * Call was rejected based on Caller ID information.
         */
        traceServer("ANSWER: CID REJECTED");
-       callResolved = FALSE;
-       advanceRotary = FALSE;
+       callResolved = false;
+       advanceRotary = false;
     } else if (ctype != ClassModem::CALLTYPE_UNKNOWN) {
        /*
         * Distinctive ring or other means has already identified
@@ -307,8 +307,8 @@ faxGettyApp::answerPhone(AnswerType atype, CallType ctype, const CallerID& cid)
                 "but told to answer as %s; call ignored",
                 ClassModem::callTypes[ctype],
                 ClassModem::answerTypes[atype]);
-           callResolved = FALSE;
-           advanceRotary = FALSE;
+           callResolved = false;
+           advanceRotary = false;
        } else {
            // NB: answer based on ctype, not atype
            ctype = modemAnswerCall(ctype, emsg);
@@ -373,14 +373,14 @@ faxGettyApp::answerCleanup()
 {
     if (modemReady()) {
        modemHangup();
-       discardModem(TRUE);
+       discardModem(true);
     }
-    fxBool isSetup;
+    bool isSetup;
     if (isModemLocked() || lockModem()) {
        isSetup = setupModem();
        unlockModem();
     } else
-       isSetup = FALSE;
+       isSetup = false;
     if (isSetup)
        changeState(RUNNING);
     else
@@ -395,10 +395,10 @@ faxGettyApp::answerCleanup()
  * comes up with.  Otherwise we use whatever deduction
  * the modem layer arrives at as the call type.
  */
-fxBool
+bool
 faxGettyApp::answerCall(AnswerType atype, CallType& ctype, fxStr& emsg)
 {
-    fxBool callResolved;
+    bool callResolved;
     if (atype == ClassModem::ANSTYPE_EXTERN) {
        if (egettyArgs != "") {
            /*
@@ -409,9 +409,9 @@ faxGettyApp::answerCall(AnswerType atype, CallType& ctype, fxStr& emsg)
             * then we take action based on the returned call type.
             */
            ctype = runGetty("EXTERN GETTY", OSnewEGetty,
-               egettyArgs, emsg, lockExternCalls, TRUE);
+               egettyArgs, emsg, lockExternCalls, true);
            if (ctype == ClassModem::CALLTYPE_DONE)     // NB: call completed
-               return (TRUE);
+               return (true);
            if (ctype != ClassModem::CALLTYPE_ERROR)
                modemAnswerCallCmd(ctype);
        } else
@@ -435,10 +435,10 @@ faxGettyApp::answerCall(AnswerType atype, CallType& ctype, fxStr& emsg)
  * it removes the modem lock file and reconditions the modem for
  * incoming calls (if configured).
  */
-fxBool
+bool
 faxGettyApp::processCall(CallType ctype, fxStr& emsg)
 {
-    fxBool callHandled = FALSE;
+    bool callHandled = false;
 
     switch (ctype) {
     case ClassModem::CALLTYPE_FAX:
@@ -456,7 +456,7 @@ faxGettyApp::processCall(CallType ctype, fxStr& emsg)
            sendModemStatus("e");
        } else
            traceServer("ANSWER: Data connections are not permitted");
-       callHandled = TRUE;
+       callHandled = true;
        break;
     case ClassModem::CALLTYPE_VOICE:
        traceServer("ANSWER: VOICE CONNECTION");
@@ -466,7 +466,7 @@ faxGettyApp::processCall(CallType ctype, fxStr& emsg)
            sendModemStatus("w");
        } else
            traceServer("ANSWER: Voice connections are not permitted");
-       callHandled = TRUE;
+       callHandled = true;
        break;
     case ClassModem::CALLTYPE_ERROR:
        traceServer("ANSWER: %s", (const char*) emsg);
@@ -486,8 +486,8 @@ faxGettyApp::runGetty(
     Getty* (*newgetty)(const fxStr&, const fxStr&),
     const char* args,
     fxStr& emsg,
-    fxBool keepLock,
-    fxBool keepModem
+    bool keepLock,
+    bool keepModem
 )
 {
     fxStr prefix(_PATH_DEV);
@@ -513,7 +513,7 @@ faxGettyApp::runGetty(
      */
     if (!keepLock)
        unlockModem();
-    fxBool parentIsInit = (getppid() == 1);
+    bool parentIsInit = (getppid() == 1);
     pid_t pid = fork();
     if (pid == -1) {
        emsg = fxStr::format("%s: can not fork: %s", what, strerror(errno));
@@ -552,10 +552,10 @@ faxGettyApp::runGetty(
      * SIGHUP on last close.
      */
     if (!keepModem)
-       discardModem(FALSE);
+       discardModem(false);
     changeState(GETTYWAIT);
     int status;
-    getty->wait(status, TRUE);         // wait for getty/login work to complete
+    getty->wait(status, true);         // wait for getty/login work to complete
     /*
      * Retake ownership of the modem.  Note that there's
      * a race in here (another process could come along
@@ -604,11 +604,11 @@ faxGettyApp::setRingsBeforeAnswer(int rings)
     }
 }
 
-fxBool
+bool
 faxGettyApp::isCIDOk(const fxStr& cid)
 {
     updatePatterns(qualifyCID, cidPats, acceptCID, lastCIDModTime);
-    return (qualifyCID == "" ? TRUE : checkACL(cid, cidPats, *acceptCID));
+    return (qualifyCID == "" ? true : checkACL(cid, cidPats, *acceptCID));
 }
 
 /*
@@ -706,14 +706,14 @@ faxGettyApp::notifyRecvDone(const FaxRecvInfo& ri)
     );
     traceServer("RECV FAX: %s", (const char*) cmd);
     setProcessPriority(BASE);                  // lower priority
-    runCmd(cmd, TRUE);
+    runCmd(cmd, true);
     setProcessPriority(state);                 // restore priority
 }
 
 /*
  * Send a modem status message to the central queuer process.
  */
-fxBool
+bool
 faxGettyApp::sendModemStatus(const char* msg)
 {
     return faxApp::sendModemStatus(getModemDeviceID(), msg);
@@ -729,7 +729,7 @@ faxGettyApp::sendModemStatus(const char* msg)
 void
 faxGettyApp::openFIFOs()
 {
-    devfifo = openFIFO(fifoName | "." | getModemDeviceID(), 0600, TRUE);
+    devfifo = openFIFO(fifoName | "." | getModemDeviceID(), 0600, true);
     Dispatcher::instance().link(devfifo, Dispatcher::ReadMask, this);
 }
 
@@ -832,10 +832,10 @@ const faxGettyApp::numbertag faxGettyApp::numbers[] = {
 { "answerbias",                &faxGettyApp::answerBias,       (u_int) -1 },
 };
 const faxGettyApp::booltag faxGettyApp::booleans[] = {
-{ "adaptiveanswer",    &faxGettyApp::adaptiveAnswer,   FALSE },
-{ "lockdatacalls",     &faxGettyApp::lockDataCalls,    TRUE },
-{ "lockvoicecalls",    &faxGettyApp::lockVoiceCalls,   TRUE },
-{ "lockexterncalls",   &faxGettyApp::lockExternCalls,  TRUE },
+{ "adaptiveanswer",    &faxGettyApp::adaptiveAnswer,   false },
+{ "lockdatacalls",     &faxGettyApp::lockDataCalls,    true },
+{ "lockvoicecalls",    &faxGettyApp::lockVoiceCalls,   true },
+{ "lockexterncalls",   &faxGettyApp::lockExternCalls,  true },
 };
 
 void
@@ -855,7 +855,7 @@ faxGettyApp::setupConfig()
     setAnswerRotary("any");            // answer calls as ``any''
 }
 
-fxBool
+bool
 faxGettyApp::setConfigItem(const char* tag, const char* value)
 {
     u_int ix;
@@ -887,7 +887,7 @@ faxGettyApp::setConfigItem(const char* tag, const char* value)
        }
     } else
        return (FaxServer::setConfigItem(tag, value));
-    return (TRUE);
+    return (true);
 }
 #undef N
 
index 5855ad67314c529d194468218609cfe018e07284..41fa7ed3215c744fdcf14baa069b4f2119136c10 100644 (file)
@@ -55,7 +55,7 @@ public:
     };
     struct booltag {
        const char*      name;
-       fxBool faxGettyApp::*p;
+       bool faxGettyApp::*p;
        u_int            def;
     };
 private:
@@ -74,10 +74,10 @@ private:
     fxStr      gettyArgs;              // getty arguments
     fxStr      vgettyArgs;             // voice getty arguments
     fxStr      egettyArgs;             // extern getty arguments
-    fxBool     adaptiveAnswer;         // answer as data if fax answer fails
-    fxBool     lockDataCalls;          // hold uucp lock for getty
-    fxBool     lockVoiceCalls;         // hold uucp lock for vgetty
-    fxBool     lockExternCalls;        // hold uucp lock for egetty
+    bool       adaptiveAnswer;         // answer as data if fax answer fails
+    bool       lockDataCalls;          // hold uucp lock for getty
+    bool       lockVoiceCalls;         // hold uucp lock for vgetty
+    bool       lockExternCalls;        // hold uucp lock for egetty
     u_int      answerBias;             // rotor bias applied after good calls
     u_short    answerRotor;            // rotor into possible selections
     u_short    answerRotorSize;        // rotor table size
@@ -96,32 +96,32 @@ private:
 // configuration support
     void       setupConfig();
     void       resetConfig();
-    fxBool     setConfigItem(const char* tag, const char* value);
+    bool       setConfigItem(const char* tag, const char* value);
     void       setAnswerRotary(const fxStr& value);
 // modem handling
-    fxBool     isModemLocked();
-    fxBool     lockModem();
+    bool       isModemLocked();
+    bool       lockModem();
     void       unlockModem();
-    fxBool     setupModem();
-    void       discardModem(fxBool dropDTR);
+    bool       setupModem();
+    void       discardModem(bool dropDTR);
 // inbound call handling
-    fxBool     isCIDOk(const fxStr& cid);
-    fxBool     processCall(CallType ctype, fxStr& emsg);
+    bool       isCIDOk(const fxStr& cid);
+    bool       processCall(CallType ctype, fxStr& emsg);
     CallType   runGetty(const char* what,
                    Getty* (*newgetty)(const fxStr&, const fxStr&),
                    const char* args, fxStr &emsg,
-                   fxBool keepLock, fxBool keepModem = FALSE);
+                   bool keepLock, bool keepModem = false);
     void       setRingsBeforeAnswer(int rings);
     void       listenBegin();
     void       listenForRing();
     void       answerPhoneCmd(AnswerType);
     void       answerPhone(AnswerType, CallType, const CallerID&);
     void       answerCleanup();
-    fxBool     answerCall(AnswerType atype, CallType& ctype, fxStr& emsg);
+    bool       answerCall(AnswerType atype, CallType& ctype, fxStr& emsg);
 
     friend void AnswerTimeoutHandler::timerExpired(long, long);
 // miscellaneous stuff
-    fxBool     sendModemStatus(const char* msg);
+    bool       sendModemStatus(const char* msg);
 // FIFO-related stuff
     void       openFIFOs();
     void       closeFIFOs();
index 218a4057e28eaf5d7b478dc915cdd2d0df95fdab..63f3f7769646b73e91ab49b83489ff87422a94a2 100644 (file)
@@ -43,10 +43,10 @@ fxIMPLEMENT_StrKeyPtrValueDictionary(RefDict, u_int)
 
 class faxQCleanApp : public faxApp {
 private:
-    fxBool     archiving;              // enable archival support
-    fxBool     verbose;                // trace interesting actions
-    fxBool     trace;                  // trace all actions
-    fxBool     nowork;                 // do not carry out actions
+    bool       archiving;              // enable archival support
+    bool       verbose;                // trace interesting actions
+    bool       trace;                  // trace all actions
+    bool       nowork;                 // do not carry out actions
     time_t     minJobAge;              // threshold for processing done jobs
     time_t     minDocAge;              // threshold for purging unref'd docs
 
@@ -69,10 +69,10 @@ public:
 
     void setJobAge(const char*);
     void setDocAge(const char*);
-    void setArchiving(fxBool);
-    void setVerbose(fxBool);
-    void setTracing(fxBool);
-    void setNoWork(fxBool);
+    void setArchiving(bool);
+    void setVerbose(bool);
+    void setTracing(bool);
+    void setNoWork(bool);
 };
 
 const fxStr faxQCleanApp::archDir      = FAX_ARCHDIR;
@@ -83,10 +83,10 @@ faxQCleanApp::faxQCleanApp()
 {
     minJobAge = 15*60;         // jobs kept max 15 minutes in doneq
     minDocAge = 60*60;         // 1 hour threshold on keeping unref'd documents
-    archiving = FALSE;         // default is to disable job archiving
-    verbose = FALSE;           // log actions to stdout
-    nowork = FALSE;            // default is to carry out work
-    trace = FALSE;             // trace work
+    archiving = false;         // default is to disable job archiving
+    verbose = false;           // log actions to stdout
+    nowork = false;            // default is to carry out work
+    trace = false;             // trace work
 
     qFilePrefix = FAX_SENDDIR "/q";
 }
@@ -97,16 +97,16 @@ void faxQCleanApp::setJobAge(const char* s)
     { minJobAge = (time_t) strtoul(s, NULL, 0); }
 void faxQCleanApp::setDocAge(const char* s)
     { minDocAge = (time_t) strtoul(s, NULL, 0); }
-void faxQCleanApp::setArchiving(fxBool b)      { archiving = b; }
-void faxQCleanApp::setVerbose(fxBool b)                { verbose = b; }
-void faxQCleanApp::setTracing(fxBool b)                { trace = b; }
-void faxQCleanApp::setNoWork(fxBool b)         { nowork = b; }
+void faxQCleanApp::setArchiving(bool b)        { archiving = b; }
+void faxQCleanApp::setVerbose(bool b)          { verbose = b; }
+void faxQCleanApp::setTracing(bool b)          { trace = b; }
+void faxQCleanApp::setNoWork(bool b)           { nowork = b; }
 
 void
 faxQCleanApp::run(void)
 {
     if (trace)
-       verbose = TRUE;
+       verbose = true;
     scanDirectory();
     expungeCruft();
 }
@@ -144,7 +144,7 @@ faxQCleanApp::scanDirectory(void)
        if (fd >= 0) {
            if (flock(fd, LOCK_SH|LOCK_NB) >= 0) {
                FaxRequest* req = new FaxRequest(filename, fd);
-               fxBool reject;
+               bool reject;
                if (req->readQFile(reject) && !reject) {
                    if (now - sb.st_mtime < minJobAge) {
                        /*
@@ -392,13 +392,13 @@ main(int argc, char** argv)
     fxStr queueDir(FAX_SPOOLDIR);
     for (GetoptIter iter(argc, argv, faxApp::getOpts()); iter.notDone(); iter++)
        switch (iter.option()) {
-       case 'a': app.setArchiving(TRUE); break;
+       case 'a': app.setArchiving(true); break;
        case 'j': app.setJobAge(optarg); break;
        case 'd': app.setDocAge(optarg); break;
-       case 'n': app.setNoWork(TRUE); break;
+       case 'n': app.setNoWork(true); break;
        case 'q': queueDir = iter.optArg(); break;
-       case 't': app.setTracing(TRUE); break;
-       case 'v': app.setVerbose(TRUE); break;
+       case 't': app.setTracing(true); break;
+       case 'v': app.setVerbose(true); break;
        case '?': usage(appName);
        }
     if (Sys::chdir(queueDir) < 0) {
index 5346ddc67a9ea17c1d75a179d658071bce5f2858..0167400da32f79353d6ba8ce7d9486c8ee8a0e95 100644 (file)
@@ -62,13 +62,13 @@ fxStr strTime(time_t t)     { return fxStr(fmtTime(t)); }
 
 #define        JOBHASH(pri)    (((pri) >> 4) & (NQHASH-1))
 
-faxQueueApp::SchedTimeout::SchedTimeout() { started = FALSE; }
+faxQueueApp::SchedTimeout::SchedTimeout() { started = false; }
 faxQueueApp::SchedTimeout::~SchedTimeout() {}
 
 void
 faxQueueApp::SchedTimeout::timerExpired(long, long)
 {
-    started = FALSE;
+    started = false;
     faxQueueApp::instance().runScheduler();
 }
 
@@ -77,7 +77,7 @@ faxQueueApp::SchedTimeout::start()
 {
     if (!started) {
        Dispatcher::instance().startTimer(0,1, this);
-       started = TRUE;
+       started = true;
     }
 }
 
@@ -87,7 +87,7 @@ faxQueueApp::faxQueueApp()
     : configFile(FAX_CONFIG)
 {
     fifo = -1;
-    quit = FALSE;
+    quit = false;
     dialRules = NULL;
     setupConfig();
 
@@ -176,7 +176,7 @@ faxQueueApp::scanQueueDirectory()
     }
     for (dirent* dp = readdir(dir); dp; dp = readdir(dir)) {
        if (dp->d_name[0] == 'q')
-           submitJob(&dp->d_name[1], TRUE);
+           submitJob(&dp->d_name[1], true);
     }
     closedir(dir);
 }
@@ -229,7 +229,7 @@ faxQueueApp::processJob(Job& job, FaxRequest* req,
     if (!prepareJobNeeded(job, *req, status)) {
        if (status != Job::done) {
            job.state = FaxRequest::state_done;
-           deleteRequest(job, req, status, TRUE);
+           deleteRequest(job, req, status, true);
            setDead(job);
        } else
            sendJobStart(job, req, dci);
@@ -244,7 +244,7 @@ faxQueueApp::processJob(Job& job, FaxRequest* req,
  * cover page must be crafted (i.e. the work may take
  * a while).
  */
-fxBool
+bool
 faxQueueApp::prepareJobNeeded(Job& job, FaxRequest& req, JobStatus& status)
 {
     for (u_int i = 0, n = req.requests.length(); i < n; i++)
@@ -252,13 +252,13 @@ faxQueueApp::prepareJobNeeded(Job& job, FaxRequest& req, JobStatus& status)
        case FaxRequest::send_postscript:       // convert PostScript
        case FaxRequest::send_pcl:              // convert PCL
        case FaxRequest::send_tiff:             // verify&possibly convert TIFF
-           return (TRUE);
+           return (true);
        case FaxRequest::send_poll:             // verify modem is capable
            if (!job.modem->supportsPolling()) {
                req.notice = "Modem does not support polling";
                status = Job::rejected;
                jobError(job, "SEND REJECT: " | req.notice);
-               return (FALSE);
+               return (false);
            }
            break;
        }
@@ -277,7 +277,7 @@ faxQueueApp::prepareCleanup(int s)
 {
     signal(s, fxSIGHANDLER(faxQueueApp::prepareCleanup));
     logError("CAUGHT SIGNAL %d, ABORT JOB PREPARATION", s);
-    faxQueueApp::instance().abortPrepare = TRUE;
+    faxQueueApp::instance().abortPrepare = true;
 }
 
 /*
@@ -294,7 +294,7 @@ faxQueueApp::prepareJobStart(Job& job, FaxRequest* req,
     FaxMachineInfo& info, const DestControlInfo& dci)
 {
     traceQueue(job, "PREPARE START");
-    abortPrepare = FALSE;
+    abortPrepare = false;
     pid_t pid = fork();
     switch (pid) {
     case 0:                            // child, do work
@@ -344,7 +344,7 @@ faxQueueApp::prepareJobDone(Job& job, int status)
     } else
        status >>= 8;
     if (job.suspendPending) {          // co-thread waiting
-       job.suspendPending = FALSE;
+       job.suspendPending = false;
        releaseModem(job);
        return;
     }
@@ -365,7 +365,7 @@ faxQueueApp::prepareJobDone(Job& job, int status)
            sendJobStart(job, req, destCtrls[job.dest]);
            break;
        default:                        // problem preparing job
-           deleteRequest(job, req, status, TRUE);
+           deleteRequest(job, req, status, true);
            setDead(job);
            break;
        }
@@ -532,7 +532,7 @@ faxQueueApp::prepareJob(Job& job, FaxRequest& req,
      * using the parameter selected above.
      */
     JobStatus status = Job::done;
-    fxBool updateQFile = FALSE;
+    bool updateQFile = false;
     fxStr tmp;         // NB: here to avoid compiler complaint
     u_int i = 0;
     while (i < req.requests.length() && status == Job::done && !abortPrepare) {
@@ -555,7 +555,7 @@ faxQueueApp::prepareJob(Job& job, FaxRequest& req,
                req.insertFax(i+1, tmp);
            } else
                Sys::unlink(tmp);               // bail out
-           updateQFile = TRUE;
+           updateQFile = true;
            break;
        }
        i++;
@@ -568,7 +568,7 @@ faxQueueApp::prepareJob(Job& job, FaxRequest& req,
             * fatal; perhaps this should be configurable?
             */
            makeCoverPage(job, req, params, dci);
-           updateQFile = TRUE;
+           updateQFile = true;
        }
        if (req.pagehandling == "" && !abortPrepare) {
            /*
@@ -579,7 +579,7 @@ faxQueueApp::prepareJob(Job& job, FaxRequest& req,
                status = Job::rejected;         // XXX
                req.notice.insert("Document preparation failed: ");
            }
-           updateQFile = TRUE;
+           updateQFile = true;
        }    
     }
     if (updateQFile)
@@ -596,7 +596,7 @@ faxQueueApp::prepareJob(Job& job, FaxRequest& req,
  * be slow and there can be timing problems if this
  * is done during transmission.
  */
-fxBool
+bool
 faxQueueApp::preparePageHandling(FaxRequest& req,
     const FaxMachineInfo& info, const DestControlInfo& dci, fxStr& emsg)
 {
@@ -705,11 +705,11 @@ faxQueueApp::preparePageHandling(FaxRequest& req,
     }
 done:
     req.pagehandling.append('P');              // EOP
-    return (TRUE);
+    return (true);
 bad:
     if (tif)
        TIFFClose(tif);
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -806,7 +806,7 @@ MemoryDecoder::decodeNextByte()
     return (*bp++);
 }
 
-static fxBool
+static bool
 isBlank(uint16* runs, u_int rowpixels)
 {
     u_int x = 0;
@@ -814,11 +814,11 @@ isBlank(uint16* runs, u_int rowpixels)
        if ((x += *runs++) >= rowpixels)
            break;
        if (runs[0] != 0)
-           return (FALSE);
+           return (false);
        if ((x += *runs++) >= rowpixels)
            break;
     }
-    return (TRUE);
+    return (true);
 }
 
 void
@@ -1117,7 +1117,7 @@ cleanse(char buf[], int n)
  * is an error -- this is sent back to the user that
  * submitted the job.
  */
-fxBool
+bool
 faxQueueApp::runConverter1(Job& job, int fd, fxStr& output)
 {
     int n;
@@ -1132,9 +1132,9 @@ faxQueueApp::runConverter1(Job& job, int fd, fxStr& output)
     if (timer.wasTimeout()) {
        jobError(job, "CONVERT DOCUMENT: job time limit exceeded");
        output.append("\n[Job time limit exceeded]\n");
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 /*
@@ -1159,7 +1159,7 @@ faxQueueApp::makeCoverPage(Job& job, FaxRequest& req, const Class2Params& params
        | " " | freq.item
     );
     traceQueue(job, "COVER PAGE: " | cmd);
-    if (runCmd(cmd, TRUE)) {
+    if (runCmd(cmd, true)) {
        fxStr emsg;
        fxStr tmp = freq.item | ";" | params.encodePage();
        if (convertDocument(job, freq, tmp, params, dci, emsg)) {
@@ -1362,7 +1362,7 @@ faxQueueApp::sendJobDone(Job& job, int status)
         */
        fxAssert(!job.suspendPending, "Interrupted job timed out");
        job.state = FaxRequest::state_done;
-       deleteRequest(job, req, Job::timedout, TRUE);
+       deleteRequest(job, req, Job::timedout, true);
        setDead(job);
     } else if (req->status == send_retry) {
        /*
@@ -1433,7 +1433,7 @@ faxQueueApp::sendJobDone(Job& job, int status)
                setReadyToRun(job);             // NB: job.tts will be <= now
            }
        } else                                  // signal waiting co-thread
-           job.suspendPending = FALSE;
+           job.suspendPending = false;
        delete req;                             // implicit unlock of q file
     } else {
        job.state = FaxRequest::state_done;
@@ -1441,9 +1441,9 @@ faxQueueApp::sendJobDone(Job& job, int status)
        Trigger::post(Trigger::SEND_DONE, job);
        // NB: always notify client if job failed
        if (req->status == send_failed)
-           deleteRequest(job, req, Job::failed, TRUE, fmtTime(duration));
+           deleteRequest(job, req, Job::failed, true, fmtTime(duration));
        else
-           deleteRequest(job, req, Job::done, FALSE, fmtTime(duration));
+           deleteRequest(job, req, Job::done, false, fmtTime(duration));
        setDead(job);
     }
 }
@@ -1496,7 +1496,7 @@ void
 faxQueueApp::setDead(Job& job)
 {
     job.state = FaxRequest::state_done;
-    job.suspendPending = FALSE;
+    job.suspendPending = false;
     traceJob(job, "DEAD");
     Trigger::post(Trigger::JOB_DEAD, job);
     DestInfo& di = destJobs[job.dest];
@@ -1558,8 +1558,8 @@ faxQueueApp::setSuspend(Job& job)
  * appropriate queue.  A kill timer is also setup
  * for the job.
  */
-fxBool
-faxQueueApp::submitJob(FaxRequest& req, fxBool checkState)
+bool
+faxQueueApp::submitJob(FaxRequest& req, bool checkState)
 {
     Job* job = new Job(req);
     traceJob(*job, "CREATE");
@@ -1567,8 +1567,8 @@ faxQueueApp::submitJob(FaxRequest& req, fxBool checkState)
     return (submitJob(*job, req, checkState));
 }
 
-fxBool
-faxQueueApp::submitJob(Job& job, FaxRequest& req, fxBool checkState)
+bool
+faxQueueApp::submitJob(Job& job, FaxRequest& req, bool checkState)
 {
     /*
      * Check various submission parameters.  We setup the
@@ -1583,27 +1583,27 @@ faxQueueApp::submitJob(Job& job, FaxRequest& req, fxBool checkState)
            req.external = req.number;
        rejectSubmission(job, req,
            "REJECT: Unable to convert dial string to canonical format");
-       return (FALSE);
+       return (false);
     }
     time_t now = Sys::now();
     if (req.killtime <= now) {
        timeoutJob(job, req);
-       return (FALSE);
+       return (false);
     }
     if (!Modem::modemExists(req.modem) && !ModemGroup::find(req.modem)) {
        rejectSubmission(job, req,
            "REJECT: Requested modem " | req.modem | " is not registered");
-       return (FALSE);
+       return (false);
     }
     if (req.requests.length() == 0) {
        rejectSubmission(job, req, "REJECT: No work found in job file");
-       return (FALSE);
+       return (false);
     }
     if (req.pagewidth > 303) {
        rejectSubmission(job, req,
            fxStr::format("REJECT: Page width (%u) appears invalid",
                req.pagewidth));
-       return (FALSE);
+       return (false);
     }
     /*
      * Verify the killtime is ``reasonable''; otherwise
@@ -1614,7 +1614,7 @@ faxQueueApp::submitJob(Job& job, FaxRequest& req, fxBool checkState)
        rejectSubmission(job, req,
            fxStr::format("REJECT: Job expiration time (%u) appears invalid",
                req.killtime));
-       return (FALSE);
+       return (false);
     }
     if (checkState) {
        /*
@@ -1632,10 +1632,10 @@ faxQueueApp::submitJob(Job& job, FaxRequest& req, fxBool checkState)
        switch (req.state) {
        case FaxRequest::state_suspended:
            setSuspend(job);
-           return (TRUE);
+           return (true);
        case FaxRequest::state_done:
            setDead(job);
-           return (TRUE);
+           return (true);
        }
     }
     /*
@@ -1650,7 +1650,7 @@ faxQueueApp::submitJob(Job& job, FaxRequest& req, fxBool checkState)
            rejectSubmission(job, req,
                fxStr::format("REJECT: Time-to-send (%u) appears invalid",
                    req.tts));
-           return (FALSE);
+           return (false);
        }
        job.startKillTimer(req.killtime);
        job.state = FaxRequest::state_pending;
@@ -1660,7 +1660,7 @@ faxQueueApp::submitJob(Job& job, FaxRequest& req, fxBool checkState)
        setReadyToRun(job);
     }
     updateRequest(req, job);
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -1673,7 +1673,7 @@ faxQueueApp::rejectSubmission(Job& job, FaxRequest& req, const fxStr& reason)
     req.status = send_failed;
     req.notice = reason;
     traceServer("JOB " | job.jobid | ": " | reason);
-    deleteRequest(job, req, Job::rejected, TRUE);
+    deleteRequest(job, req, Job::rejected, true);
     setDead(job);                              // dispose of job
 }
 
@@ -1685,11 +1685,11 @@ faxQueueApp::rejectSubmission(Job& job, FaxRequest& req, const fxStr& reason)
  * and we wait for the process to stop before
  * returning to the caller.
  */
-fxBool
-faxQueueApp::suspendJob(Job& job, fxBool abortActive)
+bool
+faxQueueApp::suspendJob(Job& job, bool abortActive)
 {
     if (job.suspendPending)                    // already being suspended
-       return (FALSE);
+       return (false);
     switch (job.state) {
     case FaxRequest::state_active:
        /*
@@ -1700,7 +1700,7 @@ faxQueueApp::suspendJob(Job& job, fxBool abortActive)
         * to terminate the process completion work will not
         * mistakenly terminate the job (see sendJobDone).
         */
-       job.suspendPending = TRUE;              // mark thread waiting
+       job.suspendPending = true;              // mark thread waiting
        if (abortActive)
            (void) kill(job.pid, SIGTERM);      // signal subprocess
        job.stopKillTimer();
@@ -1714,7 +1714,7 @@ faxQueueApp::suspendJob(Job& job, fxBool abortActive)
            break;
        /* fall thru... */
     case FaxRequest::state_done:
-       return (FALSE);
+       return (false);
     case FaxRequest::state_sleeping:
     case FaxRequest::state_pending:
        job.stopTTSTimer();                     // cancel timeout
@@ -1732,7 +1732,7 @@ faxQueueApp::suspendJob(Job& job, fxBool abortActive)
     }
     job.remove();                              // remove from old queue
     job.stopKillTimer();                       // clear kill timer
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -1742,8 +1742,8 @@ faxQueueApp::suspendJob(Job& job, fxBool abortActive)
  * This control is used by clients that want to modify
  * the state of a job (i.e. suspend, modify, submit).
  */
-fxBool
-faxQueueApp::suspendJob(const fxStr& jobid, fxBool abortActive)
+bool
+faxQueueApp::suspendJob(const fxStr& jobid, bool abortActive)
 {
     Job* job = Job::getJobByID(jobid);
     if (job && suspendJob(*job, abortActive)) {
@@ -1753,9 +1753,9 @@ faxQueueApp::suspendJob(const fxStr& jobid, fxBool abortActive)
            updateRequest(*req, *job);
            delete req;
        }
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 /*
@@ -1767,20 +1767,20 @@ faxQueueApp::suspendJob(const fxStr& jobid, fxBool abortActive)
  * the appropriate queue and any associated resources
  * are purged.
  */
-fxBool
+bool
 faxQueueApp::terminateJob(const fxStr& jobid, JobStatus why)
 {
     Job* job = Job::getJobByID(jobid);
-    if (job && suspendJob(*job, TRUE)) {
+    if (job && suspendJob(*job, true)) {
        job->state = FaxRequest::state_done;
        Trigger::post(Trigger::JOB_KILL, *job);
        FaxRequest* req = readRequest(*job);
        if (req)
            deleteRequest(*job, req, why, why != Job::removed);
        setDead(*job);
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 /*
@@ -1853,7 +1853,7 @@ faxQueueApp::timeoutJob(Job& job)
        job.state = FaxRequest::state_done;
        FaxRequest* req = readRequest(job);
        if (req)
-           deleteRequest(job, req, Job::timedout, TRUE);
+           deleteRequest(job, req, Job::timedout, true);
        setDead(job);
     } else
        job.killtime = 0;                       // mark job to be removed
@@ -1875,7 +1875,7 @@ faxQueueApp::timeoutJob(Job& job, FaxRequest& req)
     job.state = FaxRequest::state_done;
     traceQueue(job, "KILL TIME EXPIRED");
     Trigger::post(Trigger::JOB_TIMEDOUT, job);
-    deleteRequest(job, req, Job::timedout, TRUE);
+    deleteRequest(job, req, Job::timedout, true);
     setDead(job);
 }
 
@@ -1883,12 +1883,12 @@ faxQueueApp::timeoutJob(Job& job, FaxRequest& req)
  * Resubmit an existing job or create a new job
  * using the specified job description file.
  */
-fxBool
-faxQueueApp::submitJob(const fxStr& jobid, fxBool checkState)
+bool
+faxQueueApp::submitJob(const fxStr& jobid, bool checkState)
 {
     Job* job = Job::getJobByID(jobid);
     if (job) {
-       fxBool ok = FALSE;
+       bool ok = false;
        if (job->state == FaxRequest::state_suspended) {
            job->remove();                      // remove from suspend queue
            FaxRequest* req = readRequest(*job);// XXX need better mechanism
@@ -1901,7 +1901,7 @@ faxQueueApp::submitJob(const fxStr& jobid, fxBool checkState)
        } else if (job->state == FaxRequest::state_done)
            jobError(*job, "Cannot resubmit a completed job");
        else
-           ok = TRUE;                          // other, nothing to do
+           ok = true;                          // other, nothing to do
        return (ok);
     }
     /*
@@ -1912,9 +1912,9 @@ faxQueueApp::submitJob(const fxStr& jobid, fxBool checkState)
     if (!Sys::isRegularFile(filename)) {
        logError("JOB %s: qfile %s is not a regular file.",
            (const char*) jobid, (const char*) filename);
-       return (FALSE);
+       return (false);
     }
-    fxBool status = FALSE;
+    bool status = false;
     int fd = Sys::open(filename, O_RDWR);
     if (fd >= 0) {
        if (flock(fd, LOCK_SH) >= 0) {
@@ -1932,7 +1932,7 @@ faxQueueApp::submitJob(const fxStr& jobid, fxBool checkState)
             * 4. Insufficient information was obtained to purge
             *    the job; just skip it.
             */
-           fxBool reject;
+           bool reject;
            if (req.readQFile(reject) && !reject &&
              req.state != FaxRequest::state_done) {
                status = submitJob(req, checkState);
@@ -1943,7 +1943,7 @@ faxQueueApp::submitJob(const fxStr& jobid, fxBool checkState)
                req.notice = "Invalid or corrupted job description file";
                traceServer("JOB " | jobid | ": " | req.notice);
                // NB: this may not work, but we try...
-               deleteRequest(job, req, Job::rejected, TRUE);
+               deleteRequest(job, req, Job::rejected, true);
            } else if (req.state == FaxRequest::state_done) {
                logError("JOB %s: Cannot resubmit a completed job",
                    (const char*) jobid);
@@ -2047,7 +2047,7 @@ faxQueueApp::runScheduler()
                rejectJob(job, *req, fxStr::format(
                    "REJECT: Too many attempts to dial: %u, max %u",
                    req->totdials, maxdials));
-               deleteRequest(job, req, Job::rejected, TRUE);
+               deleteRequest(job, req, Job::rejected, true);
                continue;
            }
            u_short maxtries = fxmin((u_short) dci.getMaxTries(),req->maxtries);
@@ -2055,7 +2055,7 @@ faxQueueApp::runScheduler()
                rejectJob(job, *req, fxStr::format(
                    "REJECT: Too many attempts to transmit: %u, max %u",
                    req->tottries, maxtries));
-               deleteRequest(job, req, Job::rejected, TRUE);
+               deleteRequest(job, req, Job::rejected, true);
                continue;
            }
            // NB: repeat this check so changes in max pages are applied
@@ -2064,7 +2064,7 @@ faxQueueApp::runScheduler()
                rejectJob(job, *req, fxStr::format(
                    "REJECT: Too many pages in submission: %u, max %u",
                    req->totpages, maxpages));
-               deleteRequest(job, req, Job::rejected, TRUE);
+               deleteRequest(job, req, Job::rejected, true);
                continue;
            }
            if (dci.getRejectNotice() != "") {
@@ -2073,7 +2073,7 @@ faxQueueApp::runScheduler()
                 * a specified reason that we return to the sender.
                 */
                rejectJob(job, *req, "REJECT: " | dci.getRejectNotice());
-               deleteRequest(job, req, Job::rejected, TRUE);
+               deleteRequest(job, req, Job::rejected, true);
                continue;
            }
            time_t now = Sys::now();
@@ -2141,19 +2141,19 @@ faxQueueApp::runScheduler()
  * do not get information about when modems are in
  * use from faxgetty processes.
  */
-fxBool
+bool
 faxQueueApp::assignModem(Job& job)
 {
     fxAssert(job.modem == NULL, "Assigning modem to job that already has one");
 
-    fxBool retryModemLookup;
+    bool retryModemLookup;
     do {
-       retryModemLookup = FALSE;
+       retryModemLookup = false;
        Modem* modem = Modem::findModem(job);
        if (modem) {
            if (modem->assign(job)) {
                Trigger::post(Trigger::MODEM_ASSIGN, *modem);
-               return (TRUE);
+               return (true);
            }
            /*
             * Modem could not be assigned to job.  The
@@ -2168,11 +2168,11 @@ faxQueueApp::assignModem(Job& job)
                (const char*) modem->getDeviceID());
            modem->startLockPolling(pollLockWait);
            traceModem(*modem, "BUSY (begin polling)");
-           retryModemLookup = TRUE;
+           retryModemLookup = true;
        } else
            traceJob(job, "No assignable modem located");
     } while (retryModemLookup);
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -2232,7 +2232,7 @@ faxQueueApp::readRequest(Job& job)
     if (fd >= 0) {
        if (flock(fd, LOCK_EX) >= 0) {
            FaxRequest* req = new FaxRequest(job.file, fd);
-           fxBool reject;
+           bool reject;
            if (req->readQFile(reject) && !reject) {
                if (req->external == "")
                    req->external = job.dest;
@@ -2269,7 +2269,7 @@ faxQueueApp::updateRequest(FaxRequest& req, Job& job)
  */
 void
 faxQueueApp::deleteRequest(Job& job, FaxRequest* req, JobStatus why,
-    fxBool force, const char* duration)
+    bool force, const char* duration)
 {
     deleteRequest(job, *req, why, force, duration);
     delete req;
@@ -2277,7 +2277,7 @@ faxQueueApp::deleteRequest(Job& job, FaxRequest* req, JobStatus why,
 
 void
 faxQueueApp::deleteRequest(Job& job, FaxRequest& req, JobStatus why,
-    fxBool force, const char* duration)
+    bool force, const char* duration)
 {
     fxStr dest = FAX_DONEDIR |
        req.qfile.tail(req.qfile.length() - (sizeof (FAX_SENDDIR)-1));
@@ -2356,7 +2356,7 @@ faxQueueApp::deleteRequest(Job& job, FaxRequest& req, JobStatus why,
 void
 faxQueueApp::openFIFOs()
 {
-    fifo = openFIFO(fifoName, 0600, TRUE);
+    fifo = openFIFO(fifoName, 0600, true);
     Dispatcher::instance().link(fifo, Dispatcher::ReadMask, this);
 }
 
@@ -2390,7 +2390,7 @@ faxQueueApp::FIFOMessage(const char* cp)
 void
 faxQueueApp::FIFOMessage(char cmd, const fxStr& id, const char* args)
 {
-    fxBool status = FALSE;
+    bool status = false;
     switch (cmd) {
     case '+':                          // modem status msg
        FIFOModemMessage(id, args);
@@ -2403,7 +2403,7 @@ faxQueueApp::FIFOMessage(char cmd, const fxStr& id, const char* args)
        return;
     case 'Q':                          // quit
        traceServer("QUIT");
-       quit = TRUE;
+       quit = true;
        pokeScheduler();
        return;                         // NB: no return value expected
     case 'T':                          // create new trigger 
@@ -2439,20 +2439,20 @@ faxQueueApp::FIFOMessage(char cmd, const fxStr& id, const char* args)
     case 'U':                          // unreference file
        traceServer("UNREF DOC %s", args);
        unrefDoc(args);
-       status = TRUE;
+       status = true;
        break;
     case 'X':                          // suspend job
        traceServer("SUSPEND JOB %s", args);
-       if (status = suspendJob(args, FALSE))
+       if (status = suspendJob(args, false))
            pokeScheduler();
        break;
     case 'Y':                          // interrupt job
        traceServer("INTERRUPT JOB %s", args);
-       if (status = suspendJob(args, TRUE))
+       if (status = suspendJob(args, true))
            pokeScheduler();
        break;
     case 'N':                          // noop
-       status = TRUE;
+       status = true;
        break;
     default:
        logError("Bad FIFO cmd '%c' from client %s", cmd, (const char*) id);
@@ -2479,7 +2479,7 @@ faxQueueApp::notifyModemWedged(Modem& modem)
        | quote |                  dev | enquote
     );
     traceServer("MODEM WEDGED: %s", (const char*) cmd);
-    runCmd(cmd, TRUE);
+    runCmd(cmd, true);
 }
 
 void
@@ -2672,7 +2672,7 @@ faxQueueApp::setupConfig()
     for (i = N(numbers)-1; i >= 0; i--)
        (*this).*numbers[i].p = numbers[i].def;
     tod.reset();                       // any day, any time
-    use2D = TRUE;                      // ok to use 2D data
+    use2D = true;                      // ok to use 2D data
     uucpLockMode = UUCP_LOCKMODE;
     delete dialRules, dialRules = NULL;
     ModemGroup::reset();               // clear+add ``any modem'' class
@@ -2743,7 +2743,7 @@ tiffWarningHandler(const char* module, const char* fmt0, va_list ap)
     vlogWarning(fmt, ap);
 }
 
-fxBool
+bool
 faxQueueApp::setConfigItem(const char* tag, const char* value)
 {
     u_int ix;
@@ -2812,8 +2812,8 @@ faxQueueApp::setConfigItem(const char* tag, const char* value)
     } else if (streq(tag, "pagechopthreshold"))
        pageChopThreshold = atof(value);
     else
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 
 /*
@@ -2943,7 +2943,7 @@ faxQueueApp::notifySender(Job& job, JobStatus why, const char* duration)
        cmd.append(buf);
     }
     traceServer("NOTIFY: %s", (const char*) cmd);
-    runCmd(cmd, TRUE);
+    runCmd(cmd, true);
 }
 
 void
@@ -3062,12 +3062,12 @@ main(int argc, char** argv)
 
     faxApp::setOpts("q:D");
 
-    fxBool detach = TRUE;
+    bool detach = true;
     fxStr queueDir(FAX_SPOOLDIR);
     for (GetoptIter iter(argc, argv, faxApp::getOpts()); iter.notDone(); iter++)
        switch (iter.option()) {
        case 'q': queueDir = iter.optArg(); break;
-       case 'D': detach = FALSE; break;
+       case 'D': detach = false; break;
        case '?': usage(appName);
        }
     if (Sys::chdir(queueDir) < 0)
index b69a08fd0c5fe2deabfec8dbf0d2014f98e583dd..01967f47c0b71b9f7f1c11b2518d37abc93a4969 100644 (file)
@@ -68,7 +68,7 @@ public:
 private:
     class SchedTimeout : public IOHandler {
     private:
-       fxBool  started;
+       bool    started;
     public:
        SchedTimeout();
        ~SchedTimeout();
@@ -100,7 +100,7 @@ private:
     u_int      tracingMask;            // tracing level control mask
     fxStr      logFacility;            // syslog facility to direct trace msgs
     u_int      requeueInterval;        // job requeue interval
-    fxBool     use2D;                  // ok to use 2D-encoded data
+    bool       use2D;                  // ok to use 2D-encoded data
     u_int      pageChop;               // default page chop handling
     float      pageChopThreshold;      // minimum space before page chop
     fxStr      notifyCmd;              // external command for notification
@@ -116,9 +116,9 @@ private:
     static const stringtag strings[];
     static const numbertag numbers[];
 // runtime state
-    fxBool     timeout;                // timeout occurred
-    fxBool     abortPrepare;           // job preparation should be aborted
-    fxBool     quit;                   // terminate server
+    bool       timeout;                // timeout occurred
+    bool       abortPrepare;           // job preparation should be aborted
+    bool       quit;                   // terminate server
     int                fifo;                   // fifo job queue interface
 #define        NQHASH          16
     QLink      runqs[NQHASH];          // jobs ready to run
@@ -146,14 +146,14 @@ private:
 // configuration support
     void       setupConfig();
     void       resetConfig();
-    fxBool     setConfigItem(const char* tag, const char* value);
+    bool       setConfigItem(const char* tag, const char* value);
     void       configError(const char* fmt, ...);
     void       configTrace(const char* fmt, ...);
     void       setDialRules(const char* name);
     fxStr      canonicalizePhoneNumber(const fxStr& ds);
 // modem support
     void       scanForModems();
-    fxBool     assignModem(Job& job);
+    bool       assignModem(Job& job);
     void       releaseModem(Job& job);
     void       notifyModemWedged(Modem&);
     void       pollForModemLock(Modem& modem);
@@ -184,9 +184,9 @@ private:
     FaxRequest*        readRequest(Job&);
     void       updateRequest(FaxRequest& req, Job& job);
     void       deleteRequest(Job&, FaxRequest* req, JobStatus why,
-                   fxBool force, const char* duration = "");
+                   bool force, const char* duration = "");
     void       deleteRequest(Job&, FaxRequest& req, JobStatus why,
-                   fxBool force, const char* duration = "");
+                   bool force, const char* duration = "");
     void       notifySender(Job&, JobStatus, const char* = "");
 // job management interfaces
     void       processJob(Job& job);
@@ -197,8 +197,8 @@ private:
     void       blockJob(Job&, FaxRequest&, const char*);
     void       delayJob(Job&, FaxRequest&, const char*, time_t);
     void       rejectJob(Job& job, FaxRequest& req, const fxStr& reason);
-    fxBool     submitJob(const fxStr& jobid, fxBool checkState = FALSE);
-    fxBool     suspendJob(const fxStr& jobid, fxBool abortActive);
+    bool       submitJob(const fxStr& jobid, bool checkState = false);
+    bool       suspendJob(const fxStr& jobid, bool abortActive);
     void       rejectSubmission(Job&, FaxRequest&, const fxStr& reason);
 
     void       setReadyToRun(Job& job);
@@ -206,10 +206,10 @@ private:
     void       setDead(Job& job);
     void       setActive(Job& job);
     void       setSuspend(Job& job);
-    fxBool     submitJob(FaxRequest&, fxBool checkState = FALSE);
-    fxBool     submitJob(Job& job, FaxRequest& req, fxBool checkState = FALSE);
-    fxBool     suspendJob(Job& job, fxBool abortActive);
-    fxBool     terminateJob(const fxStr& filename, JobStatus why);
+    bool       submitJob(FaxRequest&, bool checkState = false);
+    bool       submitJob(Job& job, FaxRequest& req, bool checkState = false);
+    bool       suspendJob(Job& job, bool abortActive);
+    bool       terminateJob(const fxStr& filename, JobStatus why);
     void       timeoutJob(Job& job);
     void       timeoutJob(Job& job, FaxRequest&);
     void       runJob(Job& job);
@@ -217,7 +217,7 @@ private:
     void       runScheduler();
     void       pokeScheduler();
 // job preparation stuff
-    fxBool     prepareJobNeeded(Job&, FaxRequest&, JobStatus&);
+    bool       prepareJobNeeded(Job&, FaxRequest&, JobStatus&);
     static void prepareCleanup(int s);
     void       prepareJobStart(Job&, FaxRequest*,
                    FaxMachineInfo&, const DestControlInfo&);
@@ -230,10 +230,10 @@ private:
                    const DestControlInfo& dci, fxStr& emsg);
     JobStatus  runConverter(Job& job, const char* app, char* const* argv,
                    fxStr& emsg);
-    fxBool     runConverter1(Job& job, int fd, fxStr& output);
+    bool       runConverter1(Job& job, int fd, fxStr& output);
     void       makeCoverPage(Job&, FaxRequest&, const Class2Params&,
                    const DestControlInfo&);
-    fxBool     preparePageHandling(FaxRequest&,
+    bool       preparePageHandling(FaxRequest&,
                    const FaxMachineInfo&, const DestControlInfo&, fxStr& emsg);
     void       preparePageChop(const FaxRequest&,
                    TIFF*, const Class2Params&, fxStr&);
index a4b047aae699670cfe6fa56468d701b6ae9fed06..ccf272a5a0b9a8e7d00c846656eaf0ca316c36ba 100644 (file)
@@ -44,7 +44,7 @@ faxRequest::~faxRequest() {}
 
 int faxRequest::compare(faxRequest const*) const { return 0; }
 
-fxBool
+bool
 faxRequest::isSavedOp() const
 {
     return (op == FaxRequest::send_tiff_saved ||
index 0655826379e1ecae2313c9742c5891c658e9af8e..6c5d6e84979905ec60bf6fe90df3ee44a8d9f96c 100644 (file)
@@ -52,7 +52,7 @@ struct faxRequest {
 
     int compare(faxRequest const *a) const;    // XXX needed for array
 
-    fxBool isSavedOp() const;
+    bool isSavedOp() const;
 };
 fxDECLARE_ObjArray(faxRequestArray, faxRequest)
 #endif /* _faxRequest_ */
index e81a0c059c3068e303a8ff4f39c38b0809ec58b4..bdbacfe2ba1b69e7ab6acf1440223459c53445e7 100644 (file)
@@ -53,7 +53,7 @@ faxSendApp* faxSendApp::_instance = NULL;
 faxSendApp::faxSendApp(const fxStr& devName, const fxStr& devID)
     : FaxServer(devName, devID)
 {
-    ready = FALSE;
+    ready = false;
     modemLock = NULL;
     setupConfig();
 
@@ -131,7 +131,7 @@ faxSendApp::send(const char* filename)
                req->desiredec = desiredEC;
            if (desiredST != (u_int) -1)
                req->desiredst = desiredST;
-           fxBool reject;
+           bool reject;
            if (req->readQFile(reject) && !reject) {
                FaxMachineInfo info;
                info.updateConfig(canonicalizePhoneNumber(req->number));
@@ -177,10 +177,10 @@ faxSendApp::send(const char* filename)
  * Modem locking support.
  */
 
-fxBool
+bool
 faxSendApp::lockModem()
 {
-    return (modemLock ? modemLock->lock() : TRUE);
+    return (modemLock ? modemLock->lock() : true);
 }
 
 void
@@ -201,7 +201,7 @@ faxSendApp::unlockModem()
 void
 faxSendApp::notifyModemReady()
 {
-    ready = TRUE;
+    ready = true;
 }
 
 /*
@@ -298,7 +298,7 @@ faxSendApp::notifyPollRecvd(FaxRequest& req, const FaxRecvInfo& ri)
      );
     traceServer("RECV POLL: %s", (const char*) cmd);
     setProcessPriority(BASE);                  // lower priority
-    runCmd(cmd, TRUE);
+    runCmd(cmd, true);
     setProcessPriority(state);                 // restore previous priority
 }
 
@@ -348,7 +348,7 @@ faxSendApp::setupConfig()
        (*this).*numbers[i].p = numbers[i].def;
 }
 
-fxBool
+bool
 faxSendApp::setConfigItem(const char* tag, const char* value)
 {
     u_int ix;
@@ -358,7 +358,7 @@ faxSendApp::setConfigItem(const char* tag, const char* value)
        (*this).*numbers[ix].p = getNumber(value);
     } else
        return (FaxServer::setConfigItem(tag, value));
-    return (TRUE);
+    return (true);
 }
 #undef N
 
index d635ed0751bd9ee865f4e5b660be4f4b7bc20df4..846430f918409e3628e5aa6f17517bbdfb8d4956 100644 (file)
@@ -47,7 +47,7 @@ public:
     };
 private:
 // runtime state
-    fxBool     ready;                  // modem ready for use
+    bool       ready;                  // modem ready for use
     UUCPLock*  modemLock;              // uucp lockfile handle
     fxStr      pollRcvdCmd;            // command for docs received by polling
     u_int      desiredBR;              // desired signalling rate
@@ -62,9 +62,9 @@ private:
 // configuration support
     void       setupConfig();
     void       resetConfig();
-    fxBool     setConfigItem(const char* tag, const char* value);
+    bool       setConfigItem(const char* tag, const char* value);
 // modem handling
-    fxBool     lockModem();
+    bool       lockModem();
     void       unlockModem();
 // notification interfaces used by FaxServer
     void       notifyModemReady();
@@ -87,7 +87,7 @@ public:
 
     FaxSendStatus send(const char* filename);
 
-    fxBool     isReady() const;
+    bool       isReady() const;
 };
-inline fxBool faxSendApp::isReady() const      { return ready; }
+inline bool faxSendApp::isReady() const        { return ready; }
 #endif
index 2b57944ad1eb32c756ce9a041f709665184905d9..1c489ff550230d6b8fcdbfff5a06f57d74710082 100644 (file)
@@ -52,7 +52,7 @@ pageSendApp* pageSendApp::_instance = NULL;
 pageSendApp::pageSendApp(const fxStr& devName, const fxStr& devID)
     : ModemServer(devName, devID)
 {
-    ready = FALSE;
+    ready = false;
     modemLock = NULL;
     setupConfig();
 
@@ -118,7 +118,7 @@ pageSendApp::send(const char* filename)
     if (fd >= 0) {
        if (flock(fd, LOCK_EX) >= 0) {
            FaxRequest* req = new FaxRequest(filename, fd);
-           fxBool reject;
+           bool reject;
            if (req->readQFile(reject) && !reject) {
                if (req->findRequest(FaxRequest::send_page) != fx_invalidArrayIndex) {
                    FaxMachineInfo info;
@@ -193,7 +193,7 @@ pageSendApp::sendPage(FaxRequest& req, FaxMachineInfo& info)
            changeState(MODEMWAIT);             // ...sort of...
        } else
            sendFailed(req, send_retry, "Can not setup modem", 4*pollModemWait);
-       discardModem(TRUE);
+       discardModem(true);
        endSession();
        unlockModem();
     } else {
@@ -201,17 +201,17 @@ pageSendApp::sendPage(FaxRequest& req, FaxMachineInfo& info)
     }
 }
 
-fxBool
+bool
 pageSendApp::prepareMsg(FaxRequest& req, FaxMachineInfo& info, fxStr& msg)
 {
     u_int i = req.findRequest(FaxRequest::send_data);
     if (i == fx_invalidArrayIndex)             // page w/o text
-       return (TRUE);
+       return (true);
     int fd = Sys::open(req.requests[i].item, O_RDONLY);
     if (fd < 0) {
        sendFailed(req, send_failed,
            "Internal error: unable to open text message file");
-       return (FALSE);
+       return (false);
     }
     struct stat sb;
     (void) Sys::fstat(fd, sb);
@@ -219,7 +219,7 @@ pageSendApp::prepareMsg(FaxRequest& req, FaxMachineInfo& info, fxStr& msg)
     if (Sys::read(fd, &msg[0], (u_int) sb.st_size) != sb.st_size) {
        sendFailed(req, send_failed,
            "Internal error: unable to read text message file");
-       return (FALSE);
+       return (false);
     }
     Sys::close(fd);
 
@@ -231,7 +231,7 @@ pageSendApp::prepareMsg(FaxRequest& req, FaxMachineInfo& info, fxStr& msg)
            msg.length(), maxMsgLen);
        msg.resize(maxMsgLen);
     }
-    return (TRUE);
+    return (true);
 }
 
 void
@@ -273,7 +273,7 @@ pageSendApp::sendPage(FaxRequest& req, FaxMachineInfo& info, const fxStr& number
        req.ndials = 0;                         // consec. failed dial attempts
        req.tottries++;                         // total answered calls
        req.totdials++;                         // total attempted calls
-       info.setCalledBefore(TRUE);
+       info.setCalledBefore(true);
        info.setDialFailures(0);
 
        req.status = send_ok;                   // be optimistic
@@ -435,7 +435,7 @@ pageSendApp::getResponse(fxStackBuffer& buf, long secs)
  * as PageNet intersperse protocol messages and
  * verbose text messages.
  */
-static fxBool
+static bool
 scanForCode(const u_char*& cp, u_int& len)
 {
     if (len > 0) {
@@ -447,7 +447,7 @@ scanForCode(const u_char*& cp, u_int& len)
     return (len > 0);
 }
 
-fxBool
+bool
 pageSendApp::pagePrologue(FaxRequest& req, const FaxMachineInfo& info, fxStr& emsg)
 {
     fxStackBuffer buf;
@@ -461,7 +461,7 @@ pageSendApp::pagePrologue(FaxRequest& req, const FaxMachineInfo& info, fxStr& em
      */
     traceIXO("EXPECT ID (paging central identification)");
     start = Sys::now();
-    fxBool gotID = FALSE;
+    bool gotID = false;
     do {
        putModem("\r", 1);
        if (getResponse(buf, ixoIDProbe) >= 3) {
@@ -480,7 +480,7 @@ pageSendApp::pagePrologue(FaxRequest& req, const FaxMachineInfo& info, fxStr& em
     if (!gotID) {
        emsg = "No initial ID response from paging central";
        req.status = send_retry;
-       return (FALSE);
+       return (false);
     }
     flushModemInput();                 // paging central may send multiple ID=
     /*
@@ -526,7 +526,7 @@ pageSendApp::pagePrologue(FaxRequest& req, const FaxMachineInfo& info, fxStr& em
                if (--ntries == 0) {
                    emsg = "Login failed multiple times";
                    req.status = send_retry;
-                   return (FALSE);
+                   return (false);
                }
                /*
                 * Resend the login request.
@@ -550,12 +550,12 @@ pageSendApp::pagePrologue(FaxRequest& req, const FaxMachineInfo& info, fxStr& em
                        emsg =
                            "Paging central responded with forced disconnect";
                        req.status = send_failed;
-                       return (FALSE);
+                       return (false);
                    }
                    // check for go-ahead message
                    if (len > 2 && cp[1] == '[' && cp[2] == 'p') {
                        traceIXO("RECV ACK (login successful & got go-ahead)");
-                       return (TRUE);
+                       return (true);
                    }
                }
                break;
@@ -568,10 +568,10 @@ pageSendApp::pagePrologue(FaxRequest& req, const FaxMachineInfo& info, fxStr& em
        (unknown ?
            "timeout waiting for response" : "too many unknown responses"));
     req.status = send_retry;
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 pageSendApp::pageGoAhead(FaxRequest& req, const FaxMachineInfo&, fxStr& emsg)
 {
     fxStackBuffer buf;
@@ -583,7 +583,7 @@ pageSendApp::pageGoAhead(FaxRequest& req, const FaxMachineInfo&, fxStr& emsg)
        while (len > 0) {
            if (len > 2 && cp[0] == ESC && cp[1] == '[' && cp[2] == 'p') {
                traceIXO("RECV go-ahead (prologue done)");
-               return (TRUE);
+               return (true);
            }
            (void) scanForCode(cp, len);
        }
@@ -592,7 +592,7 @@ pageSendApp::pageGoAhead(FaxRequest& req, const FaxMachineInfo&, fxStr& emsg)
     emsg = fxStr::format("Protocol failure: %s waiting for go-ahead message",
        unknown ? "timeout" : "too many unknown responses");
     req.status = send_retry;
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -612,7 +612,7 @@ addChecksum(fxStackBuffer& buf)
     buf.put(check, 3);
 }
 
-fxBool
+bool
 pageSendApp::sendPagerMsg(FaxRequest& req, faxRequest& preq, const fxStr& msg, fxStr& emsg)
 {
     /*
@@ -656,14 +656,14 @@ pageSendApp::sendPagerMsg(FaxRequest& req, faxRequest& preq, const fxStr& msg, f
            switch (cp[0]) {
            case ACK:
                traceIXO("RECV ACK (message block accepted)");
-               return (TRUE);
+               return (true);
            case NAK:
                traceIXO("RECV NAK (message block rejected)");
                if (--ntries == 0) {
                    req.status = send_retry;
                    emsg = "Message block not acknowledged by paging central "
                        "after multiple tries";
-                   return (FALSE);
+                   return (false);
                }
                /*
                 * Retransmit the packet to paging central.
@@ -693,14 +693,14 @@ pageSendApp::sendPagerMsg(FaxRequest& req, faxRequest& preq, const fxStr& msg, f
                req.status = send_failed;
                emsg = "Message block transmit failed; "
                    "paging central rejected it";
-               return (FALSE);
+               return (false);
            case ESC:
                if (len > 1 && cp[1] == EOT) {
                    traceIXO("RECV EOT (forced disconnect)");
                    req.status = send_failed;
                    emsg = "Protocol failure: paging central responded to "
                        "message block transmit with forced disconnect";
-                   return (FALSE);
+                   return (false);
                }
                /* fall thru... */
            default:                            // unrecognized response
@@ -715,10 +715,10 @@ pageSendApp::sendPagerMsg(FaxRequest& req, faxRequest& preq, const fxStr& msg, f
        (unknown ?
            "timeout waiting for response" : "too many unknown responses"));
     req.status = send_retry;
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 pageSendApp::pageEpilogue(FaxRequest& req, const FaxMachineInfo&, fxStr& emsg)
 {
     putModem("\4\r", 2);               // EOT then <CR>
@@ -733,14 +733,14 @@ pageSendApp::pageEpilogue(FaxRequest& req, const FaxMachineInfo&, fxStr& emsg)
            case ESC:
                if (len > 1 && cp[1] == EOT) {
                    traceIXO("RECV EOT (disconnect)");
-                   return (TRUE);
+                   return (true);
                }
                break;
            case RS:
                traceIXO("RECV RS (message content rejected)");
                emsg = "Paging central rejected content; check PIN";
                req.status = send_failed;
-               return (FALSE);
+               return (false);
            }
            (void) scanForCode(cp, len);
        }
@@ -750,7 +750,7 @@ pageSendApp::pageEpilogue(FaxRequest& req, const FaxMachineInfo&, fxStr& emsg)
     req.status = send_retry;
     emsg = "Protocol failure: timeout waiting for transaction ACK/NAK "
        "from paging central";
-    return (FALSE);
+    return (false);
 }
 
 void
@@ -1022,7 +1022,7 @@ addUcpCodedMsg(fxStackBuffer& buf, const fxStr& msg)
     }
 }
 
-fxBool
+bool
 pageSendApp::sendUcpMsg(FaxRequest& req, faxRequest& preq, const fxStr& msg, fxStr& emsg, FaxMachineInfo& info)
 {
     /*
@@ -1112,14 +1112,14 @@ pageSendApp::sendUcpMsg(FaxRequest& req, faxRequest& preq, const fxStr& msg, fxS
                    switch( N_ACK[0]) { 
                    case 'A':  // positive result (ACK)
                        traceIXO("RECV ACK (message block accepted)");
-                       return(TRUE);
+                       return(true);
                    case 'N': // Negative result (NACK)
                        traceIXO("RECV NACK (message block rejected)");
                        if(--ntries==0) {
                            req.status = send_retry;
                            emsg="Message block not acknowledged by paging central"
                              "after multiple tries";
-                           return(FALSE);
+                           return(false);
                        }
                        traceIXO("SEND message block (retransmit)");
                        putModem((const char*) buf, buf.getLength());
@@ -1130,14 +1130,14 @@ pageSendApp::sendUcpMsg(FaxRequest& req, faxRequest& preq, const fxStr& msg, fxS
            }
        }
     } while (Sys::now()-start < ixoXmitTimeout && unknown < ixoMaxUnknown);
-    return FALSE;
+    return false;
 }
 
 /*
  * END UCP Support
  */
 
-fxBool
+bool
 pageSendApp::putModem(const void* data, int n, long ms)
 {
     traceIXOCom("<--",  (const u_char*) data, n);
@@ -1192,7 +1192,7 @@ pageSendApp::setupConfig()
        (*this).*numbers[i].p = numbers[i].def;
 }
 
-fxBool
+bool
 pageSendApp::setConfigItem(const char* tag, const char* value)
 {
     u_int ix;
@@ -1204,7 +1204,7 @@ pageSendApp::setConfigItem(const char* tag, const char* value)
        (*this).*numbers[ix].p = getNumber(value);
     } else
        return (ModemServer::setConfigItem(tag, value));
-    return (TRUE);
+    return (true);
 }
 #undef N
 
@@ -1226,7 +1226,7 @@ pageSendApp::getConfigParity(const char* value) const
 /*
  * Modem and TTY setup
  */
-fxBool 
+bool 
 pageSendApp::setupModem()
 {
     return (ModemServer::setupModem() &&
@@ -1237,10 +1237,10 @@ pageSendApp::setupModem()
  * Modem locking support.
  */
 
-fxBool
+bool
 pageSendApp::lockModem()
 {
-    return (modemLock ? modemLock->lock() : TRUE);
+    return (modemLock ? modemLock->lock() : true);
 }
 
 void
@@ -1261,7 +1261,7 @@ pageSendApp::unlockModem()
 void
 pageSendApp::notifyModemReady()
 {
-    ready = TRUE;
+    ready = true;
 }
 
 /*
index ccae712dac0c2903afb81b54d81f5bf1b9282d8f..2dad8660f0bdc8c423c536ec89f6aaf819f6a0ed 100644 (file)
@@ -49,7 +49,7 @@ public:
     };
 private:
 // runtime state
-    fxBool     ready;                  // modem ready for use
+    bool       ready;                  // modem ready for use
     UUCPLock*  modemLock;              // uucp lockfile handle
     time_t     connTime;               // time connected to peer
 
@@ -78,7 +78,7 @@ private:
 // configuration support
     void       setupConfig();
     void       resetConfig();
-    fxBool     setConfigItem(const char* tag, const char* value);
+    bool       setConfigItem(const char* tag, const char* value);
     u_int      getConfigParity(const char* value) const;
 // page transmission support (independent of paging protocol)
     void       sendPage(FaxRequest&, FaxMachineInfo&);
@@ -86,27 +86,27 @@ private:
                    const fxStr&);
 // IXO transmission support
     void       sendIxoPage(FaxRequest&, FaxMachineInfo&, const fxStr&, fxStr&);
-    fxBool     sendPagerMsg(FaxRequest&, faxRequest&, const fxStr&, fxStr&);
+    bool       sendPagerMsg(FaxRequest&, faxRequest&, const fxStr&, fxStr&);
     u_int      getResponse(fxStackBuffer& buf, long secs);
-    fxBool     prepareMsg(FaxRequest&, FaxMachineInfo&, fxStr&);
-    fxBool     pagePrologue(FaxRequest&, const FaxMachineInfo&, fxStr&);
-    fxBool     pageGoAhead(FaxRequest&, const FaxMachineInfo&, fxStr&);
-    fxBool     pageEpilogue(FaxRequest&, const FaxMachineInfo&, fxStr&);
+    bool       prepareMsg(FaxRequest&, FaxMachineInfo&, fxStr&);
+    bool       pagePrologue(FaxRequest&, const FaxMachineInfo&, fxStr&);
+    bool       pageGoAhead(FaxRequest&, const FaxMachineInfo&, fxStr&);
+    bool       pageEpilogue(FaxRequest&, const FaxMachineInfo&, fxStr&);
     void       sendFailed(FaxRequest&, FaxSendStatus, const char*, u_int = 0);
     void       notifyPageSent(FaxRequest& req, u_int fi);
     time_t     getConnectTime() const;
 // UCP transmission support
-    void       sendUcpPage(FaxRequest&, FaxMachineInfo&, const fxStr&, fxStr&);    fxBool      sendUcpMsg(FaxRequest&, faxRequest&, const fxStr&, fxStr&,
+    void       sendUcpPage(FaxRequest&, FaxMachineInfo&, const fxStr&, fxStr&);    bool        sendUcpMsg(FaxRequest&, faxRequest&, const fxStr&, fxStr&,
                    FaxMachineInfo&);
 // modem handling
-    fxBool     lockModem();
+    bool       lockModem();
     void       unlockModem();
-    fxBool     setupModem();
+    bool       setupModem();
 // notification interfaces used by ModemServer
     void       notifyModemReady();
     void       notifyModemWedged();
 // miscellaneous
-    fxBool     putModem(const void* data, int n, long ms = 0);
+    bool       putModem(const void* data, int n, long ms = 0);
     void       traceResponse(const fxStackBuffer& buf);
     void       traceIXO(const char* fmt ...);
     void       traceIXOCom(const char* dir, const u_char* data, u_int cc);
@@ -122,7 +122,7 @@ public:
 
     FaxSendStatus send(const char* filename);
 
-    fxBool     isReady() const;
+    bool       isReady() const;
 };
-inline fxBool pageSendApp::isReady() const     { return ready; }
+inline bool pageSendApp::isReady() const       { return ready; }
 #endif
index 61a8c7fe8a992affae55c8b3dc3ad585ffe91824..731efd6c7ea0500a455d755a33690e9f2e6ef7c7 100644 (file)
@@ -113,15 +113,15 @@ setupTagLine()
 #define        MARGIN_LEFT     2
 #define        MARGIN_RIGHT    2
 
-fxBool
+bool
 setupTagLineSlop(const Class2Params& params)
 {
     if (tagLineFont->isReady()) {
        tagLineSlop = (tagLineFont->fontHeight()+MARGIN_TOP+MARGIN_BOT+3) * 
            howmany(params.pageWidth(),8);
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 class MemoryDecoder : public G3Decoder {
@@ -464,7 +464,7 @@ main(int argc, char* argv[])
        uint32* stripbytecount;
        (void) TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &stripbytecount);
 
-       fxBool firstStrip = setupTagLineSlop(params);
+       bool firstStrip = setupTagLineSlop(params);
        u_int ts = tagLineSlop;
        for (u_int strip = 0; strip < TIFFNumberOfStrips(tif); strip++) {
            u_int totbytes = (u_int) stripbytecount[strip];
@@ -478,7 +478,7 @@ main(int argc, char* argv[])
                         */
                        dp = imageTagLine(data+ts, fillorder, params);
                        totbytes = totbytes+ts - (dp-data);
-                       firstStrip = FALSE;
+                       firstStrip = false;
                    } else
                        dp = data;
                    if (fillorder != FILLORDER_LSB2MSB)
index 5376904605a00fbd9c651d9f5503ff6795435d2d..2cdd34ab3ca66c3262cb59423e218d94629f56bd 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
 
 #include "config.h"
 
-fxBool verbose = FALSE;
+bool   verbose = false;
 
 static int
 openFIFO(const char* name, int mode)
@@ -416,7 +416,7 @@ main(int argc, char* argv[])
        exit(-1);
     }
     if (argc == 3) {
-       verbose = TRUE;
+       verbose = true;
        argc--, argv++;
     }
     if (chdir(FAX_SPOOLDIR) == -1) {
index c6c62a4e3df45cddf8f66b6bc490e5303e42f6da..c3c3e007c0aaa5d86727e29c51b7b232fac30802 100644 (file)
@@ -81,10 +81,10 @@ readTSIPatterns(FILE* fd, RegExArray*& pats, fxBoolArray*& accept)
            continue;
        RegEx* re;
        if (line[0] == '!') {
-           accept->append(FALSE);
+           accept->append(false);
            pats->append(re = new RegEx(line+1));
        } else {
-           accept->append(TRUE);
+           accept->append(true);
            pats->append(re = new RegEx(line));
        }
        if (re->getErrorCode() > REG_NOMATCH) {
@@ -138,7 +138,7 @@ prompt()
 int
 main(int argc, char* argv[])
 {
-    fxBool verbose = TRUE;
+    bool verbose = true;
     extern int optind, opterr;
     extern char* optarg;
     int c;
@@ -147,7 +147,7 @@ main(int argc, char* argv[])
     while ((c = getopt(argc, argv, ":q")) != -1)
        switch (c) {
        case 'q':
-           verbose = FALSE;
+           verbose = false;
            break;
        case '?':
            usage();
index e932e0e4abab870ac4199d1e61060fb017c64877..734b9c1c2d012b74df6bf537d9209897d9bb2aa0 100644 (file)
@@ -36,7 +36,7 @@
 MIMEState::MIMEState(const char* t, const char* st) : type(t), subtype(st)
 {
     parent = NULL;
-    lastPart = FALSE;
+    lastPart = false;
     encode = ENC_7BIT;
     charset = CS_USASCII;
     blen = (u_int) -1;                 // NB: should insure no matches
@@ -50,7 +50,7 @@ MIMEState::MIMEState(MIMEState& other)
        type = "message", subtype = "rfc822";
     else
        type = "text", subtype = "plain";
-    lastPart = FALSE;
+    lastPart = false;
     encode = other.encode;
     charset = other.charset;
     blen = other.blen;
@@ -62,7 +62,7 @@ MIMEState::MIMEState(MIMEState& other, const char* t, const char* st)
     , subtype(st)
     , boundary(other.boundary)
 {
-    lastPart = FALSE;
+    lastPart = false;
     encode = other.encode;
     charset = other.charset;
     blen = other.blen;
@@ -108,7 +108,7 @@ MIMEState::trace(FILE* fd)
     );
 }
 
-fxBool
+bool
 MIMEState::parseToken(const char*& cp, const char delimeter, fxStr& result)
 {
     while (*cp && isspace(*cp))
@@ -120,16 +120,16 @@ MIMEState::parseToken(const char*& cp, const char delimeter, fxStr& result)
        result = fxStr(bp, cp-bp);
        while (isspace(*cp))                            // remove trailing ws
            cp++;
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 /*
  * Extract MIME-related information from a set of
  * message headers and fillin the MIME state block.
  */
-fxBool
+bool
 MIMEState::parse(const MsgFmt& msg, fxStr& emsg)
 {
     const fxStr* s = msg.findHeader("Content-Type");
@@ -145,7 +145,7 @@ MIMEState::parse(const MsgFmt& msg, fxStr& emsg)
        } else {
            emsg = "Syntax error parsing MIME Content-Type: " | *s;
            type = "text";              // reset on parsing error
-           return (FALSE);
+           return (false);
        }
     }
     s = msg.findHeader("Content-Transfer-Encoding");
@@ -157,7 +157,7 @@ MIMEState::parse(const MsgFmt& msg, fxStr& emsg)
     s = msg.findHeader("Content-ID");
     if (s)
        cid = *s;
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -210,7 +210,7 @@ MIMEState::parseParameters(const char* cp)
 /*
  * Set a MIME parameter used by the decoder.
  */
-fxBool
+bool
 MIMEState::setParameter(const fxStr& p, const fxStr& value)
 {
     fxStr param(p);
@@ -220,8 +220,8 @@ MIMEState::setParameter(const fxStr& p, const fxStr& value)
     } else if (param.length() == 8 && param == "boundary") {
        setBoundary(value);                     // part boundary marker
     } else
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 
 /*
@@ -290,15 +290,15 @@ extern void fxFatal(const char* fmt ...);
  * Return a line of data according to the current
  * setting of the content-transfer-encoding and
  * the body part boundary.  If the boundary marker
- * or EOF is reached FALSE is returned, otherwise
- * this method returns TRUE and the decoded line.
+ * or EOF is reached false is returned, otherwise
+ * this method returns true and the decoded line.
  * If the data is encoded with a text-oriented
  * scheme (7bit, 8bit, binary, or quoted-printable)
  * then the trailing newline character is returned
  * in the buffer.  Otherwise any trailing newline
  * is discarded and only the decoded data is returned.
  */
-fxBool
+bool
 MIMEState::getLine(FILE* fd, fxStackBuffer& buf)
 {
     buf.reset();
@@ -314,14 +314,14 @@ MIMEState::getLine(FILE* fd, fxStackBuffer& buf)
                u_int cc = buf.getLength();
                if (cc >= blen && buf[0] == '-') {
                    if (cc == blen && strneq(buf, boundary, blen))
-                       return (FALSE);
+                       return (false);
                    if (cc == blen+2 && strneq(buf, boundary, blen+2)) {
-                       lastPart = TRUE;
-                       return (FALSE);
+                       lastPart = true;
+                       return (false);
                    }
                }
                buf.put('\n');
-               return (TRUE);
+               return (true);
            }
            buf.put(c);
        }
@@ -338,14 +338,14 @@ MIMEState::getLine(FILE* fd, fxStackBuffer& buf)
                u_int cc = buf.getLength();
                if (cc >= blen && buf[0] == '-') {
                    if (cc == blen && strneq(buf, boundary, blen))
-                       return (FALSE);
+                       return (false);
                    if (cc == blen+2 && strneq(buf, boundary, blen+2)) {
-                       lastPart = TRUE;
-                       return (FALSE);
+                       lastPart = true;
+                       return (false);
                    }
                }
                buf.put('\n');
-               return (TRUE);
+               return (true);
            }
            buf.put(c);
        }
@@ -356,7 +356,7 @@ MIMEState::getLine(FILE* fd, fxStackBuffer& buf)
     }
     fxFatal("Internal error, unsupported Content-Transfer-Encoding %u", encode);
     /*NOTREACHED*/
-    return (FALSE);
+    return (false);
 }
 
 static int
@@ -383,7 +383,7 @@ copyQP(fxStackBuffer& buf, const char line[], u_int cc)
 /*
  * Return a decoded line of quoted-printable text.
  */
-fxBool
+bool
 MIMEState::getQuotedPrintableLine(FILE* fd, fxStackBuffer& buf)
 {
     char line[80];                             // spec says never more than 76
@@ -404,15 +404,15 @@ MIMEState::getQuotedPrintableLine(FILE* fd, fxStackBuffer& buf)
            }
            if (cc >= blen && line[0] == '-') {
                if (cc == blen && strneq(line, boundary, blen))
-                   return (FALSE);
+                   return (false);
                if (cc == blen+2 && strneq(line, boundary, blen+2)) {
-                   lastPart = TRUE;
-                   return (FALSE);
+                   lastPart = true;
+                   return (false);
                }
            }
            copyQP(buf, line, cc);
            buf.put('\n');
-           return (TRUE);
+           return (true);
        }
        if (cc < sizeof (line)-1)
            line[cc++] = c;
@@ -467,7 +467,7 @@ copyBase64(fxStackBuffer& buf, const char line[], u_int cc)
 /*
  * Return a decoded line of base64 data.
  */
-fxBool
+bool
 MIMEState::getBase64Line(FILE* fd, fxStackBuffer& buf)
 {
     char line[80];                             // spec says never more than 76
@@ -483,14 +483,14 @@ MIMEState::getBase64Line(FILE* fd, fxStackBuffer& buf)
            lineno++;
            if (cc >= blen && line[0] == '-') {
                if (cc == blen && strneq(line, boundary, blen))
-                   return (FALSE);
+                   return (false);
                if (cc == blen+2 && strneq(line, boundary, blen+2)) {
-                   lastPart = TRUE;
-                   return (FALSE);
+                   lastPart = true;
+                   return (false);
                }
            }
            copyBase64(buf, line, cc);
-           return (TRUE);
+           return (true);
        }
        if (cc < sizeof (line)-1)
            line[cc++] = c;
@@ -525,7 +525,7 @@ copyUUDecode(fxStackBuffer& buf, const char line[], u_int)
 /*
  * Return a decoded line of uuencode'd data.
  */
-fxBool
+bool
 MIMEState::getUUDecodeLine(FILE* fd, fxStackBuffer& buf)
 {
     char line[80];                             // spec says never more than 62
@@ -541,10 +541,10 @@ MIMEState::getUUDecodeLine(FILE* fd, fxStackBuffer& buf)
            lineno++;
            if (cc >= blen && line[0] == '-') { // check for boundary marker
                if (cc == blen && strneq(line, boundary, blen))
-                   return (FALSE);
+                   return (false);
                if (cc == blen+2 && strneq(line, boundary, blen+2)) {
-                   lastPart = TRUE;
-                   return (FALSE);
+                   lastPart = true;
+                   return (false);
                }
            } else if (cc >= 6 && strneq(line, "begin ", 6)) {
                return (getUUDecodeLine(fd, buf));
@@ -552,10 +552,10 @@ MIMEState::getUUDecodeLine(FILE* fd, fxStackBuffer& buf)
                // consume to boundary marker
                while (getUUDecodeLine(fd, buf))
                    ;
-               return (FALSE);
+               return (false);
            }
            copyUUDecode(buf, line, cc);
-           return (TRUE);
+           return (true);
        }
        if (cc < sizeof (line)-1)
            line[cc++] = c;
index 6e896f7bfbd481264c77036b9dfeda5f973bca30..d7f52050c702f058bdc9d7b198c0a560098adf07 100644 (file)
@@ -64,19 +64,19 @@ private:
     fxStr      cid;                    // content ID
     fxStr      boundary;               // multipart boundary marker
     u_int      blen;                   // adjusted boundary length
-    fxBool     lastPart;               // TRUE if last multipart boundary seen
+    bool       lastPart;               // true if last multipart boundary seen
     Encoding   encode;                 // content transfer encoding
     Charset    charset;                // text character set
 
-    static fxBool parseToken(const char*&, const char delimeter, fxStr& result);
+    static bool parseToken(const char*&, const char delimeter, fxStr& result);
 
     void parseParameters(const char*);
 protected:
-    virtual fxBool setParameter(const fxStr& param, const fxStr& value);
+    virtual bool setParameter(const fxStr& param, const fxStr& value);
 
-    fxBool getQuotedPrintableLine(FILE* fd, fxStackBuffer& buf);
-    fxBool getBase64Line(FILE* fd, fxStackBuffer& buf);
-    fxBool getUUDecodeLine(FILE* fd, fxStackBuffer& buf);
+    bool getQuotedPrintableLine(FILE* fd, fxStackBuffer& buf);
+    bool getBase64Line(FILE* fd, fxStackBuffer& buf);
+    bool getUUDecodeLine(FILE* fd, fxStackBuffer& buf);
 public:
     MIMEState(const char* type, const char* subtype);
     MIMEState(MIMEState& parent);
@@ -84,12 +84,12 @@ public:
     ~MIMEState();
 
     u_int      lineno;                 // input line number
-    fxBool parse(const MsgFmt&, fxStr& emsg);
+    bool parse(const MsgFmt&, fxStr& emsg);
 
     const fxStr& getType(void) const;
     const fxStr& getSubType(void) const;
-    fxBool isParent(const char* type) const;
-    fxBool isParent(const char* type, const char* subtype) const;
+    bool isParent(const char* type) const;
+    bool isParent(const char* type, const char* subtype) const;
     const fxStr& getDescription(void) const;
     const fxStr& getContentID(void) const;
 
@@ -100,18 +100,18 @@ public:
     void setBoundary(const char*);
     const fxStr& getBoundary(void) const;
 
-    virtual fxBool getLine(FILE*, fxStackBuffer&);
-    fxBool isLastPart(void) const;
+    virtual bool getLine(FILE*, fxStackBuffer&);
+    bool isLastPart(void) const;
 
     virtual void trace(FILE*);
 };
 inline Charset MIMEState::getCharset(void) const       { return charset; }
 inline Encoding MIMEState::getEncoding(void) const     { return encode; }
 inline const fxStr& MIMEState::getBoundary(void) const { return boundary; }
-inline fxBool MIMEState::isLastPart(void) const                { return lastPart; }
-inline fxBool MIMEState::isParent(const char* t) const
+inline bool MIMEState::isLastPart(void) const          { return lastPart; }
+inline bool MIMEState::isParent(const char* t) const
     { return (parent && parent->type == t); }
-inline fxBool MIMEState::isParent(const char* t, const char* st) const
+inline bool MIMEState::isParent(const char* t, const char* st) const
     { return (parent && parent->type == t && parent->subtype == st); }
 inline const fxStr& MIMEState::getType(void) const     { return type; }
 inline const fxStr& MIMEState::getSubType(void) const  { return subtype; }
index a2d2ab88b60f4970610d22a7f79de930846ca56f..26a6996e785f646facf7077f45a6c5ed2822c0d8 100644 (file)
@@ -67,7 +67,7 @@ MsgFmt::mapHeader(const fxStr& name)
     return (name);
 }
 
-fxBool
+bool
 MsgFmt::getLine(FILE* fd, fxStackBuffer& buf)
 {
     buf.reset();
@@ -80,7 +80,7 @@ MsgFmt::getLine(FILE* fd, fxStackBuffer& buf)
            break;
        buf.put(c);
     }
-    return (TRUE);
+    return (true);
 }
 
 void
@@ -139,7 +139,7 @@ MsgFmt::parseHeaders(FILE* fd, u_int& lineno)
 void
 MsgFmt::setupConfig()
 {
-    verbose = FALSE;
+    verbose = false;
     boldFont = "Helvetica-Bold";
     italicFont = "Helvetica-Oblique";
 
@@ -157,7 +157,7 @@ MsgFmt::setupConfig()
 #undef streq
 #define        streq(a,b)      (strcasecmp(a,b)==0)
 
-fxBool
+bool
 MsgFmt::setConfigItem(const char* tag, const char* value)
 {
     if (streq(tag, "headers")) {
@@ -187,8 +187,8 @@ MsgFmt::setConfigItem(const char* tag, const char* value)
     } else if (streq(tag, "verbose")) {
        verbose = FaxConfig::getBoolean(tag);
     } else
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 #undef streq
 
index d94991e58afdfea55bcec12b7e122d1f7d657039..f4b7e87270940932fa4cdd8b63438a06372277b1 100644 (file)
@@ -36,7 +36,7 @@ struct MsgFmt {
     TextCoord  headerStop;             // tab stop for headers
     fxStr      boldFont;               // bold font family name
     fxStr      italicFont;             // italic font family name
-    fxBool     verbose;                // trace header handling
+    bool       verbose;                // trace header handling
 
     fxStrArray fields;                 // header tags
     fxStrArray headers;                // header values
@@ -48,9 +48,9 @@ struct MsgFmt {
     virtual ~MsgFmt();
 
     void setupConfig();
-    virtual fxBool setConfigItem(const char* tag, const char* value);
+    virtual bool setConfigItem(const char* tag, const char* value);
 
-    static fxBool getLine(FILE* fd, fxStackBuffer& buf);
+    static bool getLine(FILE* fd, fxStackBuffer& buf);
 
     const fxStr* findHeader(const fxStr& name) const;
     u_int headerCount(void);
index d2542ad72b05ebf534f028517b13491fd3f58851..bf2310e4b3594e8e3016bc23f55fd98d30354887 100644 (file)
@@ -44,14 +44,14 @@ public:
     MySendFaxClient();
     ~MySendFaxClient();
 
-    void setup(fxBool);
-    fxBool setConfigItem(const char* tag, const char* value);
+    void setup(bool);
+    bool setConfigItem(const char* tag, const char* value);
     void fatal(const char* fmt ...);
 };
 MySendFaxClient::MySendFaxClient() {}
 MySendFaxClient::~MySendFaxClient() {}
 void
-MySendFaxClient::setup(fxBool b)
+MySendFaxClient::setup(bool b)
 {
     resetConfig();
     readConfig(FAX_SYSCONF);
@@ -61,13 +61,13 @@ MySendFaxClient::setup(fxBool b)
     setVerbose(b);
     FaxClient::setVerbose(b);
 }
-fxBool MySendFaxClient::setConfigItem(const char* tag, const char* value)
+bool MySendFaxClient::setConfigItem(const char* tag, const char* value)
     { return SendFaxClient::setConfigItem(tag, value); }
 
 class faxMailApp : public TextFmt, public MsgFmt {
 private:
-    fxBool     markDiscarded;          // mark MIME parts not handled
-    fxBool     withinFile;             // between beginFile() & endFile()
+    bool       markDiscarded;          // mark MIME parts not handled
+    bool       withinFile;             // between beginFile() & endFile()
     fxStr      mimeConverters;         // pathname to MIME converter scripts
     fxStr      mailProlog;             // site-specific prologue definitions
     fxStr      clientProlog;           // client-specific prologue info
@@ -77,7 +77,7 @@ private:
     MySendFaxClient* client;           // for direct delivery
     SendFaxJob*        job;                    // reference to outbound job
     fxStr      mailUser;               // user ID for contacting server
-    fxBool     autoCoverPage;          // make cover page for direct delivery
+    bool       autoCoverPage;          // make cover page for direct delivery
 
     void formatMIME(FILE* fd, MIMEState& mime, MsgFmt& msg);
     void formatText(FILE* fd, MIMEState& mime);
@@ -85,18 +85,18 @@ private:
     void formatMessage(FILE* fd, MIMEState& mime, MsgFmt& msg);
     void formatApplication(FILE* fd, MIMEState& mime);
     void formatDiscarded(MIMEState& mime);
-    fxBool formatWithExternal(FILE* fd, const fxStr& app, MIMEState& mime);
+    bool formatWithExternal(FILE* fd, const fxStr& app, MIMEState& mime);
 
     void emitClientPrologue(FILE*);
 
     void discardPart(FILE* fd, MIMEState& mime);
-    fxBool copyPart(FILE* fd, MIMEState& mime, fxStr& tmpFile);
-    fxBool runConverter(const fxStr& app, const fxStr& tmp, MIMEState& mime);
+    bool copyPart(FILE* fd, MIMEState& mime, fxStr& tmpFile);
+    bool runConverter(const fxStr& app, const fxStr& tmp, MIMEState& mime);
     void copyFile(FILE* fd, const char* filename);
 
     void resetConfig();
     void setupConfig();
-    fxBool setConfigItem(const char* tag, const char* value);
+    bool setConfigItem(const char* tag, const char* value);
 
     void usage(void);
 public:
@@ -105,7 +105,7 @@ public:
 
     void run(int argc, char** argv);
 
-    void setVerbose(fxBool b)          { verbose = b; }
+    void setVerbose(bool b)            { verbose = b; }
     void setBoldFont(const char* cp)   { boldFont = cp; }
     void setItalicFont(const char* cp) { italicFont = cp; }
 };
@@ -136,7 +136,7 @@ faxMailApp::run(int argc, char** argv)
     readConfig(FAX_LIBDATA "/faxmail.conf");
     readConfig(FAX_USERCONF);
 
-    fxBool deliver = FALSE;
+    bool deliver = false;
     while ((c = Sys::getopt(argc, argv, "12b:cdf:H:i:M:np:rRs:u:vW:")) != -1)
        switch (c) {
        case '1': case '2':             // format in 1 or 2 columns
@@ -146,10 +146,10 @@ faxMailApp::run(int argc, char** argv)
            setBoldFont(optarg);
            break;
        case 'c':                       // truncate lines
-           setLineWrapping(FALSE);
+           setLineWrapping(false);
            break;
        case 'd':                       // enable direct delivery
-           deliver = TRUE;
+           deliver = true;
            break;
        case 'f':                       // default font for text body
            setTextFont(optarg);
@@ -164,7 +164,7 @@ faxMailApp::run(int argc, char** argv)
            setPageMargins(optarg);
            break;
        case 'n':                       // suppress cover page
-           autoCoverPage = FALSE;
+           autoCoverPage = false;
            break;
        case 'p':                       // point size
            setTextPointSize(TextFmt::inch(optarg));
@@ -185,7 +185,7 @@ faxMailApp::run(int argc, char** argv)
            setPageWidth(atof(optarg));
            break;
        case 'v':                       // trace work
-           setVerbose(TRUE);
+           setVerbose(true);
            break;
        case '?':
            usage();
@@ -322,24 +322,24 @@ faxMailApp::run(int argc, char** argv)
     const fxStr* version = findHeader("MIME-Version");
     if (version && *version == "1.0") {
         beginFile();
-       withinFile = TRUE;
+       withinFile = true;
         formatHeaders(*this);          // format top-level headers
        formatMIME(stdin, mime, *this); // parse MIME format
         if (withinFile) endFile();
-       withinFile = FALSE;
+       withinFile = false;
     } else {
         beginFile();
-       withinFile = TRUE;
+       withinFile = true;
         formatHeaders(*this);          // format top-level headers
        formatText(stdin, mime);        // treat body as text/plain
         if (withinFile) endFile();
-       withinFile = FALSE;
+       withinFile = false;
     }
 
     endFormatting();
 
     if (client) {                      // complete direct delivery
-       fxBool status = FALSE;
+       bool status = false;
        fxStr emsg;
        const char* user = mailUser;
        if (user[0] == '\0')            // null user =>'s use real uid
@@ -504,13 +504,13 @@ faxMailApp::formatApplication(FILE* fd, MIMEState& mime)
 {
     if (mime.getSubType() == "postscript") {   // copy PS straight thru
        if (withinFile) endFile();
-       withinFile = FALSE;
+       withinFile = false;
        FILE* fout = getOutputFile();
        fxStackBuffer buf;
        while (mime.getLine(fd, buf))
            fwrite((const char*) buf, buf.getLength(), 1, fout);
        if (!withinFile) beginFile();
-       withinFile = TRUE;
+       withinFile = true;
     } else if (mime.getSubType() == "x-faxmail-prolog") {
        copyPart(fd, mime, clientProlog);       // save client PS prologue
     } else {
@@ -523,10 +523,10 @@ faxMailApp::formatApplication(FILE* fd, MIMEState& mime)
  * Format a MIME part using an external conversion
  * script to convert the decoded body to PostScript.
  */
-fxBool
+bool
 faxMailApp::formatWithExternal(FILE* fd, const fxStr& app, MIMEState& mime)
 {
-    fxBool ok = FALSE;
+    bool ok = false;
     if (verbose)
        fprintf(stderr, "CONVERT: run %s\n", (const char*) app);
     fxStr tmp;
@@ -580,7 +580,7 @@ faxMailApp::discardPart(FILE* fd, MIMEState& mime)
  * The latter is used, for example, to accumulate
  * client-specified prologue data.
  */
-fxBool
+bool
 faxMailApp::copyPart(FILE* fd, MIMEState& mime, fxStr& tmpFile)
 {
     int ftmp;
@@ -592,25 +592,25 @@ faxMailApp::copyPart(FILE* fd, MIMEState& mime, fxStr& tmpFile)
        ftmp = Sys::open(tmpFile, O_WRONLY|O_APPEND);
     if (ftmp >= 0) {
        fxStackBuffer buf;
-       fxBool ok = TRUE;
+       bool ok = true;
        while (mime.getLine(fd, buf) && ok)
            ok = (Sys::write(ftmp, buf, buf.getLength()) == buf.getLength());
        if (ok) {
            Sys::close(ftmp);
-           return (TRUE);
+           return (true);
        }
        error("%s: write error: %s", (const char*) tmpFile, strerror(errno));
        Sys::close(ftmp);
     } else
        error("%s: Can not create temporary file", (const char*) tmpFile);
     discardPart(fd, mime);
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Run an external converter program.
  */
-fxBool
+bool
 faxMailApp::runConverter(const fxStr& app, const fxStr& tmp, MIMEState& mime)
 {
     const char* av[3];
@@ -637,7 +637,7 @@ faxMailApp::runConverter(const fxStr& app, const fxStr& tmp, MIMEState& mime)
     default:
        int status;
        if (Sys::waitpid(pid, status) == pid && status == 0)
-           return (TRUE);
+           return (true);
        error("Error converting %s/%s; command was \"%s %s\"; exit status %x"
            , (const char*) mime.getType()
            , (const char*) mime.getSubType()
@@ -647,7 +647,7 @@ faxMailApp::runConverter(const fxStr& app, const fxStr& tmp, MIMEState& mime)
        );
        break;
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -674,18 +674,18 @@ faxMailApp::copyFile(FILE* fd, const char* filename)
 void
 faxMailApp::setupConfig()
 {
-    markDiscarded = TRUE;
+    markDiscarded = true;
     mimeConverters = FAX_LIBEXEC "/faxmail";
     mailProlog = FAX_LIBDATA "/faxmail.ps";
     msgDivider = "";
     mailUser = "";                     // default to real uid
-    autoCoverPage = TRUE;              // a la sendfax
+    autoCoverPage = true;              // a la sendfax
 
-    setPageHeaders(FALSE);             // disable normal page headers
+    setPageHeaders(false);             // disable normal page headers
     setNumberOfColumns(1);             // 1 input page per output page
 
-    setLineWrapping(TRUE);
-    setISO8859(TRUE);
+    setLineWrapping(true);
+    setISO8859(true);
 
     MsgFmt::setupConfig();
 }
@@ -700,7 +700,7 @@ faxMailApp::resetConfig()
 #undef streq
 #define        streq(a,b)      (strcasecmp(a,b)==0)
 
-fxBool
+bool
 faxMailApp::setConfigItem(const char* tag, const char* value)
 {
     if (streq(tag, "markdiscarded"))
@@ -720,8 +720,8 @@ faxMailApp::setConfigItem(const char* tag, const char* value)
     else if (TextFmt::setConfigItem(tag, value))
        ;
     else
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 #undef streq
 
index 962ad59a2d4a566258120ca2b501cd71fc88a329..47c79770495f4f55c5d580c5a0599c44236c3a46 100644 (file)
@@ -31,8 +31,8 @@ class faxRmApp : public FaxClient {
 private:
     void usage();
 
-    fxBool removeJob(const char* id, fxStr& emsg);
-    fxBool deleteDoc(const char* id);
+    bool removeJob(const char* id, fxStr& emsg);
+    bool deleteDoc(const char* id);
 public:
     faxRmApp();
     ~faxRmApp();
@@ -54,24 +54,24 @@ faxRmApp::run(int argc, char** argv)
     readConfig(FAX_SYSCONF);
     readConfig(FAX_USERCONF);
 
-    fxBool jobs = TRUE;
-    fxBool docs = FALSE;
-    fxBool useadmin = FALSE;
+    bool jobs = true;
+    bool docs = false;
+    bool useadmin = false;
 
     while ((c = getopt(argc, argv, "ah:dv")) != -1)
        switch (c) {
        case 'a':
-           useadmin = TRUE;
+           useadmin = true;
            break;
        case 'd':                       // treat args as document names
-           jobs = FALSE;
-           docs = TRUE;
+           jobs = false;
+           docs = true;
            break;
        case 'h':                       // server's host
            setHost(optarg);
            break;
        case 'v':
-           setVerbose(TRUE);
+           setVerbose(true);
            break;
        case '?':
            usage();
@@ -103,23 +103,23 @@ faxRmApp::run(int argc, char** argv)
        printError(emsg);
 }
 
-fxBool
+bool
 faxRmApp::removeJob(const char* id, fxStr& emsg)
 {
     if (jobKill(id)) {
        printf("Job %s removed.\n", id);
-       return (TRUE);
+       return (true);
     }
     emsg = getLastResponse();
     if (getLastCode() == 504 && jobDelete(id)) {
        printf("Job %s removed (from doneq).\n", id);
        emsg = "";
-       return (TRUE);
+       return (true);
     }
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 faxRmApp::deleteDoc(const char* id)
 {
     return (command("DELE %s%s"
index 8e89179b20dcbc3361438c64143600e702badc77..b8563526daf48e07b6766ba4757a4d73331e18f1 100644 (file)
@@ -34,7 +34,7 @@ class faxStatApp : public FaxClient {
 private:
     fxStr      header;
 
-    fxBool listWithHeader(const fxStr& dir, fxStr& emsg);
+    bool listWithHeader(const fxStr& dir, fxStr& emsg);
 public:
     faxStatApp();
     ~faxStatApp();
@@ -44,11 +44,11 @@ public:
 faxStatApp::faxStatApp() {}
 faxStatApp::~faxStatApp() {}
 
-static fxBool
+static bool
 writeStdout(void*, const char* buf, int cc, fxStr&)
 {
     (void) Sys::write(STDOUT_FILENO, buf, cc);
-    return (TRUE);
+    return (true);
 }
 
 void
@@ -60,7 +60,7 @@ faxStatApp::run(int argc, char** argv)
 
     fxStrArray dirs;
     dirs.append(FAX_STATUSDIR);                // server status
-    fxBool checkInfo = FALSE;
+    bool checkInfo = false;
     int c;
     while ((c = getopt(argc, argv, "h:adgfilrsv")) != -1)
        switch (c) {
@@ -80,7 +80,7 @@ faxStatApp::run(int argc, char** argv)
            setHost(optarg);
            break;
        case 'i':                       // display any.info file
-           checkInfo = TRUE;
+           checkInfo = true;
            break;
        case 'l':                       // use local timezone for dates & times
            setTimeZone(TZ_LOCAL);
@@ -92,7 +92,7 @@ faxStatApp::run(int argc, char** argv)
            dirs.append(FAX_SENDDIR);
            break;
        case 'v':                       // enable protocol tracing
-           setVerbose(TRUE);
+           setVerbose(true);
            break;
        case '?':
            fxFatal("usage: faxstat [-h server-host] [-adfglrsv]");
@@ -122,7 +122,7 @@ faxStatApp::run(int argc, char** argv)
        printError(emsg);
 }
 
-fxBool
+bool
 faxStatApp::listWithHeader(const fxStr& dir, fxStr& emsg)
 {
     if (!setMode(MODE_S))
@@ -139,11 +139,11 @@ faxStatApp::listWithHeader(const fxStr& dir, fxStr& emsg)
        int cc = read(getDataFd(), buf, sizeof (buf));
        if (cc == 0) {
            closeDataConn();
-           return (getReply(FALSE) == COMPLETE);
+           return (getReply(false) == COMPLETE);
        }
        if (cc < 0) {
            emsg = fxStr::format("Data Connection: %s", strerror(errno));
-           (void) getReply(FALSE);
+           (void) getReply(false);
            break;
        }
        if (byte_count == 0 && header.length() > 0)
@@ -153,7 +153,7 @@ faxStatApp::listWithHeader(const fxStr& dir, fxStr& emsg)
     }
 bad:
     closeDataConn();
-    return (FALSE);
+    return (false);
 }
 
 int
index 7e84471274ff9b9ab1310d892595ed7390a9018d..4e9090b795cc44050bf443e7ef6bdf5d0dc65309 100644 (file)
 /*
  * Create the client FIFO and open it for use.
  */
-fxBool
+bool
 HylaFAXServer::initClientFIFO(fxStr& emsg)
 {
     clientFIFOName = fxStr::format(FAX_CLIENTDIR "/%u", getpid());
     if (Sys::mkfifo(clientFIFOName, 0622) < 0 && errno != EEXIST) {
        emsg = fxStr::format("Could not create %s: %s",
            (const char*) clientFIFOName, strerror(errno));
-       return (FALSE);
+       return (false);
     }
     clientFd = Sys::open(clientFIFOName, CONFIG_OPENFIFO|O_NDELAY);
     if (clientFd == -1) {
        emsg = fxStr::format("Could not open FIFO file %s: %s",
            (const char*) clientFIFOName, strerror(errno));
-       return (FALSE);
+       return (false);
     }
     if (!Sys::isFIFOFile(clientFd)) {
        emsg = clientFIFOName | " is not a FIFO special file";
-       return (FALSE);
+       return (false);
     }
     // open should set O_NDELAY, but just to be sure...
     if (fcntl(clientFd, F_SETFL, fcntl(clientFd, F_GETFL, 0) | O_NDELAY) < 0)
        logError("initClientFIFO %s: fcntl: %m", (const char*) clientFIFOName);
     Dispatcher::instance().link(clientFd, Dispatcher::ReadMask, this);
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -139,10 +139,10 @@ HylaFAXServer::FIFOMessage(const char* cp, u_int)
 /*
  * Send a message to the central queuer process.
  */
-fxBool
+bool
 HylaFAXServer::sendQueuerMsg(fxStr& emsg, const fxStr& msg)
 {
-    fxBool retry = FALSE;
+    bool retry = false;
 again:
     if (faxqFd == -1) {
 #ifdef FIFOSELECTBUG
@@ -164,7 +164,7 @@ again:
        if (faxqFd == -1) {
            emsg = fxStr::format("Unable to open scheduler FIFO: %s",
                strerror(errno));
-           return (FALSE);
+           return (false);
        }
        /*
         * Turn off O_NDELAY so that write will block if FIFO is full.
@@ -181,26 +181,26 @@ again:
             */
            Sys::close(faxqFd), faxqFd = -1;
            if (!retry) {
-               retry = TRUE;
+               retry = true;
                goto again;
            }
        }
        emsg = fxStr::format("FIFO write failed: %s", strerror(errno));
        logError(emsg);
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 /*
  * Send a message to the central queuer process.
  */
-fxBool
+bool
 HylaFAXServer::sendQueuer(fxStr& emsg, const char* fmt ...)
 {
     va_list ap;
     va_start(ap, fmt);
-    fxBool ok = sendQueuerMsg(emsg, fxStr::vformat(fmt, ap));
+    bool ok = sendQueuerMsg(emsg, fxStr::vformat(fmt, ap));
     va_end(ap);
     return (ok);
 }
@@ -209,43 +209,43 @@ HylaFAXServer::sendQueuer(fxStr& emsg, const char* fmt ...)
  * Send a message to the central queuer process
  * and wait for a response on our client FIFO.
  */
-fxBool
+bool
 HylaFAXServer::sendQueuerACK(fxStr& emsg, const char* fmt, ...)
 {
     va_list ap;
     va_start(ap, fmt);
-    fxBool b = vsendQueuerACK(emsg, fmt, ap);
+    bool b = vsendQueuerACK(emsg, fmt, ap);
     va_end(ap);
     return (b);
 }
 
-fxBool
+bool
 HylaFAXServer::vsendQueuerACK(fxStr& emsg, const char* fmt, va_list ap)
 {
     if (clientFd == -1) {
        emsg = "Bad server state, client FIFO is not open";
-       return (FALSE);
+       return (false);
     }
     fxStr msg = fxStr::vformat(fmt, ap);
     if (msg.length() < 2) {                    // sanity check
        emsg = "Bad FIFO message, too short to be valid";
-       return (FALSE);
+       return (false);
     }
     msg.insert(clientFIFOName | ":", 1);       // insert FIFO name for reply 
-    fxBool ok = sendQueuerMsg(emsg, msg);
+    bool ok = sendQueuerMsg(emsg, msg);
     if (ok) {
        Dispatcher& disp = Dispatcher::instance();
        for (state |= S_WAITFIFO; IS(WAITFIFO); disp.dispatch())
            ;
        if (fifoResponse.length() < 2) {        // too short to be valid
            emsg = "Unexpected response from scheduler: \"" |fifoResponse| "\"";
-           ok = FALSE;
+           ok = false;
        } else if (fifoResponse[0] == msg[0]) { // response to our request
            ok = (fifoResponse[1] == '*');
            if (!ok)
                emsg = "Unspecified reason (scheduler NAK'd request)";
        } else                                  // user abort
-           ok = FALSE;
+           ok = false;
     }
     return (ok);
 }
@@ -253,7 +253,7 @@ HylaFAXServer::vsendQueuerACK(fxStr& emsg, const char* fmt, va_list ap)
 /*
  * Send a message to a modem process via the per-modem FIFO.
  */
-fxBool
+bool
 HylaFAXServer::sendModem(const char* modem, fxStr& emsg, const char* fmt ...)
 {
     fxStr fifoName(modem);
@@ -279,7 +279,7 @@ HylaFAXServer::sendModem(const char* modem, fxStr& emsg, const char* fmt ...)
     if (fd == -1) {
        emsg = fxStr::format("Unable to open %s: %s",
            (const char*) fifoName, strerror(errno));
-       return (FALSE);
+       return (false);
     }
     va_list ap;
     va_start(ap, fmt);
@@ -290,7 +290,7 @@ HylaFAXServer::sendModem(const char* modem, fxStr& emsg, const char* fmt ...)
        emsg = fxStr::format("write to %s failed: %s",
            (const char*) fifoName, strerror(errno));
        logError(emsg);
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
index a8c91e1d27f713ab174b6d9d78c3831677dc4305..c1510786bc24b1d360b3657e76dfe4117c5cbc1e 100644 (file)
@@ -85,8 +85,8 @@ FileCache::hash(const char* pathname)
     return (h % CACHESIZE);
 }
 
-fxBool
-FileCache::lookup(const char* pathname, struct stat& sb, fxBool addToCache)
+bool
+FileCache::lookup(const char* pathname, struct stat& sb, bool addToCache)
 {
     lookups++;
     u_int h = hash(pathname);
@@ -99,7 +99,7 @@ FileCache::lookup(const char* pathname, struct stat& sb, fxBool addToCache)
            fi->serial = master++;
            sb = fi->sb;
            hits++;
-           return (TRUE);
+           return (true);
        }
        if (fi->serial < oldest->serial)
            oldest = fi;
@@ -110,7 +110,7 @@ FileCache::lookup(const char* pathname, struct stat& sb, fxBool addToCache)
      * Pathname not found in the cache.
      */
     if (Sys::stat(pathname, sb) < 0)
-       return (FALSE);
+       return (false);
     if (addToCache && pathname[0] != '.') {
        if (fi) {
            fi = oldest;
@@ -121,17 +121,17 @@ FileCache::lookup(const char* pathname, struct stat& sb, fxBool addToCache)
        fi->serial = master++;
        fi->sb = sb;
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Update the file mode for any in-cache entry.
  */
-fxBool
+bool
 FileCache::chmod(const char* pathname, mode_t mode)
 {
     if (Sys::chmod(pathname, mode) < 0)
-       return (FALSE);
+       return (false);
     lookups++;
     u_int h = hash(pathname);
     u_int maxprobes = 5;
@@ -146,13 +146,13 @@ FileCache::chmod(const char* pathname, mode_t mode)
        h = (u_int)(h*h) % CACHESIZE;
        fi = cache[h];
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Update the file ownership for any in-cache entry.
  */
-fxBool
+bool
 FileCache::chown(const char* pathname, uid_t uid, gid_t gid)
 {
     /*
@@ -167,7 +167,7 @@ FileCache::chown(const char* pathname, uid_t uid, gid_t gid)
      */
     uid_t ouid = geteuid();
     (void) seteuid(0);
-    fxBool ok = (Sys::chown(pathname, uid, gid) >= 0);
+    bool ok = (Sys::chown(pathname, uid, gid) >= 0);
     (void) seteuid(ouid);
     if (ok) {
        lookups++;
@@ -192,8 +192,8 @@ FileCache::chown(const char* pathname, uid_t uid, gid_t gid)
 /*
  * Like lookup, but if found in the cache, re-do the stat.
  */
-fxBool
-FileCache::update(const char* pathname, struct stat& sb, fxBool addToCache)
+bool
+FileCache::update(const char* pathname, struct stat& sb, bool addToCache)
 {
     lookups++;
     u_int h = hash(pathname);
@@ -207,12 +207,12 @@ FileCache::update(const char* pathname, struct stat& sb, fxBool addToCache)
                hits++;
                fi->serial = master++;
                fi->sb = sb;
-               return (TRUE);
+               return (true);
            } else {
                flushed++;
                cache[h] = NULL;
                delete fi;
-               return (FALSE);
+               return (false);
            }
        }
        if (fi->serial < oldest->serial)
@@ -224,7 +224,7 @@ FileCache::update(const char* pathname, struct stat& sb, fxBool addToCache)
      * Pathname not found in the cache.
      */
     if (Sys::stat(pathname, sb) < 0)
-       return (FALSE);
+       return (false);
     if (addToCache && pathname[0] != '.') {
        if (fi) {
            fi = oldest;
@@ -235,7 +235,7 @@ FileCache::update(const char* pathname, struct stat& sb, fxBool addToCache)
        fi->serial = master++;
        fi->sb = sb;
     }
-    return (TRUE);
+    return (true);
 }
 
 void
index a5a1c6d0c188b2e4a20306237ddbab0cd5743818..326997ec8093722061f38a02be46d9c01f407118 100644 (file)
@@ -52,13 +52,13 @@ struct FileCache {
 
     static u_int hash(const char* pathname);
 
-    static fxBool lookup(const char* pathname, struct stat& sb,
-       fxBool addToCache = TRUE);
-    static fxBool update(const char* pathname, struct stat& sb,
-       fxBool addToCache = TRUE);
+    static bool lookup(const char* pathname, struct stat& sb,
+       bool addToCache = true);
+    static bool update(const char* pathname, struct stat& sb,
+       bool addToCache = true);
     static void flush(const char* pathname);
-    static fxBool chmod(const char* pathname, mode_t mode);
-    static fxBool chown(const char* pathname, uid_t uid, gid_t gid);
+    static bool chmod(const char* pathname, mode_t mode);
+    static bool chown(const char* pathname, uid_t uid, gid_t gid);
     static void reset(void);
 };
 #endif /* _FileCache_ */
index d1e2e39c24a3b19132c50d2863a0afedafc49e83..823caccb86dcc3c2327adbf9caa9c42f3dc9c539 100644 (file)
@@ -137,64 +137,64 @@ HylaFAXServer::mdtmCmd(const char* pathname)
  * NB: this array is ordered by expected frequency of access.
  */
 SpoolDir HylaFAXServer::dirs[] = {
-{ "/status/",  FALSE, FALSE, FALSE, 0,
-  HylaFAXServer::isVisibleTRUE,
+{ "/status/",  false, false, false, 0,
+  HylaFAXServer::isVisibletrue,
   &HylaFAXServer::listStatus,  &HylaFAXServer::listStatusFile,
   &HylaFAXServer::nlstStatus,  &HylaFAXServer::nlstUnixFile, },
-{ "/sendq/",   FALSE, FALSE, FALSE, 0,
+{ "/sendq/",   false, false, false, 0,
   HylaFAXServer::isVisibleSendQFile,
   &HylaFAXServer::listSendQ,   &HylaFAXServer::listSendQFile,
   &HylaFAXServer::nlstSendQ,   &HylaFAXServer::nlstSendQFile, },
-{ "/doneq/",   FALSE, FALSE, FALSE, 0,
+{ "/doneq/",   false, false, false, 0,
   HylaFAXServer::isVisibleSendQFile,
   &HylaFAXServer::listSendQ,   &HylaFAXServer::listSendQFile,
   &HylaFAXServer::nlstSendQ,   &HylaFAXServer::nlstSendQFile, },
-{ "/docq/",    FALSE,  TRUE,  TRUE, 0,
+{ "/docq/",    false,  true,  true, 0,
   HylaFAXServer::isVisibleDocQFile,
   &HylaFAXServer::listDirectory,       &HylaFAXServer::listUnixFile,
   &HylaFAXServer::nlstDirectory,       &HylaFAXServer::nlstUnixFile, },
-{ "/tmp/",     FALSE,  TRUE,  TRUE, 0,
-  HylaFAXServer::isVisibleTRUE,
+{ "/tmp/",     false,  true,  true, 0,
+  HylaFAXServer::isVisibletrue,
   &HylaFAXServer::listDirectory,       &HylaFAXServer::listUnixFile,
   &HylaFAXServer::nlstDirectory,       &HylaFAXServer::nlstUnixFile, },
-{ "/log/",     FALSE, FALSE, FALSE, 0,
-  HylaFAXServer::isVisibleTRUE,
+{ "/log/",     false, false, false, 0,
+  HylaFAXServer::isVisibletrue,
   &HylaFAXServer::listDirectory,       &HylaFAXServer::listUnixFile,
   &HylaFAXServer::nlstDirectory,       &HylaFAXServer::nlstUnixFile, },
-{ "/recvq/",   FALSE, FALSE,  TRUE, 0,
+{ "/recvq/",   false, false,  true, 0,
   HylaFAXServer::isVisibleRecvQFile,
   &HylaFAXServer::listRecvQ,   &HylaFAXServer::listRecvQFile,
   &HylaFAXServer::nlstDirectory,       &HylaFAXServer::nlstUnixFile, },
-{ "/archive/", FALSE, FALSE, FALSE, 0,
-  HylaFAXServer::isVisibleTRUE,
+{ "/archive/", false, false, false, 0,
+  HylaFAXServer::isVisibletrue,
   &HylaFAXServer::listDirectory,       &HylaFAXServer::listUnixFile,
   &HylaFAXServer::nlstDirectory,       &HylaFAXServer::nlstUnixFile, },
-{ "/pollq/",   FALSE,  TRUE,  TRUE, 0,
+{ "/pollq/",   false,  true,  true, 0,
   HylaFAXServer::isVisibleRecvQFile,
   &HylaFAXServer::listRecvQ,   &HylaFAXServer::listRecvQFile,
   &HylaFAXServer::nlstDirectory,       &HylaFAXServer::nlstUnixFile, },
-{ "/",         FALSE, FALSE, FALSE, 0,
+{ "/",         false, false, false, 0,
   HylaFAXServer::isVisibleRootFile,
   &HylaFAXServer::listDirectory,       &HylaFAXServer::listUnixFile,
   &HylaFAXServer::nlstDirectory,       &HylaFAXServer::nlstUnixFile, },
-{ "/etc/",      TRUE, FALSE, FALSE, 0,
-  HylaFAXServer::isVisibleTRUE,
+{ "/etc/",      true, false, false, 0,
+  HylaFAXServer::isVisibletrue,
   &HylaFAXServer::listDirectory,       &HylaFAXServer::listUnixFile,
   &HylaFAXServer::nlstDirectory,       &HylaFAXServer::nlstUnixFile, },
-{ "/info/",    FALSE, FALSE, FALSE, 0,
-  HylaFAXServer::isVisibleTRUE,
+{ "/info/",    false, false, false, 0,
+  HylaFAXServer::isVisibletrue,
   &HylaFAXServer::listDirectory,       &HylaFAXServer::listUnixFile,
   &HylaFAXServer::nlstDirectory,       &HylaFAXServer::nlstUnixFile, },
-{ "/bin/",      TRUE, FALSE, FALSE, 0,
-  HylaFAXServer::isVisibleTRUE,
+{ "/bin/",      true, false, false, 0,
+  HylaFAXServer::isVisibletrue,
   &HylaFAXServer::listDirectory,       &HylaFAXServer::listUnixFile,
   &HylaFAXServer::nlstDirectory,       &HylaFAXServer::nlstUnixFile, },
-{ "/config/",  FALSE, FALSE, FALSE, 0,
-  HylaFAXServer::isVisibleTRUE,
+{ "/config/",  false, false, false, 0,
+  HylaFAXServer::isVisibletrue,
   &HylaFAXServer::listDirectory,       &HylaFAXServer::listUnixFile,
   &HylaFAXServer::nlstDirectory,       &HylaFAXServer::nlstUnixFile, },
-{ "/client/",   TRUE, FALSE, FALSE, 0,
-  HylaFAXServer::isVisibleTRUE,
+{ "/client/",   true, false, false, 0,
+  HylaFAXServer::isVisibletrue,
   &HylaFAXServer::listDirectory,       &HylaFAXServer::listUnixFile,
   &HylaFAXServer::nlstDirectory,       &HylaFAXServer::nlstUnixFile, },
 };
@@ -400,18 +400,18 @@ HylaFAXServer::setFileOwner(const char* file)
 /*
  * Is the specified file visible to the client.
  */
-fxBool
+bool
 HylaFAXServer::fileVisible(const SpoolDir& dir, const char* filename, const struct stat& sb)
 {
     return (IS(PRIVILEGED) || (*dir.isVisibleFile)(filename, sb));
 }
-fxBool
-HylaFAXServer::isVisibleTRUE(const char*, const struct stat&)
-    { return (TRUE); }
-fxBool
+bool
+HylaFAXServer::isVisibletrue(const char*, const struct stat&)
+    { return (true); }
+bool
 HylaFAXServer::isVisibleDocQFile(const char* filename, const struct stat&)
     { return (strncmp(filename, "doc", 3) == 0); }
-fxBool
+bool
 HylaFAXServer::isVisibleRootFile(const char*, const struct stat& sb)
     { return (S_ISREG(sb.st_mode) || S_ISDIR(sb.st_mode)); }
 
@@ -621,7 +621,7 @@ HylaFAXServer::Fprintf(FILE* fd, const char* fmt,
 }
 
 void
-HylaFAXServer::makeProt(const struct stat& sb, fxBool withGrp, char prot[10])
+HylaFAXServer::makeProt(const struct stat& sb, bool withGrp, char prot[10])
 {
     char* pp = prot;
     *pp++ = S_ISREG(sb.st_mode)  ? '-' :
@@ -721,11 +721,11 @@ HylaFAXServer::nlstUnixFile(FILE* fd, const SpoolDir&,
     fprintf(fd, "%s", filename);
 }
 
-static fxBool
+static bool
 isTIFF(const TIFFHeader& h)
 {
     if (h.tiff_magic != TIFF_BIGENDIAN && h.tiff_magic != TIFF_LITTLEENDIAN)
-       return (FALSE);
+       return (false);
     union {
        int32   i;
        char    c[4];
@@ -738,7 +738,7 @@ isTIFF(const TIFFHeader& h)
     return (version == TIFF_VERSION);
 }
 
-fxBool
+bool
 HylaFAXServer::docType(const char* docname, FaxSendOp& op)
 {
     op = FaxRequest::send_unknown;
index 8eb2807cf74b3f08edd72811438c7fb06de6feeb..948182487a7ea99fc4bce80472807f2f5ba22f30 100644 (file)
 #endif
 #endif /* CHAR_BIT */
 
-#define        HAVE_PSLEVEL2   FALSE
-#define        HAVE_PCL5       FALSE
+#define        HAVE_PSLEVEL2   false
+#define        HAVE_PCL5       false
 
 static struct {
     const char*        name;           // protocol token name
-    fxBool     supported;      // TRUE if format is supported
+    bool       supported;      // true if format is supported
     const char*        suffix;         // file suffix
     const char* help;          // help string for HELP FORM command
 } formats[] = {
-{ "TIFF", TRUE,                 "tif", "Tagged Image File Format, Class F only" },
-{ "PS",          TRUE,          "ps",  "Adobe PostScript Level I" },
+{ "TIFF", true,                 "tif", "Tagged Image File Format, Class F only" },
+{ "PS",          true,          "ps",  "Adobe PostScript Level I" },
 { "PS2",  HAVE_PSLEVEL2, "ps",  "Adobe PostScript Level II" },
 { "PCL",  HAVE_PCL5,    "pcl", "HP Printer Control Language (PCL), Version 5"},
 };
@@ -88,15 +88,15 @@ HylaFAXServer::logTransfer(const char* direction,
     (void) Sys::write(xferfaxlog, msg, msg.length());
 }
 
-fxBool
+bool
 HylaFAXServer::restartSend(FILE* fd, off_t marker)
 {
     if (type == TYPE_A) {                      // restart based on line count
        int c;
        while ((c = getc(fd)) != EOF)
            if (c == '\n' && --marker == 0)
-               return (TRUE);
-       return (FALSE);
+               return (true);
+       return (false);
     } else                                     // restart based on file offset
        return (lseek(fileno(fd), marker, SEEK_SET) == marker);
 }
@@ -265,13 +265,13 @@ HylaFAXServer::openTIFF(const char* name)
 /*
  * Tranfer the current directory's contents of "tif" to "fdout".
  */
-fxBool
+bool
 HylaFAXServer::sendTIFFData(TIFF* tif, FILE* fdout)
 {
     state |= S_TRANSFER;
     if (setjmp(urgcatch) != 0) {
        state &= ~S_TRANSFER;
-       return (FALSE);
+       return (false);
     }
 #define        PACK(a,b)       (((a)<<8)|(b))
     switch (PACK(type,mode)) {
@@ -280,7 +280,7 @@ HylaFAXServer::sendTIFFData(TIFF* tif, FILE* fdout)
        if (sendTIFFHeader(tif, fileno(fdout)) &&
            sendITIFFData(tif, fileno(fdout))) {
            state &= ~S_TRANSFER;
-           return (TRUE);
+           return (true);
        }
        break;
     default:
@@ -292,7 +292,7 @@ HylaFAXServer::sendTIFFData(TIFF* tif, FILE* fdout)
     }
 #undef PACK
     state &= ~S_TRANSFER;
-    return (FALSE);
+    return (false);
 }
 
 static void
@@ -316,7 +316,7 @@ getShort(TIFF* tif, TIFFDirEntry& de)
  * immediately after this data) and it is assumed that
  * all image data is concatenated into a single strip.
  */
-fxBool
+bool
 HylaFAXServer::sendTIFFHeader(TIFF* tif, int fdout)
 {
     static DirTemplate templ = {
@@ -398,10 +398,10 @@ HylaFAXServer::sendTIFFHeader(TIFF* tif, int fdout)
     memcpy(buf.dirstuff, &templ, sizeof (templ));
     if (write(fdout, (const char*) &buf, sizeof (buf)) != sizeof (buf)) {
        perror_reply(426, "Data connection", errno);
-       return (FALSE);
+       return (false);
     } else {
        byte_count += sizeof (buf);
-       return (TRUE);
+       return (true);
     }
 #undef NTAGS
 #undef offsetof
@@ -414,7 +414,7 @@ HylaFAXServer::sendTIFFHeader(TIFF* tif, int fdout)
  * consideration for any padding that might be present
  * or might be needed.
  */
-fxBool
+bool
 HylaFAXServer::sendITIFFData(TIFF* tif, int fdout)
 {
     uint32* sb;
@@ -429,7 +429,7 @@ HylaFAXServer::sendITIFFData(TIFF* tif, int fdout)
        }
        if (buf == NULL) {
            reply(551, "Error allocating intermediate buffer");
-           return (FALSE);
+           return (false);
        }
        if (TIFFReadRawStrip(tif, s, buf, cc) != cc) {
            reply(551, "Error reading input file at strip %u", s);
@@ -442,10 +442,10 @@ HylaFAXServer::sendITIFFData(TIFF* tif, int fdout)
        byte_count += cc;
     }
     _TIFFfree(buf);
-    return (TRUE);
+    return (true);
 bad:
     _TIFFfree(buf);
-    return (FALSE);
+    return (false);
 }
 
 const char*
@@ -518,7 +518,7 @@ HylaFAXServer::storeCmd(const char* name, const char* mode)
  * be shared across multiple sessions.
  */
 void
-HylaFAXServer::storeUniqueCmd(fxBool isTemp)
+HylaFAXServer::storeUniqueCmd(bool isTemp)
 {
     fxStr emsg;
     u_int seqnum = getDocumentNumbers(1, emsg);
@@ -562,13 +562,13 @@ HylaFAXServer::storeUniqueCmd(fxBool isTemp)
 /*
  * Tranfer the contents of "fdin" to "fdout".
  */
-fxBool
+bool
 HylaFAXServer::sendData(FILE* fdin, FILE* fdout)
 {
     state |= S_TRANSFER;
     if (setjmp(urgcatch) != 0) {
        state &= ~S_TRANSFER;
-       return (FALSE);
+       return (false);
     }
 #define        PACK(a,b)       (((a)<<8)|(b))
     switch (PACK(type,mode)) {
@@ -576,14 +576,14 @@ HylaFAXServer::sendData(FILE* fdin, FILE* fdout)
     case PACK(TYPE_L,MODE_S):
        if (sendIData(fileno(fdin), fileno(fdout))) {
            state &= ~S_TRANSFER;
-           return (TRUE);
+           return (true);
        }
        break;
     case PACK(TYPE_I,MODE_Z):
     case PACK(TYPE_L,MODE_Z):
        if (sendZData(fileno(fdin), fileno(fdout))) {
            state &= ~S_TRANSFER;
-           return (TRUE);
+           return (true);
        }
        break;
     case PACK(TYPE_A,MODE_S):
@@ -600,7 +600,7 @@ HylaFAXServer::sendData(FILE* fdin, FILE* fdout)
                    break;
                }
                state &= ~S_TRANSFER;
-               return (TRUE);
+               return (true);
            }
            byte_count++;
            if (c == '\n') {            // \n -> \r\n
@@ -622,17 +622,17 @@ HylaFAXServer::sendData(FILE* fdin, FILE* fdout)
     }
 #undef PACK
     state &= ~S_TRANSFER;
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 HylaFAXServer::sendIData(int fdin, int fdout)
 {
     char buf[16*1024];
     for (;;) {
        int cc = read(fdin, buf, sizeof (buf));
        if (cc == 0)
-           return (TRUE);
+           return (true);
        if (cc < 0) {
            perror_reply(551, "Error reading input file", errno);
            break;
@@ -643,10 +643,10 @@ HylaFAXServer::sendIData(int fdin, int fdout)
        }
        byte_count += cc;
     }
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 HylaFAXServer::sendZData(int fdin, int fdout)
 {
     z_stream zstream;
@@ -709,24 +709,24 @@ HylaFAXServer::sendZData(int fdin, int fdout)
            }
        } while (state != Z_STREAM_END);
        deflateEnd(&zstream);
-       return (TRUE);
+       return (true);
 bad:
        deflateEnd(&zstream);
     } else
        reply(452, "Can not initialize compression library: %s", zstream.msg);
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Transfer data from peer to file.
  */
-fxBool
+bool
 HylaFAXServer::recvData(FILE* fdin, FILE* fdout)
 {
     state |= S_TRANSFER;
     if (setjmp(urgcatch) != 0) {
        state &= ~S_TRANSFER;
-       return (FALSE);
+       return (false);
     }
 #define        PACK(a,b)       (((a)<<8)|(b))
     switch (PACK(type,mode)) {
@@ -734,14 +734,14 @@ HylaFAXServer::recvData(FILE* fdin, FILE* fdout)
     case PACK(TYPE_L,MODE_S):
        if (recvIData(fileno(fdin), fileno(fdout))) {
            state &= ~S_TRANSFER;
-           return (TRUE);
+           return (true);
        }
        break;
     case PACK(TYPE_I,MODE_Z):
     case PACK(TYPE_L,MODE_Z):
        if (recvZData(fileno(fdin), fileno(fdout))) {
            state &= ~S_TRANSFER;
-           return (TRUE);
+           return (true);
        }
        break;
     case PACK(TYPE_A,MODE_S):
@@ -758,7 +758,7 @@ HylaFAXServer::recvData(FILE* fdin, FILE* fdout)
                    break;
                }
                state &= ~S_TRANSFER;
-               return (TRUE);
+               return (true);
            }
            byte_count++;
            if (c == '\r') {            // \r\n -> \n
@@ -786,17 +786,17 @@ HylaFAXServer::recvData(FILE* fdin, FILE* fdout)
     }
 #undef PACK
     state &= ~S_TRANSFER;
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 HylaFAXServer::recvIData(int fdin, int fdout)
 {
     char buf[16*1024];                 // XXX better if page-aligned
     for (;;) {
        int cc = read(fdin, buf, sizeof (buf));
        if (cc == 0)
-           return (TRUE);
+           return (true);
        if (cc < 0) {
            perror_reply(426, "Data Connection", errno);
            break;
@@ -807,10 +807,10 @@ HylaFAXServer::recvIData(int fdin, int fdout)
        }
        byte_count += cc;
     }
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 HylaFAXServer::recvZData(int fdin, int fdout)
 {
     z_stream zstream;
@@ -832,7 +832,7 @@ HylaFAXServer::recvZData(int fdin, int fdout)
                    break;
                }
                (void) inflateEnd(&zstream);
-               return (TRUE);
+               return (true);
            }
            if (cc < 0) {
                perror_reply(426, "Data Connection", errno);
@@ -862,7 +862,7 @@ bad:
        (void) inflateEnd(&zstream);
     } else
        reply(452, "Can not initialize decoder: %s", zstream.msg);
-    return (FALSE);
+    return (false);
 }
 
 void
index da493d616374f1516495b1252d6538cadae6efc9..66502db5537f0bcbb4dba2f5d439cf87fe16627a 100644 (file)
@@ -193,7 +193,7 @@ HylaFAXServer::open(void)
        dologout(-1);
     }
     ctrlFlags = fcntl(STDIN_FILENO, F_GETFL);  // for parser
-    if (isShutdown(TRUE))
+    if (isShutdown(true))
        reply(220, "%s HylaFAX server shut down; available only for admin use.",
            (const char*) hostname);
     else
@@ -273,10 +273,10 @@ HylaFAXServer::fixPathname(const char* file)
     return (!IS(LOGGEDIN) && file[0] == '/' ? file+1 : file);
 }
 
-fxBool
+bool
 HylaFAXServer::readShutdownFile(void)
 {
-    fxBool ok = FALSE;
+    bool ok = false;
     FILE* fd = fopen(fixPathname(shutdownFile), "r");
     if (fd != NULL) {
        struct tm tm;
@@ -297,7 +297,7 @@ HylaFAXServer::readShutdownFile(void)
                char buf[1024];
                while (fgets(buf, sizeof (buf), fd))
                    shutdownMsg.append(buf);
-               ok = TRUE;
+               ok = true;
            } else
                logError("%s: Invalid shutdown time, mktime conversion failed;"
                    "Year=%d Mon=%d Day=%d Hour=%d Min=%d"
@@ -318,22 +318,22 @@ HylaFAXServer::readShutdownFile(void)
     return (ok);
 }
 
-fxBool
-HylaFAXServer::isShutdown(fxBool quiet)
+bool
+HylaFAXServer::isShutdown(bool quiet)
 {
     struct stat sb;
     if (shutdownFile == "" || Sys::stat(fixPathname(shutdownFile), sb) < 0)
-       return (FALSE);
+       return (false);
     if (sb.st_mtime != lastModTime) {
        if (!readShutdownFile())
-           return (FALSE);
+           return (false);
        lastModTime = sb.st_mtime;
     }
     time_t now = Sys::now();
     if (!quiet) {                      // possibly send client shutdown msg
        time_t timeToDisconnect = discTime - now;
        time_t lastMsg = now-lastTime;
-       fxBool sendShutDownMsg =
+       bool sendShutDownMsg =
               (lastTime == 0)          // first time
            || (timeToDisconnect < 60)  // <60 seconds, warn continuously
                                        // <15 minutes, warn ever 5 minutes
@@ -650,7 +650,7 @@ HylaFAXServer::configTrace(const char* fmt, ...)
     }
 }
 
-fxBool
+bool
 HylaFAXServer::setConfigItem(const char* tag, const char* value)
 {
     u_int ix;
@@ -662,7 +662,7 @@ HylaFAXServer::setConfigItem(const char* tag, const char* value)
     } else if (findTag(tag, (const tags*) numbers, N(numbers), ix)) {
        (*this).*numbers[ix].p = getNumber(value);
     } else
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 #undef N
index f5dfe92e01975c015142ed50f0c94ae804bc7c3c..f76b435c3e4d15e2c6942939464c238a8b8fb142 100644 (file)
  */
 struct Job : public FaxRequest {
     time_t     lastmod;                // last file modify time, for updates
-    fxBool     queued;                 // for SNPP
+    bool       queued;                 // for SNPP
 
     Job(const fxStr& qf, int fd = -1);
     ~Job();
 
-    fxBool checkDocument(const char* pathname);
+    bool checkDocument(const char* pathname);
 };
 fxDECLARE_StrKeyDictionary(JobDict, Job*)
 
@@ -63,7 +63,7 @@ fxDECLARE_StrKeyDictionary(JobDict, Job*)
  * Received facsimile information.
  */
 struct RecvInfo : public FaxRecvInfo {
-    fxBool     beingReceived;          // currently being received
+    bool       beingReceived;          // currently being received
     time_t     recvTime;               // time receive operation started
 
     RecvInfo();
@@ -131,8 +131,8 @@ enum Token {
 struct tab {                   // protocol command table entry
     const char*        name;
     Token      token;
-    fxBool     checklogin;     // if TRUE, must be logged in first
-    fxBool     implemented;    // FALSE if command is not implemented
+    bool       checklogin;     // if true, must be logged in first
+    bool       implemented;    // false if command is not implemented
     const char*        help;
 };
 
@@ -148,11 +148,11 @@ class HylaFAXServer;
  */ 
 struct SpoolDir {
     const char*        pathname;
-    fxBool     adminOnly;      // accessible by unprivileged clients
-    fxBool     storAble;       // unprivileged clients may STOR files
-    fxBool     deleAble;       // unprivileged clients may DELE files
+    bool       adminOnly;      // accessible by unprivileged clients
+    bool       storAble;       // unprivileged clients may STOR files
+    bool       deleAble;       // unprivileged clients may DELE files
     ino_t      ino;            // directory inode number
-    fxBool (*isVisibleFile)(const char*, const struct stat&);
+    bool (*isVisibleFile)(const char*, const struct stat&);
     void (HylaFAXServer::*listDirectory)(FILE*, const SpoolDir&, DIR*);
     void (HylaFAXServer::*listFile)(FILE*, const SpoolDir&,
        const char*, const struct stat&);
@@ -316,7 +316,7 @@ protected:
     void listCmd(const char* name);    // LIST
     void nlstCmd(const char* name);    // NLST
     void storeCmd(const char*, const char*);// STOR+APPE
-    void storeUniqueCmd(fxBool isTemp);        // STOU+STOT
+    void storeUniqueCmd(bool isTemp);  // STOU+STOT
     void statFileCmd(const char* name);        // STAT
     void chownCmd(const char*, const char*);// CHOWN
     void chmodCmd(const char*, u_int); // CHMOD
@@ -342,8 +342,8 @@ protected:
     void configCmd(const char* where, const char* info);
 
     virtual void initServer(void);
-    fxBool readShutdownFile(void);
-    fxBool isShutdown(fxBool quiet);
+    bool readShutdownFile(void);
+    bool isShutdown(bool quiet);
     void fatal(const char *fmt, ...);
     void reply(int code, const char* fmt, ...);
     void vreply(int code, const char* fmt, va_list ap);
@@ -356,21 +356,21 @@ protected:
     void setFileOwner(const char* filename);
 
     void loginRefused(const char* why);
-    fxBool checkUser(const char*);
-    fxBool checkuser(FILE*, const char *name);
+    bool checkUser(const char*);
+    bool checkuser(FILE*, const char *name);
     void login(void);
     void end_login(void);
     virtual void dologout(int status);
     const char* fixPathname(const char* file);
     const char* userName(u_int uid);
-    fxBool userID(const char*, u_int& id);
+    bool userID(const char*, u_int& id);
     void fillIDCache(void);
 
-    fxBool cvtPasswd(const char* type, const char* pass, fxStr& result);
-    fxBool findUser(FILE* db, const char* user, u_int& newuid);
-    fxBool addUser(FILE* db, const char* user, u_int uid,
+    bool cvtPasswd(const char* type, const char* pass, fxStr& result);
+    bool findUser(FILE* db, const char* user, u_int& newuid);
+    bool addUser(FILE* db, const char* user, u_int uid,
        const char* upass, const char* apass);
-    fxBool deleteUser(FILE* db, const char* user);
+    bool deleteUser(FILE* db, const char* user);
 
     /*
      * Configuration file support.
@@ -382,9 +382,9 @@ protected:
     void setupConfig();
     void configError(const char* fmt, ...);
     void configTrace(const char* fmt, ...);
-    fxBool setConfigItem(const char* tag, const char* value);
+    bool setConfigItem(const char* tag, const char* value);
 
-    fxBool restartSend(FILE* fd, off_t marker);
+    bool restartSend(FILE* fd, off_t marker);
 
     static SpoolDir dirs[];
 
@@ -393,13 +393,13 @@ protected:
     static SpoolDir* dirLookup(ino_t ino);
     SpoolDir* dirAccess(const char* path);
     SpoolDir* fileAccess(const char* path, int op, struct stat&);
-    fxBool fileVisible(const SpoolDir&, const char*, const struct stat&);
+    bool fileVisible(const SpoolDir&, const char*, const struct stat&);
 
-    static fxBool isVisibleRecvQFile(const char*, const struct stat&);
+    static bool isVisibleRecvQFile(const char*, const struct stat&);
     void listRecvQ(FILE* fd, const SpoolDir& sd, DIR* dir);
     void listRecvQFile(FILE*, const SpoolDir&, const char*, const struct stat&);
 
-    static fxBool isVisibleSendQFile(const char*, const struct stat&);
+    static bool isVisibleSendQFile(const char*, const struct stat&);
     void listSendQ(FILE* fd, const SpoolDir& sd, DIR* dir);
     void listSendQFile(FILE*, const SpoolDir&, const char*, const struct stat&);
     void nlstSendQ(FILE* fd, const SpoolDir& sd, DIR* dir);
@@ -409,13 +409,13 @@ protected:
     void listStatusFile(FILE*, const SpoolDir&, const char*, const struct stat&);
     void nlstStatus(FILE* fd, const SpoolDir& sd, DIR* dir);
 
-    static fxBool isVisibleTRUE(const char*, const struct stat&);
-    static fxBool isVisibleDocQFile(const char*, const struct stat&);
-    static fxBool isVisibleRootFile(const char*, const struct stat&);
+    static bool isVisibletrue(const char*, const struct stat&);
+    static bool isVisibleDocQFile(const char*, const struct stat&);
+    static bool isVisibleRootFile(const char*, const struct stat&);
 
     void listDirectory(FILE* fd, const SpoolDir& sd, DIR* dir);
     void listUnixFile(FILE*, const SpoolDir&, const char*, const struct stat&);
-    void makeProt(const struct stat& sb, fxBool withGrp, char prot[10]);
+    void makeProt(const struct stat& sb, bool withGrp, char prot[10]);
     void Fprintf(FILE*, const char* fmt, const char*, const struct stat&);
 
     void nlstDirectory(FILE* fd, const SpoolDir& sd, DIR* dir);
@@ -425,64 +425,64 @@ protected:
     static const char* dataConnMsg(int code);
     virtual void closeDataConn(FILE*);
 
-    fxBool sendData(FILE* fdin, FILE* fdout);
-    fxBool sendIData(int fdin, int fdout);
-    fxBool sendZData(int fdin, int fdout);
-    fxBool recvData(FILE* instr, FILE* outstr);
-    fxBool recvIData(int fdin, int fdout);
-    fxBool recvZData(int fdin, int fdout);
+    bool sendData(FILE* fdin, FILE* fdout);
+    bool sendIData(int fdin, int fdout);
+    bool sendZData(int fdin, int fdout);
+    bool recvData(FILE* instr, FILE* outstr);
+    bool recvIData(int fdin, int fdout);
+    bool recvZData(int fdin, int fdout);
 
     TIFF* openTIFF(const char* name);
-    fxBool sendTIFFData(TIFF* tif, FILE* fdout);
-    fxBool sendTIFFHeader(TIFF* tif, int fdout);
-    fxBool sendITIFFData(TIFF* tif, int fdout);
+    bool sendTIFFData(TIFF* tif, FILE* fdout);
+    bool sendTIFFHeader(TIFF* tif, int fdout);
+    bool sendITIFFData(TIFF* tif, int fdout);
 
     void logTransfer(const char*, const SpoolDir&, const char*, time_t);
 
     virtual int parse(void);
-    fxBool cmd(Token t);
-    fxBool site_cmd(Token t);
-    fxBool param_cmd(Token t);
-    fxBool string_param(fxStr&, const char* what = NULL);
-    fxBool number_param(long&);
-    fxBool boolean_param(fxBool&);
-    fxBool file_param(fxStr& pathname);
-    fxBool pwd_param(fxStr& s);
-    fxBool timespec_param(int ndigits, time_t& t);
-    fxBool pathname_param(fxStr& pathname);
-    fxBool job_param(fxStr& jid);
-    fxBool jgrp_param(fxStr& jgid);
-    fxBool pathname(fxStr& s);
-    fxBool CRLF();
-    fxBool SP();
-    fxBool COMMA();
-    fxBool TIMESPEC(u_int len, time_t& result);
-    fxBool BOOLEAN(fxBool& b);
-    fxBool STRING(fxStr& s, const char* what = NULL);
-    fxBool NUMBER(long& n);
-    fxBool checkNUMBER(const char* s);
-    fxBool opt_CRLF();
-    fxBool opt_STRING(fxStr& s);
-    fxBool multi_STRING(fxStr& s);
+    bool cmd(Token t);
+    bool site_cmd(Token t);
+    bool param_cmd(Token t);
+    bool string_param(fxStr&, const char* what = NULL);
+    bool number_param(long&);
+    bool boolean_param(bool&);
+    bool file_param(fxStr& pathname);
+    bool pwd_param(fxStr& s);
+    bool timespec_param(int ndigits, time_t& t);
+    bool pathname_param(fxStr& pathname);
+    bool job_param(fxStr& jid);
+    bool jgrp_param(fxStr& jgid);
+    bool pathname(fxStr& s);
+    bool CRLF();
+    bool SP();
+    bool COMMA();
+    bool TIMESPEC(u_int len, time_t& result);
+    bool BOOLEAN(bool& b);
+    bool STRING(fxStr& s, const char* what = NULL);
+    bool NUMBER(long& n);
+    bool checkNUMBER(const char* s);
+    bool opt_CRLF();
+    bool opt_STRING(fxStr& s);
+    bool multi_STRING(fxStr& s);
     static u_int twodigits(const char* cp, u_int range);
     static u_int fourdigits(const char* cp);
     virtual void syntaxError(const char* msg);
 
     virtual void netStatus(FILE*) = 0; // depends on transport
-    virtual fxBool hostPort() = 0;     // depends on transport
+    virtual bool hostPort() = 0;       // depends on transport
 
-    int getChar(fxBool waitForInput);
+    int getChar(bool waitForInput);
     void pushCmdData(const char* data, int n);
-    fxBool getCmdLine(char* s, int n, fxBool waitForInput = FALSE);
+    bool getCmdLine(char* s, int n, bool waitForInput = false);
     void pushToken(Token t);
     Token nextToken(void);
-    fxBool checkToken(Token);
-    fxBool getToken(Token, const char*);
+    bool checkToken(Token);
+    bool getToken(Token, const char*);
     void helpCmd(const tab* ctab, const char* s);
     void logcmd(Token t, const char* fmt = NULL, ...);
     void cmdFailure(Token t, const char* why);
-    fxBool checklogin(Token);
-    fxBool checkadmin(Token);
+    bool checklogin(Token);
+    bool checkadmin(Token);
 
     static const char* version;
 
@@ -490,19 +490,19 @@ protected:
     virtual const char* siteToken(Token t);
     static const char* parmToken(Token t);
 
-    fxBool initClientFIFO(fxStr& emsg);
+    bool initClientFIFO(fxStr& emsg);
     int FIFOInput(int fd);
     void FIFOMessage(const char* cp, u_int len);
-    fxBool sendModem(const char* modem, fxStr& emsg, const char* fmt ...);
-    fxBool sendQueuerMsg(fxStr& emsg, const fxStr& msg);
-    fxBool sendQueuer(fxStr& emsg, const char* fmt ...);
-    fxBool sendQueuerACK(fxStr& emsg, const char* fmt, ...);
-    fxBool vsendQueuerACK(fxStr& emsg, const char* fmt, va_list ap);
-
-    fxBool newTrigger(fxStr& emsg, const char* fmt, ...);
-    fxBool vnewTrigger(fxStr& emsg, const char* fmt, va_list ap);
-    fxBool loadTrigger(fxStr& emsg);
-    fxBool cancelTrigger(fxStr& emsg);
+    bool sendModem(const char* modem, fxStr& emsg, const char* fmt ...);
+    bool sendQueuerMsg(fxStr& emsg, const fxStr& msg);
+    bool sendQueuer(fxStr& emsg, const char* fmt ...);
+    bool sendQueuerACK(fxStr& emsg, const char* fmt, ...);
+    bool vsendQueuerACK(fxStr& emsg, const char* fmt, va_list ap);
+
+    bool newTrigger(fxStr& emsg, const char* fmt, ...);
+    bool vnewTrigger(fxStr& emsg, const char* fmt, va_list ap);
+    bool loadTrigger(fxStr& emsg);
+    bool cancelTrigger(fxStr& emsg);
     void triggerEvent(const TriggerMsgHeader& h, const char* data);
     void logEventMsg(const TriggerMsgHeader&h, fxStr& msg);
     void logJobEventMsg(const TriggerMsgHeader&, const JobExt&);
@@ -514,30 +514,30 @@ protected:
 
     virtual void initDefaultJob(void);
     void parmBotch(Token t);
-    fxBool checkAccess(const Job& job, Token t, u_int op);
-    fxBool checkParm(Job&, Token t, u_int op);
-    fxBool checkJobState(Job*);
+    bool checkAccess(const Job& job, Token t, u_int op);
+    bool checkParm(Job&, Token t, u_int op);
+    bool checkJobState(Job*);
     void replyJobParamValue(Job&, int code, Token t);
-    void replyBoolean(int code, fxBool b);
-    fxBool setValue(u_short& v, const char* value, const char* what,
+    void replyBoolean(int code, bool b);
+    bool setValue(u_short& v, const char* value, const char* what,
        const char* valNames[], u_int nValNames);
     void flushPreparedDocuments(Job& job);
-    fxBool setJobParameter(Job&, Token t, const fxStr& value);
-    fxBool setJobParameter(Job&, Token t, u_short value);
-    fxBool setJobParameter(Job&, Token t, time_t value);
-    fxBool setJobParameter(Job&, Token t, fxBool b);
-    fxBool setJobParameter(Job&, Token t, float value);
-    fxBool docType(const char* docname, FaxSendOp& op);
-    fxBool checkAddDocument(Job&, Token type, const char* docname, FaxSendOp&);
+    bool setJobParameter(Job&, Token t, const fxStr& value);
+    bool setJobParameter(Job&, Token t, u_short value);
+    bool setJobParameter(Job&, Token t, time_t value);
+    bool setJobParameter(Job&, Token t, bool b);
+    bool setJobParameter(Job&, Token t, float value);
+    bool docType(const char* docname, FaxSendOp& op);
+    bool checkAddDocument(Job&, Token type, const char* docname, FaxSendOp&);
     void addCoverDocument(Job&, const char* docname);
     void addDocument(Job&, const char* docname);
     void addPollOp(Job&, const char* sep, const char* pwd);
     void newJobCmd(void);
-    fxBool newJob(fxStr& emsg);
+    bool newJob(fxStr& emsg);
     Job* findJob(const char* jobid, fxStr& emsg);
     Job* findJobInMemmory(const char* jobid);
     Job* findJobOnDisk(const char* jobid, fxStr& emsg);
-    fxBool updateJobFromDisk(Job& job);
+    bool updateJobFromDisk(Job& job);
     void replyCurrentJob(const char* leader);
     void setCurrentJob(const char* jobid);
     Job* preJobCmd(const char* op, const char* jobid, fxStr& emsg);
@@ -550,9 +550,9 @@ protected:
     void suspendJob(const char* jobid);
     void submitJob(const char* jobid);
     void waitForJob(const char* jobid);
-    fxBool updateJobOnDisk(Job& req, fxStr& emsg);
-    fxBool lockJob(Job& job, int how, fxStr& emsg);
-    fxBool lockJob(Job& job, int how);
+    bool updateJobOnDisk(Job& req, fxStr& emsg);
+    bool lockJob(Job& job, int how, fxStr& emsg);
+    bool lockJob(Job& job, int how);
     void unlockJob(Job& job);
 #ifdef OLDPROTO_SUPPORT
     void readJobs(void);
@@ -568,7 +568,7 @@ protected:
     u_int getJobNumber(fxStr&);
     u_int getDocumentNumbers(u_int count, fxStr&);
 
-    fxBool getRecvDocStatus(RecvInfo& ri);
+    bool getRecvDocStatus(RecvInfo& ri);
     RecvInfo* getRecvInfo(const fxStr& qfile, const struct stat& sb);
     const char* compactRecvTime(time_t t);
     void Rprintf(FILE*, const char*, const RecvInfo&, const struct stat&);
index 4fa9d3265350d90c6e4dc489ea87a3e00be72714..b90cdf4d85780de0bb600fe55b9eebc405296f13 100644 (file)
@@ -46,7 +46,7 @@ InetSuperServer::InetSuperServer(const char* p, int bl)
 {}
 InetSuperServer::~InetSuperServer() {}
 
-fxBool
+bool
 InetSuperServer::startServer(void)
 {
     int s = socket(AF_INET, SOCK_STREAM, 0);
@@ -66,14 +66,14 @@ InetSuperServer::startServer(void)
        if (Socket::bind(s, &sin, sizeof (sin)) >= 0) {
            (void) listen(s, getBacklog());
            Dispatcher::instance().link(s, Dispatcher::ReadMask, this);
-           return (TRUE);                              // success
+           return (true);                              // success
        }
        Sys::close(s);
        logError("HylaFAX %s: bind (port %u): %m",
            getKind(), ntohs(sin.sin_port));
     } else
        logError("HylaFAX %s: socket: %m", getKind());
-    return (FALSE);
+    return (false);
 }
 HylaFAXServer* InetSuperServer::newChild(void) { return new InetFaxServer; }
 
@@ -81,7 +81,7 @@ InetFaxServer* InetFaxServer::_instance = NULL;
 
 InetFaxServer::InetFaxServer()
 {
-    usedefault = TRUE;
+    usedefault = true;
     swaitmax = 90;                     // wait at most 90 seconds
     swaitint = 5;                      // interval between retries
 
@@ -110,7 +110,7 @@ void
 InetFaxServer::initServer(void)
 {
     HylaFAXServer::initServer();
-    usedefault = TRUE;
+    usedefault = true;
 }
 
 void
@@ -148,7 +148,7 @@ topDomain(const fxStr& h)
  * assume that the host is local, as it will be
  * interpreted as such.
  */
-fxBool
+bool
 InetFaxServer::isLocalDomain(const fxStr& h)
 {
     const char* p1 = topDomain(hostname);
@@ -164,23 +164,23 @@ InetFaxServer::isLocalDomain(const fxStr& h)
  * look up the name and check that the peer's address
  * corresponds to the host name.
  */
-fxBool
+bool
 InetFaxServer::checkHostIdentity(hostent*& hp)
 {
     if (!isLocalDomain(hp->h_name))            // not local, don't check
-       return (TRUE);
+       return (true);
     fxStr name(hp->h_name);                    // must copy static value
     hp = Socket::gethostbyname(name);
     if (hp) {
        for (const char** cpp = (const char**) hp->h_addr_list; *cpp; cpp++)
            if (memcmp(*cpp, &peer_addr.sin_addr, hp->h_length) == 0)
-               return (TRUE);
+               return (true);
        reply(130, "Warning, client address \"%s\" is not listed for host name \"%s\".",
            (const char*) remoteaddr, hp->h_name);
     } else
        reply(130, "Warning, no inverse address mapping for client host name \"%s\".",
            (const char*) name);
-    return (FALSE);
+    return (false);
 }
 
 void
@@ -302,7 +302,7 @@ InetFaxServer::lostConnection(void)
 }
 void InetFaxServer::sigPIPE(int) { InetFaxServer::instance().lostConnection(); }
 
-static fxBool
+static bool
 setupPassiveDataSocket(int pdata, struct sockaddr_in& pasv_addr)
 {
     socklen_t len = sizeof (pasv_addr);
@@ -400,7 +400,7 @@ bad:
     return (NULL);
 }
 
-fxBool
+bool
 InetFaxServer::dataConnect(void)
 {
     return Socket::connect(data, &data_dest,sizeof (data_dest)) >= 0;
@@ -464,12 +464,12 @@ InetFaxServer::openDataConn(const char* mode, int& code)
     return (file);
 }
 
-fxBool
+bool
 InetFaxServer::hostPort()
 {
     long a0, a1, a2, a3;
     long p0, p1;
-    fxBool syntaxOK = 
+    bool syntaxOK = 
                      NUMBER(a0)
        && COMMA() && NUMBER(a1)
        && COMMA() && NUMBER(a2)
@@ -482,16 +482,16 @@ InetFaxServer::hostPort()
        u_char* p = (u_char*) &data_dest.sin_port;
        a[0] = UC(a0); a[1] = UC(a1); a[2] = UC(a2); a[3] = UC(a3);
        p[0] = UC(p0); p[1] = UC(p1);
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 void
 InetFaxServer::portCmd(void)
 {
     logcmd(T_PORT, "%s;%u", inet_ntoa(data_dest.sin_addr), data_dest.sin_port);
-    usedefault = FALSE;
+    usedefault = false;
     if (pdata >= 0)
        (void) Sys::close(pdata), pdata = -1;
     ack(200, cmdToken(T_PORT));
index 8d5659d549556c4407576987d263ebb8748f315b..d70b876d2822a40aaf6129423a3763cce0b0281a 100644 (file)
@@ -40,7 +40,7 @@ protected:
     sockaddr_in        data_source;            // source of data connection
     sockaddr_in        data_dest;              // destination of data connection
     sockaddr_in        pasv_addr;              // local end of passive connections
-    fxBool     usedefault;             // for data transfers
+    bool       usedefault;             // for data transfers
     /*
      * Timeout intervals for retrying connections
      * to hosts that don't accept PORT cmds.
@@ -48,8 +48,8 @@ protected:
     int                swaitmax;               // wait at most 90 seconds
     int                swaitint;               // interval between retries
 
-    fxBool isLocalDomain(const fxStr& h);
-    fxBool checkHostIdentity(hostent*& hp);
+    bool isLocalDomain(const fxStr& h);
+    bool checkHostIdentity(hostent*& hp);
     void setupNetwork(int fd);
     void handleUrgentData(void);
     void passiveCmd(void);
@@ -61,10 +61,10 @@ protected:
 
     void netStatus(FILE*);
     void printaddr(FILE*, const char* leader, const struct sockaddr_in& sin);
-    fxBool hostPort();
+    bool hostPort();
     void portCmd(void);
 
-    fxBool dataConnect(void);
+    bool dataConnect(void);
     FILE* getDataSocket(const char* mode);
     FILE* openDataConn(const char* mode, int& code);
 
@@ -86,7 +86,7 @@ class InetSuperServer : public SuperServer {
 private:
     fxStr port;
 protected:
-    fxBool startServer(void);
+    bool startServer(void);
     HylaFAXServer* newChild(void);
 public:
     InetSuperServer(const char* port, int backlog = 5);
index 4ab81732b0bf6e0b0ec84467f4d3207f61b4f255..4a97d6790c6d533688dbd9a451645082c006d398 100644 (file)
@@ -40,7 +40,7 @@
 Job::Job(const fxStr& qf, int f) : FaxRequest(qf,f)
 {
     lastmod = 0;
-    queued = FALSE;
+    queued = false;
 }
 Job::~Job() {}
 
@@ -53,7 +53,7 @@ Job::~Job() {}
  * check for ``..'' and ``/'' being used to reference
  * files outside the spooling area.
  */
-fxBool
+bool
 Job::checkDocument(const char* pathname)
 {
     struct stat sb;
@@ -154,7 +154,7 @@ static const struct {
  * ownership is based on login account and not fax uid;
  * this may need to be rethought.
  */
-fxBool
+bool
 HylaFAXServer::checkAccess(const Job& job, Token t, u_int op)
 {
     u_int n = N(params)-1;
@@ -163,12 +163,12 @@ HylaFAXServer::checkAccess(const Job& job, Token t, u_int op)
        i++;
     u_int m = params[i].protect;
     if (m&op)                                  // other/public access
-       return (TRUE);
+       return (true);
     if (IS(PRIVILEGED) && ((m>>3)&op))         // administrative access
-       return (TRUE);
+       return (true);
     if (job.owner == the_user && ((m>>6)&op))  // owner access
-       return (TRUE);
-    return (FALSE);
+       return (true);
+    return (false);
 }
 
 static const struct {
@@ -263,12 +263,12 @@ static const char* docTypeNames[] = {
 };
 
 static const char*
-boolString(fxBool b)
+boolString(bool b)
 {
     return (b ? "YES" : "NO");
 }
 void
-HylaFAXServer::replyBoolean(int code, fxBool b)
+HylaFAXServer::replyBoolean(int code, bool b)
 {
     reply(code, "%s", boolString(b));
 }
@@ -281,7 +281,7 @@ HylaFAXServer::replyBoolean(int code, fxBool b)
  * and send the client an error reply.  This method is used
  * before each place a job's state is access.
  */
-fxBool
+bool
 HylaFAXServer::checkJobState(Job* job)
 {
     /*
@@ -295,13 +295,13 @@ HylaFAXServer::checkJobState(Job* job)
        if (job == curJob)                      // make default job current
            curJob = &defJob;
        delete job, job = NULL;
-       return (FALSE);
+       return (false);
     }
     if (job->lastmod < sb.st_mtime) {
        (void) updateJobFromDisk(*job);
        job->lastmod = sb.st_mtime;
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -312,25 +312,25 @@ HylaFAXServer::checkJobState(Job* job)
  * could be lost (in our case they will be lost due to the
  * way that things work).
  */
-fxBool
+bool
 HylaFAXServer::checkParm(Job& job, Token t, u_int op)
 {
     if (!checkJobState(&job)) {                        // insure consistent state
        reply(500, "Cannot access job %s state; job deleted by another party.",
            (const char*) job.jobid);
-       return (FALSE);
+       return (false);
     } else if (!checkAccess(job, t, op)) {
        reply(503, "Permission denied: no %s access to job parameter %s."
            , (op == A_READ ? "read" : "write")
            , parmToken(t)
        );
-       return (FALSE);
+       return (false);
     } else if ((op & (A_WRITE|A_MODIFY)) &&
       job.state != FaxRequest::state_suspended && job.jobid != "default") {
        reply(503, "Suspend the job with JSUSP first.");
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 /*
@@ -572,17 +572,17 @@ HylaFAXServer::jstatCmd(const Job& job)
  * array.  Parameter names are case-insensitive. 
  * Unknown values cause an error reply.  
  */
-fxBool
+bool
 HylaFAXServer::setValue(u_short& v, const char* value, const char* what,
     const char* valNames[], u_int nValNames)
 {
     for (u_int i = 0; i < nValNames; i++)
        if (strcasecmp(value, valNames[i]) == 0) {
            v = i;
-           return (TRUE);
+           return (true);
        }
     reply(503, "Unknown %s value %s.", what, value);
-    return (FALSE);
+    return (false);
 }
 
 void
@@ -619,7 +619,7 @@ HylaFAXServer::flushPreparedDocuments(Job& job)
 /*
  * Set a job state parameter that has a string value.
  */
-fxBool
+bool
 HylaFAXServer::setJobParameter(Job& job, Token t, const fxStr& value)
 {
     if (checkParm(job, t, A_WRITE|A_MODIFY)) {
@@ -631,31 +631,31 @@ HylaFAXServer::setJobParameter(Job& job, Token t, const fxStr& value)
            if (setValue(job.pagechop, value, parmToken(t),
              chopVals, N(chopVals))) {
                job.pagehandling = "";          // force recalculation
-               return (TRUE);
+               return (true);
            } else
-               return (FALSE);
+               return (false);
        case T_DATAFORMAT:
            if (setValue(job.desireddf, value, parmToken(t),
              dataVals, N(dataVals))) {
                flushPreparedDocuments(job);
-               return (TRUE);
+               return (true);
            } else
-               return (FALSE);
+               return (false);
        }
        for (u_int i = 0, n = N(strvals); i < n; i++)
            if (strvals[i].t == t) {
                job.*strvals[i].p = value;
-               return (TRUE);
+               return (true);
            }
        parmBotch(t);
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Set a job state parameter that has a integer value.
  */
-fxBool
+bool
 HylaFAXServer::setJobParameter(Job& job, Token t, u_short value)
 {
     if (checkParm(job, t, A_WRITE|A_MODIFY)) {
@@ -679,17 +679,17 @@ HylaFAXServer::setJobParameter(Job& job, Token t, u_short value)
                        break;
                    }
                }
-               return (TRUE);
+               return (true);
            }
        parmBotch(t);
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Set a job state parameter that has a time value.
  */
-fxBool
+bool
 HylaFAXServer::setJobParameter(Job& job, Token t, time_t value)
 {
     if (checkParm(job, t, A_WRITE|A_MODIFY)) {
@@ -699,12 +699,12 @@ HylaFAXServer::setJobParameter(Job& job, Token t, time_t value)
            if (value != 0) {                   // explicit time
                if (value < now) {
                    reply(503, "Bad time to send; time in the past.");  // XXX
-                   return (FALSE);
+                   return (false);
                }
                job.tts = value;
            } else                              // ``NOW''
                job.tts = now;
-           return (TRUE);
+           return (true);
        case T_LASTTIME:
            /*
             * Convert client-specified kill time (as a relative number)
@@ -716,43 +716,43 @@ HylaFAXServer::setJobParameter(Job& job, Token t, time_t value)
             * value may be installed for LASTTIME.
             */
            job.killtime = value + (job.tts == 0 ? now : job.tts);
-           return (TRUE);
+           return (true);
        case T_RETRYTIME:
            job.retrytime = value;
-           return (TRUE);
+           return (true);
        }
        parmBotch(t);
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Set a job state parameter that has a boolean value.
  */
-fxBool
-HylaFAXServer::setJobParameter(Job& job, Token t, fxBool b)
+bool
+HylaFAXServer::setJobParameter(Job& job, Token t, bool b)
 {
     if (checkParm(job, t, A_WRITE|A_MODIFY)) {
        switch (t) {
        case T_USE_ECM:
            job.desiredec = b;
-           return (TRUE);
+           return (true);
        case T_USE_TAGLINE:
            job.desiredtl = b;
-           return (TRUE);
+           return (true);
        case T_USE_CONTCOVER:
            job.useccover = b;
-           return (TRUE);
+           return (true);
        }
        parmBotch(t);
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Set a job state parameter that has a float value.
  */
-fxBool
+bool
 HylaFAXServer::setJobParameter(Job& job, Token t, float value)
 {
     if (checkParm(job, t, A_WRITE|A_MODIFY)) {
@@ -762,11 +762,11 @@ HylaFAXServer::setJobParameter(Job& job, Token t, float value)
                job.chopthreshold = value;
                job.pagehandling = "";          // force recalculation
            }
-           return (TRUE);
+           return (true);
        }
        parmBotch(t);
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -792,8 +792,8 @@ HylaFAXServer::initDefaultJob(void)
     defJob.desiredst   = ST_0MS;
     defJob.desiredec   = EC_ENABLE;
     defJob.desireddf   = DF_2DMMR;
-    defJob.desiredtl   = FALSE;
-    defJob.useccover   = TRUE;
+    defJob.desiredtl   = false;
+    defJob.useccover   = true;
     defJob.pagechop    = FaxRequest::chop_default;
     defJob.notify      = FaxRequest::no_notice;// FAX_DEFNOTIFY
     defJob.chopthreshold= 3.0;
@@ -845,16 +845,16 @@ HylaFAXServer::newJobCmd(void)
  * information in dial strings and passwords to be
  * transmitted with polling requests.
  */
-fxBool
+bool
 HylaFAXServer::newJob(fxStr& emsg)
 {
     if (!IS(PRIVILEGED) && the_user != curJob->owner) {
        emsg = "Permission denied; cannot inherit from job " | curJob->jobid;
-       return (FALSE);
+       return (false);
     }
     u_int id = getJobNumber(emsg);             // allocate unique job ID
     if (id == (u_int) -1)
-       return (FALSE);
+       return (false);
     fxStr jobid = fxStr::format("%u", id);
     Job* job = new Job(FAX_SENDDIR "/" FAX_QFILEPREF | jobid);
     job->jobid = jobid;
@@ -898,22 +898,22 @@ HylaFAXServer::newJob(fxStr& emsg)
     job->queued = curJob->queued;
     jobs[jobid] = job;
     curJob = job;
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Update the job's state on disk.
  */
-fxBool
+bool
 HylaFAXServer::updateJobOnDisk(Job& job, fxStr& emsg)
 {
     if (lockJob(job, LOCK_EX|LOCK_NB, emsg)) {
        // XXX don't update in place, use temp file and rename
        job.writeQFile();
        unlockJob(job);
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 /*
@@ -957,7 +957,7 @@ HylaFAXServer::findJobOnDisk(const char* jid, fxStr& emsg)
     if (fd >= 0) {
        // XXX should we lock here???
        Job* req = new Job(&filename[1], fd);
-       fxBool reject;
+       bool reject;
        if (req->readQFile(reject) && !reject) {
            Sys::close(req->fd), req->fd = -1;
            return (req);
@@ -973,12 +973,12 @@ HylaFAXServer::findJobOnDisk(const char* jid, fxStr& emsg)
 /*
  * Update a job's state from the on-disk copy.
  */
-fxBool
+bool
 HylaFAXServer::updateJobFromDisk(Job& job)
 {
-    fxBool status = FALSE;
+    bool status = false;
     if (lockJob(job, LOCK_SH|LOCK_NB)) {
-       fxBool reject;
+       bool reject;
        status = (job.reReadQFile(reject) && !reject);
        unlockJob(job);
     }
@@ -991,28 +991,28 @@ HylaFAXServer::updateJobFromDisk(Job& job)
  * occurs a descriptive message is returned for
  * transmission to the client.
  */
-fxBool
+bool
 HylaFAXServer::lockJob(Job& job, int how, fxStr& emsg)
 {
     if (job.fd < 0) {
        job.fd = Sys::open("/" | job.qfile, O_RDWR|O_CREAT, 0600);
        if (job.fd < 0) {
            emsg = "Cannot open/create job description file /" | job.qfile;
-           return (FALSE);
+           return (false);
        }
     }
     if (flock(job.fd, how) < 0) {
        emsg = fxStr::format("Job file lock failed: %s", strerror(errno));
        Sys::close(job.fd), job.fd = -1;
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 /*
  * Like above, but no error message is returned.
  */
-fxBool
+bool
 HylaFAXServer::lockJob(Job& job, int how)
 {
     if (job.fd < 0)
@@ -1407,7 +1407,7 @@ HylaFAXServer::waitForJob(const char* jobid)
  * Do common work used in adding a document to a
  * job's set of documents that are to be sent.
  */
-fxBool
+bool
 HylaFAXServer::checkAddDocument(Job& job, Token type,
     const char* docname, FaxSendOp& op)
 {
@@ -1418,9 +1418,9 @@ HylaFAXServer::checkAddDocument(Job& job, Token type,
        else if (!docType(docname, op))
            reply(550, "%s: Document type not recognized.", docname);
        else
-           return (TRUE);
+           return (true);
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -1484,7 +1484,7 @@ HylaFAXServer::addPollOp(Job& job, const char* sep, const char* pwd)
  * Directory interface support for querying job status.
  */
 
-fxBool
+bool
 HylaFAXServer::isVisibleSendQFile(const char* filename, const struct stat&)
 {
     return (filename[0] == 'q');
@@ -1605,7 +1605,7 @@ HylaFAXServer::Jprintf(FILE* fd, const char* fmt, const Job& job)
      *     implies read access to anything else in the
      *     job state that is protected.
      */
-    fxBool haveAccess = checkAccess(job, T_DIALSTRING, A_READ);
+    bool haveAccess = checkAccess(job, T_DIALSTRING, A_READ);
     for (const char* cp = fmt; *cp; cp++) {
        if (*cp == '%') {
 #define        MAXSPEC 20
index 94bb0c91aff2b92b8747e3c3084b4f37a36e1d1d..015ff1c7df1f274e93b92ebfda1da3f8e881a7a3 100644 (file)
@@ -147,7 +147,7 @@ HylaFAXServer::login(void)
 
     uid_t ouid = geteuid();
     (void) seteuid(0);
-    fxBool isSetup = (chroot(".") >= 0 && chdir("/") >= 0);
+    bool isSetup = (chroot(".") >= 0 && chdir("/") >= 0);
     /*
      * Install the client's fax-uid as the effective gid
      * so that created files automatically are given the
@@ -162,7 +162,7 @@ HylaFAXServer::login(void)
        end_login();
        return;
     }
-    (void) isShutdown(FALSE);  // display any shutdown messages
+    (void) isShutdown(false);  // display any shutdown messages
     reply(230, "User %s logged in.", (const char*) the_user);
     if (TRACE(LOGIN))
        logInfo("FAX LOGIN FROM %s [%s], %s"
index 540ed6c419c4070ddef471645ef3709008dc6d3f..b9251ac332ac7860372bb3ff9eacb6637bafb30f 100644 (file)
@@ -62,7 +62,7 @@ OldProtocolSuperServer::OldProtocolSuperServer(const char* p, int bl)
 {}
 OldProtocolSuperServer::~OldProtocolSuperServer() {}
 
-fxBool
+bool
 OldProtocolSuperServer::startServer(void)
 {
     int s = socket(AF_INET, SOCK_STREAM, 0);
@@ -82,14 +82,14 @@ OldProtocolSuperServer::startServer(void)
        if (Socket::bind(s, &sin, sizeof (sin)) >= 0) {
            (void) listen(s, getBacklog());
            Dispatcher::instance().link(s, Dispatcher::ReadMask, this);
-           return (TRUE);                              // success
+           return (true);                              // success
        }
        Sys::close(s);
        logError("HylaFAX %s: bind (port %u): %m",
            getKind(), ntohs(sin.sin_port));
     } else
        logError("HylaFAX %s: socket: %m", getKind());
-    return (FALSE);
+    return (false);
 }
 HylaFAXServer* OldProtocolSuperServer::newChild(void)
     { return new OldProtocolServer; }
@@ -97,7 +97,7 @@ HylaFAXServer* OldProtocolSuperServer::newChild(void)
 OldProtocolServer::OldProtocolServer()
 {
     version = 0;
-    alreadyChecked = FALSE;
+    alreadyChecked = false;
     codetab = NULL;
 }
 OldProtocolServer::~OldProtocolServer() {}
@@ -114,7 +114,7 @@ OldProtocolServer::open(void)
            (const char*) remotehost, (const char*) remoteaddr);
 
     fxStr emsg;
-    if (isShutdown(TRUE)) {
+    if (isShutdown(true)) {
         logInfo("HylaFAX Old connection refused (server shut down) from %s [%s]",
            (const char*) remotehost, (const char*) remoteaddr);
        dologout(-1);
@@ -149,23 +149,23 @@ OldProtocolServer::open(void)
  * look up the name and check that the peer's address
  * corresponds to the host name.
  */
-fxBool
+bool
 OldProtocolServer::checkHostIdentity(hostent*& hp)
 {
     if (!isLocalDomain(hp->h_name))            // not local, don't check
-       return (TRUE);
+       return (true);
     fxStr name(hp->h_name);                    // must copy static value
     hp = Socket::gethostbyname(name);
     if (hp) {
        for (const char** cpp = (const char**) hp->h_addr_list; *cpp; cpp++)
            if (memcmp(*cpp, &peer_addr.sin_addr, hp->h_length) == 0)
-               return (TRUE);
+               return (true);
        sendError("Client address %s is not listed for host name %s.",
            (const char*) remoteaddr, hp->h_name);
     } else
        sendError("No inverse address mapping for client host name %s.",
            (const char*) name);
-    return (FALSE);
+    return (false);
 }
 
 void
@@ -220,38 +220,38 @@ OldProtocolServer::setupNetwork(int fd)
 
 // NB: there is no support for the old style data transfer
 const OldProtocolServer::protoCmd OldProtocolServer::cmds[] = {
-{ "begin",             TRUE,   &OldProtocolServer::submitJob },
-{ "checkPerm",         TRUE,   &OldProtocolServer::ackPermission },
-{ "tiff",              TRUE,   &OldProtocolServer::getTIFFData },
-{ "postscript",                TRUE,   &OldProtocolServer::getPostScriptData },
-{ "zpostscript",       TRUE,   &OldProtocolServer::getZPostScriptData },
-{ "opaque",            TRUE,   &OldProtocolServer::getOpaqueData },
-{ "zopaque",           TRUE,   &OldProtocolServer::getZOpaqueData },
-{ "poll",              TRUE,   &OldProtocolServer::newPollID },
-{ "userID",            FALSE,  &OldProtocolServer::setUserID },
-{ "version",           FALSE,  &OldProtocolServer::setProtoVersion },
-{ "serverStatus",      FALSE,  &OldProtocolServer::sendServerStatus },
-{ "serverInfo",                FALSE,  &OldProtocolServer::sendServerInfo },
-{ "allStatus",         FALSE,  &OldProtocolServer::sendAllStatus },
-{ "userStatus",                FALSE,  &OldProtocolServer::sendUserStatus },
-{ "jobStatus",         FALSE,  &OldProtocolServer::sendJobStatus },
-{ "recvStatus",                FALSE,  &OldProtocolServer::sendRecvStatus },
-{ "remove",            TRUE,   &OldProtocolServer::removeJob },
-{ "removeGroup",       TRUE,   &OldProtocolServer::removeJobGroup },
-{ "kill",              TRUE,   &OldProtocolServer::killJob },
-{ "killGroup",         TRUE,   &OldProtocolServer::killJobGroup },
-{ "alterTTS",          TRUE,   &OldProtocolServer::alterJobTTS },
-{ "alterGroupTTS",     TRUE,   &OldProtocolServer::alterJobGroupTTS },
-{ "alterKillTime",     TRUE,   &OldProtocolServer::alterJobKillTime },
-{ "alterGroupKillTime",        TRUE,   &OldProtocolServer::alterJobGroupKillTime },
-{ "alterMaxDials",     TRUE,   &OldProtocolServer::alterJobMaxDials },
-{ "alterGroupMaxDials",        TRUE,   &OldProtocolServer::alterJobGroupMaxDials },
-{ "alterNotify",       TRUE,   &OldProtocolServer::alterJobNotification },
-{ "alterGroupNotify",  TRUE,   &OldProtocolServer::alterJobGroupNotification },
-{ "alterModem",                TRUE,   &OldProtocolServer::alterJobModem },
-{ "alterGroupModem",   TRUE,   &OldProtocolServer::alterJobGroupModem },
-{ "alterPriority",     TRUE,   &OldProtocolServer::alterJobPriority },
-{ "alterGroupPriority",        TRUE,   &OldProtocolServer::alterJobGroupPriority },
+{ "begin",             true,   &OldProtocolServer::submitJob },
+{ "checkPerm",         true,   &OldProtocolServer::ackPermission },
+{ "tiff",              true,   &OldProtocolServer::getTIFFData },
+{ "postscript",                true,   &OldProtocolServer::getPostScriptData },
+{ "zpostscript",       true,   &OldProtocolServer::getZPostScriptData },
+{ "opaque",            true,   &OldProtocolServer::getOpaqueData },
+{ "zopaque",           true,   &OldProtocolServer::getZOpaqueData },
+{ "poll",              true,   &OldProtocolServer::newPollID },
+{ "userID",            false,  &OldProtocolServer::setUserID },
+{ "version",           false,  &OldProtocolServer::setProtoVersion },
+{ "serverStatus",      false,  &OldProtocolServer::sendServerStatus },
+{ "serverInfo",                false,  &OldProtocolServer::sendServerInfo },
+{ "allStatus",         false,  &OldProtocolServer::sendAllStatus },
+{ "userStatus",                false,  &OldProtocolServer::sendUserStatus },
+{ "jobStatus",         false,  &OldProtocolServer::sendJobStatus },
+{ "recvStatus",                false,  &OldProtocolServer::sendRecvStatus },
+{ "remove",            true,   &OldProtocolServer::removeJob },
+{ "removeGroup",       true,   &OldProtocolServer::removeJobGroup },
+{ "kill",              true,   &OldProtocolServer::killJob },
+{ "killGroup",         true,   &OldProtocolServer::killJobGroup },
+{ "alterTTS",          true,   &OldProtocolServer::alterJobTTS },
+{ "alterGroupTTS",     true,   &OldProtocolServer::alterJobGroupTTS },
+{ "alterKillTime",     true,   &OldProtocolServer::alterJobKillTime },
+{ "alterGroupKillTime",        true,   &OldProtocolServer::alterJobGroupKillTime },
+{ "alterMaxDials",     true,   &OldProtocolServer::alterJobMaxDials },
+{ "alterGroupMaxDials",        true,   &OldProtocolServer::alterJobGroupMaxDials },
+{ "alterNotify",       true,   &OldProtocolServer::alterJobNotification },
+{ "alterGroupNotify",  true,   &OldProtocolServer::alterJobGroupNotification },
+{ "alterModem",                true,   &OldProtocolServer::alterJobModem },
+{ "alterGroupModem",   true,   &OldProtocolServer::alterJobGroupModem },
+{ "alterPriority",     true,   &OldProtocolServer::alterJobPriority },
+{ "alterGroupPriority",        true,   &OldProtocolServer::alterJobGroupPriority },
 };
 #define        NCMDS   (sizeof (cmds) / sizeof (cmds[0]))
 
@@ -302,7 +302,7 @@ OldProtocolServer::doProtocol(void)
                        );
                        dologout(-1);
                    }
-                   alreadyChecked = TRUE;
+                   alreadyChecked = true;
                }
            }
            (this->*cmds[i].cmdFunc)(tag);
@@ -463,7 +463,7 @@ OldProtocolServer::ackPermission(const char*)
  */
 #include <pwd.h>
 
-fxBool
+bool
 OldProtocolServer::_checkUser(const char* requestor, struct passwd* pwd)
 {
     char buf[1024];
@@ -494,11 +494,11 @@ OldProtocolServer::_checkUser(const char* requestor, struct passwd* pwd)
     return (strcmp(requestor, buf) == 0);
 }
 
-fxBool
+bool
 OldProtocolServer::isAdmin(const char* requestor)
 {
-    static fxBool checked = FALSE;
-    static fxBool isadmin = FALSE;
+    static bool checked = false;
+    static bool isadmin = false;
 
     if (!checked) {
        struct passwd* pwd = getpwuid(getuid());
@@ -509,18 +509,18 @@ OldProtocolServer::isAdmin(const char* requestor)
        }
        if (!pwd) {
            logError("getpwuid failed for effective uid %d: %m", geteuid());
-           isadmin = FALSE;
+           isadmin = false;
        }
        isadmin = _checkUser(requestor, pwd);
        if (!isadmin) {                                 /* not fax user */
            pwd = getpwnam("root");
            if (!pwd) {
                logError("getpwnam failed for \"root\": %m");
-               isadmin = FALSE;
+               isadmin = false;
            } else
                isadmin = _checkUser(requestor, pwd);   /* root user */
        }
-       checked = TRUE;
+       checked = true;
     }
     return (isadmin);
 }
@@ -608,19 +608,19 @@ void OldProtocolServer::alterJob##param(const char* tag)          \
 void OldProtocolServer::alterJobGroup##param(const char* tag)          \
     { applyToJobGroup(tag, "alter", &OldProtocolServer::reallyAlterJob##param); }
 
-fxBool
+bool
 OldProtocolServer::alterSuspend(Job& job)
 {
     if (job.state == FaxRequest::state_active) {
        sendClient("jobLocked", job.jobid);     // NB: maintain old semantics
-       return (FALSE);
+       return (false);
     }
     fxStr emsg;
     if (!sendQueuerACK(emsg, "X%s", (const char*) job.jobid)) {
        sendError("Unable to suspend job: %s", (const char*) emsg);
-       return (FALSE);
+       return (false);
     }
-    return (TRUE);
+    return (true);
 }
 
 void
@@ -1302,7 +1302,7 @@ OldProtocolServer::sendJobStatus(Job& job)
        sendClientJobLocked(job);
 }
 
-fxBool
+bool
 OldProtocolServer::modemMatch(const fxStr& a, const fxStr& b)
 {
     return (a == MODEM_ANY || b == MODEM_ANY || a == b);
index f1a0e5705903ca425f37c4ce462f0cbcfe2adee0..e8db0ca06ff57aff62f10440cf32bbec8a2293de 100644 (file)
@@ -36,20 +36,20 @@ class OldProtocolServer : public InetFaxServer {
 public:
     struct protoCmd {
        const char* cmd;                // command to match
-       fxBool  check;                  // if true, checkPermission first
+       bool    check;                  // if true, checkPermission first
        void (OldProtocolServer::*cmdFunc)(const char*);
     };
 private:
     faxRequestArray reqs;
     char       line[1024];             // current input line
     int                version;
-    fxBool     alreadyChecked;
+    bool       alreadyChecked;
     code_ent*  codetab;
     fxStr      modem;                  // selected modem
 
     static const protoCmd cmds[];
 
-    fxBool checkHostIdentity(hostent*& hp);
+    bool checkHostIdentity(hostent*& hp);
     void setupNetwork(int fd);
     void doProtocol(void);
     void getCommandLine(char line[1024], char*& tag);
@@ -63,13 +63,13 @@ private:
     void newPollID(const char* tag);
     void setProtoVersion(const char* tag);
     void ackPermission(const char*);
-    fxBool _checkUser(const char* requestor, struct passwd* pwd);
-    fxBool isAdmin(const char* requestor);
+    bool _checkUser(const char* requestor, struct passwd* pwd);
+    bool isAdmin(const char* requestor);
     void applyToJob(const char* tag, const char* op,
        void (OldProtocolServer::*f)(Job&, const char*));
     void applyToJobGroup(const char* tag, const char* op,
        void (OldProtocolServer::*f)(Job&, const char*));
-    fxBool alterSuspend(Job&);
+    bool alterSuspend(Job&);
     void alterResubmit(Job&);
     void alterJobTTS(const char*);
     void alterJobGroupTTS(const char*);
@@ -111,7 +111,7 @@ private:
     void getZPostScriptData(const char* tag);
     void getZOpaqueData(const char* tag);
     void dologout(int status);
-    fxBool modemMatch(const fxStr& a, const fxStr& b);
+    bool modemMatch(const fxStr& a, const fxStr& b);
     void sendServerStatus(const char*);
     void sendServerInfo1(const char* name);
     void sendServerInfo(const char*);
@@ -138,7 +138,7 @@ class OldProtocolSuperServer : public SuperServer {
 private:
     fxStr port;
 protected:
-    fxBool startServer(void);
+    bool startServer(void);
     HylaFAXServer* newChild(void);
 public:
     OldProtocolSuperServer(const char* port, int backlog = 5);
index ace009df29e822c7e967a620c649543e5d05fd8c..4f822f491b3957ec950734e37e744b617840a006 100644 (file)
  * Standard protocol commands.
  */
 static const tab cmdtab[] = {
-{ "ABOR",         T_ABOR,      FALSE, TRUE, "[modem] (abort operation)" },
-{ "ACCT",         T_ACCT,      FALSE,FALSE, "(specify account)" },
-{ "ADMIN",        T_ADMIN,      TRUE, TRUE, "password" },
-{ "ALLO",         T_ALLO,      FALSE,FALSE, "(allocate disk space)" },
-{ "ANSWER",       T_ANSWER,     TRUE, TRUE, "modem [DATA|VOICE|FAX]" },
-{ "APPE",         T_APPE,       TRUE, TRUE, "file-name" },
-{ "CWD",          T_CWD,        TRUE, TRUE, "[directory-name]" },
-{ "CDUP",         T_CDUP,       TRUE, TRUE, "(change directory up one level)"},
-{ "CHMOD",        T_CHMOD,      TRUE, TRUE, "file-name mode" },
-{ "CHOWN",        T_CHOWN,      TRUE, TRUE, "file-name user" },
-{ "DELE",         T_DELE,       TRUE, TRUE, "file-name" },
-{ "DISABLE",      T_DISABLE,    TRUE, TRUE, "modem [reason]" },
-{ "ENABLE",       T_ENABLE,     TRUE, TRUE, "modem" },
-{ "HELP",         T_HELP,      FALSE, TRUE, "[<string>]" },
-{ "FILEFMT",      T_FILEFMT,    TRUE, TRUE, "[format-string]" },
-{ "FORM",         T_FORM,       TRUE, TRUE, "format-type" },
-{ "IDLE",         T_IDLE,       TRUE, TRUE, "[max-idle-timeout]" },
-{ "JDELE",        T_JDELE,      TRUE, TRUE, "[job-id]" },
-{ "JINTR",        T_JINTR,      TRUE, TRUE, "[job-id]" },
-{ "JKILL",        T_JKILL,      TRUE, TRUE, "[job-id]" },
-{ "JNEW",         T_JNEW,       TRUE, TRUE, "" },
-{ "JOB",          T_JOB,        TRUE, TRUE, "[job-id]" },
-{ "JOBFMT",       T_JOBFMT,     TRUE, TRUE, "[format-string]" },
-{ "JPARM",        T_JPARM,      TRUE, TRUE, "[parm-name [parm-value]]" },
-{ "JREST",        T_JREST,      TRUE, TRUE, "(reset current job state)" },
-{ "JSUBM",        T_JSUB,       TRUE, TRUE, "[job-id]" },
-{ "JSUSP",        T_JSUSP,      TRUE, TRUE, "[job-id]" },
-{ "JWAIT",        T_JWAIT,      TRUE, TRUE, "[job-id]" },
-{ "JGDELE",       T_JGDELE,     TRUE,FALSE, "[jobgroup-id]" },
-{ "JGINTR",       T_JGINTR,     TRUE,FALSE, "[jobgroup-id]" },
-{ "JGKILL",       T_JGKILL,     TRUE,FALSE, "[jobgroup-id]" },
-{ "JGNEW",        T_JGNEW,      TRUE, TRUE, "" },
-{ "JGPARM",       T_JGPARM,     TRUE,FALSE, "parm-name [parm-value]" },
-{ "JGREST",       T_JGREST,     TRUE,FALSE, "(reset current job group state)"},
-{ "JGRP",         T_JGRP,       TRUE,FALSE, "[jobgroup-id]" },
-{ "JGSUBM",       T_JGSUB,      TRUE,FALSE, "[jobgroup-id]" },
-{ "JGSUSP",       T_JGSUSP,     TRUE,FALSE, "[jobgroup-id]" },
-{ "JGWAIT",       T_JGWAIT,     TRUE,FALSE, "[jobgroup-id]" },
-{ "LIST",         T_LIST,       TRUE, TRUE, "[path-name]" },
-{ "MDTM",         T_MDTM,       TRUE, TRUE, "path-name" },
-{ "MODE",         T_MODE,      FALSE, TRUE, "(specify transfer mode)" },
-{ "MDMFMT",       T_MODEMFMT,   TRUE, TRUE, "[format-string]" },
-{ "NLST",         T_NLST,       TRUE, TRUE, "[path-name]" },
-{ "NOOP",         T_NOOP,      FALSE, TRUE, "" },
-{ "PASS",         T_PASS,      FALSE, TRUE, "password" },
-{ "PASV",         T_PASV,       TRUE, TRUE, "(set server in passive mode)" },
-{ "PORT",         T_PORT,       TRUE, TRUE, "a0,a1,a2,a3,p0,p1" },
-{ "PWD",          T_PWD,        TRUE, TRUE, "(print working directory)" },
-{ "QUIT",         T_QUIT,      FALSE, TRUE, "(terminate service)", },
-{ "RCVFMT",       T_RCVFMT,     TRUE, TRUE, "[format-string]" },
-{ "REIN",         T_REIN,      FALSE, TRUE, "(reinitialize server state)" },
-{ "REST",         T_REST,       TRUE, TRUE, "restart-marker" },
-{ "RETP",         T_RETP,       TRUE, TRUE, "file-name" },
-{ "RETR",         T_RETR,       TRUE, TRUE, "file-name" },
-{ "RNFR",         T_RNFR,       TRUE,FALSE, "file-name" },
-{ "RNTO",         T_RNTO,       TRUE,FALSE, "file-name" },
-{ "SHUT",         T_SHUT,       TRUE, TRUE, "NOW|HHSS|YYYYMMDDHHSS [reason]" },
-{ "SITE",         T_SITE,       TRUE, TRUE, "site-cmd [arguments]" },
-{ "SIZE",         T_SIZE,       TRUE, TRUE, "path-name" },
-{ "STAT",         T_STAT,      FALSE, TRUE, "[path-name]" },
-{ "STOR",         T_STOR,       TRUE, TRUE, "file-name" },
-{ "STOT",         T_STOT,       TRUE, TRUE, "(store unique temporary)" },
-{ "STOU",         T_STOU,       TRUE, TRUE, "(store unique)" },
-{ "STRU",         T_STRU,      FALSE, TRUE, "file-structure" },
-{ "SYST",         T_SYST,       TRUE, TRUE, "(return system type)" },
-{ "TZONE",        T_TZONE,      TRUE, TRUE, "[GMT|LOCAL]" },
-{ "TYPE",         T_TYPE,      FALSE, TRUE, "transfer-type" },
-{ "USER",         T_USER,      FALSE, TRUE, "username" },
-{ "VRFY",         T_VRFY,      FALSE, TRUE, "dialstring" },
+{ "ABOR",         T_ABOR,      false, true, "[modem] (abort operation)" },
+{ "ACCT",         T_ACCT,      false,false, "(specify account)" },
+{ "ADMIN",        T_ADMIN,      true, true, "password" },
+{ "ALLO",         T_ALLO,      false,false, "(allocate disk space)" },
+{ "ANSWER",       T_ANSWER,     true, true, "modem [DATA|VOICE|FAX]" },
+{ "APPE",         T_APPE,       true, true, "file-name" },
+{ "CWD",          T_CWD,        true, true, "[directory-name]" },
+{ "CDUP",         T_CDUP,       true, true, "(change directory up one level)"},
+{ "CHMOD",        T_CHMOD,      true, true, "file-name mode" },
+{ "CHOWN",        T_CHOWN,      true, true, "file-name user" },
+{ "DELE",         T_DELE,       true, true, "file-name" },
+{ "DISABLE",      T_DISABLE,    true, true, "modem [reason]" },
+{ "ENABLE",       T_ENABLE,     true, true, "modem" },
+{ "HELP",         T_HELP,      false, true, "[<string>]" },
+{ "FILEFMT",      T_FILEFMT,    true, true, "[format-string]" },
+{ "FORM",         T_FORM,       true, true, "format-type" },
+{ "IDLE",         T_IDLE,       true, true, "[max-idle-timeout]" },
+{ "JDELE",        T_JDELE,      true, true, "[job-id]" },
+{ "JINTR",        T_JINTR,      true, true, "[job-id]" },
+{ "JKILL",        T_JKILL,      true, true, "[job-id]" },
+{ "JNEW",         T_JNEW,       true, true, "" },
+{ "JOB",          T_JOB,        true, true, "[job-id]" },
+{ "JOBFMT",       T_JOBFMT,     true, true, "[format-string]" },
+{ "JPARM",        T_JPARM,      true, true, "[parm-name [parm-value]]" },
+{ "JREST",        T_JREST,      true, true, "(reset current job state)" },
+{ "JSUBM",        T_JSUB,       true, true, "[job-id]" },
+{ "JSUSP",        T_JSUSP,      true, true, "[job-id]" },
+{ "JWAIT",        T_JWAIT,      true, true, "[job-id]" },
+{ "JGDELE",       T_JGDELE,     true,false, "[jobgroup-id]" },
+{ "JGINTR",       T_JGINTR,     true,false, "[jobgroup-id]" },
+{ "JGKILL",       T_JGKILL,     true,false, "[jobgroup-id]" },
+{ "JGNEW",        T_JGNEW,      true, true, "" },
+{ "JGPARM",       T_JGPARM,     true,false, "parm-name [parm-value]" },
+{ "JGREST",       T_JGREST,     true,false, "(reset current job group state)"},
+{ "JGRP",         T_JGRP,       true,false, "[jobgroup-id]" },
+{ "JGSUBM",       T_JGSUB,      true,false, "[jobgroup-id]" },
+{ "JGSUSP",       T_JGSUSP,     true,false, "[jobgroup-id]" },
+{ "JGWAIT",       T_JGWAIT,     true,false, "[jobgroup-id]" },
+{ "LIST",         T_LIST,       true, true, "[path-name]" },
+{ "MDTM",         T_MDTM,       true, true, "path-name" },
+{ "MODE",         T_MODE,      false, true, "(specify transfer mode)" },
+{ "MDMFMT",       T_MODEMFMT,   true, true, "[format-string]" },
+{ "NLST",         T_NLST,       true, true, "[path-name]" },
+{ "NOOP",         T_NOOP,      false, true, "" },
+{ "PASS",         T_PASS,      false, true, "password" },
+{ "PASV",         T_PASV,       true, true, "(set server in passive mode)" },
+{ "PORT",         T_PORT,       true, true, "a0,a1,a2,a3,p0,p1" },
+{ "PWD",          T_PWD,        true, true, "(print working directory)" },
+{ "QUIT",         T_QUIT,      false, true, "(terminate service)", },
+{ "RCVFMT",       T_RCVFMT,     true, true, "[format-string]" },
+{ "REIN",         T_REIN,      false, true, "(reinitialize server state)" },
+{ "REST",         T_REST,       true, true, "restart-marker" },
+{ "RETP",         T_RETP,       true, true, "file-name" },
+{ "RETR",         T_RETR,       true, true, "file-name" },
+{ "RNFR",         T_RNFR,       true,false, "file-name" },
+{ "RNTO",         T_RNTO,       true,false, "file-name" },
+{ "SHUT",         T_SHUT,       true, true, "NOW|HHSS|YYYYMMDDHHSS [reason]" },
+{ "SITE",         T_SITE,       true, true, "site-cmd [arguments]" },
+{ "SIZE",         T_SIZE,       true, true, "path-name" },
+{ "STAT",         T_STAT,      false, true, "[path-name]" },
+{ "STOR",         T_STOR,       true, true, "file-name" },
+{ "STOT",         T_STOT,       true, true, "(store unique temporary)" },
+{ "STOU",         T_STOU,       true, true, "(store unique)" },
+{ "STRU",         T_STRU,      false, true, "file-structure" },
+{ "SYST",         T_SYST,       true, true, "(return system type)" },
+{ "TZONE",        T_TZONE,      true, true, "[GMT|LOCAL]" },
+{ "TYPE",         T_TYPE,      false, true, "transfer-type" },
+{ "USER",         T_USER,      false, true, "username" },
+{ "VRFY",         T_VRFY,      false, true, "dialstring" },
 };
 
 /*
  * Job parameter commands/keys.
  */
 static const tab parmtab[] = {
-{ "ACCTINFO",     T_ACCTINFO,    FALSE,FALSE, "[<string>]" },
-{ "BEGBR",        T_BEGBR,       FALSE, TRUE, "[ANY|bit-rate]" },
-{ "BEGST",        T_BEGST,       FALSE, TRUE, "[ANY|scanline-time]" },
-{ "CHOPTHRESHOLD",T_CHOPTHRESH,          FALSE, TRUE, "[inches]" },
-{ "CLIENT",       T_CLIENT,      FALSE, TRUE, "[<string>]" },
-{ "COMMENTS",     T_COMMENTS,    FALSE,FALSE, "[<string>]" },
-{ "COMMID",       T_COMMID,      FALSE, TRUE, "(communication identifier)" },
-{ "COVER",        T_COVER,       FALSE, TRUE, "path-name" },
-{ "DATAFORMAT",   T_DATAFORMAT,          FALSE, TRUE, "[ANY|G31D|G32D|G4]" },
-{ "DIALSTRING",   T_DIALSTRING,          FALSE, TRUE, "[<string>]" },
-{ "DOCUMENT",     T_DOCUMENT,    FALSE, TRUE, "path-name" },
-{ "DONEOP",       T_DONEOP,      FALSE, TRUE, "[<string>]" },
-{ "EXTERNAL",     T_EXTERNAL,    FALSE, TRUE, "[<string>]" },
-{ "FROMCOMPANY",  T_FROM_COMPANY, FALSE,FALSE, "[<string>]" },
-{ "FROMLOCATION", T_FROM_LOCATION,FALSE,FALSE, "[<string>]" },
-{ "FROMUSER",     T_FROM_USER,   FALSE, TRUE, "[<string>]" },
-{ "FROMVOICE",    T_FROM_VOICE,          FALSE,FALSE, "[<string>]" },
-{ "GROUPID",      T_GROUPID,     FALSE, TRUE, "(job group identifier)" },
-{ "HRES",         T_HRES,        FALSE,FALSE, "[dots-per-inch]" },
-{ "JOBID",        T_JOBID,       FALSE, TRUE, "(job identifier)" },
-{ "JOBINFO",      T_JOBINFO,     FALSE, TRUE, "[<string>]" },
-{ "JOBTYPE",      T_JOBTYPE,     FALSE, TRUE, "(job type)" },
-{ "LASTTIME",     T_LASTTIME,    FALSE, TRUE, "[DDHHSS]" },
-{ "MAXDIALS",     T_MAXDIALS,    FALSE, TRUE, "[<number>]" },
-{ "MAXPAGES",     T_MAXPAGES,    FALSE, TRUE, "[<number>]" },
-{ "MAXTRIES",     T_MAXTRIES,    FALSE, TRUE, "[<number>]" },
-{ "MINBR",        T_MINBR,       FALSE, TRUE, "[ANY|bit-rate]" },
-{ "MODEM",        T_MODEM,       FALSE, TRUE, "[device|class]" },
-{ "NDIALS",       T_NDIALS,      FALSE, TRUE, "[<number>]" },
-{ "NOTIFY",       T_NOTIFY,      FALSE, TRUE, "[NONE|DONE|REQUEUE|DONE+REQUEUE]" },
-{ "NOTIFYADDR",   T_NOTIFYADDR,          FALSE, TRUE, "[email-address]" },
-{ "NPAGES",       T_NPAGES,      FALSE, TRUE, "[<number>]" },
-{ "NTRIES",       T_NTRIES,      FALSE, TRUE, "[<number>]" },
-{ "OWNER",        T_OWNER,       FALSE, TRUE, "[<name>|<number>]" },
-{ "PAGECHOP",     T_PAGECHOP,    FALSE, TRUE, "[DEFAULT|NONE|ALL|LAST]" },
-{ "PAGELENGTH",   T_PAGELENGTH,          FALSE, TRUE, "[millimeters]" },
-{ "PAGEWIDTH",    T_PAGEWIDTH,   FALSE, TRUE, "[millimeters]" },
-{ "PASSWD",       T_PASSWD,      FALSE, TRUE, "[<string>]" },
-{ "POLL",         T_POLL,        FALSE, TRUE, "selector [passwd]" },
-{ "REGARDING",    T_REGARDING,   FALSE,FALSE, "[<string>]" },
-{ "RETRYTIME",    T_RETRYTIME,   FALSE, TRUE, "[HHSS]" },
-{ "SCHEDPRI",     T_SCHEDPRI,    FALSE, TRUE, "[<number>]" },
-{ "SENDTIME",     T_SENDTIME,    FALSE, TRUE, "[NOW|YYYYMMDDHHSS]" },
-{ "STATE",        T_STATE,       FALSE, TRUE, "(job state)" },
-{ "STATUS",       T_STATUS,       FALSE, TRUE, "[<string>" },
-{ "SUBADDR",      T_SUBADDR,     FALSE, TRUE, "[<string>]" },
-{ "TAGLINE",      T_TAGLINE,     FALSE, TRUE, "[<string>]" },
-{ "TOCOMPANY",    T_TO_COMPANY,          FALSE, TRUE, "[<string>]" },
-{ "TOLOCATION",   T_TO_LOCATION,  FALSE, TRUE, "[<string>]" },
-{ "TOTDIALS",     T_TOTDIALS,    FALSE, TRUE, "[<number>]" },
-{ "TOTPAGES",     T_TOTPAGES,    FALSE, TRUE, "[<number>]" },
-{ "TOTTRIES",     T_TOTTRIES,    FALSE, TRUE, "[<number>]" },
-{ "TOUSER",       T_TO_USER,     FALSE, TRUE, "[<string>]" },
-{ "TOVOICE",      T_TO_VOICE,    FALSE,FALSE, "[<string>]" },
-{ "USECONTCOVER", T_USE_CONTCOVER,FALSE, TRUE, "[YES|NO]" },
-{ "USEECM",       T_USE_ECM,     FALSE, TRUE, "[YES|NO]" },
-{ "USETAGLINE",   T_USE_TAGLINE,  FALSE, TRUE, "[YES|NO]" },
-{ "USRKEY",       T_USRKEY,      FALSE, TRUE, "[<string>]" },
-{ "VRES",         T_VRES,        FALSE, TRUE, "[lines-per-inch]" },
+{ "ACCTINFO",     T_ACCTINFO,    false,false, "[<string>]" },
+{ "BEGBR",        T_BEGBR,       false, true, "[ANY|bit-rate]" },
+{ "BEGST",        T_BEGST,       false, true, "[ANY|scanline-time]" },
+{ "CHOPTHRESHOLD",T_CHOPTHRESH,          false, true, "[inches]" },
+{ "CLIENT",       T_CLIENT,      false, true, "[<string>]" },
+{ "COMMENTS",     T_COMMENTS,    false,false, "[<string>]" },
+{ "COMMID",       T_COMMID,      false, true, "(communication identifier)" },
+{ "COVER",        T_COVER,       false, true, "path-name" },
+{ "DATAFORMAT",   T_DATAFORMAT,          false, true, "[ANY|G31D|G32D|G4]" },
+{ "DIALSTRING",   T_DIALSTRING,          false, true, "[<string>]" },
+{ "DOCUMENT",     T_DOCUMENT,    false, true, "path-name" },
+{ "DONEOP",       T_DONEOP,      false, true, "[<string>]" },
+{ "EXTERNAL",     T_EXTERNAL,    false, true, "[<string>]" },
+{ "FROMCOMPANY",  T_FROM_COMPANY, false,false, "[<string>]" },
+{ "FROMLOCATION", T_FROM_LOCATION,false,false, "[<string>]" },
+{ "FROMUSER",     T_FROM_USER,   false, true, "[<string>]" },
+{ "FROMVOICE",    T_FROM_VOICE,          false,false, "[<string>]" },
+{ "GROUPID",      T_GROUPID,     false, true, "(job group identifier)" },
+{ "HRES",         T_HRES,        false,false, "[dots-per-inch]" },
+{ "JOBID",        T_JOBID,       false, true, "(job identifier)" },
+{ "JOBINFO",      T_JOBINFO,     false, true, "[<string>]" },
+{ "JOBTYPE",      T_JOBTYPE,     false, true, "(job type)" },
+{ "LASTTIME",     T_LASTTIME,    false, true, "[DDHHSS]" },
+{ "MAXDIALS",     T_MAXDIALS,    false, true, "[<number>]" },
+{ "MAXPAGES",     T_MAXPAGES,    false, true, "[<number>]" },
+{ "MAXTRIES",     T_MAXTRIES,    false, true, "[<number>]" },
+{ "MINBR",        T_MINBR,       false, true, "[ANY|bit-rate]" },
+{ "MODEM",        T_MODEM,       false, true, "[device|class]" },
+{ "NDIALS",       T_NDIALS,      false, true, "[<number>]" },
+{ "NOTIFY",       T_NOTIFY,      false, true, "[NONE|DONE|REQUEUE|DONE+REQUEUE]" },
+{ "NOTIFYADDR",   T_NOTIFYADDR,          false, true, "[email-address]" },
+{ "NPAGES",       T_NPAGES,      false, true, "[<number>]" },
+{ "NTRIES",       T_NTRIES,      false, true, "[<number>]" },
+{ "OWNER",        T_OWNER,       false, true, "[<name>|<number>]" },
+{ "PAGECHOP",     T_PAGECHOP,    false, true, "[DEFAULT|NONE|ALL|LAST]" },
+{ "PAGELENGTH",   T_PAGELENGTH,          false, true, "[millimeters]" },
+{ "PAGEWIDTH",    T_PAGEWIDTH,   false, true, "[millimeters]" },
+{ "PASSWD",       T_PASSWD,      false, true, "[<string>]" },
+{ "POLL",         T_POLL,        false, true, "selector [passwd]" },
+{ "REGARDING",    T_REGARDING,   false,false, "[<string>]" },
+{ "RETRYTIME",    T_RETRYTIME,   false, true, "[HHSS]" },
+{ "SCHEDPRI",     T_SCHEDPRI,    false, true, "[<number>]" },
+{ "SENDTIME",     T_SENDTIME,    false, true, "[NOW|YYYYMMDDHHSS]" },
+{ "STATE",        T_STATE,       false, true, "(job state)" },
+{ "STATUS",       T_STATUS,       false, true, "[<string>" },
+{ "SUBADDR",      T_SUBADDR,     false, true, "[<string>]" },
+{ "TAGLINE",      T_TAGLINE,     false, true, "[<string>]" },
+{ "TOCOMPANY",    T_TO_COMPANY,          false, true, "[<string>]" },
+{ "TOLOCATION",   T_TO_LOCATION,  false, true, "[<string>]" },
+{ "TOTDIALS",     T_TOTDIALS,    false, true, "[<number>]" },
+{ "TOTPAGES",     T_TOTPAGES,    false, true, "[<number>]" },
+{ "TOTTRIES",     T_TOTTRIES,    false, true, "[<number>]" },
+{ "TOUSER",       T_TO_USER,     false, true, "[<string>]" },
+{ "TOVOICE",      T_TO_VOICE,    false,false, "[<string>]" },
+{ "USECONTCOVER", T_USE_CONTCOVER,false, true, "[YES|NO]" },
+{ "USEECM",       T_USE_ECM,     false, true, "[YES|NO]" },
+{ "USETAGLINE",   T_USE_TAGLINE,  false, true, "[YES|NO]" },
+{ "USRKEY",       T_USRKEY,      false, true, "[<string>]" },
+{ "VRES",         T_VRES,        false, true, "[lines-per-inch]" },
 
-{ "HELP",         T_HELP,        FALSE, TRUE, "[<string>]" },
+{ "HELP",         T_HELP,        false, true, "[<string>]" },
 };
 
 /*
  * Site-specific commands.
  */
 static const tab sitetab[] = {
-{ "ADDMODEM",     T_ADDMODEM,    FALSE,FALSE, "modem [speed]"},
-{ "ADDUSER",      T_ADDUSER,     FALSE, TRUE, "user-spec [passwd [adminwd]]"},
-{ "CONFIG",       T_CONFIG,      FALSE, TRUE, "[parm-name [parm-value]]" },
-{ "DELMODEM",     T_DELMODEM,    FALSE,FALSE, "modem" },
-{ "DELUSER",      T_DELUSER,     FALSE, TRUE, "user-spec" },
-{ "TRIGGER",     T_TRIGGER,      FALSE, TRUE, "spec" },
-{ "HELP",         T_HELP,        FALSE, TRUE, "[<string>]" },
+{ "ADDMODEM",     T_ADDMODEM,    false,false, "modem [speed]"},
+{ "ADDUSER",      T_ADDUSER,     false, true, "user-spec [passwd [adminwd]]"},
+{ "CONFIG",       T_CONFIG,      false, true, "[parm-name [parm-value]]" },
+{ "DELMODEM",     T_DELMODEM,    false,false, "modem" },
+{ "DELUSER",      T_DELUSER,     false, true, "user-spec" },
+{ "TRIGGER",     T_TRIGGER,      false, true, "spec" },
+{ "HELP",         T_HELP,        false, true, "[<string>]" },
 };
 
 static const tab*
@@ -242,7 +242,7 @@ HylaFAXServer::fourdigits(const char* cp)
           (cp[2]-'0')*10 +
           (cp[3]-'0');
 }
-inline fxBool
+inline bool
 isLoginToken(Token t)
 {
     return (t == T_USER || t == T_PASS || t == T_ADMIN);
@@ -350,7 +350,7 @@ HylaFAXServer::parse()
 /*
  * Protocol command (one line).
  */
-fxBool
+bool
 HylaFAXServer::cmd(Token t)
 {
     fxStr s;
@@ -361,14 +361,14 @@ HylaFAXServer::cmd(Token t)
        if (string_param(s, "user name")) {
            logcmd(t, "%s", (const char*) s);
            userCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_PASS:                       // user password
        if (string_param(s, "password")) {
            logcmd(t, "<password>");
            passCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_ADMIN:                      // administrator password
@@ -378,7 +378,7 @@ HylaFAXServer::cmd(Token t)
            break;
        logcmd(t, "<password>");
        adminCmd(s);
-       return (TRUE);
+       return (true);
     case T_REIN:                       // reinitialize server
        logcmd(t);
        if (IS(LOGGEDIN))
@@ -392,7 +392,7 @@ HylaFAXServer::cmd(Token t)
            restart_point = n;
            reply(350, "Data transfer will restart at %lu, "
                "send transfer command", n);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_SYST:                       // system identification
@@ -400,62 +400,62 @@ HylaFAXServer::cmd(Token t)
            logcmd(t);
            // this is what we *emulate*
            reply(215, "%s", (const char*) systemType);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_PORT:                       // port for data transfer
        if (SP() && hostPort() && CRLF()) {
            portCmd();
-           return (TRUE);
+           return (true);
        }
        break;
     case T_PASV:                       // enable passive mode
        if (CRLF()) {
            logcmd(t);
            passiveCmd();
-           return (TRUE);
+           return (true);
        }
        break;
     case T_FORM:                       // document format
        if (string_param(s, "document format")) {
            logcmd(t, "%s", (const char*) s);
            formCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_MODE:                       // data transfer mode
        if (string_param(s, "transfer mode")) {
            logcmd(t, "%s", (const char*) s);
            modeCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_STRU:                       // data transfer file structure
        if (string_param(s, "file structure")) {
            logcmd(t, "%s", (const char*) s);
            struCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_TYPE:                       // data transfer type
        if (string_param(s, "transfer type")) {
            logcmd(t, "%s", (const char*) s);
            typeCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_RETP:                       // retrieve next page of document/file
        if (pathname_param(s)) {
            logcmd(t, "%s", (const char*) s);
            retrievePageCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_RETR:                       // retrieve document/file
        if (pathname_param(s)) {
            logcmd(t, "%s", (const char*) s);
            retrieveCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_STOR:                       // store document/file
@@ -463,28 +463,28 @@ HylaFAXServer::cmd(Token t)
            logcmd(t, "%s", (const char*) s);
            // XXX file must exist if not admin, check for bad chars in pathname
            storeCmd(s, "w");
-           return (TRUE);
+           return (true);
        }
        break;
     case T_APPE:                       // append to document/file
        if (pathname_param(s)) {
            logcmd(t, "%s", (const char*) s);
            storeCmd(s, "a");
-           return (TRUE);
+           return (true);
        }
        break;
     case T_STOT:                       // store uniquely named document/file
        if (CRLF()) {
            logcmd(t);
-           storeUniqueCmd(TRUE);
-           return (TRUE);
+           storeUniqueCmd(true);
+           return (true);
        }
        break;
     case T_STOU:                       // store uniquely named document/file
        if (CRLF()) {
            logcmd(t);
-           storeUniqueCmd(FALSE);
-           return (TRUE);
+           storeUniqueCmd(false);
+           return (true);
        }
        break;
     case T_LIST:                       // list directory/file
@@ -495,47 +495,47 @@ HylaFAXServer::cmd(Token t)
                listCmd(".");
            else
                nlstCmd(".");
-           return (TRUE);
+           return (true);
        } else if (pathname_param(s)) {
            logcmd(t, "%s", (const char*) s);
            if (t == T_LIST)
                listCmd(s);
            else
                nlstCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_CWD:                                // change working directory
        if (opt_CRLF()) {
            logcmd(t);
            cwdCmd("/");
-           return (TRUE);
+           return (true);
        } else if (pathname_param(s)) {
            logcmd(t, "%s", (const char*) s);
            cwdCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_CDUP:                       // CWD ..
        logcmd(t);
        cwdCmd("..");
-       return (TRUE);
+       return (true);
     case T_PWD:                                // print working directory
        if (CRLF()) {
            logcmd(t);
            pwdCmd();
-           return (TRUE);
+           return (true);
        }
        break;
     case T_STAT:                       // stat file/server status
        if (opt_CRLF()) {
            logcmd(t);
            statusCmd();
-           return (TRUE);
+           return (true);
        } else if (checklogin(T_STAT) && pathname_param(s)) {
            logcmd(t, "%s", (const char*) s);
            statFileCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_SIZE:                       // return file size
@@ -546,44 +546,44 @@ HylaFAXServer::cmd(Token t)
                reply(550, "%s: not a plain file.", (const char*) s);
            else
                reply(213, "%lu", (u_long) sb.st_size);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_CHMOD:                      // set file protection
        if (SP() && STRING(s, "filename") && SP() && NUMBER(n)) {
            chmodCmd(s, (u_int) n);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_MDTM:                       // return file last modification time
        if (pathname_param(s)) {
            logcmd(t, "%s", (const char*) s);
            mdtmCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_DELE:                       // delete file/document
        if (pathname_param(s)) {
            logcmd(t, "%s", (const char*) s);
            deleCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_ABOR:                       // abort active command/incoming call
        if (opt_CRLF()) {
            logcmd(t);
            ack(225, cmdToken(t));
-           return (TRUE);
+           return (true);
        } else if (checkadmin(T_ABOR) && string_param(s, "modem")) {
            abortCallCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_HELP:                       // return help
        if (opt_CRLF()) {
            logcmd(t);
            helpCmd(cmdtab, (char*) NULL);
-           return (TRUE);
+           return (true);
        } else if (string_param(s, "command name")) {
            logcmd(t, "%s", (const char*) s);
            s.raisecase();
@@ -593,122 +593,122 @@ HylaFAXServer::cmd(Token t)
                helpCmd(parmtab, NULL);
            else
                helpCmd(cmdtab, s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JNEW:                       // create new job
        if (CRLF()) {
            newJobCmd();
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JOB:                                // select current job
        if (job_param(s)) {
            setCurrentJob(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JREST:                      // reset job state
        if (job_param(s)) {
            resetJob(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JDELE:                      // delete job
        if (job_param(s)) {
            deleteJob(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JINTR:                      // interrupt job
        if (job_param(s)) {
            interruptJob(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JKILL:                      // kill job
        if (job_param(s)) {
            killJob(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JSUSP:                      // suspend job
        if (job_param(s)) {
            suspendJob(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JSUB:                       // submit job
        if (job_param(s)) {
            submitJob(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JWAIT:                      // wait for job
        if (job_param(s)) {
            waitForJob(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JGNEW:                      // create job group
        if (CRLF()) {
            curJob->groupid = curJob->jobid;
            ack(200, cmdToken(t));
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JGREST:                     // reset current job group state
        if (CRLF()) {
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JGRP:                       // select current job group
        if (jgrp_param(s)) {
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JGDELE:                     // delete job group
        if (jgrp_param(s)) {
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JGINTR:                     // interrupt job group
        if (jgrp_param(s)) {
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JGKILL:                     // kill job group
        if (jgrp_param(s)) {
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JGSUSP:                     // suspend job group
        if (jgrp_param(s)) {
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JGSUB:                      // submit job group
        if (jgrp_param(s)) {
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JGWAIT:                     // wait for job group
        if (jgrp_param(s)) {
-           return (TRUE);
+           return (true);
        }
        break;
     case T_NOOP:                       // no-op
        if (CRLF()) {
            logcmd(t);
            ack(200, cmdToken(t));
-           return (TRUE);
+           return (true);
        }
        break;
     case T_IDLE:                       // set/query idle timeout
        if (opt_CRLF()) {
            logcmd(t);
            reply(213, "%u seconds.", idleTimeout);
-           return (TRUE);
+           return (true);
        } else if (number_param(n)) {
            logcmd(t, "%lu", n);
            if (n > maxIdleTimeout && !IS(PRIVILEGED)) {
@@ -719,7 +719,7 @@ HylaFAXServer::cmd(Token t)
                idleTimeout = (int) n;
                reply(213, "Idle timeout set to %u.", idleTimeout);
            }
-           return (TRUE);
+           return (true);
        }
        break;
     case T_QUIT:                       // terminate session
@@ -727,14 +727,14 @@ HylaFAXServer::cmd(Token t)
            logcmd(t);
            reply(221, "Goodbye.");
            dologout(0);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_TZONE:                      // set/query timezone usage
        if (opt_CRLF()) {
            reply(200, "Time values are handled in %s.", 
                IS(USEGMT) ? "GMT" : tzname[0]);
-           return (TRUE);
+           return (true);
        } else if (string_param(s, "timezone specification")) {
            logcmd(t, "%s", (const char*) s);
            s.raisecase();
@@ -748,7 +748,7 @@ HylaFAXServer::cmd(Token t)
                reply(503, "Unknown timezone specification %s.",
                    (const char*) s);
            }
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JOBFMT:                     // query/specify job format string
@@ -762,7 +762,7 @@ HylaFAXServer::cmd(Token t)
                t == T_MODEMFMT ? (const char*) modemFormat :
                                  (const char*) fileFormat
            );
-           return (TRUE);
+           return (true);
        } else if (string_param(s, "format-string")) {
            if (t == T_JOBFMT)
                jobFormat = s;
@@ -773,7 +773,7 @@ HylaFAXServer::cmd(Token t)
            else if (t == T_FILEFMT)
                fileFormat = s;
            ack(200, cmdToken(t));
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JPARM:                      // set/query job parameter
@@ -781,7 +781,7 @@ HylaFAXServer::cmd(Token t)
            logcmd(T_JPARM);
            if (checkJobState(curJob))
                jstatCmd(*curJob);
-           return (TRUE);
+           return (true);
        } else if (SP() && getToken(T_STRING, "parameter name")) {
            tokenBody.raisecase();
            const tab* p = lookup(parmtab, N(parmtab), tokenBody);
@@ -828,7 +828,7 @@ HylaFAXServer::cmd(Token t)
            else if (!string_param(how, "answer-how"))
                break;
            answerCallCmd(s, how);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_CHOWN:                      // assign file ownership
@@ -836,7 +836,7 @@ HylaFAXServer::cmd(Token t)
            fxStr who;
            if (string_param(who, "user")) {
                chownCmd(s, who);
-               return (TRUE);
+               return (true);
            }
        }
        break;
@@ -848,13 +848,13 @@ HylaFAXServer::cmd(Token t)
            else if (!SP() || !multi_STRING(reason))
                break;
            disableModemCmd(s, reason);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_ENABLE:                     // enable outbound-usage of modem
        if (checkadmin(T_ENABLE) && string_param(s, "modem")) {
            enableModemCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_SHUT:                       // shutdown server
@@ -868,14 +868,14 @@ HylaFAXServer::cmd(Token t)
            if (s.length() == 3 && strcasecmp(cp, "NOW") == 0) {
                time_t t = Sys::now();
                shutCmd(*localtime(&t), reason);
-               return (TRUE);
+               return (true);
            } else if (s.length() == 4 && checkNUMBER(cp)) {
                time_t t = Sys::now();
                struct tm tm = *localtime(&t);
                tm.tm_hour = 60*60*twodigits(cp, 60);
                tm.tm_min  =    60*twodigits(cp+2, 60);
                shutCmd(tm, reason);
-               return (TRUE);
+               return (true);
            } else if (s.length() == 12 && checkNUMBER(cp)) {
                struct tm tm;
                tm.tm_sec  = 0;
@@ -885,7 +885,7 @@ HylaFAXServer::cmd(Token t)
                tm.tm_mon  = twodigits(cp+4, 12) -1;
                tm.tm_year = fourdigits(cp+0) - 1900;
                shutCmd(tm, reason);
-               return (TRUE);
+               return (true);
            } else
                syntaxError("bad time specification");
        }
@@ -897,17 +897,17 @@ HylaFAXServer::cmd(Token t)
                , (const char*) hostname
                , (const char*) hostaddr
            );
-           return (TRUE);
+           return (true);
        }
        break;
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Site-specific protocol commands (one line).
  */
-fxBool
+bool
 HylaFAXServer::site_cmd(Token t)
 {
     fxStr s;
@@ -918,15 +918,15 @@ HylaFAXServer::site_cmd(Token t)
            fxStr pass;
            if (opt_CRLF()) {
                addUserCmd(s, "", "");
-               return (TRUE);
+               return (true);
            } else if (SP() && STRING(pass, "password")) {
                fxStr apass;
                if (opt_CRLF()) {
                    addUserCmd(s, pass, "");
-                   return (TRUE);
+                   return (true);
                } else if (string_param(apass, "admin-password")) {
                    addUserCmd(s, pass, apass);
-                   return (TRUE);
+                   return (true);
                }
            }
        }
@@ -934,19 +934,19 @@ HylaFAXServer::site_cmd(Token t)
     case T_DELUSER:
        if (checkadmin(T_DELUSER) && string_param(s, "user-spec")) {
            delUserCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_DELMODEM:
        if (checkadmin(T_DELMODEM) && string_param(s, "modem")) {
            delModemCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_ADDMODEM:
        if (checkadmin(T_ADDMODEM) && string_param(s, "modem")) {
            addModemCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_CONFIG:
@@ -954,10 +954,10 @@ HylaFAXServer::site_cmd(Token t)
            fxStr config;
            if (opt_CRLF()) {
                configQueryCmd(s);
-               return (TRUE);
+               return (true);
            } else if (SP() && multi_STRING(config)) {
                configCmd(s, config);
-               return (TRUE);
+               return (true);
            }
        }
        break;
@@ -965,43 +965,43 @@ HylaFAXServer::site_cmd(Token t)
        if (string_param(s, "trigger-spec")) {
            logcmd(t, s);
            triggerCmd("%s", (const char*) s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_HELP:                       // return help
        if (opt_CRLF()) {
            helpCmd(sitetab, (char*) NULL);
-           return (TRUE);
+           return (true);
        } else if (string_param(s, "command name")) {
            logcmd(T_SITE, "HELP %s", (const char*) s);
            s.raisecase();
            helpCmd(sitetab, s);
-           return (TRUE);
+           return (true);
        }
        break;
     }
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 HylaFAXServer::param_cmd(Token t)
 {
     fxStr s;
     long n;
     time_t ticks;
-    fxBool b;
+    bool b;
 
     switch (t) {
     case T_SENDTIME:                   // time to send job
        if (opt_CRLF()) {
            replyJobParamValue(*curJob, 213, t);
-           return (TRUE);
+           return (true);
        } else if (SP() && getToken(T_STRING, "time specification")) {
            tokenBody.raisecase();
            if (tokenBody == "NOW") {
                if (CRLF() && setJobParameter(*curJob, t, (time_t) 0)) {
                    reply(213, "%s set to NOW.", parmToken(t));
-                   return (TRUE);
+                   return (true);
                }
            } else {
                pushToken(T_STRING);    // XXX
@@ -1021,7 +1021,7 @@ HylaFAXServer::param_cmd(Token t)
                        );
                    } else
                        reply(213, "%s set to NOW.", parmToken(t));
-                   return (TRUE);
+                   return (true);
                }
            }
        }
@@ -1029,7 +1029,7 @@ HylaFAXServer::param_cmd(Token t)
     case T_LASTTIME:                   // time to kill job
        if (opt_CRLF()) {
            replyJobParamValue(*curJob, 213, t);
-           return (TRUE);
+           return (true);
        } else if (timespec_param(6, ticks) &&
          setJobParameter(*curJob, t, ticks)) {
            reply(213, "%s set to %02d%02d%02d."
@@ -1038,13 +1038,13 @@ HylaFAXServer::param_cmd(Token t)
                , (ticks/(60*60))%24
                , (ticks/60)%60
            );
-           return (TRUE);
+           return (true);
        }
        break;
     case T_RETRYTIME:                  // retry interval for job
        if (opt_CRLF()) {
            replyJobParamValue(*curJob, 213, t);
-           return (TRUE);
+           return (true);
        } else if (timespec_param(4, ticks) &&
          setJobParameter(*curJob, t, ticks)) {
            reply(213, "%s set to %02d%02d."
@@ -1052,7 +1052,7 @@ HylaFAXServer::param_cmd(Token t)
                , ticks/60
                , ticks%60
            );
-           return (TRUE);
+           return (true);
        }
        break;
     case T_MAXDIALS:
@@ -1073,11 +1073,11 @@ HylaFAXServer::param_cmd(Token t)
     case T_TOTDIALS:
        if (opt_CRLF()) {
            replyJobParamValue(*curJob, 213, t);
-           return (TRUE);
+           return (true);
        } else if (number_param(n) &&
          setJobParameter(*curJob, t, (u_short) n)) {
            reply(213, "%s set to %u.", parmToken(t), n);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_NOTIFYADDR:
@@ -1106,11 +1106,11 @@ HylaFAXServer::param_cmd(Token t)
     case T_COMMID:
        if (opt_CRLF()) {
            replyJobParamValue(*curJob, 213, t);
-           return (TRUE);
+           return (true);
        } else if (SP() && multi_STRING(s) && CRLF() &&
          setJobParameter(*curJob, t, s)) {
            reply(213, "%s set to \"%s\".", parmToken(t), (const char*) s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_USE_ECM:
@@ -1118,75 +1118,75 @@ HylaFAXServer::param_cmd(Token t)
     case T_USE_CONTCOVER:
        if (opt_CRLF()) {
            replyJobParamValue(*curJob, 213, t);
-           return (TRUE);
+           return (true);
        } else if (boolean_param(b) &&
          setJobParameter(*curJob, t, b)) {
            reply(213, "%s set to %s.", parmToken(t), b ? "YES" : "NO");
-           return (TRUE);
+           return (true);
        }
        break;
     case T_CHOPTHRESH:
        if (opt_CRLF()) {
            replyJobParamValue(*curJob, 213, t);
-           return (TRUE);
+           return (true);
        } else if (string_param(s, "floating point number") &&
          setJobParameter(*curJob, t, (float) atof(s))) {
            reply(213, "%s set to %g.", parmToken(t), (float) atof(s));
-           return (TRUE);
+           return (true);
        }
        break;
      case T_COVER:                     // specify/query cover page document
        if (opt_CRLF()) {
            replyJobParamValue(*curJob, 213, t);
-           return (TRUE);
+           return (true);
        } else if (pathname_param(s)) {
            addCoverDocument(*curJob, s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_DOCUMENT:                   // specify/query normal document
        if (opt_CRLF()) {
            replyJobParamValue(*curJob, 213, t);
-           return (TRUE);
+           return (true);
        } else if (pathname_param(s)) {
            addDocument(*curJob, s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_POLL:                       // specify/query poll operation
        if (opt_CRLF()) {
            replyJobParamValue(*curJob, 213, t);
-           return (TRUE);
+           return (true);
        } else if (SP() && STRING(s, "polling selector")) {
            fxStr pwd;
            if (opt_CRLF()) {
                addPollOp(*curJob, s, "");      // sep but no pwd
-               return (TRUE);
+               return (true);
            } else if (SP() && pwd_param(pwd) && CRLF()) {
                addPollOp(*curJob, s, pwd);     // sep & pwd
-               return (TRUE);
+               return (true);
            }
        }
        break;
     case T_HELP:                       // return help
        if (opt_CRLF()) {
            helpCmd(parmtab, (char*) NULL);
-           return (TRUE);
+           return (true);
        } else if (string_param(s, "parameter name")) {
            s.raisecase();
            logcmd(T_JPARM, "HELP %s", (const char*) s);
            helpCmd(parmtab, s);
-           return (TRUE);
+           return (true);
        }
        break;
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Collect a single string parameter.
  */
-fxBool
+bool
 HylaFAXServer::string_param(fxStr& s, const char* what)
 {
     return SP() && STRING(s, what) && CRLF();
@@ -1195,7 +1195,7 @@ HylaFAXServer::string_param(fxStr& s, const char* what)
 /*
  * Collect a single number parameter.
  */
-fxBool
+bool
 HylaFAXServer::number_param(long& n)
 {
     return SP() && NUMBER(n) && CRLF();
@@ -1204,8 +1204,8 @@ HylaFAXServer::number_param(long& n)
 /*
  * Collect a single boolean parameter.
  */
-fxBool
-HylaFAXServer::boolean_param(fxBool& b)
+bool
+HylaFAXServer::boolean_param(bool& b)
 {
     return SP() && BOOLEAN(b) && CRLF();
 }
@@ -1213,7 +1213,7 @@ HylaFAXServer::boolean_param(fxBool& b)
 /*
  * Collect a single time parameter.
  */
-fxBool
+bool
 HylaFAXServer::timespec_param(int ndigits, time_t& t)
 {
     return SP() && TIMESPEC(ndigits, t) && CRLF();
@@ -1222,7 +1222,7 @@ HylaFAXServer::timespec_param(int ndigits, time_t& t)
 /*
  * File manipulation command.
  */
-fxBool
+bool
 HylaFAXServer::pathname_param(fxStr& s)
 {
     return SP() && pathname(s) && CRLF();
@@ -1231,48 +1231,48 @@ HylaFAXServer::pathname_param(fxStr& s)
 /*
  * Job control commands.
  */
-fxBool
+bool
 HylaFAXServer::job_param(fxStr& jid)
 {
     if (opt_CRLF()) {
        jid = curJob->jobid;
-       return (TRUE);
+       return (true);
     } else if (SP() && STRING(jid, "job identifer") && CRLF()) {
        jid.lowercase();
-       return (TRUE);
+       return (true);
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Job group control commands.
  */
-fxBool
+bool
 HylaFAXServer::jgrp_param(fxStr& jgid)
 {
     if (opt_CRLF()) {
        jgid = curJob->groupid;
-       return (TRUE);
+       return (true);
     } else if (SP() && STRING(jgid, "job group identifier") && CRLF()) {
        jgid.lowercase();
-       return (TRUE);
+       return (true);
     }
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 HylaFAXServer::pwd_param(fxStr& s)
 {
     return STRING(s, "polling password");
 }
 
-fxBool
+bool
 HylaFAXServer::pathname(fxStr& s)
 {
     return STRING(s, "pathname");
 }
 
-fxBool
+bool
 HylaFAXServer::TIMESPEC(u_int len, time_t& result)
 {
     if (getToken(T_STRING, "time specification")) {
@@ -1303,44 +1303,44 @@ HylaFAXServer::TIMESPEC(u_int len, time_t& result)
                    result = 60*twodigits(cp, 60)
                           +    twodigits(cp+2, 60);
                }
-               return (TRUE);
+               return (true);
            }
        } else
            syntaxError(fxStr::format(
                "bad time specification (expecting %d digits)", len));
     }
-    return (FALSE);
+    return (false);
 }
 
-fxBool
-HylaFAXServer::BOOLEAN(fxBool& b)
+bool
+HylaFAXServer::BOOLEAN(bool& b)
 {
     if (getToken(T_STRING, "boolean")) {
        tokenBody.raisecase();
        if (tokenBody == "YES") {
-           b = TRUE;
-           return (TRUE);
+           b = true;
+           return (true);
        } else if (tokenBody == "NO") {
-           b = FALSE;
-           return (TRUE);
+           b = false;
+           return (true);
        } else
            syntaxError("invalid boolean value, use YES or NO");
     }
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 HylaFAXServer::checkToken(Token wanted)
 {
     Token t = nextToken();
     if (t != wanted) {
        pushToken(t);
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
-fxBool
+bool
 HylaFAXServer::getToken(Token wanted, const char* expected)
 {
     Token t = nextToken();
@@ -1349,44 +1349,44 @@ HylaFAXServer::getToken(Token wanted, const char* expected)
            syntaxError("unmatched quote mark");
        else
            syntaxError(fxStr::format("expecting %s", expected));
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
-fxBool HylaFAXServer::SP()             { return getToken(T_SP, "<SP>"); }
-fxBool HylaFAXServer::COMMA()          { return getToken(T_COMMA, "\",\""); }
-fxBool HylaFAXServer::CRLF()           { return getToken(T_CRLF, "<CRLF>"); }
-fxBool HylaFAXServer::opt_CRLF()       { return checkToken(T_CRLF); }
+bool HylaFAXServer::SP()               { return getToken(T_SP, "<SP>"); }
+bool HylaFAXServer::COMMA()            { return getToken(T_COMMA, "\",\""); }
+bool HylaFAXServer::CRLF()             { return getToken(T_CRLF, "<CRLF>"); }
+bool HylaFAXServer::opt_CRLF() { return checkToken(T_CRLF); }
 
-fxBool
+bool
 HylaFAXServer::opt_STRING(fxStr& s)
 {
     if (checkToken(T_STRING)) {
        s = tokenBody;
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
-fxBool
+bool
 HylaFAXServer::STRING(fxStr& s, const char* what)
 {
     if (getToken(T_STRING, what != NULL ? what : "<STRING>")) {
        s = tokenBody;
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
-fxBool
+bool
 HylaFAXServer::multi_STRING(fxStr& s)
 {
     if (!STRING(s))
-       return (FALSE);
+       return (false);
     for (;;) {
        switch (nextToken()) {
        case T_CRLF:
            pushToken(T_CRLF);
-           return (TRUE);
+           return (true);
        case T_COMMA:
            s.append(',');
            break;
@@ -1398,12 +1398,12 @@ HylaFAXServer::multi_STRING(fxStr& s)
            break;
        case T_LEXERR:
            syntaxError("unmatched quote mark");
-           return (FALSE);
+           return (false);
        }
     }
 }
 
-fxBool
+bool
 HylaFAXServer::checkNUMBER(const char* cp)
 {
     if (cp[0] == '-' || cp[0] == '+')
@@ -1411,21 +1411,21 @@ HylaFAXServer::checkNUMBER(const char* cp)
     for (; *cp; cp++)
        if (!isdigit(*cp)) {
            syntaxError("invalid number");
-           return (FALSE);
+           return (false);
        }
-    return (TRUE);
+    return (true);
 }
 
-fxBool
+bool
 HylaFAXServer::NUMBER(long& n)
 {
     if (!getToken(T_STRING, "decimal number")) {
-       return (FALSE);
+       return (false);
     } else if (!checkNUMBER(tokenBody)) {
-       return (FALSE);
+       return (false);
     } else {
        n = strtol(tokenBody, NULL, 0);
-       return (TRUE);
+       return (true);
     }
 }
 
@@ -1448,7 +1448,7 @@ HylaFAXServer::syntaxError(const char* msg)
  * be received or return EOF.
  */
 int
-HylaFAXServer::getChar(fxBool waitForInput)
+HylaFAXServer::getChar(bool waitForInput)
 {
     if (recvCC <= 0) {
        // enable non-blocking i/o on control channel
@@ -1502,33 +1502,33 @@ HylaFAXServer::pushCmdData(const char* data, int n)
  * Return the next line of data received on the control
  * channel, ignoring any Telnet protocol command sequences.
  */
-fxBool
-HylaFAXServer::getCmdLine(char* s, int n, fxBool waitForInput)
+bool
+HylaFAXServer::getCmdLine(char* s, int n, bool waitForInput)
 {
     char* cp = s;
     cpos = 0;
     while (n > 1) {
        int c = getChar(cp != s || waitForInput);
        if (c == EOF)
-           return (FALSE);
+           return (false);
        if (c == IAC) {                 // telnet protocol command
-           c = getChar(TRUE);
+           c = getChar(true);
            if (c == EOF)
-               return (FALSE);
+               return (false);
            switch (c&0377) {
            case WILL:
            case WONT:
-               c = getChar(TRUE);      // telnet option
+               c = getChar(true);      // telnet option
                if (c == EOF)
-                   return (FALSE);
+                   return (false);
                printf("%c%c%c", IAC, DONT, c&0377);
                (void) fflush(stdout);
                continue;
            case DO:
            case DONT:
-               c = getChar(TRUE);      // telnet option
+               c = getChar(true);      // telnet option
                if (c == EOF)
-                   return (FALSE);
+                   return (false);
                printf("%c%c%c", IAC, WONT, c&0377);
                (void) fflush(stdout);
                continue;
@@ -1551,7 +1551,7 @@ HylaFAXServer::getCmdLine(char* s, int n, fxBool waitForInput)
     *cp = '\0';
     if (TRACE(PROTOCOL))
         logDebug("command: %s", s);
-    return (TRUE);
+    return (true);
 }
 
 void
@@ -1719,25 +1719,25 @@ HylaFAXServer::cmdFailure(Token t, const char* why)
     }
 }
 
-fxBool
+bool
 HylaFAXServer::checklogin(Token t)
 {
     if (!IS(LOGGEDIN)) {
        cmdFailure(t, "not logged in");
        reply(530, "Please login with USER and PASS.");
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
-fxBool
+bool
 HylaFAXServer::checkadmin(Token t)
 {
     if (checklogin(t)) {
        if (IS(PRIVILEGED))
-           return (TRUE);
+           return (true);
        cmdFailure(t, "user is not privileged");
        reply(530, "Please use ADMIN to establish administrative privileges.");
     }
-    return (FALSE);
+    return (false);
 }
index cedb745d617276786e07bcdd7e6542b899abf8dc..d355711b1beff9a0b64cfd5cde673dc935279f3a 100644 (file)
 
 RecvInfo::RecvInfo()
 {
-    beingReceived = FALSE;
+    beingReceived = false;
     recvTime = 0;
 }
 RecvInfo::RecvInfo(const char* qf)
 {
     qfile = qf;
-    beingReceived = FALSE;
+    beingReceived = false;
     recvTime = 0;
 }
 RecvInfo::~RecvInfo() {}
 
 fxIMPLEMENT_StrKeyPtrValueDictionary(RecvInfoDict, RecvInfo*)
 
-static fxBool
+static bool
 isFAXImage(TIFF* tif)
 {
     uint16 w;
     if (TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &w) && w != 1)
-       return (FALSE);
+       return (false);
     if (TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &w) && w != 1)
-       return (FALSE);
+       return (false);
     if (!TIFFGetField(tif, TIFFTAG_COMPRESSION, &w) ||
       (w != COMPRESSION_CCITTFAX3 && w != COMPRESSION_CCITTFAX4))
-       return (FALSE);
+       return (false);
     if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &w) ||
       (w != PHOTOMETRIC_MINISWHITE && w != PHOTOMETRIC_MINISBLACK))
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 
 /*
  * Construct receive information from a file's contents.
  */
-fxBool
+bool
 HylaFAXServer::getRecvDocStatus(RecvInfo& ri)
 {
     int fd = Sys::open(ri.qfile, O_RDWR);      // RDWR for flock emulation
     if (fd < 0)
-       return (FALSE);
+       return (false);
     /*
      * Files that are being received are locked
      * for exclusive use by faxgetty.  
@@ -96,7 +96,7 @@ HylaFAXServer::getRecvDocStatus(RecvInfo& ri)
      */
     if (!isFAXImage(tif)) {
        TIFFClose(tif);
-       return (FALSE);
+       return (false);
     }
     /*
      * Should be a received facsimile, build up status.
@@ -153,10 +153,10 @@ HylaFAXServer::getRecvDocStatus(RecvInfo& ri)
 #endif
     } while (TIFFReadDirectory(tif));
     TIFFClose(tif);
-    return (TRUE);
+    return (true);
 }
 
-fxBool
+bool
 HylaFAXServer::isVisibleRecvQFile(const char* filename, const struct stat&)
 {
     return (strncmp(filename, "fax", 3) == 0);
index a956790c4ecd99d3abbfca178e05c34355468c38..bcc0a6696983168e052a67fe8d1f671ab5f9f8af 100644 (file)
@@ -54,7 +54,7 @@ SNPPSuperServer::SNPPSuperServer(const char* p, int bl)
 {}
 SNPPSuperServer::~SNPPSuperServer() {}
 
-fxBool
+bool
 SNPPSuperServer::startServer(void)
 {
     /*
@@ -86,7 +86,7 @@ SNPPSuperServer::startServer(void)
            (void) listen(s, getBacklog());
            (void) seteuid(ouid);
            Dispatcher::instance().link(s, Dispatcher::ReadMask, this);
-           return (TRUE);                              // success
+           return (true);                              // success
        }
        Sys::close(s);
        logError("HylaFAX %s: bind (port %u): %m",
@@ -94,7 +94,7 @@ SNPPSuperServer::startServer(void)
     } else
        logError("HylaFAX %s: socket: %m", getKind());
     (void) seteuid(ouid);
-    return (FALSE);
+    return (false);
 }
 HylaFAXServer* SNPPSuperServer::newChild(void) { return new SNPPServer; }
 
@@ -116,7 +116,7 @@ SNPPServer::open(void)
        dologout(-1);
     }
     ctrlFlags = fcntl(STDIN_FILENO, F_GETFL);  // for parser
-    if (isShutdown(TRUE)) {
+    if (isShutdown(true)) {
        reply(421, "%s SNPP server unavailable; try again later.",
            (const char*) hostname);
        dologout(-1);
@@ -147,7 +147,7 @@ SNPPServer::initDefaultJob(void)
 void
 SNPPServer::initSNPPJob(void)
 {
-    defJob.queued = FALSE;             // jobs not queued--per protocol
+    defJob.queued = false;             // jobs not queued--per protocol
     defJob.maxdials = SNPP_DEFREDIALS; // configuration defaults...
     defJob.maxtries = SNPP_DEFRETRIES;
     defJob.killtime = 60*killMap[SNPP_DEFLEVEL];
@@ -161,7 +161,7 @@ SNPPServer::resetState(void)
 {
     initDefaultJob();                  // default job state
     msgFile = "";
-    haveText = FALSE;                  // no message text yet
+    haveText = false;                  // no message text yet
     msgs.resize(0);                    // purge any message refs
 }
 
@@ -192,7 +192,7 @@ SNPPServer::dologout(int status)
     InetFaxServer::dologout(status);
 }
 
-static inline fxBool
+static inline bool
 isMagic(char c)
 {
     return (c == '[' || c == ']' || c == '*' || c == '.' || c == '^' ||
@@ -237,7 +237,7 @@ subRHS(fxStr& result, const RegEx& re, const fxStr& match)
  * to dial of the service provider and the PIN to supply
  * to the provider when talking IXO/TAP (for aliases).
  */
-fxBool
+bool
 SNPPServer::mapPagerID(const char* pagerID, fxStr& number, fxStr& pin, fxStr& emsg)
 {
     if (pagerIDMapFile != "") {
@@ -269,13 +269,13 @@ SNPPServer::mapPagerID(const char* pagerID, fxStr& number, fxStr& pin, fxStr& em
                 * that begin with '#' are ignored (i.e. comments).
                 */
                const char* pattern = cp;
-               fxBool isRE = FALSE;
+               bool isRE = false;
                for (; *cp != '\0' && !isspace(*cp); cp++)
                    if (isMagic(*cp))
-                       isRE = TRUE;
+                       isRE = true;
                if (*cp != '\0')                        // \0-term. <pattern>
                    *cp++ = '\0';
-               fxBool match;
+               bool match;
                RegEx* re;
                if (isRE) {
                    re = new RegEx(pattern);
@@ -312,9 +312,9 @@ SNPPServer::mapPagerID(const char* pagerID, fxStr& number, fxStr& pin, fxStr& em
                        s.raisecase();
                        if (s == "REJECT") {
                            emsg = fxStr::format("Invalid pager ID %s",pagerID);
-                           return (FALSE);
+                           return (false);
                        } else
-                           return (TRUE);
+                           return (true);
                    }
                }
                delete re;
@@ -330,7 +330,7 @@ SNPPServer::mapPagerID(const char* pagerID, fxStr& number, fxStr& pin, fxStr& em
        emsg = "No pager ID mapping file found";
        logError("%s", (const char*) emsg);
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -343,51 +343,51 @@ SNPPServer::mapPagerID(const char* pagerID, fxStr& number, fxStr& pin, fxStr& em
  * Standard protocol commands.
  */
 static const tab cmdtab[] = {
-{ "2WAY", T_2WAY,       TRUE,FALSE, "(preface 2-way transaction)" },
-{ "ABOR", T_ABOR,      FALSE, TRUE, "(abort operation)" },
-{ "ACKR", T_ACKREAD,    TRUE,FALSE, "0|1" },
-{ "ALER", T_ALERT,      TRUE,FALSE, "alert-level" },
-{ "CALL", T_CALLERID,    TRUE,FALSE, "caller-ID" },
-{ "COVE", T_COVERAGE,    TRUE,FALSE, "alternate-area" },
-{ "DATA", T_DATA,       TRUE, TRUE, "(specify multi-line message)" },
-{ "EXPT", T_EXPTAG,     TRUE,FALSE, "hours" },
-{ "HELP", T_HELP,      FALSE, TRUE, "[<string>]" },
-{ "HOLD", T_HOLDUNTIL,   TRUE, TRUE, "YYYYMMDDHHMMSS [+/-GMT-diff]" },
-{ "KTAG", T_KTAG,       TRUE,FALSE, "message-tag pass-code" },
-{ "LEVE", T_LEVEL,      TRUE, TRUE, "service-level" },
-{ "LOGI", T_LOGIN,     FALSE, TRUE, "username [password]" },
-{ "MCRE", T_MCRESPONSE,  TRUE,FALSE, "2-byte-code response-text" },
-{ "MESS", T_MESSAGE,    TRUE, TRUE, "message" },
-{ "MSTA", T_MSTATUS,    TRUE,FALSE, "message-tag pass-code" },
-{ "NOQU", T_NOQUEUEING,  TRUE,FALSE, "(disable message queueing)" },
-{ "PAGE", T_PAGER,      TRUE, TRUE, "pager-ID|alias [PIN]" },
-{ "PING", T_PING,       TRUE, TRUE, "pager-ID|alias" },
-{ "QUIT", T_QUIT,      FALSE, TRUE, "(terminate service)" },
-{ "RESE", T_REST,       TRUE, TRUE, "(reset state)" },
-{ "RTYP", T_RTYPE,      TRUE,FALSE, "reply-type-code" },
-{ "SEND", T_SEND,       TRUE, TRUE, "(send message)" },
-{ "SITE", T_SITE,       TRUE, TRUE, "site-cmd [arguments]" },
-{ "STAT", T_STAT,      FALSE, TRUE, "(return server status)" },
-{ "SUBJ", T_SUBJECT,    TRUE, TRUE, "message-subject" },
+{ "2WAY", T_2WAY,       true,false, "(preface 2-way transaction)" },
+{ "ABOR", T_ABOR,      false, true, "(abort operation)" },
+{ "ACKR", T_ACKREAD,    true,false, "0|1" },
+{ "ALER", T_ALERT,      true,false, "alert-level" },
+{ "CALL", T_CALLERID,    true,false, "caller-ID" },
+{ "COVE", T_COVERAGE,    true,false, "alternate-area" },
+{ "DATA", T_DATA,       true, true, "(specify multi-line message)" },
+{ "EXPT", T_EXPTAG,     true,false, "hours" },
+{ "HELP", T_HELP,      false, true, "[<string>]" },
+{ "HOLD", T_HOLDUNTIL,   true, true, "YYYYMMDDHHMMSS [+/-GMT-diff]" },
+{ "KTAG", T_KTAG,       true,false, "message-tag pass-code" },
+{ "LEVE", T_LEVEL,      true, true, "service-level" },
+{ "LOGI", T_LOGIN,     false, true, "username [password]" },
+{ "MCRE", T_MCRESPONSE,  true,false, "2-byte-code response-text" },
+{ "MESS", T_MESSAGE,    true, true, "message" },
+{ "MSTA", T_MSTATUS,    true,false, "message-tag pass-code" },
+{ "NOQU", T_NOQUEUEING,  true,false, "(disable message queueing)" },
+{ "PAGE", T_PAGER,      true, true, "pager-ID|alias [PIN]" },
+{ "PING", T_PING,       true, true, "pager-ID|alias" },
+{ "QUIT", T_QUIT,      false, true, "(terminate service)" },
+{ "RESE", T_REST,       true, true, "(reset state)" },
+{ "RTYP", T_RTYPE,      true,false, "reply-type-code" },
+{ "SEND", T_SEND,       true, true, "(send message)" },
+{ "SITE", T_SITE,       true, true, "site-cmd [arguments]" },
+{ "STAT", T_STAT,      false, true, "(return server status)" },
+{ "SUBJ", T_SUBJECT,    true, true, "message-subject" },
 };
 
 /*
  * Site-specific commands.
  */
 static const tab sitetab[] = {
-{ "FROMUSER",   T_FROM_USER,  TRUE, TRUE, "[<string>]" },
-{ "HELP",       T_HELP,      FALSE, TRUE, "[<string>]" },
-{ "IDLE",       T_IDLE,       TRUE, TRUE, "[max-idle-timeout]" },
-{ "JPARM",      T_JPARM,      TRUE, TRUE, "(print job parameter status)" },
-{ "JQUEUE",    T_JQUEUE,     TRUE, TRUE, "[on|off]" },
-{ "LASTTIME",   T_LASTTIME,  FALSE, TRUE, "[DDHHSS]" },
-{ "MAXDIALS",   T_MAXDIALS,   TRUE, TRUE, "[<number>]" },
-{ "MAXTRIES",   T_MAXTRIES,   TRUE, TRUE, "[<number>]" },
-{ "MODEM",      T_MODEM,      TRUE, TRUE, "[device|class]" },
-{ "NOTIFY",     T_NOTIFY,     TRUE, TRUE, "[NONE|DONE|REQUEUE|DONE+REQUEUE]"},
-{ "MAILADDR",   T_NOTIFYADDR, TRUE, TRUE, "[email-address]" },
-{ "RETRYTIME",  T_RETRYTIME,  TRUE, TRUE, "[HHSS]" },
-{ "SCHEDPRI",   T_SCHEDPRI,   TRUE, TRUE, "[<number>]" },
+{ "FROMUSER",   T_FROM_USER,  true, true, "[<string>]" },
+{ "HELP",       T_HELP,      false, true, "[<string>]" },
+{ "IDLE",       T_IDLE,       true, true, "[max-idle-timeout]" },
+{ "JPARM",      T_JPARM,      true, true, "(print job parameter status)" },
+{ "JQUEUE",    T_JQUEUE,     true, true, "[on|off]" },
+{ "LASTTIME",   T_LASTTIME,  false, true, "[DDHHSS]" },
+{ "MAXDIALS",   T_MAXDIALS,   true, true, "[<number>]" },
+{ "MAXTRIES",   T_MAXTRIES,   true, true, "[<number>]" },
+{ "MODEM",      T_MODEM,      true, true, "[device|class]" },
+{ "NOTIFY",     T_NOTIFY,     true, true, "[NONE|DONE|REQUEUE|DONE+REQUEUE]"},
+{ "MAILADDR",   T_NOTIFYADDR, true, true, "[email-address]" },
+{ "RETRYTIME",  T_RETRYTIME,  true, true, "[HHSS]" },
+{ "SCHEDPRI",   T_SCHEDPRI,   true, true, "[<number>]" },
 };
 
 static const tab*
@@ -421,15 +421,15 @@ SNPPServer::siteToken(Token t)
     return tokenName(sitetab, N(sitetab), t);
 }
 
-fxBool
+bool
 SNPPServer::checklogin(Token t)
 {
     if (!IS(LOGGEDIN)) {
        cmdFailure(t, "not logged in");
        reply(530, "Please login with LOGIN.");
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 /*
@@ -528,7 +528,7 @@ SNPPServer::parse()
 /*
  * Protocol command (one line).
  */
-fxBool
+bool
 SNPPServer::cmd(Token t)
 {
     fxStr s;
@@ -540,21 +540,21 @@ SNPPServer::cmd(Token t)
        if (CRLF()) {
            logcmd(t);
            ack(250, cmdToken(t));
-           return (TRUE);
+           return (true);
        }
        break;
     case T_DATA:                       // submit multi-line message data
        if (CRLF()) {
            logcmd(t);
            dataCmd();
-           return (TRUE);
+           return (true);
        }
        break;
     case T_HELP:                       // return help
        if (opt_CRLF()) {
            logcmd(t);
            helpCmd(cmdtab, (char*) NULL);
-           return (TRUE);
+           return (true);
        } else if (string_param(s, "command name")) {
            logcmd(t, "%s", (const char*) s);
            s.raisecase();
@@ -562,14 +562,14 @@ SNPPServer::cmd(Token t)
                helpCmd(sitetab, NULL);
            else
                helpCmd(cmdtab, s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_HOLDUNTIL:                  // set time to send
        if (SP() && SNPPTime(tv)) {
            if (opt_CRLF()) {
                holdCmd(tv);
-               return (TRUE);
+               return (true);
            } else if (string_param(s, "GMT-difference")) {
                // conver GMT offset to numeric value
                int sign = 1;
@@ -580,7 +580,7 @@ SNPPServer::cmd(Token t)
                    cp++;
                time_t off = (time_t) (strtoul(cp, 0, 10)*60 / 100);
                holdCmd(tv + sign*off);
-               return (TRUE);
+               return (true);
            }
        }
        break;
@@ -588,7 +588,7 @@ SNPPServer::cmd(Token t)
        if (number_param(n)) {
            logcmd(t, "%lu", n);
            serviceLevel((u_int) n);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_LOGIN:                      // login as user
@@ -597,11 +597,11 @@ SNPPServer::cmd(Token t)
            if (opt_CRLF()) {
                logcmd(t, (const char*) s);
                loginCmd(s);
-               return (TRUE);
+               return (true);
            } else if (string_param(pwd, "password")) {
                logcmd(t, "%s <passwd>", (const char*) s);
                loginCmd(s, pwd);
-               return (TRUE);
+               return (true);
            }
        }
        break;
@@ -609,7 +609,7 @@ SNPPServer::cmd(Token t)
        if (SP() && multi_STRING(s) && CRLF()) {
            logcmd(t, "%s", (const char*) s);
            messageCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_PAGER:                      // specify destination pager ID
@@ -618,11 +618,11 @@ SNPPServer::cmd(Token t)
            if (opt_CRLF()) {
                logcmd(t, "%s", (const char*) s);
                pagerCmd(s);
-               return (TRUE);
+               return (true);
            } else if (string_param(pwd, "password/PIN")) {
                logcmd(t, "%s <passwd/PIN>", (const char*) s);
                pagerCmd(s, pwd);
-               return (TRUE);
+               return (true);
            }
        }
        break;
@@ -630,7 +630,7 @@ SNPPServer::cmd(Token t)
        if (string_param(s, "pager-ID")) {
            logcmd(t, "%s", (const char*) s);
            pingCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_QUIT:                       // terminate session
@@ -638,7 +638,7 @@ SNPPServer::cmd(Token t)
            logcmd(t);
            reply(221, "Goodbye.");
            dologout(0);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_REST:                       // reset server state
@@ -650,7 +650,7 @@ SNPPServer::cmd(Token t)
        if (CRLF()) {
            logcmd(t);
            sendCmd();
-           return (TRUE);
+           return (true);
        }
        break;
     case T_SITE:                       // site-specific command
@@ -670,37 +670,37 @@ SNPPServer::cmd(Token t)
        if (CRLF()) {
            logcmd(t);
            statusCmd();
-           return (TRUE);
+           return (true);
        }
        break;
     case T_SUBJECT:                    // message subject
        if (SP() && multi_STRING(s) && CRLF()) {
            logcmd(t, "%s", (const char*) s);
            subjectCmd(s);
-           return (TRUE);
+           return (true);
        }
        break;
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Site-specific protocol commands (one line).
  */
-fxBool
+bool
 SNPPServer::site_cmd(Token t)
 {
     fxStr s;
     long n;
     time_t tv;
-    fxBool b;
+    bool b;
 
     switch (t) {
     case T_IDLE:                       // set/query idle timeout
        if (opt_CRLF()) {
            logcmd(t);
            reply(250, "%u seconds.", idleTimeout);
-           return (TRUE);
+           return (true);
        } else if (number_param(n)) {
            logcmd(t, "%lu", n);
            if (n > maxIdleTimeout && !IS(PRIVILEGED)) {
@@ -711,18 +711,18 @@ SNPPServer::site_cmd(Token t)
                idleTimeout = (int) n;
                reply(250, "Idle timeout set to %u.", idleTimeout);
            }
-           return (TRUE);
+           return (true);
        }
        break;
     case T_HELP:                       // return help
        if (opt_CRLF()) {
            helpCmd(sitetab, (char*) NULL);
-           return (TRUE);
+           return (true);
        } else if (string_param(s, "command name")) {
            logcmd(T_SITE, "HELP %s", (const char*) s);
            s.raisecase();
            helpCmd(sitetab, s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JQUEUE:
@@ -730,7 +730,7 @@ SNPPServer::site_cmd(Token t)
            logcmd(t, "%s", b ? "YES" : "NO");
            defJob.queued = b;
            reply(250, "Job will%s be queued.", b ? "" : " not");
-           return (TRUE);
+           return (true);
        }
        break;
     case T_FROM_USER:
@@ -740,7 +740,7 @@ SNPPServer::site_cmd(Token t)
        if (SP() && multi_STRING(s) && CRLF() && setJobParameter(defJob, t, s)) {
            logcmd(t, "%s", (const char*) s);
            reply(250, "%s set to \"%s\".", parmToken(t), (const char*) s);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_MAXDIALS:
@@ -749,7 +749,7 @@ SNPPServer::site_cmd(Token t)
        if (number_param(n) && setJobParameter(defJob, t, (u_short) n)) {
            logcmd(t, "%lu", n);
            reply(250, "%s set to %u.", parmToken(t), n);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_LASTTIME:                   // time to kill job
@@ -759,31 +759,31 @@ SNPPServer::site_cmd(Token t)
            reply(250, "%s set to %02d%02d%02d."
                , parmToken(t)
                , tv/(24*60*60) , (tv/(60*60))%24 , (tv/60)%60);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_RETRYTIME:                  // retry interval for job
        if (timespec_param(4, tv) && setJobParameter(defJob, t, tv)) {
            logcmd(t, "%02d%02d" , tv/60, tv%60);
            reply(250, "%s set to %02d%02d.", parmToken(t), tv/60, tv%60);
-           return (TRUE);
+           return (true);
        }
        break;
     case T_JPARM:                      // query job parameters
        if (CRLF()) {
            logcmd(t);
            jstatCmd(defJob);
-           return (TRUE);
+           return (true);
        }
        break;
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Parse an SNPP time specification.
  */
-fxBool
+bool
 SNPPServer::SNPPTime(time_t& result)
 {
     if (getToken(T_STRING, "time specification") && checkNUMBER(tokenBody)) {
@@ -818,12 +818,12 @@ SNPPServer::SNPPTime(time_t& result)
             * client will then be applied to this result.
             */
            result = mktime(&tm) - gmtoff;
-           return (TRUE);
+           return (true);
        }
        syntaxError(fxStr::format(
            "bad time specification (expecting 10/12 digits, got %u)", tlen));
     }
-    return (FALSE);
+    return (false);
 }
 
 void
@@ -862,7 +862,7 @@ SNPPServer::dataCmd(void)
            char buf[1024];
            u_int len = 0;
            for (;;) {
-               if (getCmdLine(buf, sizeof (buf), TRUE)) {
+               if (getCmdLine(buf, sizeof (buf), true)) {
                    const char* bp = buf;
                    if (bp[0] == '.') {
                        if ((bp[1] == '\n' && bp[2] == '\0') || bp[1] == '\0')
@@ -889,7 +889,7 @@ SNPPServer::dataCmd(void)
                perror_reply(554, msgFile, errno);
                Sys::unlink(msgFile);
            } else {
-               haveText = TRUE;
+               haveText = true;
                reply(250, "Message text OK.");
            }
        } else
@@ -1067,7 +1067,7 @@ SNPPServer::messageCmd(const char* msg)
                perror_reply(554, msgFile, errno);
                Sys::unlink(msgFile);
            } else {
-               haveText = TRUE;
+               haveText = true;
                reply(250, "Message text OK.");
            }
        } else
@@ -1151,13 +1151,13 @@ SNPPServer::pingCmd(const char* pagerID)
        reply(550, "%s.", (const char*) emsg);
 }
 
-static fxBool
+static bool
 notPresent(faxRequestArray& a, const char* name)
 {
     for (u_int i = 0, n = a.length(); i < n; i++)
        if (a[i].op == FaxRequest::send_data && a[i].item == name)
-           return (FALSE);
-    return (TRUE);
+           return (false);
+    return (true);
 }
 
 /*
@@ -1179,13 +1179,13 @@ SNPPServer::sendCmd(void)
      */
     fxStr emsg;
     u_int i, n = msgs.length();
-    fxBool waitForJobs = FALSE;
+    bool waitForJobs = false;
     for (i = 0; i < n; i++) {
        Job* job = findJob(msgs[i], emsg);
        if (!job)
            msgs.remove(i), n--;
        else if (!job->queued)
-           waitForJobs = TRUE;
+           waitForJobs = true;
     }
     if (waitForJobs) {
        state &= ~S_LOGTRIG;            // just process events
@@ -1275,7 +1275,7 @@ SNPPServer::sendCmd(void)
        if (setjmp(urgcatch) == 0) {
            Dispatcher& disp = Dispatcher::instance();
            state |= S_WAITTRIG|S_SENDWAIT;
-           fxBool jobsPending;
+           bool jobsPending;
            do {
                disp.dispatch();
                /*
@@ -1284,13 +1284,13 @@ SNPPServer::sendCmd(void)
                 * monitor the job state(s) after each event we
                 * receive.
                 */
-               jobsPending = FALSE;
+               jobsPending = false;
                for (i = 0; i < n; i++) {
                    Job* job = findJob(msgs[i], emsg);
                    if (!job)
                        msgs.remove(i), n--;
                    else if (!job->queued && job->state != FaxRequest::state_done)
-                       jobsPending = TRUE;
+                       jobsPending = true;
                }
            } while (IS(WAITTRIG) && jobsPending);
            reply(250, "Message processing completed.");
@@ -1427,7 +1427,7 @@ setTimeMap(time_t map[12], const char* value)
     }
 }
 
-fxBool
+bool
 SNPPServer::setConfigItem(const char* tag, const char* value)
 {
     if (streq(tag, "maxmsglength")) {
@@ -1441,7 +1441,7 @@ SNPPServer::setConfigItem(const char* tag, const char* value)
     } else if (streq(tag, "retrytimemap")) {
        setTimeMap(retryMap, value);
     } else if (!InetFaxServer::setConfigItem(tag, value))
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 #endif /* SNPP_SUPPORT */
index 957efc8833f1906efb3704aa49a8cec0f55864d5..e19bb2bf6b2f40ed52017d2e33304b6d58af6c62 100644 (file)
@@ -34,7 +34,7 @@
 class SNPPServer : public InetFaxServer {
 private:
     fxStr      msgFile;                // file with message text
-    fxBool     haveText;               // client specified message text
+    bool       haveText;               // client specified message text
     fxStrArray msgs;                   // jobs pending SEND (jobids)
 #define        S_SENDWAIT      0x10000         // in SEND waiting for jobs
 
@@ -53,13 +53,13 @@ protected:
 
     virtual void resetConfig();
     void setupConfig();
-    virtual fxBool setConfigItem(const char* tag, const char* value);
+    virtual bool setConfigItem(const char* tag, const char* value);
 
     int parse(void);
-    fxBool cmd(Token t);
-    fxBool site_cmd(Token t);
-    fxBool checklogin(Token);
-    fxBool SNPPTime(time_t& result);
+    bool cmd(Token t);
+    bool site_cmd(Token t);
+    bool checklogin(Token);
+    bool SNPPTime(time_t& result);
     virtual void syntaxError(const char* msg);
 
     virtual const char* cmdToken(Token t);
@@ -77,7 +77,7 @@ protected:
     void statusCmd(void);
     void subjectCmd(const char*);
 
-    fxBool mapPagerID(const char* pagerID,
+    bool mapPagerID(const char* pagerID,
        fxStr& number, fxStr& pid, fxStr& emsg);
 public:
     SNPPServer();
@@ -91,7 +91,7 @@ class SNPPSuperServer : public SuperServer {
 private:
     fxStr port;
 protected:
-    fxBool startServer(void);
+    bool startServer(void);
     HylaFAXServer* newChild(void);
 public:
     SNPPSuperServer(const char* port, int backlog = 5);
index b87d0df2ff58202ae3a05389200b5834a58cbee4..98422286e7fd1d92a3b1b6fd9f55bf07f604b0d8 100644 (file)
@@ -50,13 +50,13 @@ public:
     fxStr      localIdentifier;        // to use in place of FAXNumber
     fxStr      FAXNumber;              // phone number
     fxStr      modemName;              // canonical modem name
-    fxBool     isGettyRunning;         // TRUE if faxgetty responds via FIFO
+    bool       isGettyRunning;         // true if faxgetty responds via FIFO
     fxStr      status;                 // from status file
 
     ModemConfig(const char* name);
     ~ModemConfig() {};
 
-    fxBool setConfigItem(const char* tag, const char* value);
+    bool setConfigItem(const char* tag, const char* value);
     void configError(const char* fmt, ...);
     void configTrace(const char* fmt, ...);
 
@@ -81,7 +81,7 @@ ModemConfig::checkGetty(const char* fifoFile)
     isGettyRunning = (fifo != -1);
 }
 
-fxBool
+bool
 ModemConfig::setConfigItem(const char* tag, const char* value)
 {
     if (streq(tag, "faxnumber"))
@@ -105,7 +105,7 @@ ModemConfig::setConfigItem(const char* tag, const char* value)
        logTracingLevel = getNumber(value);
     else if (streq(tag, "maxrecvpages"))
        maxRecvPages = getNumber(value);
-    return (TRUE);                             // avoid complaints
+    return (true);                             // avoid complaints
 }
 
 void
index 5cb63220fef56ba30aa651b168560e946e75f319..9b4bad66b8e3dd024742589441b7767a93698ce6 100644 (file)
@@ -35,7 +35,7 @@ protected:
     SuperServer(const char* kind, int backlog);
 
     virtual HylaFAXServer* newChild(void) = 0;
-    virtual fxBool startServer(void) = 0;
+    virtual bool startServer(void) = 0;
 
     int inputReady(int fd);
     void timerExpired(long, long);
index d79a38f7468244c76cb5d967224a3576cd7adb24..a40ecdaa4c2758c17d1f0f2dfcaa34f222d685d3 100644 (file)
@@ -90,16 +90,16 @@ HylaFAXServer::triggerCmd(const char* fmt ...)
  * and return the identifier sent back by the
  * scheduler.
  */
-fxBool
+bool
 HylaFAXServer::newTrigger(fxStr& emsg, const char* fmt, ...)
 {
     va_list ap;
     va_start(ap, fmt);
-    fxBool b = vnewTrigger(emsg, fmt, ap);
+    bool b = vnewTrigger(emsg, fmt, ap);
     va_end(ap);
     return (b);
 }
-fxBool
+bool
 HylaFAXServer::vnewTrigger(fxStr& emsg, const char* fmt, va_list ap)
 {
     trigSpec = fxStr::vformat(fmt, ap);
@@ -112,22 +112,22 @@ HylaFAXServer::vnewTrigger(fxStr& emsg, const char* fmt, va_list ap)
  * create triggers the first time as well as to re-load an
  * active trigger if the scheduler is restarted.
  */
-fxBool
+bool
 HylaFAXServer::loadTrigger(fxStr& emsg)
 {
     if (sendQueuerACK(emsg, "T%s", (const char*) trigSpec) &&
       fifoResponse.length() > 2) {
        tid = atoi(&fifoResponse[2]);
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 /*
  * Inform the spooler that it should cancel
  * a previously created trigger.
  */
-fxBool
+bool
 HylaFAXServer::cancelTrigger(fxStr& emsg)
 {
     trigSpec = "";                             // avoid spontaneous reloads
@@ -181,10 +181,10 @@ HylaFAXServer::triggerEvent(const TriggerMsgHeader& h, const char* cp)
        if (rip->recvTime == 0)
            rip->recvTime = h.tstamp;
        if (h.event == Trigger::RECV_END) {
-           rip->beingReceived = FALSE;
+           rip->beingReceived = false;
            rip->reason = ri.reason;
        } else
-           rip->beingReceived = TRUE;
+           rip->beingReceived = true;
        rip->sender = ri.sender;
        rip->subaddr = ri.subaddr;
        rip->npages = ri.npages;
index 692a8a7d370278b602e04022833d84a3100f5a65..ad06da1748afff371514481d13a410941b4676b3 100644 (file)
@@ -48,7 +48,7 @@ UnixSuperServer::~UnixSuperServer()
        Sys::unlink(fileName);
 }
 
-fxBool
+bool
 UnixSuperServer::startServer(void)
 {
     int s = socket(AF_UNIX, SOCK_STREAM, 0);
@@ -64,7 +64,7 @@ UnixSuperServer::startServer(void)
 #endif
            (void) listen(s, getBacklog());
            Dispatcher::instance().link(s, Dispatcher::ReadMask, this);
-           return (TRUE);
+           return (true);
        }
        Sys::close(s);
        logError("%s HylaFAX: bind (port %s): %m",
@@ -72,13 +72,13 @@ UnixSuperServer::startServer(void)
        fileName = "";                          // don't try to unlink file
     } else
        logError("%s HylaFAX: socket: %m", getKind());
-    return (FALSE);
+    return (false);
 }
 HylaFAXServer* UnixSuperServer::newChild(void) { return new UnixFaxServer; }
 
 UnixFaxServer::UnixFaxServer()
 {
-    usedefault = TRUE;
+    usedefault = true;
 }
 UnixFaxServer::~UnixFaxServer() {}
 
@@ -86,7 +86,7 @@ void
 UnixFaxServer::initServer(void)
 {
     HylaFAXServer::initServer();
-    usedefault = TRUE;
+    usedefault = true;
 }
 
 void
@@ -135,7 +135,7 @@ UnixFaxServer::getDataSocket(const char* mode)
     return (NULL);
 }
 
-fxBool
+bool
 UnixFaxServer::dataConnect(void)
 {
     return Socket::connect(data, &data_dest,sizeof (data_dest)) >= 0;
@@ -188,23 +188,23 @@ UnixFaxServer::openDataConn(const char* mode, int& code)
     return (file);
 }
 
-fxBool
+bool
 UnixFaxServer::hostPort()
 {
     fxStr s;
     if (pathname(s)) {
        data_dest.sun_family = AF_UNIX;
        strncpy(data_dest.sun_path, s, sizeof (data_dest.sun_path));
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 void
 UnixFaxServer::portCmd(void)
 {
     logcmd(T_PORT, "%s", data_dest.sun_path);
-    usedefault = FALSE;
+    usedefault = false;
     if (pdata >= 0)
        (void) Sys::close(pdata), pdata = -1;
     reply(200, "PORT command successful.");
index 25c8444cd844380c8b523c1e69b6c8128ca64432..c505c9ee98410f136fc7c94f592efef5bfc78e15 100644 (file)
@@ -36,20 +36,20 @@ private:
     sockaddr_un        data_source;            // source of data connection
     sockaddr_un        data_dest;              // destination of data connection
     sockaddr_un        peer_addr;              // destination of control connection
-    fxBool     usedefault;             // for data transfers
+    bool       usedefault;             // for data transfers
 
     void passiveCmd(void);
     void netStatus(FILE*);
-    fxBool hostPort();
+    bool hostPort();
     void portCmd(void);
 
     virtual void initServer(void);
 
     FILE* getDataSocket(const char* mode);
-    fxBool dataConnect(void);
+    bool dataConnect(void);
     FILE* openDataConn(const char* mode, int& code);
     void send_data(FILE* instr, FILE* outstr, off_t blksize);
-    fxBool receive_data(FILE* instr, FILE* outstr);
+    bool receive_data(FILE* instr, FILE* outstr);
 public:
     UnixFaxServer();
     virtual ~UnixFaxServer();
@@ -63,7 +63,7 @@ class UnixSuperServer : public SuperServer {
 private:
     fxStr      fileName;               // UNIX domain socket filename
 protected:
-    fxBool startServer(void);
+    bool startServer(void);
     HylaFAXServer* newChild(void);
 public:
     UnixSuperServer(const char* filename, int backlog = 5);
index 13a6682d86c9ba922662de8a4b70838b0ae2bb27..5e55efff7f4f6f2ffa87eb85066a2de7b5c169fc 100644 (file)
 gid_t  HylaFAXServer::faxuid = 0;              // reserved fax uid
 #define        FAXUID_RESV     HylaFAXServer::faxuid   // reserved fax uid
 
-fxBool
+bool
 HylaFAXServer::checkUser(const char* name)
 {
-    fxBool check = FALSE;
+    bool check = false;
     FILE* db = fopen(fixPathname(userAccessFile), "r");
     if (db != NULL) {
        check = checkuser(db, name);
@@ -63,7 +63,7 @@ HylaFAXServer::checkUser(const char* name)
     return (check);
 }
 
-static fxBool
+static bool
 nextRecord(FILE* db, char line[], u_int size)
 {
     while (fgets(line, size-1, db)) {
@@ -77,9 +77,9 @@ nextRecord(FILE* db, char line[], u_int size)
        if (cp = strchr(line, '\n'))
            *cp = '\0';
        if (line[0] != '\0')
-           return (TRUE);
+           return (true);
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -87,15 +87,15 @@ nextRecord(FILE* db, char line[], u_int size)
  * the list of users and hosts that are permitted to
  * user the server and setup password handling.
  */
-fxBool
+bool
 HylaFAXServer::checkuser(FILE* db, const char* name)
 {
     struct stat sb;
     if (Sys::fstat(fileno(db), sb) < 0)
-       return (FALSE);
+       return (false);
     if (sb.st_mode&077) {      // file must not be publicly readable
        logError("Access control file not mode 600; access denied.");
-       return (FALSE);
+       return (false);
     }
     uid = FAXUID_ANON;         // anonymous user
     adminwd = "*";             // disallow privileged access
@@ -132,7 +132,7 @@ HylaFAXServer::checkuser(FILE* db, const char* name)
        RegEx pat(base, cp-base);
        if (line[0] == '!') {           // disallow access on match
            if (pat.Find(dotform) || pat.Find(hostform))
-               return (FALSE);
+               return (false);
        } else {                        // allow access on match
            if (pat.Find(dotform) || pat.Find(hostform)) {
                passwd = "";            // no password required
@@ -153,7 +153,7 @@ HylaFAXServer::checkuser(FILE* db, const char* name)
                    } else
                        passwd = "";    // no password required
                }
-               return (TRUE);
+               return (true);
            }
        }
     }
@@ -163,7 +163,7 @@ HylaFAXServer::checkuser(FILE* db, const char* name)
      * folks that probe the server looking for valid accounts.
      */
     passwd = "*";
-    return (TRUE);
+    return (true);
 }
 
 fxDECLARE_PtrKeyDictionary(IDCache, u_int, fxStr)
@@ -232,7 +232,7 @@ HylaFAXServer::userName(u_int id)
 /*
  * Map user name to fax UID.
  */
-fxBool
+bool
 HylaFAXServer::userID(const char* name, u_int& id)
 {
     if (name == the_user)
@@ -245,22 +245,22 @@ HylaFAXServer::userID(const char* name, u_int& id)
        for (IDCacheIter iter(*idcache); iter.notDone(); iter++)
            if (iter.value() == name) {
                id = iter.key();
-               return (TRUE);
+               return (true);
            }
-       return (FALSE);
+       return (false);
     }
-    return (TRUE);
+    return (true);
 }
 
-static fxBool
+static bool
 isAllLower(const char* cp)
 {
     while (*cp) {
        if (!islower(*cp))
-           return (FALSE);
+           return (false);
        cp++;
     }
-    return (TRUE);
+    return (true);
 }
 
 static void
@@ -272,20 +272,20 @@ to64(char* cp, long v, int len)
     }
 }
 
-fxBool
+bool
 HylaFAXServer::cvtPasswd(const char* type, const char* pass, fxStr& result)
 {
     if (*pass == '\0') {               // null password *IS* permitted
        result = "";
-       return (TRUE);
+       return (true);
     }
     if (strlen(pass) <= 5) {
        reply(500, "%s password is too short; use 5-8 characters.", type);
-       return (FALSE);
+       return (false);
     }
     if (isAllLower(pass)) {
        reply(500, "%s password is all lower-case; use something more.", type);
-       return (FALSE);
+       return (false);
     }
     srandom((int) Sys::now());
     char salt[9];
@@ -303,7 +303,7 @@ HylaFAXServer::cvtPasswd(const char* type, const char* pass, fxStr& result)
     to64(&salt[0], random(), 2);
 #endif
     result = crypt(pass, salt);
-    return (TRUE);
+    return (true);
 }
 
 #define        NBPL    (sizeof (u_long) * CHAR_BIT)    // bits/u_long
@@ -314,7 +314,7 @@ HylaFAXServer::cvtPasswd(const char* type, const char* pass, fxStr& result)
 #endif
 #define        N(a)    (sizeof (a) / sizeof (a[0]))
 
-fxBool
+bool
 HylaFAXServer::findUser(FILE* db, const char* user, u_int& newuid)
 {
     rewind(db);
@@ -333,7 +333,7 @@ HylaFAXServer::findUser(FILE* db, const char* user, u_int& newuid)
        for (cp = line; *cp && *cp != ':'; cp++)
            ;
        if (strncmp(user, line, cp-line) == 0)
-           return (TRUE);
+           return (true);
        if (*cp == ':' && isdigit(cp[1])) {     // mark uid as in-use
            u_int uid = (u_int) atoi(cp+1);
            SetBit(uid);
@@ -346,13 +346,13 @@ HylaFAXServer::findUser(FILE* db, const char* user, u_int& newuid)
            for (u_long mask = 1; allocated[l] & mask; mask <<= 1) 
                b++;
            newuid = (u_int) (l*NBPL + b);
-           return (FALSE);
+           return (false);
        }
     newuid = (u_int) -1;                       // no more space
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 HylaFAXServer::addUser(FILE* db, const char* user, u_int uid, const char* upass, const char* apass)
 {
     fxStr templ("/" FAX_TMPDIR "/uaddXXXXXX");
@@ -360,7 +360,7 @@ HylaFAXServer::addUser(FILE* db, const char* user, u_int uid, const char* upass,
     if (fd < 0) {
        reply(550, "Error creating temp file %s: %s.",
            (const char*) templ, strerror(errno));
-       return (FALSE);
+       return (false);
     }
     rewind(db);
     char buf[8*1024];
@@ -370,7 +370,7 @@ HylaFAXServer::addUser(FILE* db, const char* user, u_int uid, const char* upass,
            perror_reply(550, "Write error", errno);
            Sys::close(fd);
            (void) Sys::unlink(templ);
-           return (FALSE);
+           return (false);
        }
     fxStr line;
     if (*apass != '\0')
@@ -383,15 +383,15 @@ HylaFAXServer::addUser(FILE* db, const char* user, u_int uid, const char* upass,
        perror_reply(550, "Write error", errno);
        Sys::close(fd);
        (void) Sys::unlink(templ);
-       return (FALSE);
+       return (false);
     }
     Sys::close(fd);
     if (Sys::rename(templ, fixPathname(userAccessFile)) < 0) {
        perror_reply(550, "Rename of temp file failed", errno);
        (void) Sys::unlink(templ);
-       return (FALSE);
+       return (false);
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -419,7 +419,7 @@ HylaFAXServer::addUserCmd(const char* user, const char* up, const char* ap)
            (const char*) userAccessFile, strerror(errno));
 }
 
-fxBool
+bool
 HylaFAXServer::deleteUser(FILE* db, const char* user)
 {
     fxStr templ("/" FAX_TMPDIR "/udelXXXXXX");
@@ -428,7 +428,7 @@ HylaFAXServer::deleteUser(FILE* db, const char* user)
     if (fd < 0 || (ftmp = fdopen(fd, "w")) == NULL) {
        reply(550, "Error creating temp file %s: %s.",
            (const char*) templ, strerror(errno));
-       return (FALSE);
+       return (false);
     }
     /*
      * Scan the existing file for the specified user
@@ -437,7 +437,7 @@ HylaFAXServer::deleteUser(FILE* db, const char* user)
      * scanning line-by-line and just block-copy the
      * remaining part of the file.
      */
-    fxBool found = FALSE;
+    bool found = false;
     rewind(db);
     char line[8*1024];
     while (fgets(line, sizeof (line)-1, db)) {
@@ -446,7 +446,7 @@ HylaFAXServer::deleteUser(FILE* db, const char* user)
            for (cp = line; *cp && *cp != '\n' && *cp != ':'; cp++)
                ;
            if (strncmp(user, line, cp-line) == 0) {
-               found = TRUE;
+               found = true;
                break;
            }
        }
@@ -455,18 +455,18 @@ HylaFAXServer::deleteUser(FILE* db, const char* user)
     int cc;
     while ((cc = fread(line, 1, sizeof (line), db)) > 0)
        fwrite(line, cc, 1, ftmp);
-    fxBool ioError = (fclose(ftmp) != 0);
+    bool ioError = (fclose(ftmp) != 0);
     if (found) {
        if (ioError)
            perror_reply(550, "I/O error", errno);
        else if (Sys::rename(templ, fixPathname(userAccessFile)) < 0)
            perror_reply(550, "Rename of temp file failed", errno);
        else
-           return (TRUE);
+           return (true);
     } else
        reply(500, "User %s not found in access file.", user);
     (void) Sys::unlink(templ);
-    return (FALSE);
+    return (false);
 }
 
 /*
index 275fd0cf2afca557db90529d28bf4de92dd11b2b..3a074576475650ff9934b00a0f36df92e1de2d8e 100644 (file)
@@ -224,18 +224,18 @@ main(int argc, char** argv, char** envp)
        switch (c) {
        case 'h': case 'i': case 'o': case 's': case 'u':
            if (detach == -1)           // detach unless explicitly specified
-               detach = TRUE;
+               detach = true;
            break;
        case 'H': case 'I': case 'O': case 'S':
            if (detach == -1)           // don't detach when invoked by inetd
-               detach = FALSE;
+               detach = false;
            break;
-       case 'd': detach = FALSE; break;
+       case 'd': detach = false; break;
        case 'q': queueDir = optarg; break;
        case '?': usage(appName);
        }
     if (detach == -1)                  // no protocol options means -I
-       detach = FALSE;
+       detach = false;
     if (Sys::chdir(queueDir) < 0)
        fatal(queueDir | ": Can not change directory");
     CheckSpoolingSetup();
index 7dceb3ea7af9f41a2111deaaf2c8610c527af601..df2c3fae0c5069e9c3748e3d468ac3c7f55e58b5 100644 (file)
@@ -50,7 +50,7 @@ public:
     sendFaxApp();
     ~sendFaxApp();
 
-    fxBool run(int argc, char** argv);
+    bool run(int argc, char** argv);
 };
 
 fxStr sendFaxApp::dbName("~/.faxdb");
@@ -66,7 +66,7 @@ sendFaxApp::~sendFaxApp()
     delete db;
 }
 
-fxBool
+bool
 sendFaxApp::run(int argc, char** argv)
 {
     extern int optind;
@@ -82,7 +82,7 @@ sendFaxApp::run(int argc, char** argv)
     readConfig(FAX_LIBDATA "/sendfax.conf");
     readConfig(FAX_USERCONF);
 
-    fxBool waitForJob = FALSE;
+    bool waitForJob = false;
     int verbose = 0;
     SendFaxJob& proto = getProtoJob();
     db = new FaxDB(tildeExpand(dbName));
@@ -116,7 +116,7 @@ sendFaxApp::run(int argc, char** argv)
         addDestination(optarg);
         break;
     case 'E':                  // disable use of ECM
-        proto.setDesiredEC(FALSE);
+        proto.setDesiredEC(false);
         break;
     case 'F':                  // override tag line format string
         proto.setTagLineFormat(optarg);
@@ -146,7 +146,7 @@ sendFaxApp::run(int argc, char** argv)
         proto.setVResolution(196.);
         break;
     case 'n':                  // no cover sheet
-        proto.setAutoCoverPage(FALSE);
+        proto.setAutoCoverPage(false);
         break;
     case 'N':                  // no notification
         proto.setNotification("none");
@@ -175,14 +175,14 @@ sendFaxApp::run(int argc, char** argv)
     case 'v':                  // verbose mode
         verbose++;
         setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
-        SendFaxClient::setVerbose(TRUE);       // type rules & basic operation
+        SendFaxClient::setVerbose(true);       // type rules & basic operation
         FaxClient::setVerbose(verbose > 1);    // protocol tracing
         break;
     case 'V':                  // cover sheet: voice number field
         proto.setCoverVoiceNumber(optarg);
         break;
     case 'w':                  // wait for job to complete
-        waitForJob = TRUE;
+        waitForJob = true;
         break;
     case 'x':                  // cover page: to's company
         proto.setCoverCompany(optarg);
@@ -207,7 +207,7 @@ sendFaxApp::run(int argc, char** argv)
         copyToTemporary(fileno(stdin), stdinTemp);
         addFile(stdinTemp);
     }
-    fxBool status = FALSE;
+    bool status = false;
     fxStr emsg;
     if (callServer(emsg)) {
         status = login(NULL, emsg)
index c3a8a001edb39f4ee78a88d35679c2e867474034..7d14ef5029079b866d9f3ffe032a9fdc2b91249a 100644 (file)
@@ -49,7 +49,7 @@ public:
     sendPageApp();
     ~sendPageApp();
 
-    fxBool run(int argc, char** argv);
+    bool run(int argc, char** argv);
 };
 
 sendPageApp::sendPageApp()
@@ -63,7 +63,7 @@ sendPageApp::~sendPageApp()
        Sys::unlink(msgFile);
 }
 
-fxBool
+bool
 sendPageApp::run(int argc, char** argv)
 {
     extern int optind;
@@ -80,7 +80,7 @@ sendPageApp::run(int argc, char** argv)
     readConfig(FAX_USERCONF);
 
     fxStr emsg;
-    fxBool noText = FALSE;             // default is to assume message text
+    bool noText = false;               // default is to assume message text
     SNPPJob& proto = getProtoJob();
     while ((c = Sys::getopt(argc, argv, "a:De:f:h:i:I:l:nNp:qRs:t:T:v")) != -1)
        switch (c) {
@@ -110,7 +110,7 @@ sendPageApp::run(int argc, char** argv)
            proto.setServiceLevel(atoi(optarg));
            break;
        case 'n':                       // numeric-only page, no message text
-           noText = TRUE;
+           noText = true;
            break;
        case 'N':                       // no notification
            proto.setNotification("none");
@@ -119,7 +119,7 @@ sendPageApp::run(int argc, char** argv)
            addJob().setPIN(optarg);
            break;
        case 'q':                       // queue job and don't wait
-           proto.setQueued(TRUE);
+           proto.setQueued(true);
            break;
        case 'R':                       // notify when requeued or done
            proto.setNotification("when requeued");
@@ -132,7 +132,7 @@ sendPageApp::run(int argc, char** argv)
            break;
        case 'v':                       // client-server protocol tracing
            setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
-           setVerbose(TRUE);
+           setVerbose(true);
            break;
        case '?':
            usage();
@@ -158,7 +158,7 @@ sendPageApp::run(int argc, char** argv)
            setPagerMsgFile(msgFile);
        }
     }
-    fxBool status = FALSE;
+    bool status = false;
     if (callServer(emsg)) {
        status = login(NULL, emsg)
              && prepareForJobSubmissions(emsg)
index 33183fa50ef6961f384bf80d5ef32220bb8e524c..c23aaffe3b2cc44d603c5a233d8d9640044b70b5 100644 (file)
@@ -98,8 +98,8 @@ protected:
        fxAddress()                                     { ptr = 0; }
        fxAddress(void* p)                              { ptr = (char*) p; }
        fxAddress operator+(u_long offset) const        { return ptr + offset; }
-       fxBool operator==(const fxAddress& r) const     { return ptr == r.ptr; }
-       fxBool operator!=(const fxAddress& r) const     { return ptr != r.ptr; }
+       bool operator==(const fxAddress& r) const       { return ptr == r.ptr; }
+       bool operator!=(const fxAddress& r) const       { return ptr != r.ptr; }
        // NB: operator const void*() const does not work
        operator void*() const                          { return ptr; }
     protected:
index 6b447af95c0a9884b021bb615beef0a6180726f9..38236a33966bad9c25986540b25aa3ef5930487c 100644 (file)
@@ -49,12 +49,12 @@ isLeapYear(const tm& at) {
 #endif
 #define        streq(a,b,n)    (strncasecmp(a,b,n) == 0)
 
-static fxBool checkDay(const char*& cp, int& day);
+static bool checkDay(const char*& cp, int& day);
 static void adjustDay(struct tm& at, int day, const struct tm&);
-static fxBool checkMonth(const char*& cp, int& month);
-static fxBool parseMonthAndYear(const char*&, const struct tm& ref,
+static bool checkMonth(const char*& cp, int& month);
+static bool parseMonthAndYear(const char*&, const struct tm& ref,
            struct tm& at, fxStr& emsg);
-static fxBool parseMultiplier(const char* cp, struct tm& at, fxStr& emsg);
+static bool parseMultiplier(const char* cp, struct tm& at, fxStr& emsg);
 static const char* whitespace(const char* cp);
 static void fixup(struct tm& at);
 
@@ -102,20 +102,20 @@ parseAtSyntax(const char* s, const struct tm& ref, struct tm& at0, fxStr& emsg)
                int min = 10*(cp[1]-'0') + (cp[2]-'0');
                if (min >= 60) {
                    _atError(emsg, "Illegal minutes value %u", min);
-                   return (FALSE);
+                   return (false);
                }
                v += min;
                cp += 3;
            } else {
                _atSyntax(emsg, "expecting HH:MM");
-               return (FALSE);
+               return (false);
            }
        }
        cp = whitespace(cp);
        if (streq(cp, "am", 2)) {
            if (v >= HALFDAY+HOUR) {
                _atError(emsg, "%u:%02u is not an AM value", v/HOUR, v%HOUR);
-               return (FALSE);
+               return (false);
            }
            if (HALFDAY <= v && v < HALFDAY+HOUR)
                v -= HALFDAY;
@@ -123,7 +123,7 @@ parseAtSyntax(const char* s, const struct tm& ref, struct tm& at0, fxStr& emsg)
        } else if (streq(cp, "pm", 2)) {
            if (v >= HALFDAY+HOUR) {
                _atError(emsg, "%u:%02u is not a PM value", v/HOUR, v%HOUR);
-               return (FALSE);
+               return (false);
            }
            if (v < HALFDAY)
                v += HALFDAY;
@@ -144,12 +144,12 @@ parseAtSyntax(const char* s, const struct tm& ref, struct tm& at0, fxStr& emsg)
            cp += 4;
        } else {
            _atSyntax(emsg, "unrecognized symbolic time \"%s\"", cp);
-           return (FALSE);
+           return (false);
        }
     }
     if ((unsigned) v >= FULLDAY) {
        _atError(emsg, "Illegal time value; out of range");
-       return (FALSE);
+       return (false);
     }
     at.tm_hour = v/HOUR;
     at.tm_min = v%HOUR;
@@ -162,7 +162,7 @@ parseAtSyntax(const char* s, const struct tm& ref, struct tm& at0, fxStr& emsg)
     if (checkMonth(cp, v)) {
        at.tm_mon = v;
        if (!parseMonthAndYear(cp, ref, at, emsg))
-           return (FALSE);
+           return (false);
     } else if (checkDay(cp, v)) {
        adjustDay(at, v, ref);
     } else {
@@ -173,7 +173,7 @@ parseAtSyntax(const char* s, const struct tm& ref, struct tm& at0, fxStr& emsg)
            cp += 8;
        } else if (cp[0] != '\0' && cp[0] != '+') {
            _atSyntax(emsg, "expecting \"+\" after time");
-           return (FALSE);
+           return (false);
        }
        /*
         * Adjust the date according to whether it is before ``now''.
@@ -185,14 +185,14 @@ parseAtSyntax(const char* s, const struct tm& ref, struct tm& at0, fxStr& emsg)
      * Process any increment expression.
      */
     if (cp[0] == '+' && !parseMultiplier(++cp, at, emsg))
-       return (FALSE);
+       return (false);
     fixup(at);
     if (at < ref) {
        _atError(emsg, "Invalid date/time; time must be in the future");
-       return (FALSE);
+       return (false);
     }
     at0 = at;
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -214,7 +214,7 @@ whitespace(const char* cp)
  * return the day number [0..6] and update
  * the character pointer.
  */
-static fxBool
+static bool
 checkDay(const char*& cp, int& day)
 {
     static const char* days[] = {
@@ -227,14 +227,14 @@ again:
        if (streq(cp, days[i], len)) {
            cp += len;
            day = i;
-           return (TRUE);
+           return (true);
        }
        if (len != 3) {                 // an Algol-style for loop...
            len = 3;
            goto again;
        }
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -267,7 +267,7 @@ static const char* months[] = {
  * return the month index [0..11] and update
  * the character pointer.
  */
-static fxBool
+static bool
 checkMonth(const char*& cp, int& month)
 {
     for (u_int i = 0; i < N(months); i++) {
@@ -276,14 +276,14 @@ again:
        if (streq(cp, months[i], len)) {
            cp += len;
            month = i;
-           return (TRUE);
+           return (true);
        }
        if (len != 3) {                 // an Algol-style for loop...
            len = 3;
            goto again;
        }
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -308,14 +308,14 @@ adjustYDay(struct tm& t)
 /*
  * Parse an expected day [, year] expression.
  */
-static fxBool
+static bool
 parseMonthAndYear(const char*& cp, const struct tm& ref, struct tm& at, fxStr& emsg)
 {
     char* tp;
     at.tm_mday = (u_int) strtoul(cp, &tp, 10);
     if (tp == cp) {
        _atSyntax(emsg, "missing or invalid day of month");
-       return (FALSE);
+       return (false);
     }
     at.tm_mday--;                      // tm_mday is [0..31]
     tp = (char*) whitespace(tp);
@@ -324,12 +324,12 @@ parseMonthAndYear(const char*& cp, const struct tm& ref, struct tm& at, fxStr& e
        u_int year = (u_int) strtoul(++tp, &xp, 10);
        if (tp == xp) {
            _atSyntax(emsg, "missing year");
-           return (FALSE);
+           return (false);
        }
        if (year < TM_YEAR_BASE) {
            _atError(emsg, "Sorry, cannot handle dates before %u",
                TM_YEAR_BASE);
-           return (FALSE);
+           return (false);
        }
        at.tm_year = year - TM_YEAR_BASE;
        adjustYDay(at);
@@ -352,22 +352,22 @@ parseMonthAndYear(const char*& cp, const struct tm& ref, struct tm& at, fxStr& e
     if (at.tm_mday > days[at.tm_mon]) {
        _atError(emsg, "Invalid day of month, %s has only %u days",
            months[at.tm_mon], days[at.tm_mon]);
-       return (FALSE);
+       return (false);
     }
     cp = tp;
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Parse an expected multiplier expression.
  */
-static fxBool
+static bool
 parseMultiplier(const char* cp, struct tm& at, fxStr& emsg)
 {
     cp = whitespace(cp);
     if (!isdigit(cp[0])) {
        _atSyntax(emsg, "expecting number after \"+\"");
-       return (FALSE);
+       return (false);
     }
     int v = 0;
     for (; isdigit(*cp); cp++)
@@ -375,7 +375,7 @@ parseMultiplier(const char* cp, struct tm& at, fxStr& emsg)
     cp = whitespace(cp);
     if (*cp == '\0') {
        _atSyntax(emsg, "\"+%u\" without unit", v);
-       return (FALSE);
+       return (false);
     }
     if (streq(cp, "minute", 6))
        at.tm_min += v;
@@ -394,9 +394,9 @@ parseMultiplier(const char* cp, struct tm& at, fxStr& emsg)
        at.tm_year += v;
     else {
        _atError(emsg, "Unknown increment unit \"%s\"", cp);
-       return (FALSE);
+       return (false);
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -413,7 +413,7 @@ fixup(struct tm& at)
        at.tm_hour++, at.tm_min -= HOUR;
     while (at.tm_hour >= FULLDAY)
        at.tm_yday++, at.tm_hour -= FULLDAY;
-    fxBool leap;
+    bool leap;
     int daysinyear;
     for (;;) {
        leap = isLeapYear(at);
index 40a0e6991c35be81774ae1080e7ef3c642495655..6772f427cc63930437dac7f17ba2f3cf0d01008f 100644 (file)
@@ -25,4 +25,4 @@
  */
 #include "BoolArray.h"
 
-fxIMPLEMENT_PrimArray(fxBoolArray, fxBool)
+fxIMPLEMENT_PrimArray(fxBoolArray, bool)
index 1f14d3e0d4d715f9dd2b020ad66ca01a9a674ead..e4441fc13847e2e7387ca6b3bf38bc270dec0094 100644 (file)
@@ -28,5 +28,5 @@
 
 #include "Array.h"
 
-fxDECLARE_PrimArray(fxBoolArray, fxBool)
+fxDECLARE_PrimArray(fxBoolArray, bool)
 #endif /* _BoolArray_ */
index 4ba48fdb53f88b3aab699efe475dfe6d38f0b662..68bd0d7d72ac0cd3949d30509dce7deb8ce2bbe2 100644 (file)
@@ -91,7 +91,7 @@ Class2Params::cmd() const
     return fxStr(buf);
 }
 
-fxBool
+bool
 Class2Params::is2D() const
 {
     return (DF_2DMR <= df && df <= DF_2DMRUNCOMP);
index 03c68452b51e942cafe21aa64b5d2fefb5d29c8f..c33d06046e187b4273acd384f6a0a79d681ee030 100644 (file)
@@ -80,7 +80,7 @@ public:
     void setFromDCS(u_int dcs, u_int xinfo = 0);
     u_int getDCS() const;
     u_int getXINFO() const;
-    fxBool is2D() const;
+    bool is2D() const;
 
     u_int transferSize(u_int ms) const;
     u_int minScanlineSize() const;
index f19eb6a061300250ffcb9c9885528c8de739a740..1438399c654bd4c59d2f8b448f175f3e1c4b71c4 100644 (file)
@@ -63,7 +63,7 @@ fxIMPLEMENT_StrKeyObjValueDictionary(RulesDict, RuleArrayPtr)
 
 DialStringRules::DialStringRules(const char* file) : filename(file)
 {
-    verbose = FALSE;
+    verbose = false;
     fp = NULL;
     vars = new VarDict;
     regex = new RegExArray;
@@ -77,16 +77,16 @@ DialStringRules::~DialStringRules()
     delete vars;
 }
 
-void DialStringRules::setVerbose(fxBool b) { verbose = b; }
+void DialStringRules::setVerbose(bool b) { verbose = b; }
 
 /*
  * Parse the dialing string rules file
  * to create the in-memory rules.
  */
-fxBool
-DialStringRules::parse(fxBool shouldExist)
+bool
+DialStringRules::parse(bool shouldExist)
 {
-    fxBool ok = FALSE;
+    bool ok = false;
     lineno = 0;
     fp = fopen(filename, "r");
     if (fp) {
@@ -115,7 +115,7 @@ DialStringRules::undef(const fxStr& var)
     vars->remove(var);
 }
 
-fxBool
+bool
 DialStringRules::parseRules()
 {
     char line[1024];
@@ -124,7 +124,7 @@ DialStringRules::parseRules()
        // collect token
        if (!isalpha(*cp)) {
            parseError("Syntax error, expecting identifier");
-           return (FALSE);
+           return (false);
        }
        const char* tp = cp;
        for (cp++; isalnum(*cp); cp++)
@@ -136,14 +136,14 @@ DialStringRules::parseRules()
            for (cp += 2; *cp != '['; cp++)
                if (*cp == '\0') {
                    parseError("Missing '[' while parsing rule set");
-                   return (FALSE);
+                   return (false);
                }
            if (verbose)
                traceParse("%s := [", (const char*) var);
            RuleArray* ra = new RuleArray;
            if (!parseRuleSet(*ra)) {
                delete ra;
-               return (FALSE);
+               return (false);
            }
            (*rules)[var] = ra;
            if (verbose)
@@ -151,11 +151,11 @@ DialStringRules::parseRules()
        } else if (*cp == '=') {                // variable definition
            fxStr value;
            if (parseToken(cp+1, value) == NULL)
-               return (FALSE);
+               return (false);
            def(var, value);
        } else {                                // an error
            parseError("Missing '=' or ':=' after \"%s\"", (const char*) var);
-           return (FALSE);
+           return (false);
        }
     }
     if (verbose) {
@@ -166,7 +166,7 @@ DialStringRules::parseRules()
        if (ra == 0)
            traceParse("Warning, no \"DialString\" rules.");
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -244,7 +244,7 @@ DialStringRules::parseToken(const char* cp, fxStr& v)
            u_int l = v.next(i, '}');
            if (l >= v.length()) {
                parseError("Missing '}' for variable reference");
-               return (FALSE);
+               return (NULL);
            }
            fxStr var = v.cut(i+2,l-(i+2));// variable name
            v.remove(i, 3);             // remove ${}
@@ -283,7 +283,7 @@ DialStringRules::subRHS(fxStr& v)
  * Parse a set of rules and construct the array of
  * rules (regular expressions + replacement strings).
  */
-fxBool
+bool
 DialStringRules::parseRuleSet(RuleArray& rules)
 {
     for (;;) {
@@ -291,23 +291,23 @@ DialStringRules::parseRuleSet(RuleArray& rules)
        const char* cp = nextLine(line, sizeof (line));
        if (!cp) {
            parseError("Missing ']' while parsing rule set");
-           return (FALSE);
+           return (false);
        }
        if (*cp == ']')
-           return (TRUE);
+           return (true);
        // new rule
        fxStr pat;
        if ((cp = parseToken(cp, pat)) == NULL)
-           return (FALSE);
+           return (false);
        while (isspace(*cp))
            cp++;
        if (*cp != '=') {
            parseError("Rule pattern without '='");
-           return (FALSE);
+           return (false);
        }
        DialRule r;
        if (parseToken(cp+1, r.replace) == NULL)
-           return (FALSE);
+           return (false);
        if (verbose)
            traceParse("  \"%s\" = \"%s\"",
                (const char*) pat, (const char*) r.replace);
index 9685f23f875fffb97b0789cf5a663dc6598e51d0..78c767b10e83f1641452c59f113b688281b89d66 100644 (file)
@@ -51,12 +51,12 @@ private:
     u_int      lineno;         // current line number during parsing
     FILE*      fp;             // open file during parsing
     VarDict*   vars;           // defined variables during parsing
-    fxBool     verbose;        // trace parsing of rules file
+    bool       verbose;        // trace parsing of rules file
     RegExArray*        regex;          // regular expressions
     RulesDict* rules;          // rules defined in the file
 
-    fxBool parseRules();
-    fxBool parseRuleSet(RuleArray& rules);
+    bool parseRules();
+    bool parseRuleSet(RuleArray& rules);
     const char* parseToken(const char* cp, fxStr& v);
     char* nextLine(char* line, int lineSize);
     void subRHS(fxStr& v);
@@ -68,14 +68,14 @@ public:
     DialStringRules(const char* filename);
     virtual ~DialStringRules();
 
-    void setVerbose(fxBool b);
+    void setVerbose(bool b);
     u_int getLineno() const;
     const fxStr& getFilename() const;
 
     void def(const fxStr& var, const fxStr& value);
     void undef(const fxStr& var);
 
-    fxBool parse(fxBool shouldExist = TRUE);
+    bool parse(bool shouldExist = true);
 
     fxStr applyRules(const fxStr& name, const fxStr& s);
     fxStr canonicalNumber(const fxStr&);
index 005068c68970b1854216e3fe780ffc49d65dd4e3..73664c5104098aaed4008795f6e02b5fe54be0d4 100644 (file)
@@ -79,7 +79,7 @@ void fxDictionary::cleanup()
     for (i=0; i < l; i++) {
        iters[i]->dict = 0;
        iters[i]->node = 0;
-       iters[i]->invalid = TRUE;
+       iters[i]->invalid = true;
     }
 }
 
@@ -241,7 +241,7 @@ fxDictionary::invalidateIters(const fxDictBucket *db)
        fxDictIter* di = iters[i];
        if (di->node == db) {
            (*di)++;
-           if (di->dict) di->invalid = TRUE;
+           if (di->dict) di->invalid = true;
        }
     }
 }
@@ -250,7 +250,7 @@ fxDictionary::invalidateIters(const fxDictBucket *db)
 
 fxDictIter::fxDictIter()
 {
-    invalid = FALSE;
+    invalid = false;
     dict = 0;
     bucket = 0;
     node = 0;
@@ -258,7 +258,7 @@ fxDictIter::fxDictIter()
 
 fxDictIter::fxDictIter(fxDictionary& d)
 {
-    invalid = FALSE;
+    invalid = false;
     dict = &d;
     bucket = 0;
     node = d.buckets[bucket];
@@ -278,7 +278,7 @@ fxDictIter::operator=(fxDictionary& d)
     dict = &d;
     bucket = 0;
     node = d.buckets[bucket];
-    invalid = FALSE;
+    invalid = false;
     d.addIter(this);
     if (!node) advanceToValid();
 }
@@ -302,7 +302,7 @@ fxDictIter::increment()
 {
     if (!dict) return;
     if (invalid) {
-       invalid = FALSE;
+       invalid = false;
        return;
     }
     node = node->next;
@@ -323,12 +323,12 @@ fxDictIter::advanceToValid()
        if (bucket == len) {
            dict->removeIter(this);             // it's done with us
            dict = 0;
-           invalid = TRUE;
+           invalid = true;
            break;
        }
        if (n = dict->buckets[bucket]) {        // NB: intentional =
            node = n;
-           invalid = FALSE;
+           invalid = false;
            break;
        }
     }
index d784d8f40574f0c3aa6395dd9892d292dc1d711f..448c7f36acf6e4b2e6fa4bc390f7b309c7b09254 100644 (file)
@@ -74,8 +74,8 @@ public:
     operator KEY const &() const
     KEY const& key() const;
     VALUE& value() const;
-    fxBool removed();
-    fxBool notDone();
+    bool removed();
+    bool notDone();
 }
 *******************************************/
 
@@ -155,8 +155,8 @@ public:
     void operator=(fxDictionary&);     // not a const argument!
     void operator++()     { increment(); }
     void operator++(int)   { increment(); }
-    fxBool removed() const { return invalid; }
-    fxBool notDone() const { return node != 0; }
+    bool removed() const { return invalid; }
+    bool notDone() const { return node != 0; }
 protected:
     void* getKey() const;
     void* getValue() const;
index 47e543ab1f1af269b71151062d972cc9f5cc9f4c..1c174b29dc24d3b65e74213c445d01ff2eb1aa3d 100644 (file)
@@ -76,23 +76,23 @@ timeval operator-(timeval src1, timeval src2) {
     return delta;
 }
 
-fxBool operator>(timeval src1, timeval src2) {
+bool operator>(timeval src1, timeval src2) {
     if (src1.tv_sec > src2.tv_sec) {
-       return TRUE;
+       return true;
     } else if (src1.tv_sec == src2.tv_sec && src1.tv_usec > src2.tv_usec) {
-       return TRUE;
+       return true;
     } else {
-       return FALSE;
+       return false;
     }
 }
 
-fxBool operator<(timeval src1, timeval src2) {
+bool operator<(timeval src1, timeval src2) {
     if (src1.tv_sec < src2.tv_sec) {
-       return TRUE;
+       return true;
     } else if (src1.tv_sec == src2.tv_sec && src1.tv_usec < src2.tv_usec) {
-       return TRUE;
+       return true;
     } else {
-       return FALSE;
+       return false;
     }
 }
 
@@ -113,7 +113,7 @@ public:
     TimerQueue();
     virtual ~TimerQueue();
 
-    fxBool isEmpty() const;
+    bool isEmpty() const;
     static timeval zeroTime();
     timeval earliestTime() const;
     static timeval currentTime();
@@ -145,7 +145,7 @@ TimerQueue::~TimerQueue() {
     }
 }
 
-inline fxBool TimerQueue::isEmpty() const {
+inline bool TimerQueue::isEmpty() const {
     return _first == NULL;
 }
 
@@ -221,8 +221,8 @@ public:
     ChildQueue();
     virtual ~ChildQueue();
 
-    fxBool isEmpty() const;
-    fxBool isReady() const;
+    bool isEmpty() const;
+    bool isReady() const;
 
     void insert(pid_t, IOHandler*);
     void remove(IOHandler*);
@@ -230,7 +230,7 @@ public:
     void setStatus(pid_t, int status);
 private:
     Child* _first;             // queue head
-    fxBool _ready;             // something is ready
+    bool _ready;               // something is ready
 };
 
 Child::Child(pid_t p, IOHandler* h, Child* n)
@@ -244,7 +244,7 @@ Child::Child(pid_t p, IOHandler* h, Child* n)
 ChildQueue::ChildQueue()
 {
     _first = NULL;
-    _ready = FALSE;
+    _ready = false;
 }
 
 ChildQueue::~ChildQueue() {
@@ -256,8 +256,8 @@ ChildQueue::~ChildQueue() {
     }
 }
 
-inline fxBool ChildQueue::isEmpty() const { return _first == NULL; }
-inline fxBool ChildQueue::isReady() const { return _ready; }
+inline bool ChildQueue::isEmpty() const { return _first == NULL; }
+inline bool ChildQueue::isReady() const { return _ready; }
 
 void ChildQueue::insert(pid_t p, IOHandler* handler) {
     /*
@@ -298,7 +298,7 @@ void ChildQueue::setStatus(pid_t p, int status) {
     for (Child* c = _first; c != NULL; c = c->next)
        if (c->pid == p) {
            c->status = status;
-           _ready = TRUE;
+           _ready = true;
            break;
        }
 }
@@ -315,7 +315,7 @@ void ChildQueue::notify() {
        } else
            prev = &c->next;
     }
-    _ready = FALSE;
+    _ready = false;
 }
 
 Dispatcher::Dispatcher() {
@@ -440,9 +440,9 @@ void Dispatcher::stopChild(IOHandler* handler) {
     _cqueue->remove(handler);
 }
 
-fxBool Dispatcher::setReady(int fd, DispatcherMask mask) {
+bool Dispatcher::setReady(int fd, DispatcherMask mask) {
     if (handler(fd, mask) == NULL) {
-        return FALSE;
+        return false;
     }
     if (mask == ReadMask) {
         FD_SET(fd, &_rmaskready);
@@ -451,16 +451,16 @@ fxBool Dispatcher::setReady(int fd, DispatcherMask mask) {
     } else if (mask == ExceptMask) {
         FD_SET(fd, &_emaskready);
     } else {
-        return FALSE;
+        return false;
     }
-    return TRUE;
+    return true;
 }
 
 void Dispatcher::dispatch() {
     dispatch(NULL);
 }
 
-fxBool Dispatcher::dispatch(long& sec, long& usec) {
+bool Dispatcher::dispatch(long& sec, long& usec) {
     timeval howlong;
     timeval prevTime;
     timeval elapsedTime;
@@ -469,7 +469,7 @@ fxBool Dispatcher::dispatch(long& sec, long& usec) {
     howlong.tv_usec = usec;
     prevTime = TimerQueue::currentTime();
 
-    fxBool success = dispatch(&howlong);
+    bool success = dispatch(&howlong);
 
     elapsedTime = TimerQueue::currentTime() - prevTime;
     if (howlong > elapsedTime) {
@@ -483,7 +483,7 @@ fxBool Dispatcher::dispatch(long& sec, long& usec) {
     return success;
 }
 
-fxBool Dispatcher::dispatch(timeval* howlong) {
+bool Dispatcher::dispatch(timeval* howlong) {
     fd_set rmask;
     fd_set wmask;
     fd_set emask;
@@ -501,7 +501,7 @@ fxBool Dispatcher::dispatch(timeval* howlong) {
     return (nfound != 0);
 }
 
-fxBool Dispatcher::anyReady() const {
+bool Dispatcher::anyReady() const {
     if (!_cqueue->isEmpty()) {
         Dispatcher::sigCLD(0);         // poll for pending children
         return _cqueue->isReady();
@@ -509,10 +509,10 @@ fxBool Dispatcher::anyReady() const {
     for (int i = 0; i < _nfds; i++) {
         if (FD_ISSET(i, &_rmaskready) ||
                 FD_ISSET(i, &_wmaskready) || FD_ISSET(i, &_emaskready)) {
-            return TRUE;
+            return true;
            }
     }
-    return FALSE;
+    return false;
 }
 
 int Dispatcher::fillInReady(
@@ -682,20 +682,20 @@ timeval* Dispatcher::calculateTimeout(timeval* howlong) const {
 
 extern void fxFatal(const char* fmt, ...);
 
-fxBool Dispatcher::handleError() {
+bool Dispatcher::handleError() {
     switch (errno) {
     case EBADF:
        checkConnections();
        break;
     case EINTR:
        if (_cqueue->isReady())
-           return TRUE;
+           return true;
        break;
     default:
        fxFatal("Dispatcher: select: %s", strerror(errno));
        /*NOTREACHED*/
     }
-    return FALSE;                      // retry select
+    return false;                      // retry select
 }
 
 void Dispatcher::checkConnections() {
index bc174c1db17037a5b5419051d33438bdc670d83a..225fa26e60ae1e32702c9c787f96a65b4aa729f2 100644 (file)
@@ -58,22 +58,22 @@ public:
     virtual void startChild(pid_t pid, IOHandler*);
     virtual void stopChild(IOHandler*);
 
-    virtual fxBool setReady(int fd, DispatcherMask);
+    virtual bool setReady(int fd, DispatcherMask);
     virtual void dispatch();
-    virtual fxBool dispatch(long& sec, long& usec);
+    virtual bool dispatch(long& sec, long& usec);
 
     static Dispatcher& instance();
     static void instance(Dispatcher*);
 protected:
     virtual void attach(int fd, DispatcherMask, IOHandler*);
     virtual void detach(int fd);
-    virtual fxBool dispatch(timeval*);
-    virtual fxBool anyReady() const;
+    virtual bool dispatch(timeval*);
+    virtual bool anyReady() const;
     virtual int fillInReady(fd_set&, fd_set&, fd_set&);
     virtual int waitFor(fd_set&, fd_set&, fd_set&, timeval*);
     virtual void notify(int, fd_set&, fd_set&, fd_set&);
     virtual timeval* calculateTimeout(timeval*) const;
-    virtual fxBool handleError();
+    virtual bool handleError();
     virtual void checkConnections();
 protected:
     int        _nfds;
index 00ef06029c78790ac1a6655998186d81a396edca..4f5d8bfc7c80da2e7f43a5e01aad5399b42f032e 100644 (file)
@@ -167,7 +167,7 @@ void FaxClient::setModem(const fxStr& modemarg)     { modem = modemarg; }
 void FaxClient::setModem(const char* modemarg) { modem = modemarg; }
 
 void
-FaxClient::setVerbose(fxBool v)
+FaxClient::setVerbose(bool v)
 {
     if (v)
        state |= FS_VERBOSE;
@@ -175,7 +175,7 @@ FaxClient::setVerbose(fxBool v)
        state &= ~FS_VERBOSE;
 }
 
-fxBool
+bool
 FaxClient::setupUserIdentity(fxStr& emsg)
 {
     struct passwd* pwd = NULL;
@@ -191,7 +191,7 @@ FaxClient::setupUserIdentity(fxStr& emsg)
        emsg = fxStr::format(
            "Can not locate your password entry (account name %s, uid %lu).",
            (name ? name : "<unspecified>"), (u_long) getuid());
-       return (FALSE);
+       return (false);
     }
     userName = pwd->pw_name;
     if (pwd->pw_gecos && pwd->pw_gecos[0] != '\0') {
@@ -215,9 +215,9 @@ FaxClient::setupUserIdentity(fxStr& emsg)
     if (senderName.length() == 0) {
        emsg = "Bad (null) user name; your password file entry"
            " probably has bogus GECOS field information.";
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 /*
@@ -271,7 +271,7 @@ FaxClient::configTrace(const char* fmt ...)
     }
 }
 
-fxBool
+bool
 FaxClient::setConfigItem(const char* tag, const char* value)
 {
     u_int ix;
@@ -295,11 +295,11 @@ FaxClient::setConfigItem(const char* tag, const char* value)
     } else if (streq(tag, "filefmt")) {
        setFileStatusFormat(value);
     } else
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 
-fxBool
+bool
 FaxClient::callServer(fxStr& emsg)
 {
     if (host.length() == 0) {          // if host not specified by -h
@@ -320,12 +320,12 @@ FaxClient::callServer(fxStr& emsg)
         * Transport code is expected to call back through
         * setCtrlFds so fdIn should be properly setup...
         */
-       return (fdIn != NULL && getReply(FALSE) == COMPLETE);
+       return (fdIn != NULL && getReply(false) == COMPLETE);
     } else
-       return (FALSE);
+       return (false);
 }
 
-fxBool
+bool
 FaxClient::hangupServer(void)
 {
     if (fdIn != NULL) {
@@ -342,7 +342,7 @@ FaxClient::hangupServer(void)
      */
     delete transport, transport = NULL;
     initServerState();
-    return (TRUE);
+    return (true);
 }
 
 void
@@ -367,7 +367,7 @@ FaxClient::setDataFd(int fd)
 /*
  * Do login procedure.
  */
-fxBool
+bool
 FaxClient::login(const char* user, fxStr& emsg)
 {
     if (user == NULL) {
@@ -390,10 +390,10 @@ FaxClient::login(const char* user, fxStr& emsg)
            (void) setTimeZone(tz);
            state &= ~FS_TZPEND;
        }
-       return (TRUE);
+       return (true);
     } else {
        emsg = "Login failed: " | lastResponse;
-       return (FALSE);
+       return (false);
     }
 }
 
@@ -409,58 +409,58 @@ FaxClient::getPasswd(const char* prompt)
 /*
  * Do admin login procedure.
  */
-fxBool
+bool
 FaxClient::admin(const char* pass, fxStr& emsg)
 {
     if (command("ADMIN %s", pass ? pass : getpass("Password:")) != COMPLETE) {
        emsg = "Admin failed: " | lastResponse;
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
-fxBool
+bool
 FaxClient::setCommon(const FaxParam& parm, u_int v)
 {
     if (v != this->*parm.pv) {
        if (0 < v && v < parm.NparmNames) {
            if (command("%s %s", parm.cmd, parm.parmNames[v]) != COMPLETE) {
                printError("%s", (const char*) lastResponse);
-               return (FALSE);
+               return (false);
            }
        } else {
            printError("Bad %s parameter value %u.", parm.cmd, v);
-           return (FALSE);
+           return (false);
        }
        this->*parm.pv = v;
     }
-    return (TRUE);
+    return (true);
 }
 
 static const char* typeNames[] = { "", "A", "E", "I", "L" };
 const FaxClient::FaxParam FaxClient::typeParam =
     { "TYPE", typeNames, N(typeNames), &FaxClient::type };
-fxBool FaxClient::setType(u_int v)     { return setCommon(typeParam, v); }
+bool FaxClient::setType(u_int v)       { return setCommon(typeParam, v); }
 
 static const char* modeNames[] = { "", "S", "B", "C", "Z" };
 const FaxClient::FaxParam FaxClient::modeParam =
     { "MODE", modeNames, N(modeNames), &FaxClient::mode };
-fxBool FaxClient::setMode(u_int v)     { return setCommon(modeParam, v); }
+bool FaxClient::setMode(u_int v)       { return setCommon(modeParam, v); }
 
 static const char* struNames[] = { "", "F", "R", "P", "T" };
 const FaxClient::FaxParam FaxClient::struParam =
     { "STRU", struNames, N(struNames), &FaxClient::stru };
-fxBool FaxClient::setStruct(u_int v)   { return setCommon(struParam, v); }
+bool FaxClient::setStruct(u_int v)     { return setCommon(struParam, v); }
 
 static const char* formNames[] = { "", "PS", "PS2", "TIFF", "PCL" };
 const FaxClient::FaxParam FaxClient::formParam =
     { "FORM", formNames, N(formNames), &FaxClient::format };
-fxBool FaxClient::setFormat(u_int v)   { return setCommon(formParam, v); }
+bool FaxClient::setFormat(u_int v)     { return setCommon(formParam, v); }
 
 static const char* tzoneNames[] = { "", "GMT", "LOCAL" };
 const FaxClient::FaxParam FaxClient::tzoneParam =
     { "TZONE", tzoneNames, N(tzoneNames), &FaxClient::tzone };
-fxBool
+bool
 FaxClient::setTimeZone(u_int v)
 {
     if (!isLoggedIn()) {               // set and mark pending accordingly
@@ -472,9 +472,9 @@ FaxClient::setTimeZone(u_int v)
                state |= FS_TZPEND;
        } else {
            printError("Bad time zone parameter value %u.", v);
-           return (FALSE);
+           return (false);
        }
-       return (TRUE);
+       return (true);
     } else                             // pass directly to server
        return setCommon(tzoneParam, v);
 }
@@ -502,7 +502,7 @@ FaxClient::setTimeZone(u_int v)
  * is provided for this use.
  */
 
-fxBool
+bool
 FaxClient::initDataConn(fxStr& emsg)
 {
     closeDataConn();
@@ -510,23 +510,23 @@ FaxClient::initDataConn(fxStr& emsg)
        if (!transport->initDataConn(emsg)) {
            if (emsg == "")
                emsg = "Unable to initialize data connection to server";
-           return (FALSE);
+           return (false);
        }
     }
-    return (TRUE);
+    return (true);
 }
 
-fxBool
+bool
 FaxClient::openDataConn(fxStr& emsg)
 {
     if (transport) {
        if (!transport->openDataConn(emsg)) {
            if (emsg == "")
                emsg = "Unable to open data connection to server";
-           return (FALSE);
+           return (false);
        }
     }
-    return (TRUE);
+    return (true);
 }
 
 void
@@ -538,7 +538,7 @@ FaxClient::closeDataConn(void)
     }
 }
 
-fxBool
+bool
 FaxClient::abortDataConn(fxStr& emsg)
 {
     if (fdData >= 0 && transport) {
@@ -546,7 +546,7 @@ FaxClient::abortDataConn(fxStr& emsg)
        if (!transport->abortCmd(emsg)) {
            if (emsg == "")
                emsg = "Unable to abort data connection to server";
-           return (FALSE);
+           return (false);
        }
 #ifdef notdef
        /*
@@ -563,13 +563,13 @@ FaxClient::abortDataConn(fxStr& emsg)
         * existing operation is aborted followed by an ack
         * of the ABOR command itself.
         */
-       if (getReply(FALSE) != TRANSIENT ||     // 4xx operation aborted
-           getReply(FALSE) != COMPLETE) {      // 2xx abort successful
+       if (getReply(false) != TRANSIENT ||     // 4xx operation aborted
+           getReply(false) != COMPLETE) {      // 2xx abort successful
            unexpectedResponse(emsg);
-           return (FALSE);
+           return (false);
        }
     }
-    return (TRUE);
+    return (true);
 }
 
 void
@@ -672,10 +672,10 @@ getReplyCode(const char* cp)
  * handled but not collected.
  */
 int
-FaxClient::getReply(fxBool expecteof)
+FaxClient::getReply(bool expecteof)
 {
     int firstCode = 0;
-    fxBool continuation = FALSE;
+    bool continuation = false;
     do {
        lastResponse.resize(0);
        int c;
@@ -719,9 +719,9 @@ FaxClient::getReply(fxBool expecteof)
            if (lastResponse[3] == '-') {       // continuation line
                if (firstCode == 0)             // first line of reponse
                    firstCode = code;
-               continuation = TRUE;
+               continuation = true;
            } else if (code == firstCode)       // end of continued reply
-               continuation = FALSE;
+               continuation = false;
        }
     } while (continuation || code == 0);
 
@@ -739,7 +739,7 @@ FaxClient::getReply(fxBool expecteof)
  * case was).  The resulting string is checked to
  * make sure that it is not null.
  */
-fxBool
+bool
 FaxClient::extract(u_int& pos, const char* pattern, fxStr& result,
     const char* cmd, fxStr& emsg)
 {
@@ -755,24 +755,24 @@ FaxClient::extract(u_int& pos, const char* pattern, fxStr& result,
     if (l == lastResponse.length()) {
        protocolBotch(emsg, ": No \"%s\" in %s response: %s",
            pattern, cmd, (const char*) lastResponse);
-       return (FALSE);
+       return (false);
     }
     l = lastResponse.skip(l+pat.length(), ' ');// skip white space
     result = lastResponse.extract(l, lastResponse.next(l, ' ')-l);
     if (result == "") {
        protocolBotch(emsg, ": Null %s in %s response: %s",
            pattern, cmd, (const char*) lastResponse);
-       return (FALSE);
+       return (false);
     }
     pos = l;                                   // update position
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Create a new job and return its job-id
  * and group-id, parsed from the reply.
  */
-fxBool
+bool
 FaxClient::newJob(fxStr& jobid, fxStr& groupid, fxStr& emsg)
 {
     if (command("JNEW") == COMPLETE) {
@@ -796,55 +796,55 @@ FaxClient::newJob(fxStr& jobid, fxStr& groupid, fxStr& emsg)
                jobid.resize(jobid.skip(0, "0123456789"));
                groupid.resize(groupid.skip(0, "0123456789"));
                curjob = jobid;
-               return (TRUE);
+               return (true);
            }
        } else
            unexpectedResponse(emsg);
     } else
        emsg = lastResponse;
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Set the current job on the server.
  */
-fxBool
+bool
 FaxClient::setCurrentJob(const char* jobid)
 {
     if (strcasecmp(jobid, curjob) != 0) {
        if (command("JOB %s", jobid) != COMPLETE)
-           return (FALSE);
+           return (false);
        curjob = jobid;
     }
-    return (TRUE);
+    return (true);
 }
 
-fxBool
+bool
 FaxClient::jobParm(const char* name, const fxStr& value)
 {
     return jobParm(name, (const char*) value);
 }
-fxBool
+bool
 FaxClient::jobParm(const char* name, const char* value)
 {
     return (command("JPARM %s \"%s\"", name, value) == COMPLETE);
 }
-fxBool
-FaxClient::jobParm(const char* name, fxBool b)
+bool
+FaxClient::jobParm(const char* name, bool b)
 {
     return (command("JPARM %s %s", name, b ? "YES" : "NO") == COMPLETE);
 }
-fxBool
+bool
 FaxClient::jobParm(const char* name, u_int v)
 {
     return (command("JPARM %s %u", name, v) == COMPLETE);
 }
-fxBool
+bool
 FaxClient::jobParm(const char* name, float v)
 {
     return (command("JPARM %s %g", name, v) == COMPLETE);
 }
-fxBool
+bool
 FaxClient::jobSendTime(const struct tm tm)
 {
     return (command("JPARM SENDTIME %d%02d%02d%02d%02d"
@@ -855,57 +855,57 @@ FaxClient::jobSendTime(const struct tm tm)
        , tm.tm_min
        ) == COMPLETE);
 }
-fxBool
+bool
 FaxClient::jobLastTime(u_long tv)
 {
     return (command("JPARM LASTTIME %02d%02d%02d",
        tv/(24*60*60), (tv/(60*60))%24, (tv/60)%60) == COMPLETE);
 }
-fxBool
+bool
 FaxClient::jobRetryTime(u_long tv)
 {
     return (command("JPARM RETRYTIME %02d%02d", tv/60, tv%60) == COMPLETE);
 }
-fxBool
+bool
 FaxClient::jobCover(const char* docname)
 {
     return (command("JPARM COVER %s", docname) == COMPLETE);
 }
-fxBool
+bool
 FaxClient::jobDocument(const char* docname)
 {
     return (command("JPARM DOCUMENT %s", docname) == COMPLETE);
 }
-fxBool
+bool
 FaxClient::jobPollRequest(const char* sep, const char* pwd)
 {
     return (command("JPARM POLL \"%s\" \"%s\"", sep, pwd) == COMPLETE);
 }
 
-fxBool
+bool
 FaxClient::jobOp(const char* op, const char* jobid)
 {
     return (command(jobid == curjob ? "%s" : "%s %s", op, jobid) == COMPLETE);
 }
-fxBool FaxClient::jobSubmit(const char* jobid) { return jobOp("JSUBM",jobid); }
-fxBool FaxClient::jobSuspend(const char* jobid)        { return jobOp("JSUSP",jobid); }
-fxBool FaxClient::jobKill(const char* jobid)   { return jobOp("JKILL",jobid); }
-fxBool FaxClient::jobDelete(const char* jobid) { return jobOp("JDELE",jobid); }
-fxBool FaxClient::jobWait(const char* jobid)   { return jobOp("JWAIT",jobid); }
+bool FaxClient::jobSubmit(const char* jobid)   { return jobOp("JSUBM",jobid); }
+bool FaxClient::jobSuspend(const char* jobid)  { return jobOp("JSUSP",jobid); }
+bool FaxClient::jobKill(const char* jobid)     { return jobOp("JKILL",jobid); }
+bool FaxClient::jobDelete(const char* jobid)   { return jobOp("JDELE",jobid); }
+bool FaxClient::jobWait(const char* jobid)     { return jobOp("JWAIT",jobid); }
 
-fxBool FaxClient::jgrpSubmit(const char* jgrpid)
+bool FaxClient::jgrpSubmit(const char* jgrpid)
     { return (command("JGSUBM %s", jgrpid) == COMPLETE); }
-fxBool FaxClient::jgrpSuspend(const char* jgrpid)
+bool FaxClient::jgrpSuspend(const char* jgrpid)
     { return (command("JGSUSP %s", jgrpid) == COMPLETE); }
-fxBool FaxClient::jgrpKill(const char* jgrpid)
+bool FaxClient::jgrpKill(const char* jgrpid)
     { return (command("JGKILL %s", jgrpid) == COMPLETE); }
-fxBool FaxClient::jgrpWait(const char* jgrpid)
+bool FaxClient::jgrpWait(const char* jgrpid)
     { return (command("JGWAIT %s", jgrpid) == COMPLETE); }
 
-fxBool
+bool
 FaxClient::runScript(const char* filename, fxStr& emsg)
 {
-    fxBool ok = FALSE;
+    bool ok = false;
     FILE* fd = fopen(filename, "r");
     if (fd != NULL) {
        ok = runScript(fd, filename, emsg);
@@ -915,10 +915,10 @@ FaxClient::runScript(const char* filename, fxStr& emsg)
     return (ok);
 }
 
-fxBool
+bool
 FaxClient::runScript(FILE* fp, const char* filename, fxStr& emsg)
 {
-    fxBool ok = FALSE;
+    bool ok = false;
     struct stat sb;
     (void) Sys::fstat(fileno(fp), sb);
     char* addr;
@@ -942,7 +942,7 @@ FaxClient::runScript(FILE* fp, const char* filename, fxStr& emsg)
     return (ok);
 }
 
-fxBool
+bool
 FaxClient::runScript(const char* script, u_long scriptLen,
     const char* filename, fxStr& emsg)
 {
@@ -957,7 +957,7 @@ FaxClient::runScript(const char* script, u_long scriptLen,
            if (command("%.*s", cmdLen, script) != COMPLETE) {
                emsg = fxStr::format("%s: line %u: %s",
                    filename, lineno, (const char*) lastResponse);
-               return (FALSE);
+               return (false);
            }
        }
        if (*ep == '\n')
@@ -965,14 +965,14 @@ FaxClient::runScript(const char* script, u_long scriptLen,
        scriptLen -= ep - script;
        script = ep;
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Create a uniquely named document on the server
  * that is not removed when the server exits.
  */
-fxBool
+bool
 FaxClient::storeUnique(fxStr& docname, fxStr& emsg)
 {
     return storeUnique("STOU", docname, emsg);
@@ -981,7 +981,7 @@ FaxClient::storeUnique(fxStr& docname, fxStr& emsg)
  * Create a uniquely named document on the server
  * that is automatically removed when the server exits.
  */
-fxBool
+bool
 FaxClient::storeTemp(fxStr& docname, fxStr& emsg)
 {
     return storeUnique("STOT", docname, emsg);
@@ -991,7 +991,7 @@ FaxClient::storeTemp(fxStr& docname, fxStr& emsg)
  * Send a STOU/STOT command and parse the
  * response to get the resulting filename.
  */
-fxBool
+bool
 FaxClient::storeUnique(const char* cmd, fxStr& docname, fxStr& emsg)
 {
     if (command(cmd) == PRELIM) {
@@ -1009,31 +1009,31 @@ FaxClient::storeUnique(const char* cmd, fxStr& docname, fxStr& emsg)
            unexpectedResponse(emsg);
     } else
        emsg = lastResponse;
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Create/overwrite a file on the server.
  */
-fxBool
+bool
 FaxClient::storeFile(fxStr& docname, fxStr& emsg)
 {
     if (command("STOR " | docname) != PRELIM) {
        emsg = lastResponse;
-       return (FALSE);
+       return (false);
     }
     if (code != 150) {
        unexpectedResponse(emsg);
-       return (FALSE);
+       return (false);
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Send a block of raw data on the data
  * conenction, interpreting write errors.
  */
-fxBool
+bool
 FaxClient::sendRawData(void* buf, int cc, fxStr& emsg)
 {
 #ifdef __linux__
@@ -1047,17 +1047,17 @@ FaxClient::sendRawData(void* buf, int cc, fxStr& emsg)
            protocolBotch(emsg, errno == EPIPE ?
                " (server closed connection)" : " (server write error: %s).",
                strerror(errno));
-           return (FALSE);
+           return (false);
        }
 #else
     if (write(fdData, buf, cc) != cc) {
        protocolBotch(emsg, errno == EPIPE ?
            " (server closed connection)" : " (server write error: %s).",
            strerror(errno));
-       return (FALSE);
+       return (false);
     }
 #endif
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -1065,9 +1065,9 @@ FaxClient::sendRawData(void* buf, int cc, fxStr& emsg)
  * and the current transfer parameters.  The server-side
  * document name where data gets placed is returned.
  */
-fxBool
+bool
 FaxClient::sendData(int fd,
-    fxBool (FaxClient::*store)(fxStr&, fxStr&), fxStr& docname, fxStr& emsg)
+    bool (FaxClient::*store)(fxStr&, fxStr&), fxStr& docname, fxStr& emsg)
 {
     char* addr = (char*) -1;
     struct stat sb;
@@ -1108,14 +1108,14 @@ FaxClient::sendData(int fd,
     if (addr != (char*) -1)
        munmap(addr, sb.st_size);
 #endif
-    return (getReply(FALSE) == 2);
+    return (getReply(false) == 2);
 bad:
     closeDataConn();
 #if HAS_MMAP
     if (addr != (char*) -1)
        munmap(addr, sb.st_size);
 #endif
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -1123,9 +1123,9 @@ bad:
  * and the current transfer parameters.  The server-side
  * document name where data gets placed is returned.
  */
-fxBool
+bool
 FaxClient::sendZData(int fd,
-    fxBool (FaxClient::*store)(fxStr&, fxStr&), fxStr& docname, fxStr& emsg)
+    bool (FaxClient::*store)(fxStr&, fxStr&), fxStr& docname, fxStr& emsg)
 {
     z_stream zstream;
     zstream.zalloc = NULL;
@@ -1229,9 +1229,9 @@ FaxClient::sendZData(int fd,
            munmap(addr, sb.st_size);
 #endif
        deflateEnd(&zstream);
-       return (getReply(FALSE) == COMPLETE);
+       return (getReply(false) == COMPLETE);
 bad2:
-       (void) getReply(FALSE);
+       (void) getReply(false);
        /* fall thru... */
 bad:
        closeDataConn();
@@ -1243,7 +1243,7 @@ bad:
     } else
        emsg = fxStr::format("Can not initialize compression library: %s",
            zstream.msg);
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -1255,8 +1255,8 @@ bad:
  * listing (LIST), trigger event trace log (SITE TRIGGER)
  * or other data connection-based transfer.
  */
-fxBool
-FaxClient::recvData(fxBool (*f)(void*, const char*, int, fxStr&),
+bool
+FaxClient::recvData(bool (*f)(void*, const char*, int, fxStr&),
     void* arg, fxStr& emsg, u_long restart, const char* fmt, ...)
 {
     if (!setMode(MODE_S))
@@ -1279,11 +1279,11 @@ FaxClient::recvData(fxBool (*f)(void*, const char*, int, fxStr&),
        int cc = read(fdData, buf, sizeof (buf));
        if (cc == 0) {
            closeDataConn();
-           return (getReply(FALSE) == COMPLETE);
+           return (getReply(false) == COMPLETE);
        }
        if (cc < 0) {
            emsg = fxStr::format("Data Connection: %s", strerror(errno));
-           (void) getReply(FALSE);
+           (void) getReply(false);
            break;
        }
        byte_count += cc;
@@ -1292,7 +1292,7 @@ FaxClient::recvData(fxBool (*f)(void*, const char*, int, fxStr&),
     }
 bad:
     closeDataConn();
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -1304,8 +1304,8 @@ bad:
  * listing (LIST), trigger event trace log (SITE TRIGGER)
  * or other data connection-based transfer.
  */
-fxBool
-FaxClient::recvZData(fxBool (*f)(void*, const char*, int, fxStr&),
+bool
+FaxClient::recvZData(bool (*f)(void*, const char*, int, fxStr&),
     void* arg, fxStr& emsg, u_long restart, const char* fmt, ...)
 {
     z_stream zstream;
@@ -1340,11 +1340,11 @@ FaxClient::recvZData(fxBool (*f)(void*, const char*, int, fxStr&),
                    goto bad;
                closeDataConn();
                (void) inflateEnd(&zstream);
-               return (getReply(FALSE) == COMPLETE);
+               return (getReply(false) == COMPLETE);
            }
            if (cc < 0) {
                emsg = fxStr::format("Data Connection: %s", strerror(errno));
-               (void) getReply(FALSE);
+               (void) getReply(false);
                goto bad;
            }
            zstream.next_in = (Bytef*) buf;
@@ -1369,7 +1369,7 @@ bad:
        inflateEnd(&zstream);
     } else
        emsg = fxStr::format("Can not initialize decoder: %s", zstream.msg);
-    return (FALSE);
+    return (false);
 }
 
 /*
@@ -1401,27 +1401,27 @@ FaxClient::getStatusFormat(u_int flag, const char* cmd, fxStr& fmt)
  * Set the specified status format string
  *  in the client and the server.
  */
-fxBool
+bool
 FaxClient::setStatusFormat(const char* cmd, u_int flag,
     fxStr& fmt, const char* value)
 {
     if (isLoggedIn()) {
        if (command("%s \"%s\"", cmd, value) != COMPLETE) {
            printError("%s", (const char*) lastResponse);
-           return (FALSE);
+           return (false);
        }
        state &= ~flag;
     } else
        state |= flag;
     fmt = value;
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Set the job status format string in the
  * client and the server.
  */
-fxBool
+bool
 FaxClient::setJobStatusFormat(const char* cp)
 {
     return setStatusFormat("JOBFMT", FS_JFMTPEND, jobFmt, cp);
@@ -1442,7 +1442,7 @@ FaxClient::getJobStatusFormat(void)
  * Set the receive queue status format
  * string in the client and the server.
  */
-fxBool
+bool
 FaxClient::setRecvStatusFormat(const char* cp)
 {
     return setStatusFormat("RCVFMT", FS_RFMTPEND, recvFmt, cp);
@@ -1464,7 +1464,7 @@ FaxClient::getRecvStatusFormat(void)
  * Set the modem status format
  * string in the client and the server.
  */
-fxBool
+bool
 FaxClient::setModemStatusFormat(const char* cp)
 {
     return setStatusFormat("MDMFMT", FS_MFMTPEND, modemFmt, cp);
@@ -1485,7 +1485,7 @@ FaxClient::getModemStatusFormat(void)
  * Set the file status format
  * string in the client and the server.
  */
-fxBool
+bool
 FaxClient::setFileStatusFormat(const char* cp)
 {
     return setStatusFormat("FILEFMT", FS_FFMTPEND, fileFmt, cp);
index 1199f9343e7ac604eb8c443eac2667c4935e1549..1541030a1bc0beeadb35d78dce8aea9bf99f9bab 100644 (file)
@@ -134,8 +134,8 @@ private:
 
     void init(void);
 
-    fxBool sendRawData(void* buf, int cc, fxStr& emsg);
-    fxBool setCommon(const FaxParam&, u_int);
+    bool sendRawData(void* buf, int cc, fxStr& emsg);
+    bool setCommon(const FaxParam&, u_int);
 protected:
     FaxClient();
     FaxClient(const fxStr& hostarg);
@@ -147,22 +147,22 @@ protected:
     virtual void vtraceServer(const char* fmt, va_list ap);
 
     void initServerState(void);
-    fxBool jobOp(const char* op, const char* jobid);
-    fxBool extract(u_int& pos, const char* pattern, fxStr& result,
+    bool jobOp(const char* op, const char* jobid);
+    bool extract(u_int& pos, const char* pattern, fxStr& result,
        const char* cmd, fxStr& emsg);
-    fxBool storeUnique(const char* cmd, fxStr& docname, fxStr& emsg);
+    bool storeUnique(const char* cmd, fxStr& docname, fxStr& emsg);
 
     const fxStr& getStatusFormat(u_int flag, const char* cmd, fxStr& fmt);
-    fxBool setStatusFormat(const char* cmd, u_int flag, fxStr&, const char*);
+    bool setStatusFormat(const char* cmd, u_int flag, fxStr&, const char*);
     void makeHeader(const char* fmt, const FaxFmtHeader fmts[], fxStr& header);
 
-    virtual fxBool setupUserIdentity(fxStr& emsg);
+    virtual bool setupUserIdentity(fxStr& emsg);
     void setupHostModem(const char*);
     void setupHostModem(const fxStr&);
 
     virtual void resetConfig(void);
     virtual void setupConfig(void);
-    virtual fxBool setConfigItem(const char* tag, const char* value);
+    virtual bool setConfigItem(const char* tag, const char* value);
     virtual void configError(const char* fmt ...);
     virtual void configTrace(const char* fmt ...);
 
@@ -184,25 +184,25 @@ public:
     void setModem(const char*);
     const fxStr& getModem(void) const;
 
-    virtual fxBool callServer(fxStr& emsg);
-    virtual fxBool hangupServer(void);
-    fxBool isConnected(void) const;
-    fxBool login(const char* user, fxStr& emsg);
-    fxBool admin(const char* pass, fxStr& emsg);
+    virtual bool callServer(fxStr& emsg);
+    virtual bool hangupServer(void);
+    bool isConnected(void) const;
+    bool login(const char* user, fxStr& emsg);
+    bool admin(const char* pass, fxStr& emsg);
     virtual const char* getPasswd(const char* prompt);
-    fxBool isLoggedIn(void) const;
+    bool isLoggedIn(void) const;
     void setCtrlFds(int in, int out);
     FILE* getCtrlFd(void) const;
 
-    virtual fxBool initDataConn(fxStr& emsg);
-    virtual fxBool openDataConn(fxStr& emsg);
+    virtual bool initDataConn(fxStr& emsg);
+    virtual bool openDataConn(fxStr& emsg);
     virtual void closeDataConn(void);
-    virtual fxBool abortDataConn(fxStr& emsg);
+    virtual bool abortDataConn(fxStr& emsg);
     void setDataFd(int fd);
     int getDataFd(void) const;
 
-    void setVerbose(fxBool);
-    fxBool getVerbose(void) const;
+    void setVerbose(bool);
+    bool getVerbose(void) const;
 
     int getPort(void) const;
     const fxStr& getProtoName(void) const;
@@ -213,77 +213,77 @@ public:
     // output
     int command(const char* fmt ...);
     int vcommand(const char* fmt, va_list ap);
-    int getReply(fxBool expectEOF);
+    int getReply(bool expectEOF);
     const fxStr& getLastResponse(void) const;
     int getLastCode(void) const;
     /*
      * Job control support.
      */
     const fxStr& getCurrentJob(void) const;
-    fxBool setCurrentJob(const char* jobid);
-    fxBool newJob(fxStr& jobid, fxStr& groupid, fxStr& emsg);
-    fxBool jobSubmit(const char* jobid);
-    fxBool jobSuspend(const char* jobid);
-    fxBool jobKill(const char* jobid);
-    fxBool jobDelete(const char* jobid);
-    fxBool jobWait(const char* jobid);
+    bool setCurrentJob(const char* jobid);
+    bool newJob(fxStr& jobid, fxStr& groupid, fxStr& emsg);
+    bool jobSubmit(const char* jobid);
+    bool jobSuspend(const char* jobid);
+    bool jobKill(const char* jobid);
+    bool jobDelete(const char* jobid);
+    bool jobWait(const char* jobid);
     /*
      * Set various job parameters.
      */
-    fxBool jobParm(const char* name, const fxStr& value);
-    fxBool jobParm(const char* name, const char* value);
-    fxBool jobParm(const char* name, fxBool b);
-    fxBool jobParm(const char* name, u_int v);
-    fxBool jobParm(const char* name, float v);
-    fxBool jobSendTime(const struct tm tm);
-    fxBool jobLastTime(u_long);
-    fxBool jobRetryTime(u_long);
-    fxBool jobCover(const char* docname);
-    fxBool jobDocument(const char* docname);
-    fxBool jobPollRequest(const char* sep, const char* pwd);
+    bool jobParm(const char* name, const fxStr& value);
+    bool jobParm(const char* name, const char* value);
+    bool jobParm(const char* name, bool b);
+    bool jobParm(const char* name, u_int v);
+    bool jobParm(const char* name, float v);
+    bool jobSendTime(const struct tm tm);
+    bool jobLastTime(u_long);
+    bool jobRetryTime(u_long);
+    bool jobCover(const char* docname);
+    bool jobDocument(const char* docname);
+    bool jobPollRequest(const char* sep, const char* pwd);
     /*
      * Job group control support.
      */
-    fxBool jgrpSubmit(const char* jgrpid);
-    fxBool jgrpSuspend(const char* jgrpid);
-    fxBool jgrpKill(const char* jgrpid);
-    fxBool jgrpWait(const char* jgrpid);
+    bool jgrpSubmit(const char* jgrpid);
+    bool jgrpSuspend(const char* jgrpid);
+    bool jgrpKill(const char* jgrpid);
+    bool jgrpWait(const char* jgrpid);
     /*
      * Query/set transfer state parameters.
      */
     u_int getType(void) const;
-    fxBool setType(u_int);
+    bool setType(u_int);
     u_int getMode(void) const;
-    fxBool setMode(u_int);
+    bool setMode(u_int);
     u_int getStruct(void) const;
-    fxBool setStruct(u_int);
+    bool setStruct(u_int);
     u_int getFormat(void) const;
-    fxBool setFormat(u_int);
+    bool setFormat(u_int);
     u_int getTimeZone(void) const;
-    fxBool setTimeZone(u_int);
+    bool setTimeZone(u_int);
     /*
      * Send documents to the server.
      */
-    fxBool storeUnique(fxStr& docname, fxStr& emsg);   // STOU
-    fxBool storeTemp(fxStr& docname, fxStr& emsg);     // STOT
-    fxBool storeFile(fxStr&, fxStr& emsg);             // STOR
-    fxBool sendData(int fd, fxBool (FaxClient::*store)(fxStr&, fxStr&),
+    bool storeUnique(fxStr& docname, fxStr& emsg);     // STOU
+    bool storeTemp(fxStr& docname, fxStr& emsg);       // STOT
+    bool storeFile(fxStr&, fxStr& emsg);               // STOR
+    bool sendData(int fd, bool (FaxClient::*store)(fxStr&, fxStr&),
        fxStr& docname, fxStr& emsg);
-    fxBool sendZData(int fd, fxBool (FaxClient::*store)(fxStr&, fxStr&),
+    bool sendZData(int fd, bool (FaxClient::*store)(fxStr&, fxStr&),
        fxStr& docname, fxStr& emsg);
     /*
      * Retrieve information from the server.
      */
-    fxBool recvData(fxBool (*f)(void*, const char*, int, fxStr&),
+    bool recvData(bool (*f)(void*, const char*, int, fxStr&),
        void* arg, fxStr& emsg, u_long restart, const char* fmt, ...);
-    fxBool recvZData(fxBool (*f)(void*, const char*, int, fxStr&),
+    bool recvZData(bool (*f)(void*, const char*, int, fxStr&),
        void* arg, fxStr& emsg, u_long restart, const char* fmt, ...);
     /*
      * Job scripting support.
      */
-    fxBool runScript(const char* filename, fxStr& emsg);
-    fxBool runScript(FILE*, const char* filename, fxStr& emsg);
-    fxBool runScript(const char* script, u_long scriptLen,
+    bool runScript(const char* filename, fxStr& emsg);
+    bool runScript(FILE*, const char* filename, fxStr& emsg);
+    bool runScript(const char* script, u_long scriptLen,
        const char* filename, fxStr& emsg);
     /*
      * Status query support.
@@ -293,13 +293,13 @@ public:
     static const FaxFmtHeader modemFormats[];
     static const FaxFmtHeader fileFormats[];
 
-    fxBool setJobStatusFormat(const char*);
+    bool setJobStatusFormat(const char*);
     const fxStr& getJobStatusFormat(void);
-    fxBool setRecvStatusFormat(const char*);
+    bool setRecvStatusFormat(const char*);
     const fxStr& getRecvStatusFormat(void);
-    fxBool setModemStatusFormat(const char*);
+    bool setModemStatusFormat(const char*);
     const fxStr& getModemStatusFormat(void);
-    fxBool setFileStatusFormat(const char*);
+    bool setFileStatusFormat(const char*);
     const fxStr& getFileStatusFormat(void);
     void getJobStatusHeader(fxStr& header);
     void getRecvStatusHeader(fxStr& header);
@@ -311,7 +311,7 @@ inline const fxStr& FaxClient::getUserName(void) const      { return userName; }
 inline const fxStr& FaxClient::getHost(void) const     { return host; }
 inline const fxStr& FaxClient::getModem(void) const    { return modem; }
 inline const fxStr& FaxClient::getProtoName() const    { return proto; }
-inline fxBool FaxClient::getVerbose(void) const
+inline bool FaxClient::getVerbose(void) const
     { return (state&FS_VERBOSE) != 0; }
 inline int FaxClient::getPort(void) const              { return port; }
 inline FILE* FaxClient::getCtrlFd(void) const          { return fdOut; }
@@ -319,9 +319,9 @@ inline int FaxClient::getDataFd(void) const         { return fdData; }
 inline const fxStr& FaxClient::getLastResponse(void) const
     { return lastResponse; }
 inline int FaxClient::getLastCode(void) const          { return code; }
-inline fxBool FaxClient::isLoggedIn(void) const
+inline bool FaxClient::isLoggedIn(void) const
     { return (state&FS_LOGGEDIN) != 0; }
-inline fxBool FaxClient::isConnected(void) const       { return fdIn != NULL; }
+inline bool FaxClient::isConnected(void) const { return fdIn != NULL; }
 inline u_int FaxClient::getType(void) const            { return type; }
 inline u_int FaxClient::getStruct(void) const          { return stru; }
 inline u_int FaxClient::getMode(void) const            { return mode; }
index 8e9e8bd592bdf71a1863f305d81f969ddc125abb..9f8d606259c7f6d57bebd99d8af784db89704d99 100644 (file)
@@ -63,7 +63,7 @@ FaxConfig::readConfig(const fxStr& filename)
 }
 void FaxConfig::resetConfig() { lineno = 0; }
 
-fxBool
+bool
 FaxConfig::updateConfig(const fxStr& filename)
 {
     struct stat sb;
@@ -72,9 +72,9 @@ FaxConfig::updateConfig(const fxStr& filename)
        resetConfig();
        readConfig(path);
        lastModTime = sb.st_mtime;
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 /*
@@ -102,7 +102,7 @@ FaxConfig::tildeExpand(const fxStr& filename)
     return (path);
 }
 
-fxBool
+bool
 FaxConfig::findTag(const char* tag, const void* names0, u_int n, u_int& ix)
 {
     const tags* names = (const tags*) names0;
@@ -111,23 +111,23 @@ FaxConfig::findTag(const char* tag, const void* names0, u_int n, u_int& ix)
        const char* cp = names[i].name;
        if (cp[0] == tag[0] && streq(cp, tag)) {
            ix = i;
-           return (TRUE);
+           return (true);
        }
     }
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 FaxConfig::findValue(const char* value, const char* values[], u_int n, u_int& ix)
 {
     for (u_int i = 0; i < n; i++) {
        const char* cp = values[i];
        if (cp[0] == value[0] && streq(cp, value)) {
            ix = i;
-           return (TRUE);
+           return (true);
        }
     }
-    return (FALSE);
+    return (false);
 }
 
 int
@@ -138,13 +138,13 @@ FaxConfig::getNumber(const char* s)
 
 #define        valeq(a,b)      (strcasecmp(a,b)==0)
 
-fxBool
+bool
 FaxConfig::getBoolean(const char* cp)
 {
     return (valeq(cp, "on") || valeq(cp, "yes") || valeq(cp, "true"));
 }
 
-fxBool
+bool
 FaxConfig::readConfigItem(const char* b)
 {
     char buf[2048];
@@ -155,7 +155,7 @@ FaxConfig::readConfigItem(const char* b)
     for (cp = buf; isspace(*cp); cp++)         // skip leading white space
        ;
     if (*cp == '#' || *cp == '\0')
-       return (TRUE);
+       return (true);
     const char* tag = cp;                      // start of tag
     while (*cp && *cp != ':') {                        // skip to demarcating ':'
        if (isupper(*cp))
@@ -165,7 +165,7 @@ FaxConfig::readConfigItem(const char* b)
     if (*cp != ':') {
        configError("Syntax error at line %u, missing ':' in \"%s\"",
            lineno, b);
-       return (FALSE);
+       return (false);
     }
     for (*cp++ = '\0'; isspace(*cp); cp++)     // skip white space again
        ;
@@ -180,7 +180,7 @@ FaxConfig::readConfigItem(const char* b)
            if (c == '\0') {                    // unmatched quote mark
                configError("Syntax error at line %u, missing quote mark in \"%s\"",
                    lineno, b);
-               return (FALSE);
+               return (false);
            }
            if (c == '\\') {
                c = *++cp;
@@ -211,9 +211,9 @@ FaxConfig::readConfigItem(const char* b)
     if (!setConfigItem(tag, value)) {
        configTrace("Unknown configuration parameter \"%s\" ignored at line %u",
             tag, lineno);
-       return (FALSE);
+       return (false);
     } else {
        configTrace("%s = %s (line %u)", tag, value, lineno);
-       return (TRUE);
+       return (true);
     }
 }
index 5685fd7fcea0755cb689d789b7ba2063baca645e..4f110aef2921a8f375aeab346e58cb38cc14629d 100644 (file)
@@ -40,7 +40,7 @@ protected:
     FaxConfig();
     FaxConfig(const FaxConfig& other);
 
-    virtual fxBool setConfigItem(const char* tag, const char* value) = 0;
+    virtual bool setConfigItem(const char* tag, const char* value) = 0;
     virtual void configError(const char* fmt, ...) = 0;
     virtual void configTrace(const char* fmt, ...) = 0;
     u_int getConfigLineNumber() const;
@@ -55,18 +55,18 @@ public:
     } tags;
 
     // NB: const void* should be const tags* but gcc can't hack it
-    static fxBool findTag(const char*, const void*, u_int, u_int&);
-    static fxBool findValue(const char*, const char*[], u_int, u_int&);
+    static bool findTag(const char*, const void*, u_int, u_int&);
+    static bool findValue(const char*, const char*[], u_int, u_int&);
 
     static int getNumber(const char*);
-    static fxBool getBoolean(const char*);
+    static bool getBoolean(const char*);
 
     fxStr tildeExpand(const fxStr& filename);
 
     virtual void readConfig(const fxStr& filename);
-    virtual fxBool readConfigItem(const char*);
+    virtual bool readConfigItem(const char*);
     virtual void resetConfig();
-    virtual fxBool updateConfig(const fxStr& filename);
+    virtual bool updateConfig(const fxStr& filename);
 };
 inline u_int FaxConfig::getConfigLineNumber() const { return lineno; }
 #endif /* _FaxConfig_ */
index abb81a6447e3a0aded874b6e0986ebbec0ca8d38..9eff88ba2f901ebc6770f2c15bb78fe2045a9b4c 100644 (file)
@@ -146,13 +146,13 @@ FaxDB::parseDatabase(FILE* fd, FaxDBRecord* parent)
 #include "StackBuffer.h"
 #include <ctype.h>
 
-fxBool
+bool
 FaxDB::getToken(FILE* fd, fxStr& token)
 {
     int c;
 top:
     if ((c = getc(fd)) == EOF)
-       return (FALSE);
+       return (false);
     while (isspace(c)) {
        if (c == '\n')
            lineno++;
@@ -162,7 +162,7 @@ top:
        while ((c = getc(fd)) != EOF && c != '\n')
            ;
        if (c == EOF)
-           return (FALSE);
+           return (false);
        lineno++;
        goto top;
     }
@@ -171,7 +171,7 @@ top:
        buf[0] = c;
        buf[1] = '\0';
        token = buf;
-       return (TRUE);
+       return (true);
     }
     fxStackBuffer buf;
     if (c == '"') {
@@ -180,7 +180,7 @@ top:
                c = getc(fd);
                if (c == EOF) {
                    fprintf(stderr, "%s: Premature EOF.\n", (char*) filename);
-                   return (FALSE);
+                   return (false);
                }
                // XXX handle standard escapes
                if (c == '\n')
@@ -203,7 +203,7 @@ top:
     }
     buf.set('\0');
     token = (char*) buf;
-    return (TRUE);
+    return (true);
 }
 
 #ifdef notdef
index bbf20db205653ca9f6b33aa3b1f64ad09871e149..026ba56b780f8aea1dcdded60ce8443da0cd34bc 100644 (file)
@@ -60,7 +60,7 @@ protected:
     FaxInfoDict dict;                  // name->record map
 
     void parseDatabase(FILE*, FaxDBRecord* parent);
-    fxBool getToken(FILE*, fxStr& token);
+    bool getToken(FILE*, fxStr& token);
 public:
     FaxDB(const fxStr& filename);
     ~FaxDB();
index 9ef64c05cb270e65ce7968a3bf8144e70c4e44d3..17f6c909fc941e2db94305966929d87b2266cc36 100644 (file)
@@ -59,40 +59,40 @@ FaxRecvInfo::encode() const
     );
 }
 
-fxBool
+bool
 FaxRecvInfo::decode(const char* cp)
 {
     char* np;
     time = (u_int) strtoul(cp, &np, 16);
     if (np == cp)
-       return (FALSE);
+       return (false);
     npages = (u_short) strtoul(cp = np+1, &np, 16);
     if (np == cp)
-       return (FALSE);
+       return (false);
     params.decode((u_int) strtoul(cp = np+1, &np, 16));
     if (np == cp)
-       return (FALSE);
+       return (false);
     qfile = np+1;
     qfile.resize(qfile.next(0,','));
     cp = strchr(np+1, ',');
     if (cp == NULL)
-       return (FALSE);
+       return (false);
     commid = cp+1;
     commid.resize(commid.next(0,','));
     cp = strchr(cp+1, '"');
     if (cp == NULL)
-       return (FALSE);
+       return (false);
     sender = cp+1;
     sender.resize(sender.next(0,'"'));
     cp = strchr(cp+1, '"');
     if (cp == NULL || cp[1] != ',' || cp[2] != '"')
-       return (FALSE);
+       return (false);
     subaddr = cp+1;
     subaddr.resize(subaddr.next(0,'"'));
     cp = strchr(cp+1, '"');
     if (cp == NULL || cp[1] != ',' || cp[2] != '"')
-       return (FALSE);
+       return (false);
     reason = cp+3;                     // +1 for "/+1 for ,/+1 for "
     reason.resize(reason.next(0,'"'));
-    return (TRUE);
+    return (true);
 }
index 6efade484a721c476b7cf52aefb5a877b0104757..e721fd81aaa96add5d4ca4e71bcf87f60df86e75 100644 (file)
@@ -48,6 +48,6 @@ public:
     ~FaxRecvInfo();
 
     fxStr encode() const;
-    fxBool decode(const char*);
+    bool decode(const char*);
 };
 #endif /* _FaxRecvInfo_ */
index 5d6bf5deb26e207fcc63b3cb5158185254836fe2..b583a5ad327e3c067e3a561ad74aa0ede1fa1d19 100644 (file)
@@ -52,25 +52,25 @@ FaxSendInfo::encode() const
     );
 }
 
-fxBool
+bool
 FaxSendInfo::decode(const char* cp)
 {
     char* np;
     time = (u_int) strtoul(cp, &np, 16);
     if (np == cp)
-       return (FALSE);
+       return (false);
     npages = (u_short) strtoul(cp = np+1, &np, 16);
     if (np == cp)
-       return (FALSE);
+       return (false);
     params.decode((u_int) strtoul(cp = np+1, &np, 16));
     if (np == cp)
-       return (FALSE);
+       return (false);
     commid = np+1;
     commid.resize(commid.next(0,','));
     np = strchr(np+1, '"');
     if (np == NULL)
-       return (FALSE);
+       return (false);
     qfile = np+1;              // +1 for "
     qfile.resize(qfile.next(0,'"'));
-    return (TRUE);
+    return (true);
 }
index 05f00deddc0e8dcc4b60d780ce28b8b1a22e0822..f75184a6610bcbc66c14176c71387942f79a98b7 100644 (file)
@@ -46,6 +46,6 @@ struct FaxSendInfo {
     ~FaxSendInfo();
 
     fxStr encode() const;
-    fxBool decode(const char*);
+    bool decode(const char*);
 };
 #endif /* _FaxSendInfo_ */
index 29544ac646b5130540a4dac686f02c78186b93b4..50c73f0cd90c6195656c49ef1b6f1df957cd2686 100644 (file)
 InetTransport::InetTransport(FaxClient& c) : Transport(c) {}
 InetTransport::~InetTransport(){}
 
-fxBool
+bool
 InetTransport::isA(const char*)
 {
-     return (TRUE);                    // XXX are there checks we can make?
+     return (true);                    // XXX are there checks we can make?
 }
 
 #if CONFIG_INETTRANSPORT
@@ -52,7 +52,7 @@ extern "C" {
 #include <ctype.h>
 #include <errno.h>
 
-fxBool
+bool
 InetTransport::callServer(fxStr& emsg)
 {
     int port = client.getPort();
@@ -79,13 +79,13 @@ InetTransport::callServer(fxStr& emsg)
     struct hostent* hp = Socket::gethostbyname(client.getHost());
     if (!hp) {
        emsg = client.getHost() | ": Unknown host";
-       return (FALSE);
+       return (false);
     }
     
     int fd = socket(hp->h_addrtype, SOCK_STREAM, protocol);
     if (fd < 0) {
        emsg = "Can not create socket to connect to server.";
-       return (FALSE);
+       return (false);
     }
     struct sockaddr_in sin;
     memset(&sin, 0, sizeof (sin));
@@ -133,29 +133,29 @@ InetTransport::callServer(fxStr& emsg)
             * input and output (sigh).
             */
            client.setCtrlFds(fd, dup(fd));
-           return (TRUE);
+           return (true);
        }
     }
     emsg = fxStr::format("Can not reach server at host \"%s\", port %u.",
        (const char*) client.getHost(), ntohs(sin.sin_port));
     Sys::close(fd), fd = -1;
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 InetTransport::initDataConn(fxStr& emsg)
 {
     struct sockaddr_in data_addr;
     socklen_t dlen = sizeof (data_addr);
     if (Socket::getsockname(fileno(client.getCtrlFd()), &data_addr, &dlen) < 0) {
        emsg = fxStr::format("getsockname(ctrl): %s", strerror(errno));
-       return (FALSE);
+       return (false);
     }
     data_addr.sin_port = 0;            // let system allocate port
     int fd = socket(AF_INET, SOCK_STREAM, 0);
     if (fd < 0) {
        emsg = fxStr::format("socket: %s", strerror(errno));
-       return (FALSE);
+       return (false);
     }
     if (Socket::bind(fd, &data_addr, sizeof (data_addr)) < 0) {
        emsg = fxStr::format("bind: %s", strerror(errno));
@@ -176,16 +176,16 @@ InetTransport::initDataConn(fxStr& emsg)
     if (client.command("PORT %u,%u,%u,%u,%u,%u",
        UC(a[0]), UC(a[1]), UC(a[2]), UC(a[3]),
        UC(p[0]), UC(p[1])) != FaxClient::COMPLETE)
-       return (FALSE);
+       return (false);
 #undef UC
     client.setDataFd(fd);
-    return (TRUE);
+    return (true);
 bad:
     Sys::close(fd), fd = -1;
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 InetTransport::openDataConn(fxStr& emsg)
 {
     int s = Socket::accept(client.getDataFd(), NULL, NULL);
@@ -196,10 +196,10 @@ InetTransport::openDataConn(fxStr& emsg)
        if (Socket::setsockopt(s, IPPROTO_IP, IP_TOS, &tos, sizeof (tos)) < 0)
            client.printWarning("setsockopt(IP_TOS): %s", strerror(errno));
 #endif
-       return (TRUE);
+       return (true);
     } else {
        emsg = fxStr::format("accept: %s", strerror(errno));
-       return (FALSE);
+       return (false);
     }
 }
 
@@ -213,7 +213,7 @@ InetTransport::openDataConn(fxStr& emsg)
  * rather than before as done by most contemporary
  * TCP implementations.
  */
-fxBool
+bool
 InetTransport::abortCmd(fxStr& emsg)
 {
     static const char msg[] =
@@ -221,21 +221,21 @@ InetTransport::abortCmd(fxStr& emsg)
     int s = fileno(client.getCtrlFd());
     if (send(s, msg, 3, MSG_OOB) != 3) {
        emsg = fxStr::format("send(MSG_OOB): %s", strerror(errno));
-       return (FALSE);
+       return (false);
     }
     if (send(s, msg+3, sizeof (msg)-3, 0) != sizeof (msg)-3) {
        emsg = fxStr::format("send(<DM>ABOR\\r\\n): %s", strerror(errno));
-       return (FALSE);
+       return (false);
     }
-    return (TRUE);
+    return (true);
 }
 #else
-fxBool InetTransport::callServer(fxStr& emsg)
-    { notConfigured("TCP/IP", emsg); return (FALSE); }
-fxBool InetTransport::initDataConn(fxStr& emsg)
-    { notConfigured("TCP/IP", emsg); return (FALSE); }
-fxBool InetTransport::openDataConn(fxStr& emsg)
-    { notConfigured("TCP/IP", emsg); return (FALSE); }
-fxBool InetTransport::abortDataConn(fxStr& emsg)
-    { notConfigured("TCP/IP", emsg); return (FALSE); }
+bool InetTransport::callServer(fxStr& emsg)
+    { notConfigured("TCP/IP", emsg); return (false); }
+bool InetTransport::initDataConn(fxStr& emsg)
+    { notConfigured("TCP/IP", emsg); return (false); }
+bool InetTransport::openDataConn(fxStr& emsg)
+    { notConfigured("TCP/IP", emsg); return (false); }
+bool InetTransport::abortDataConn(fxStr& emsg)
+    { notConfigured("TCP/IP", emsg); return (false); }
 #endif
index 245e024547b9cbf8746ed5ece22accaad56e21b6..453291559d2ae31a3ea2f09015db1238a97ffa8b 100644 (file)
@@ -35,12 +35,12 @@ public:
     InetTransport(FaxClient&);
     ~InetTransport();
 
-    static fxBool isA(const char*);
+    static bool isA(const char*);
 
-    fxBool callServer(fxStr& emsg);
-    fxBool abortCmd(fxStr& emsg);
+    bool callServer(fxStr& emsg);
+    bool abortCmd(fxStr& emsg);
 
-    fxBool initDataConn(fxStr& emsg);
-    fxBool openDataConn(fxStr& emsg);
+    bool initDataConn(fxStr& emsg);
+    bool openDataConn(fxStr& emsg);
 };
 #endif /* _InetTransport_ */
index d17cd5d8d97cd36cc1e2326bd06d7c5c79785e5f..b025ed5bde79d8b977e85d4b340fa4d9c0dab53d 100644 (file)
@@ -36,7 +36,7 @@ struct ModemExt {
     fxStr      number;         // modem phone number
     fxStr      commid;         // communication identifier
     char       state;          // modem state
-    fxBool     canpoll;        // modem is capable of polling
+    bool       canpoll;        // modem is capable of polling
     u_short    priority;       // scheduling priority
     Class2Params caps;         // modem capabilities
 
index 52949965dfa663494c0c9ab07fc8741bcf2a29aa..976f57af26fe40f7ea2ef3cb1c8c38cda9c99530 100644 (file)
@@ -52,7 +52,7 @@ parseError(const char* file, u_int lineno, const char* fmt ...)
     va_end(ap);
 }
 
-fxBool
+bool
 PageSizeInfo::skipws(char*& cp,
     const char* file, const char* item, u_int lineno)
 {
@@ -63,9 +63,9 @@ PageSizeInfo::skipws(char*& cp,
     if (*cp == '\0') {
        parseError(file, lineno,
            "Unexpected end of line after \"%s\".\n", item);
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 PageInfoArray*
@@ -285,5 +285,5 @@ PageSizeInfoIter::operator const PageSizeInfo&()
        pi.info = &(*PageSizeInfo::pageInfo)[i];
     return (pi);
 }
-fxBool PageSizeInfoIter::notDone()
+bool PageSizeInfoIter::notDone()
     { return i < PageSizeInfo::pageInfo->length(); }
index 692cb6bfb99fe5f8af3498f1ea6cac3c77a38076..05c9ea6dd51ad4f2a434fa50ff666f9e734ec7ca 100644 (file)
@@ -55,7 +55,7 @@ private:
 
     static const PageInfo* getPageInfoByName(const char* name);
     static PageInfoArray* readPageInfoFile();
-    static fxBool skipws(char*& cp,
+    static bool skipws(char*& cp,
                const char* file, const char* item, u_int lineno);
 
     static float toMM(BMU v)           { return (v/1200.)*25.4; }
@@ -98,7 +98,7 @@ public:
     void operator++();
     void operator++(int);
     operator const PageSizeInfo&();
-    fxBool notDone();
+    bool notDone();
 };
 #else
 /*
index da28cd756994bde8583eded88e8d25f81b3d4319..477945f6f7f70cafb4e396495f388ecf154b9185 100644 (file)
@@ -63,7 +63,7 @@ RegEx::init(int flags)
     }
 }
 
-fxBool
+bool
 RegEx::Find(const char* text, u_int length, u_int off)
 {
     if (compResult == 0) {
index a0da9a8a2e94a2cf7606fc0dfad16b4ae4111f44..c76208e422a2555d944564fcac8ed5c215f385cc 100644 (file)
@@ -44,8 +44,8 @@ public:
 
     const char* pattern() const;
 
-    fxBool Find(const char* text, u_int length, u_int off = 0);
-    fxBool Find(const fxStr& s, u_int off = 0);
+    bool Find(const char* text, u_int length, u_int off = 0);
+    bool Find(const fxStr& s, u_int off = 0);
     int StartOfMatch(u_int subexp = 0) const;
     int EndOfMatch(u_int subexp = 0) const;
 
@@ -61,7 +61,7 @@ private:
     void       init(int flags);
 };
 
-inline fxBool RegEx::Find(const fxStr& s, u_int off)
+inline bool RegEx::Find(const fxStr& s, u_int off)
     { return Find(s, s.length(), off); }
 inline const char* RegEx::pattern() const      { return _pattern; }
 inline int RegEx::getErrorCode() const         { return execResult; }
index 15336a34545e2219e7dde83b2bbe77af84c4a205..509bb2fe0b3139b554a24459cf56b836cb50793a 100644 (file)
@@ -154,7 +154,7 @@ void SNPPClient::setModem(const fxStr& modemarg){ modem = modemarg; }
 void SNPPClient::setModem(const char* modemarg)        { modem = modemarg; }
 
 void
-SNPPClient::setVerbose(fxBool v)
+SNPPClient::setVerbose(bool v)
 {
     if (v)
        state |= SS_VERBOSE;
@@ -165,7 +165,7 @@ SNPPClient::setVerbose(fxBool v)
 /*
  * Setup the sender's identity.
  */
-fxBool
+bool
 SNPPClient::setupSenderIdentity(fxStr& emsg)
 {
     setupUserIdentity(emsg);                   // client identity
@@ -206,9 +206,9 @@ SNPPClient::setupSenderIdentity(fxStr& emsg)
     fxStr mbox;
     if (senderName == "" || !getNonBlankMailbox(mbox)) {
        emsg = "Malformed (null) sender name or mail address";
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 void SNPPClient::setFromIdentity(const char* s)                { from = s; }
 
@@ -230,20 +230,20 @@ SNPPClient::setBlankMailboxes(const fxStr& s)
  * Return the first non-null mailbox string
  * in the set of jobs.
  */
-fxBool
+bool
 SNPPClient::getNonBlankMailbox(fxStr& s)
 {
     for (u_int i = 0, n = jobs->length(); i < n; i++) {
        SNPPJob& job = (*jobs)[i];
        if (job.getMailbox() != "") {
            s = job.getMailbox();
-           return (TRUE);
+           return (true);
        }
     }
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 SNPPClient::setupUserIdentity(fxStr& emsg)
 {
     struct passwd* pwd = NULL;
@@ -259,7 +259,7 @@ SNPPClient::setupUserIdentity(fxStr& emsg)
        emsg = fxStr::format(
            "Can not locate your password entry (account name %s, uid %lu).",
            (name ? name : "<unspecified>"), (u_long) getuid());
-       return (FALSE);
+       return (false);
     }
     userName = pwd->pw_name;
     if (pwd->pw_gecos && pwd->pw_gecos[0] != '\0') {
@@ -283,9 +283,9 @@ SNPPClient::setupUserIdentity(fxStr& emsg)
     if (senderName.length() == 0) {
        emsg = "Bad (null) user name; your password file entry"
            " probably has bogus GECOS field information.";
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 void
@@ -368,7 +368,7 @@ SNPPClient::configTrace(const char* fmt ...)
     }
 }
 
-fxBool
+bool
 SNPPClient::setConfigItem(const char* tag, const char* value)
 {
     u_int ix;
@@ -401,11 +401,11 @@ SNPPClient::setConfigItem(const char* tag, const char* value)
     } else if (streq(tag, "mailaddr")) {
        jproto.setMailbox(value);
     } else
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 
-fxBool
+bool
 SNPPClient::callServer(fxStr& emsg)
 {
     if (host.length() == 0) {          // if host not specified by -h
@@ -426,9 +426,9 @@ SNPPClient::callServer(fxStr& emsg)
         * Transport code is expected to call back through
         * setCtrlFds so fdIn should be properly setup...
         */
-       return (fdIn != NULL && getReply(FALSE) == COMPLETE);
+       return (fdIn != NULL && getReply(false) == COMPLETE);
     } else
-       return (FALSE);
+       return (false);
 }
 
 #if CONFIG_INETTRANSPORT
@@ -443,7 +443,7 @@ extern "C" {
 #include <netdb.h>
 }
 
-fxBool
+bool
 SNPPClient::callInetServer(fxStr& emsg)
 {
     fxStr proto(getProtoName());
@@ -458,7 +458,7 @@ SNPPClient::callInetServer(fxStr& emsg)
     struct hostent* hp = Socket::gethostbyname(getHost());
     if (!hp) {
        emsg = getHost() | ": Unknown host";
-       return (FALSE);
+       return (false);
     }
     int protocol;
     const char* cproto = proto;                        // XXX for busted include files
@@ -471,7 +471,7 @@ SNPPClient::callInetServer(fxStr& emsg)
     int fd = socket(hp->h_addrtype, SOCK_STREAM, protocol);
     if (fd < 0) {
        emsg = "Can not create socket to connect to server.";
-       return (FALSE);
+       return (false);
     }
     struct sockaddr_in sin;
     memset(&sin, 0, sizeof (sin));
@@ -513,24 +513,24 @@ SNPPClient::callInetServer(fxStr& emsg)
                    strerror(errno));
 #endif
            setCtrlFds(fd, fd);
-           return (TRUE);
+           return (true);
        }
     }
     emsg = fxStr::format("Can not reach server at host \"%s\", port %u.",
        (const char*) getHost(), ntohs(sin.sin_port));
     close(fd), fd = -1;
-    return (FALSE);
+    return (false);
 }
 #else
-fxBool
+bool
 SNPPServer::callInetServer(fxStr& emsg)
 {
     emsg = "Sorry, no TCP/IP communication support was configured.";
-    return (FALSE);
+    return (false);
 }
 #endif
 
-fxBool
+bool
 SNPPClient::hangupServer(void)
 {
     if (fdIn != NULL)
@@ -538,7 +538,7 @@ SNPPClient::hangupServer(void)
     if (fdOut != NULL)
        fclose(fdOut), fdOut = NULL;
     initServerState();
-    return (TRUE);
+    return (true);
 }
 
 void
@@ -555,7 +555,7 @@ SNPPClient::setCtrlFds(int in, int out)
 /*
  * Do login procedure.
  */
-fxBool
+bool
 SNPPClient::login(const char* user, fxStr& emsg)
 {
     if (user == NULL) {
@@ -574,10 +574,10 @@ SNPPClient::login(const char* user, fxStr& emsg)
            state |= SS_HASSITE;
        else
            state &= ~SS_HASSITE;
-       return (TRUE);
+       return (true);
     } else {
        emsg = "Login failed: " | lastResponse;
-       return (FALSE);
+       return (false);
     }
 }
 
@@ -688,10 +688,10 @@ getReplyCode(const char* cp)
  * handled but not collected.
  */
 int
-SNPPClient::getReply(fxBool expecteof)
+SNPPClient::getReply(bool expecteof)
 {
     int firstCode = 0;
-    fxBool continuation = FALSE;
+    bool continuation = false;
     do {
        lastResponse.resize(0);
        int c;
@@ -735,9 +735,9 @@ SNPPClient::getReply(fxBool expecteof)
            if (lastResponse[3] == '-') {       // continuation line
                if (firstCode == 0)             // first line of reponse
                    firstCode = code;
-               continuation = TRUE;
+               continuation = true;
            } else if (code == firstCode)       // end of continued reply
-               continuation = FALSE;
+               continuation = false;
        }
     } while (continuation || code == 0);
 
@@ -755,7 +755,7 @@ SNPPClient::getReply(fxBool expecteof)
  * case was).  The resulting string is checked to
  * make sure that it is not null.
  */
-fxBool
+bool
 SNPPClient::extract(u_int& pos, const char* pattern, fxStr& result)
 {
     fxStr pat(pattern);
@@ -768,13 +768,13 @@ SNPPClient::extract(u_int& pos, const char* pattern, fxStr& result)
        l = lastResponse.find(pos, pat);
     }
     if (l == lastResponse.length())
-       return (FALSE);
+       return (false);
     l = lastResponse.skip(l+pat.length(), ' ');// skip white space
     result = lastResponse.extract(l, lastResponse.next(l, ' ')-l);
     if (result == "")
-       return (FALSE);
+       return (false);
     pos = l;                                   // update position
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -782,7 +782,7 @@ SNPPClient::extract(u_int& pos, const char* pattern, fxStr& result)
  * parsed from the reply (this is for HylaFAX,
  * RFC 1861 says nothing about this).
  */
-fxBool
+bool
 SNPPClient::newPage(const fxStr& pin, const fxStr& passwd, fxStr& jobid, fxStr& emsg)
 {
     int result;
@@ -810,12 +810,12 @@ SNPPClient::newPage(const fxStr& pin, const fxStr& passwd, fxStr& jobid, fxStr&
                jobid.resize(jobid.skip(0, "0123456789"));
            } else
                jobid = "unknown";
-           return (TRUE);
+           return (true);
        } else
            unexpectedResponse(emsg);
     } else
        emsg = lastResponse;
-    return (FALSE);
+    return (false);
 }
 
 SNPPJob&
@@ -847,19 +847,19 @@ SNPPClient::removeJob(const SNPPJob& job)
        jobs->remove(ix);
 }
 
-fxBool
+bool
 SNPPClient::prepareForJobSubmissions(fxStr&)
 {
     // XXX nothing to do right now
-    return (TRUE);
+    return (true);
 }
 
-fxBool
+bool
 SNPPClient::submitJobs(fxStr& emsg)
 {
     if (!isLoggedIn()) {
        emsg = "Not logged in to server";
-       return (FALSE);
+       return (false);
     }
     /*
      * Construct jobs and submit them.
@@ -867,21 +867,21 @@ SNPPClient::submitJobs(fxStr& emsg)
     for (u_int i = 0, n = jobs->length(); i < n; i++) {
        SNPPJob& job = (*jobs)[i];
        if (!job.createJob(*this, emsg))
-           return (FALSE);
+           return (false);
        notifyNewJob(job);                      // notify client
     }
     if (msgFile != "") {
        if (!sendData(msgFile, emsg))
-           return (FALSE);
+           return (false);
     } else if (msg) {
        if (!sendMsg(*msg, emsg))
-           return (FALSE);
+           return (false);
     }
     if (command("SEND") != COMPLETE) {
        emsg = lastResponse;
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 /*
@@ -901,7 +901,7 @@ SNPPClient::notifyNewJob(const SNPPJob& job)
  * Send a block of raw data on the data
  * conenction, interpreting write errors.
  */
-fxBool
+bool
 SNPPClient::sendRawData(void* buf, int cc, fxStr& emsg)
 {
 #ifdef __linux__
@@ -915,20 +915,20 @@ SNPPClient::sendRawData(void* buf, int cc, fxStr& emsg)
            protocolBotch(emsg, errno == EPIPE ?
                " (server closed connection)" : " (server write error: %s).",
                strerror(errno));
-           return (FALSE);
+           return (false);
        }
 #else
     if (write(fileno(fdOut), buf, cc) != cc) {
        protocolBotch(emsg, errno == EPIPE ?
            " (server closed connection)" : " (server write error: %s).",
            strerror(errno));
-       return (FALSE);
+       return (false);
     }
 #endif
-    return (TRUE);
+    return (true);
 }
 
-fxBool
+bool
 SNPPClient::sendData(int fd, fxStr& emsg)
 {
     struct stat sb;
@@ -942,23 +942,23 @@ SNPPClient::sendData(int fd, fxStr& emsg)
            size_t n = fxmin(cc, sizeof (buf));
            if (read(fd, buf, n) != n) {
                protocolBotch(emsg, " (data read: %s).", strerror(errno));
-               return (FALSE);
+               return (false);
            }
            if (!sendRawData(buf, n, emsg))
-               return (FALSE);
+               return (false);
            cc -= n;
        }
        if (command(".") == COMPLETE)
-           return (TRUE);
+           return (true);
     }
     emsg = getLastResponse();
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 SNPPClient::sendData(const fxStr& filename, fxStr& emsg)
 {
-    fxBool ok = FALSE;
+    bool ok = false;
     int fd = Sys::open(filename, O_RDONLY);
     if (fd >= 0) {
        ok = sendData(fd, emsg);
@@ -969,37 +969,37 @@ SNPPClient::sendData(const fxStr& filename, fxStr& emsg)
     return (ok);
 }
 
-fxBool
+bool
 SNPPClient::sendMsg(const char* msg, fxStr& emsg)
 {
     if (command("MESS %s", msg) != COMPLETE) {
        emsg = getLastResponse();
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
-fxBool
+bool
 SNPPClient::siteParm(const char* name, const fxStr& value)
 {
     if (!hasSiteCmd()) {
        printWarning("no SITE %s support; ignoring set request.", name);
-       return (TRUE);
+       return (true);
     } else
        return (command("SITE %s %s", name, (const char*) value) == COMPLETE);
 }
 
-fxBool
+bool
 SNPPClient::siteParm(const char* name, u_int value)
 {
     if (!hasSiteCmd()) {
        printWarning("no SITE %s support; ignoring set request.", name);
-       return (TRUE);
+       return (true);
     } else
        return (command("SITE %s %u", name, value) == COMPLETE);
 }
 
-fxBool
+bool
 SNPPClient::setHoldTime(u_int t)
 {
     time_t tv = t;
@@ -1012,7 +1012,7 @@ SNPPClient::setHoldTime(u_int t)
        , tm->tm_min) == COMPLETE);
 }
 
-fxBool
+bool
 SNPPClient::setRetryTime(u_int t)
 {
     return siteParm("RETRYTIME", fxStr::format("%02d%02d", t/60, t%60));
index 3c70dec0f53c9eb8e1fb9d6c92a1a8bb8ab17720..7941f852414c232f3413c4d95b79578203f0c092 100644 (file)
@@ -80,7 +80,7 @@ private:
     static const S_numbertag numbers[];
 
     void init(void);
-    fxBool callInetServer(fxStr& emsg);
+    bool callInetServer(fxStr& emsg);
 protected:
     SNPPClient();
     SNPPClient(const fxStr& hostarg);
@@ -104,9 +104,9 @@ protected:
     virtual void notifyNewJob(const SNPPJob& job);
 
     void initServerState(void);
-    fxBool extract(u_int& pos, const char* pattern, fxStr& result);
+    bool extract(u_int& pos, const char* pattern, fxStr& result);
 
-    virtual fxBool setupUserIdentity(fxStr& emsg);
+    virtual bool setupUserIdentity(fxStr& emsg);
     void setupHostModem(const char*);
     void setupHostModem(const fxStr&);
 
@@ -114,7 +114,7 @@ protected:
      * Miscellaneous stuff used by setupSenderIdentity.
      */
     void setBlankMailboxes(const fxStr&);
-    fxBool getNonBlankMailbox(fxStr&);
+    bool getNonBlankMailbox(fxStr&);
 
     /*
      * Configuration file support; derived classes may override
@@ -122,19 +122,19 @@ protected:
      */
     virtual void resetConfig(void);
     virtual void setupConfig(void);
-    virtual fxBool setConfigItem(const char* tag, const char* value);
+    virtual bool setConfigItem(const char* tag, const char* value);
     virtual void configError(const char* fmt ...);
     virtual void configTrace(const char* fmt ...);
 
-    fxBool sendRawData(void* buf, int cc, fxStr& emsg);
+    bool sendRawData(void* buf, int cc, fxStr& emsg);
     void unexpectedResponse(fxStr& emsg);
     void protocolBotch(fxStr& emsg, const char* fmt ...);
     virtual void lostServer(void);
 public:
     virtual ~SNPPClient();
                                                // prepare jobs for submission
-    virtual fxBool prepareForJobSubmissions(fxStr& emsg);
-    virtual fxBool submitJobs(fxStr& emsg);    // submit documents & jobs
+    virtual bool prepareForJobSubmissions(fxStr& emsg);
+    virtual bool submitJobs(fxStr& emsg);      // submit documents & jobs
 
     /*
      * Sender identity controls.  There are two separate
@@ -144,7 +144,7 @@ public:
      * is used by proxy services such as email to pager gateways
      * and for folks that submit jobs for other people.
      */
-    fxBool setupSenderIdentity(fxStr& emsg);   // identity associated with job
+    bool setupSenderIdentity(fxStr& emsg);     // identity associated with job
     const fxStr& getSenderName() const;
     void setFromIdentity(const char*);         // identity associated with page
     const fxStr& getFromIdentity() const;
@@ -159,19 +159,19 @@ public:
     void setModem(const char*);
     const fxStr& getModem(void) const;
 
-    virtual fxBool callServer(fxStr& emsg);
-    virtual fxBool hangupServer(void);
-    fxBool isConnected(void) const;
-    fxBool login(const char* user, fxStr& emsg);
+    virtual bool callServer(fxStr& emsg);
+    virtual bool hangupServer(void);
+    bool isConnected(void) const;
+    bool login(const char* user, fxStr& emsg);
     virtual const char* getPasswd(const char* prompt);
-    fxBool isLoggedIn(void) const;
+    bool isLoggedIn(void) const;
     void setCtrlFds(int in, int out);
     FILE* getCtrlFd(void) const;
 
-    void setVerbose(fxBool);
-    fxBool getVerbose(void) const;
+    void setVerbose(bool);
+    bool getVerbose(void) const;
 
-    fxBool hasSiteCmd(void) const;             // server has SITE cmd support
+    bool hasSiteCmd(void) const;               // server has SITE cmd support
 
     int getPort(void) const;
     const fxStr& getProtoName(void) const;
@@ -181,7 +181,7 @@ public:
     // output
     int command(const char* fmt ...);
     int vcommand(const char* fmt, va_list ap);
-    int getReply(fxBool expectEOF);
+    int getReply(bool expectEOF);
     const fxStr& getLastResponse(void) const;
     int getLastCode(void) const;
 
@@ -200,15 +200,15 @@ public:
 
     SNPPJob& getProtoJob();
 
-    fxBool setHoldTime(u_int t);
-    fxBool setRetryTime(u_int t);
-    fxBool siteParm(const char* name, const fxStr& v);
-    fxBool siteParm(const char* name, u_int v);
-    fxBool newPage(const fxStr& pin, const fxStr& passwd,
+    bool setHoldTime(u_int t);
+    bool setRetryTime(u_int t);
+    bool siteParm(const char* name, const fxStr& v);
+    bool siteParm(const char* name, u_int v);
+    bool newPage(const fxStr& pin, const fxStr& passwd,
        fxStr& jobid, fxStr& emsg);
-    fxBool sendData(int fd, fxStr& emsg);
-    fxBool sendData(const fxStr& filename, fxStr& emsg);
-    fxBool sendMsg(const char* msg, fxStr& emsg);
+    bool sendData(int fd, fxStr& emsg);
+    bool sendData(const fxStr& filename, fxStr& emsg);
+    bool sendMsg(const char* msg, fxStr& emsg);
 
     void printError(const char* fmt ...);
     void printWarning(const char* fmt ...);
@@ -220,17 +220,17 @@ inline const fxStr& SNPPClient::getUserName(void) const   { return userName; }
 inline const fxStr& SNPPClient::getHost(void) const    { return host; }
 inline const fxStr& SNPPClient::getModem(void) const   { return modem; }
 inline const fxStr& SNPPClient::getProtoName() const   { return proto; }
-inline fxBool SNPPClient::getVerbose(void) const
+inline bool SNPPClient::getVerbose(void) const
     { return (state&SS_VERBOSE) != 0; }
 inline int SNPPClient::getPort(void) const             { return port; }
 inline FILE* SNPPClient::getCtrlFd(void) const         { return fdOut; }
 inline const fxStr& SNPPClient::getLastResponse(void) const
     { return lastResponse; }
 inline int SNPPClient::getLastCode(void) const         { return code; }
-inline fxBool SNPPClient::isLoggedIn(void) const
+inline bool SNPPClient::isLoggedIn(void) const
     { return (state&SS_LOGGEDIN) != 0; }
-inline fxBool SNPPClient::isConnected(void) const      { return fdIn != NULL; }
-inline fxBool SNPPClient::hasSiteCmd(void) const
+inline bool SNPPClient::isConnected(void) const        { return fdIn != NULL; }
+inline bool SNPPClient::hasSiteCmd(void) const
     { return (state&SS_HASSITE) != 0 ; }
 inline SNPPJob& SNPPClient::getProtoJob()              { return jproto; }
 inline const fxStr* SNPPClient::getPagerMsg() const    { return msg; }
index 834a08eb2492bb3025fcd23b68b7f8668ac4d59a..357fe3cb625b7b6a4fe55fbd6273ff0fd094bcac 100644 (file)
@@ -61,7 +61,7 @@ SNPPJob::~SNPPJob() {}
 #define        valeq(a,b)      (strcasecmp(a,b)==0)
 #define        valneq(a,b,n)   (strncasecmp(a,b,n)==0)
 
-fxBool
+bool
 SNPPJob::setNotification(const char* v0)
 {
     const char* v = v0;
@@ -78,8 +78,8 @@ SNPPJob::setNotification(const char* v0)
     else if (valeq(v, "default"))
        setNotification(SNPP_DEFNOTIFY);
     else
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 void SNPPJob::setNotification(PageNotify n)            { notify = n; }
 /*
@@ -132,17 +132,17 @@ void SNPPJob::setRetryTime(u_int v)                       { retryTime = v; }
 extern int
 parseAtSyntax(const char* s, const struct tm& ref, struct tm& at0, fxStr& emsg);
 
-fxBool
+bool
 SNPPJob::setHoldTime(const char* s, fxStr& emsg)
 {
     struct tm tts;
     time_t now = Sys::now();
     if (!parseAtSyntax(s, *localtime(&now), tts, emsg)) {
        emsg.insert(fxStr::format("%s: ", s));
-       return (FALSE);
+       return (false);
     } else {
        setHoldTime((u_int) mktime(&tts));
-       return (TRUE);
+       return (true);
     }
 }
 void SNPPJob::setHoldTime(u_int v)                     { holdTime = v; }
@@ -150,7 +150,7 @@ void SNPPJob::setMaxTries(u_int n)                  { maxRetries = n; }
 void SNPPJob::setMaxDials(u_int n)                     { maxDials = n; }
 void SNPPJob::setPIN(const char* s)                    { pin = s; }
 void SNPPJob::setPassword(const char* s)               { passwd = s; }
-void SNPPJob::setQueued(fxBool v)                      { queued = v; }
+void SNPPJob::setQueued(bool v)                        { queued = v; }
 void SNPPJob::setSubject(const char* s)                        { subject = s; }
 void SNPPJob::setServiceLevel(u_int n)                 { serviceLevel = n; }
 
@@ -160,7 +160,7 @@ void SNPPJob::setServiceLevel(u_int n)                      { serviceLevel = n; }
 #define        CHECKPARM(a,b)  CHECK(client.siteParm(a,b))
 #define        IFPARM(a,b,v)   { if ((b) != (v)) CHECKPARM(a,b) }
 
-fxBool
+bool
 SNPPJob::createJob(SNPPClient& client, fxStr& emsg)
 {
     if (holdTime != 0 && !client.setHoldTime((u_int) holdTime))
@@ -185,7 +185,7 @@ SNPPJob::createJob(SNPPClient& client, fxStr& emsg)
     return (client.newPage(pin, passwd, jobid, emsg));
 failure:
     emsg = client.getLastResponse();
-    return (FALSE);
+    return (false);
 }
 #undef IFPARM
 #undef CHECKPARM
index aabf7258da26312cc43eff4b0a77b4bea2f67ffe..7a9a30db24cbeedd3423edf8e863c5646190890c 100644 (file)
@@ -54,7 +54,7 @@ private:
     u_int      maxRetries;             // max number times to try send
     u_int      maxDials;               // max number times to dial telephone
     u_int      serviceLevel;           // delivery service type
-    fxBool     queued;                 // queued delivery
+    bool       queued;                 // queued delivery
 
     u_int parseTime(const char* v);
 public:
@@ -62,14 +62,14 @@ public:
     SNPPJob(const SNPPJob& other);
     virtual ~SNPPJob();
 
-    virtual fxBool createJob(SNPPClient& client, fxStr& emsg);
+    virtual bool createJob(SNPPClient& client, fxStr& emsg);
 
     const fxStr& getJobID(void) const;
 
     /*
      * Job notification.
      */
-    fxBool setNotification(const char*);// email notification
+    bool setNotification(const char*);// email notification
     void setNotification(PageNotify);
     PageNotify getNotification() const;
     void setMailbox(const char*);      // email notification address
@@ -78,13 +78,13 @@ public:
     /*
      * Job scheduling controls.
      */
-    void setQueued(fxBool);            // queued or synchronous wait
-    fxBool getQueued() const;
+    void setQueued(bool);              // queued or synchronous wait
+    bool getQueued() const;
     void setRetryTime(u_int);          // job retry time (seconds)
     void setRetryTime(const char* v);
     u_int getRetryTime() const;
                                        // time to initiate tranmission
-    fxBool setHoldTime(const char*, fxStr& emsg);
+    bool setHoldTime(const char*, fxStr& emsg);
     void setHoldTime(u_int);
     u_int getHoldTime() const;
     void setMaxTries(u_int);           // maximum attempts to send
@@ -116,7 +116,7 @@ inline u_int SNPPJob::getMaxTries() const           { return maxRetries; }
 inline u_int SNPPJob::getMaxDials() const              { return maxDials; }
 inline const fxStr& SNPPJob::getPIN() const            { return pin; }
 inline const fxStr& SNPPJob::getPasswd() const         { return passwd; }
-inline fxBool SNPPJob::getQueued() const               { return queued; }
+inline bool SNPPJob::getQueued() const         { return queued; }
 inline const fxStr& SNPPJob::getSubject(void) const    { return subject; }
 inline u_int SNPPJob::getServiceLevel() const          { return serviceLevel; }
 #endif /* _SNPPJob_ */
index 97c46600f6fc593bfa54acac519aec52f394ea89..d16ffdc1e13579d106e294a76fe85b41028e46de 100644 (file)
@@ -64,7 +64,7 @@ SendFaxClient::SendFaxClient()
     dialRules = NULL;
     files = new FileInfoArray;
     polls = new PollRequestArray;
-    setup = FALSE;
+    setup = false;
 
     setupConfig();
 }
@@ -87,11 +87,11 @@ void SendFaxClient::vprintWarning(const char* fmt, va_list ap)
 void SendFaxClient::vtraceServer(const char* fmt, va_list ap)
     { FaxClient::vtraceServer(fmt, ap); }
 
-fxBool
+bool
 SendFaxClient::prepareForJobSubmissions(fxStr& emsg)
 {
     if (senderName == "" && !setupSenderIdentity(from, emsg))
-       return (FALSE);
+       return (false);
     /*
      * Prepare documents for transmission.
      */
@@ -99,7 +99,7 @@ SendFaxClient::prepareForJobSubmissions(fxStr& emsg)
        typeRules = TypeRules::read(typeRulesFile);
        if (!typeRules) {
            emsg = "Unable to setup file typing and conversion rules";
-           return (FALSE);
+           return (false);
        }
     }
     typeRules->setVerbose(verbose);
@@ -112,7 +112,7 @@ SendFaxClient::prepareForJobSubmissions(fxStr& emsg)
         *     confused by this that the message has been removed so I no
         *     longer have to explain why it's not a problem.
         */
-       (void) dialRules->parse(FALSE);
+       (void) dialRules->parse(false);
     } else
        dialRules->setVerbose(verbose);
     /*
@@ -125,7 +125,7 @@ SendFaxClient::prepareForJobSubmissions(fxStr& emsg)
            continue;
        if (!job.setPageSize(job.getPageSize())) {
            emsg = "Unknown page size " | job.getPageSize();
-           return (FALSE);
+           return (false);
        }
     }
     /*
@@ -137,7 +137,7 @@ SendFaxClient::prepareForJobSubmissions(fxStr& emsg)
     totalPages = 0;
     for (i = 0, n = files->length(); i < n; i++)
        if (!prepareFile((*files)[i], emsg))
-           return (FALSE);
+           return (false);
     /*
      * Prepare cover pages.
      */
@@ -159,11 +159,11 @@ SendFaxClient::prepareForJobSubmissions(fxStr& emsg)
        if (job.getAutoCoverPage() && getNumberOfFiles() > 0) {
            fxStr file;
            if (!makeCoverPage(job, file, emsg))
-               return (FALSE);
-           job.setCoverPageFile(file, TRUE);
+               return (false);
+           job.setCoverPageFile(file, true);
        }
     }
-    return (setup = TRUE);
+    return (setup = true);
 }
 
 static fxStr
@@ -187,7 +187,7 @@ addarg(const char* av[], int& ac, const char* flag, const fxStr& opt)
 /*
  * Invoke the cover page generation program.
  */
-fxBool
+bool
 SendFaxClient::makeCoverPage(const SendFaxJob& job, fxStr& file, fxStr& emsg)
 {
     tmpFile = _PATH_TMP "/sndfaxXXXXXX";
@@ -250,7 +250,7 @@ SendFaxClient::makeCoverPage(const SendFaxJob& job, fxStr& file, fxStr& emsg)
                int status;
                if (Sys::waitpid(pid, status) == pid && status == 0) {
                    file = tmpFile;
-                   return (TRUE);
+                   return (true);
                }
                emsg = fxStr::format("Error creating cover sheet; "
                    "command was \"%s\"; exit status %x"
@@ -269,7 +269,7 @@ SendFaxClient::makeCoverPage(const SendFaxJob& job, fxStr& file, fxStr& emsg)
        emsg = fxStr::format("%s: Can not create temporary file for cover page",
            (const char*) tmpFile);
     Sys::unlink(tmpFile);
-    return (FALSE);
+    return (false);
 }
 
 SendFaxJob&
@@ -278,7 +278,7 @@ SendFaxClient::addJob(void)
     u_int ix = jobs->length();
     jobs->resize(ix+1);
     (*jobs)[ix] = proto;
-    setup = FALSE;
+    setup = false;
     return ((*jobs)[ix]);
 }
 u_int SendFaxClient::getNumberOfJobs() const   { return jobs->length(); }
@@ -324,7 +324,7 @@ SendFaxClient::addFile(const fxStr& filename)
     u_int ix = files->length();
     files->resize(ix+1);
     (*files)[ix].name = filename;
-    setup = FALSE;
+    setup = false;
     return (ix);
 }
 
@@ -381,7 +381,7 @@ SendFaxClient::addPollRequest(const fxStr& sep, const fxStr& pwd)
     polls->resize(ix+1);
     (*polls)[ix].sep = sep;
     (*polls)[ix].pwd = pwd;
-    setup = FALSE;
+    setup = false;
     return (ix);
 }
 u_int SendFaxClient::getNumberOfPollRequests() const { return polls->length(); }
@@ -405,43 +405,43 @@ SendFaxClient::removePollRequest(u_int ix)
 /*
  * Submit documents and jobs to the server.
  */
-fxBool
+bool
 SendFaxClient::submitJobs(fxStr& emsg)
 {
     if (!setup) {
        emsg = "Documents not prepared";
-       return (FALSE);
+       return (false);
     }
     if (!isLoggedIn()) {
        emsg = "Not logged in to server";
-       return (FALSE);
+       return (false);
     }
     /*
      * Transfer documents to the server.
      */
     if (!sendDocuments(emsg))
-       return (FALSE);
+       return (false);
     /*
      * Construct jobs and submit them.
      */
     for (u_int i = 0, n = jobs->length(); i < n; i++) {
        SendFaxJob& job = (*jobs)[i];
        if (!job.createJob(*this, emsg))
-           return (FALSE);
+           return (false);
        if (!jobSubmit(job.getJobID())) {
            emsg = getLastResponse();
-           return (FALSE);
+           return (false);
        }
        notifyNewJob(job);                      // notify client
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
  * Transfer the document files to the server and
  * record the serve-side documents for job submission.
  */
-fxBool
+bool
 SendFaxClient::sendDocuments(fxStr& emsg)
 {
     emsg = "";
@@ -451,9 +451,9 @@ SendFaxClient::sendDocuments(fxStr& emsg)
        if (fd < 0) {
            emsg = fxStr::format(info.temp | ": Can not open: %s",
                strerror(errno));
-           return (FALSE);                     // XXX
+           return (false);                     // XXX
        }
-       fxBool fileSent;
+       bool fileSent;
        if (info.rule->getResult() == TypeRule::TIFF) {
            fileSent = setFormat(FORM_TIFF)
                    && setType(TYPE_I)
@@ -467,10 +467,10 @@ SendFaxClient::sendDocuments(fxStr& emsg)
        if (!fileSent) {
            if (emsg == "")
                emsg = "Document transfer failed: " | getLastResponse();
-           return (FALSE);
+           return (false);
        }
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
@@ -510,7 +510,7 @@ SendFaxClient::setupConfig()
 {
     for (int i = N(strings)-1; i >= 0; i--)
        (*this).*strings[i].p = (strings[i].def ? strings[i].def : "");
-    verbose = FALSE;
+    verbose = false;
     delete typeRules, typeRules = NULL;
     delete dialRules, dialRules = NULL;
 
@@ -524,7 +524,7 @@ SendFaxClient::resetConfig()
     setupConfig();
 }
 
-fxBool
+bool
 SendFaxClient::setConfigItem(const char* tag, const char* value)
 {
     u_int ix;
@@ -536,15 +536,15 @@ SendFaxClient::setConfigItem(const char* tag, const char* value)
     } else if (proto.setConfigItem(tag, value)) {
        ;
     } else if (!FaxClient::setConfigItem(tag, value))
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 #undef N
 
 /*
  * Setup the sender's identity.
  */
-fxBool
+bool
 SendFaxClient::setupSenderIdentity(const fxStr& from, fxStr& emsg)
 {
     FaxClient::setupUserIdentity(emsg);                // client identity
@@ -588,9 +588,9 @@ SendFaxClient::setupSenderIdentity(const fxStr& from, fxStr& emsg)
     fxStr mbox;
     if (senderName == "" || !getNonBlankMailbox(mbox)) {
        emsg = "Malformed (null) sender name or mail address";
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 void SendFaxClient::setFromIdentity(const char* s)     { from = s; }
@@ -613,28 +613,28 @@ SendFaxClient::setBlankMailboxes(const fxStr& s)
  * Return the first non-null mailbox string
  * in the set of jobs.
  */
-fxBool
+bool
 SendFaxClient::getNonBlankMailbox(fxStr& s)
 {
     for (u_int i = 0, n = jobs->length(); i < n; i++) {
        SendFaxJob& job = (*jobs)[i];
        if (job.getMailbox() != "") {
            s = job.getMailbox();
-           return (TRUE);
+           return (true);
        }
     }
-    return (FALSE);
+    return (false);
 }
 
 /*
  * Process a file submitted for transmission.
  */
-fxBool
+bool
 SendFaxClient::prepareFile(FileInfo& info, fxStr& emsg)
 {
     info.rule = fileType(info.name, emsg);
     if (!info.rule)
-       return (FALSE);
+       return (false);
     if (info.temp != "" && info.temp != info.name)
        Sys::unlink(info.temp);
     if (info.rule->getCmd() != "") {   // conversion required
@@ -659,7 +659,7 @@ SendFaxClient::prepareFile(FileInfo& info, fxStr& emsg)
            Sys::unlink(tmpFile);
            emsg = fxStr::format("Error converting data; command was \"%s\"",
                (const char*) sysCmd);
-           return (FALSE);
+           return (false);
        }
        info.temp = tmpFile;
     } else                             // already postscript or tiff
@@ -672,7 +672,7 @@ SendFaxClient::prepareFile(FileInfo& info, fxStr& emsg)
        estimatePostScriptPages(info.temp);
        break;
     }
-    return (TRUE);
+    return (true);
 }
 
 /*
index 3788f0e1f73491ec71ca9e06706a038b16fd22b9..5b47f6c39b93fb20f075e888433271a285e91572 100644 (file)
@@ -54,8 +54,8 @@ private:
     DialStringRules* dialRules;                // dial string conversion database
     FileInfoArray* files;              // files to send (possibly converted)
     PollRequestArray* polls;           // polling requests
-    fxBool     verbose;                // enable debugging information
-    fxBool     setup;                  // if true, then ready to send
+    bool       verbose;                // enable debugging information
+    bool       setup;                  // if true, then ready to send
     fxStr      tmpFile;                // stuff to cleanup on abort
     fxStr      from;                   // command line from information
     fxStr      senderName;             // sender's full name
@@ -87,7 +87,7 @@ protected:
      * Derived classes can override makeCoverPage to supply an
      * application-specific cover page generation scheme.
      */
-    virtual fxBool makeCoverPage(const SendFaxJob&, fxStr& file, fxStr& emsg);
+    virtual bool makeCoverPage(const SendFaxJob&, fxStr& file, fxStr& emsg);
     /*
      * These methods are used to count/estimate the number
      * of pages in a document that is to be transmitted.
@@ -105,27 +105,27 @@ protected:
      */
     virtual void setupConfig();
     virtual void resetConfig();
-    virtual fxBool setConfigItem(const char* tag, const char* value);
+    virtual bool setConfigItem(const char* tag, const char* value);
 
     /*
      * File typerule support.
      */
     const TypeRule* fileType(const char* filename, fxStr& emsg);
-    fxBool prepareFile(FileInfo& info, fxStr& emsg);
+    bool prepareFile(FileInfo& info, fxStr& emsg);
 
     /*
      * Miscellaneous stuff used by setupSenderIdentity.
      */
     void setBlankMailboxes(const fxStr&);
-    fxBool getNonBlankMailbox(fxStr&);
+    bool getNonBlankMailbox(fxStr&);
 public:
     virtual ~SendFaxClient();
 
                                                // prepare jobs for submission
-    virtual fxBool prepareForJobSubmissions(fxStr& emsg);
+    virtual bool prepareForJobSubmissions(fxStr& emsg);
     void purgeFileConversions(void);           // purge any converted docs
-    virtual fxBool submitJobs(fxStr& emsg);    // submit documents & jobs
-    virtual fxBool sendDocuments(fxStr& emsg); // send prepared documents
+    virtual bool submitJobs(fxStr& emsg);      // submit documents & jobs
+    virtual bool sendDocuments(fxStr& emsg);   // send prepared documents
 
     /*
      * Job manipulation interfaces.
@@ -164,18 +164,18 @@ public:
      * and for folks people that submit jobs for other people.
      */
                                                // identity associated with job
-    fxBool setupSenderIdentity(const fxStr&, fxStr& emsg);
+    bool setupSenderIdentity(const fxStr&, fxStr& emsg);
     const fxStr& getSenderName() const;
     void setFromIdentity(const char*);         // identity associated with fax
     const fxStr& getFromIdentity() const;
 
-    fxBool getVerbose() const;                 // trace operation
-    void setVerbose(fxBool);
+    bool getVerbose() const;                   // trace operation
+    void setVerbose(bool);
 };
 
 inline SendFaxJob& SendFaxClient::getProtoJob()                   { return proto; }
 inline const fxStr& SendFaxClient::getFromIdentity() const { return from; }
 inline const fxStr& SendFaxClient::getSenderName() const   { return senderName;}
-inline void SendFaxClient::setVerbose(fxBool b)                   { verbose = b; }
-inline fxBool SendFaxClient::getVerbose() const                   { return verbose; }
+inline void SendFaxClient::setVerbose(bool b)             { verbose = b; }
+inline bool SendFaxClient::getVerbose() const             { return verbose; }
 #endif /* _SendFaxClient_ */
index 271c37e74937f9b470af441a1f38b0e65036bf17..b07eb36fb832d89655d49aba45818d00aa936d00 100644 (file)
@@ -135,8 +135,8 @@ SendFaxJob::setupConfig()
     for (i = N(floats)-1; i >= 0; i--)
        (*this).*floats[i].p = floats[i].def;
 
-    autoCover = TRUE;
-    sendTagLine = FALSE;               // default is to use server config
+    autoCover = true;
+    sendTagLine = false;               // default is to use server config
     notify = FAX_DEFNOTIFY;            // default notification
     mailbox = "";
     priority = FAX_DEFPRIORITY;                // default transmit priority
@@ -149,14 +149,14 @@ SendFaxJob::setupConfig()
     pagechop = chop_default;
 }
 
-fxBool
+bool
 SendFaxJob::setConfigItem(const char* tag, const char* value)
 {
     u_int ix;
     if (FaxConfig::findTag(tag, (const FaxConfig::tags*) strings, N(strings), ix)) {
        (*this).*strings[ix].p = value;
        switch (ix) {
-       case 0: sendTagLine = TRUE; break;
+       case 0: sendTagLine = true; break;
        }
     } else if (FaxConfig::findTag(tag, (const FaxConfig::tags*) numbers, N(numbers), ix)) {
        (*this).*numbers[ix].p = atoi(value);
@@ -185,15 +185,15 @@ SendFaxJob::setConfigItem(const char* tag, const char* value)
     else if (streq(tag, "pagechop"))
        setChopHandling(value);
     else
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 #undef N
 
 #define        valeq(a,b)      (strcasecmp(a,b)==0)
 #define        valneq(a,b,n)   (strncasecmp(a,b,n)==0)
 
-fxBool
+bool
 SendFaxJob::setNotification(const char* v0)
 {
     const char* v = v0;
@@ -210,8 +210,8 @@ SendFaxJob::setNotification(const char* v0)
     else if (valeq(v, "default"))
        notify = FAX_DEFNOTIFY;
     else
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 void SendFaxJob::setNotification(FaxNotify n)          { notify = n; }
 /*
@@ -283,9 +283,9 @@ void SendFaxJob::setSubAddress(const char* s)               { subaddr = s; }
 void SendFaxJob::setPassword(const char* s)            { passwd = s; }
 void SendFaxJob::setExternalNumber(const char* s)      { external = s; }
 
-void SendFaxJob::setAutoCoverPage(fxBool b)            { autoCover = b; }
+void SendFaxJob::setAutoCoverPage(bool b)              { autoCover = b; }
 void
-SendFaxJob::setCoverPageFile(const char* s, fxBool removeOnExit)
+SendFaxJob::setCoverPageFile(const char* s, bool removeOnExit)
 {
     if (coverFile != "" && removeOnExit)
        Sys::unlink(coverFile);
@@ -300,7 +300,7 @@ void SendFaxJob::setCoverComments(const char* s)    { comments = s; }
 void SendFaxJob::setCoverRegarding(const char* s)      { regarding = s; }
 void SendFaxJob::setCoverVoiceNumber(const char* s)    { voicenumber = s; }
 
-fxBool
+bool
 SendFaxJob::setPageSize(const char* name)
 {
     PageSizeInfo* info = PageSizeInfo::getPageSizeByName(name);
@@ -309,9 +309,9 @@ SendFaxJob::setPageSize(const char* name)
        pageLength = info->height();
        pageSize = name;
        delete info;
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 void SendFaxJob::setVResolution(float r)               { vres = r; }
 void SendFaxJob::setHResolution(float r)               { hres = r; }
@@ -356,7 +356,7 @@ SendFaxJob::setDesiredMST(const char* v)
        desiredst = atoi(v);
 }
 void SendFaxJob::setDesiredMST(int v)                  { desiredst = v; }
-void SendFaxJob::setDesiredEC(fxBool b)                        { desiredec = b; }
+void SendFaxJob::setDesiredEC(bool b)                  { desiredec = b; }
 void
 SendFaxJob::setDesiredDF(const char* v)
 {
@@ -377,7 +377,7 @@ void
 SendFaxJob::setTagLineFormat(const char* v)
 {
     tagline = v;
-    sendTagLine = TRUE;
+    sendTagLine = true;
 }
 
 void
@@ -403,15 +403,15 @@ parseAtSyntax(const char* s, const struct tm& ref, struct tm& at0, fxStr& emsg);
 #define        CHECKPARM(a,b)  CHECK(client.jobParm(a,b))
 #define        IFPARM(a,b,v)   { if ((b) != (v)) CHECKPARM(a,b) }
 
-fxBool
+bool
 SendFaxJob::createJob(SendFaxClient& client, fxStr& emsg)
 {
     if (!client.setCurrentJob("DEFAULT")) {    // inherit from default
        emsg = client.getLastResponse();
-       return (FALSE);
+       return (false);
     }
     if (!client.newJob(jobid, groupid, emsg))  // create new job on server
-       return (FALSE);
+       return (false);
 
     time_t now = Sys::now();
 
@@ -421,7 +421,7 @@ SendFaxJob::createJob(SendFaxClient& client, fxStr& emsg)
     if (sendTime != "") {
        if (!parseAtSyntax(sendTime, *localtime(&now), tts, emsg)) {
            emsg.insert(sendTime | ": ");
-           return (FALSE);
+           return (false);
        }
        now = mktime(&tts);
        // NB: must send time relative to GMT
@@ -432,7 +432,7 @@ SendFaxJob::createJob(SendFaxClient& client, fxStr& emsg)
        struct tm when;
        if (!parseAtSyntax(killTime, tts, when, emsg)) {
            emsg.insert(killTime | ": ");
-           return (FALSE);
+           return (false);
        }
        CHECK(client.jobLastTime(mktime(&when) - now))
     }
@@ -462,7 +462,7 @@ SendFaxJob::createJob(SendFaxClient& client, fxStr& emsg)
     IFPARM("BEGBR", desiredbr, (u_int) -1)
     IFPARM("BEGST", desiredst, (u_int) -1)
     if (desiredec != (u_int) -1)
-       CHECKPARM("USEECM", (fxBool) desiredec)
+       CHECKPARM("USEECM", (bool) desiredec)
     if (desireddf != (u_int) -1) {
        CHECKPARM("DATAFORMAT",
            desireddf == 0      ? "g31d" :
@@ -472,7 +472,7 @@ SendFaxJob::createJob(SendFaxClient& client, fxStr& emsg)
                                  "g31d")
     }
     if (sendTagLine) {
-       CHECKPARM("USETAGLINE", TRUE)
+       CHECKPARM("USETAGLINE", true)
        CHECKPARM("TAGLINE", tagline)
     }
     CHECKPARM("NOTIFY",
@@ -490,10 +490,10 @@ SendFaxJob::createJob(SendFaxClient& client, fxStr& emsg)
        if (fd < 0) {
            emsg = fxStr::format("%s: Can not open: %s",
                (const char*) coverFile, strerror(errno));
-           return (FALSE);                     // XXX
+           return (false);                     // XXX
        }
        fxStr coverDoc;
-       fxBool fileSent = 
+       bool fileSent = 
               client.setFormat(FaxClient::FORM_PS)
            && client.setType(FaxClient::TYPE_I)        // XXX??? TYPE_A
            && client.sendZData(fd, &FaxClient::storeTemp, coverDoc, emsg);
@@ -501,7 +501,7 @@ SendFaxJob::createJob(SendFaxClient& client, fxStr& emsg)
        if (!fileSent) {
            if (emsg == "")
                emsg = "Document transfer failed: " | client.getLastResponse();
-           return (FALSE);
+           return (false);
        }
        CHECK(client.jobCover(coverDoc))
     }
@@ -516,10 +516,10 @@ SendFaxJob::createJob(SendFaxClient& client, fxStr& emsg)
        client.getPollRequest(i, sep, pwd);
        CHECK(client.jobPollRequest(sep, pwd))
     }
-    return (TRUE);
+    return (true);
 failure:
     emsg = client.getLastResponse();
-    return (FALSE);
+    return (false);
 }
 #undef CHECKPARM
 #undef IFPARM
index ccd2bcaa20403cad54e60f1ae944a3ed67f7ab26..ef222bfc6c7f54a8857cae2415acaa3aaf2ea89b 100644 (file)
@@ -76,8 +76,8 @@ private:
     fxStr      passwd;                 // password (opt)
     fxStr      external;               // displayable version of number (opt)
 
-    fxBool     autoCover;              // if TRUE, auto-generate cover sheet
-    fxBool     coverIsTemp;            // if TRUE, remove coverFile on exit
+    bool       autoCover;              // if true, auto-generate cover sheet
+    bool       coverIsTemp;            // if true, remove coverFile on exit
     fxStr      coverFile;              // cover page file
     fxStr      coverTemplate;          // cover page template file
     fxStr      name;                   // receipient for cover page
@@ -87,7 +87,7 @@ private:
     fxStr      comments;               // comments for cover page
     fxStr      regarding;              // regarding info for cover page
 
-    fxBool     sendTagLine;            // if TRUE, use custom tagline format
+    bool       sendTagLine;            // if true, use custom tagline format
     fxStr      killTime;               // job's time to be killed
     fxStr      sendTime;               // job's time to be sent
     u_int      retryTime;              // retry time for failures (secs)
@@ -118,10 +118,10 @@ public:
     SendFaxJob(const SendFaxJob& other);
     virtual ~SendFaxJob();
 
-    virtual fxBool createJob(SendFaxClient& client, fxStr& emsg);
+    virtual bool createJob(SendFaxClient& client, fxStr& emsg);
 
     virtual void setupConfig();
-    virtual fxBool setConfigItem(const char* tag, const char* value);
+    virtual bool setConfigItem(const char* tag, const char* value);
 
     const fxStr& getJobID(void) const;
     const fxStr& getGroupID(void) const;
@@ -129,7 +129,7 @@ public:
     /*
      * Job notification.
      */
-    fxBool setNotification(const char*);// email notification
+    bool setNotification(const char*);// email notification
     void setNotification(FaxNotify);
     FaxNotify getNotification() const;
     void setMailbox(const char*);      // email notification address
@@ -183,10 +183,10 @@ public:
      * suppressed or an application-specified file can be
      * specified instead.
      */
-    void setAutoCoverPage(fxBool);     // auto-generate cover page
-    fxBool getAutoCoverPage() const;
+    void setAutoCoverPage(bool);       // auto-generate cover page
+    bool getAutoCoverPage() const;
                                        // cover page file
-    void setCoverPageFile(const char*, fxBool removeOnExit);
+    void setCoverPageFile(const char*, bool removeOnExit);
     const fxStr& getCoverPageFile() const;
     void setCoverTemplate(const char*);        // cover page template file
     const fxStr& getCoverTemplate() const;
@@ -215,7 +215,7 @@ public:
     float getPageWidth() const;                // sending page width (mm)
     float getPageLength() const;       // sending page length (mm)
     const fxStr& getPageSize() const;  // page size by name
-    fxBool setPageSize(const char* name);
+    bool setPageSize(const char* name);
     void setVResolution(float);                // vertical resolution (lines/inch)
     float getVResolution() const;
     void setHResolution(float);                // horizontal resolution (lines/inch)
@@ -233,8 +233,8 @@ public:
     void setDesiredMST(int);           // desired/initial min-scanline time
     void setDesiredMST(const char* v);
     int getDesiredMST() const;
-    void setDesiredEC(fxBool b);       // desired use of Error Correction mode
-    fxBool getDesiredEC() const;
+    void setDesiredEC(bool b); // desired use of Error Correction mode
+    bool getDesiredEC() const;
     void setDesiredDF(int);            // desired data format
     void setDesiredDF(const char*);
     int getDesiredDF() const;
@@ -266,7 +266,7 @@ inline const fxStr& SendFaxJob::getDialString() const       { return number; }
 inline const fxStr& SendFaxJob::getSubAddress() const  { return subaddr; }
 inline const fxStr& SendFaxJob::getPasswd() const      { return passwd; }
 inline const fxStr& SendFaxJob::getExternalNumber() const{ return external; }
-inline fxBool SendFaxJob::getAutoCoverPage() const     { return autoCover; }
+inline bool SendFaxJob::getAutoCoverPage() const       { return autoCover; }
 inline const fxStr& SendFaxJob::getCoverPageFile() const{ return coverFile; }
 inline const fxStr& SendFaxJob::getCoverTemplate() const{ return coverTemplate;}
 inline const fxStr& SendFaxJob::getCoverName() const   { return name; }
@@ -283,7 +283,7 @@ inline float SendFaxJob::getHResolution() const             { return hres; }
 inline int SendFaxJob::getMinSpeed() const             { return minsp; }
 inline int SendFaxJob::getDesiredSpeed() const         { return desiredbr; }
 inline int SendFaxJob::getDesiredMST() const           { return desiredst; }
-inline fxBool SendFaxJob::getDesiredEC() const         { return desiredec; }
+inline bool SendFaxJob::getDesiredEC() const           { return desiredec; }
 inline int SendFaxJob::getDesiredDF() const            { return desireddf; }
 inline const fxStr& SendFaxJob::getTagLineFormat() const{ return tagline; }
 inline u_int SendFaxJob::getChopHandling() const       { return pagechop; }
index 5f52cf0d1c04b572387f45c498da4c7f6bfa1d9b..8b9fcb17545d7cbb164717540a1916dd0c7f9ec9 100644 (file)
@@ -307,7 +307,7 @@ void fxStr::resizeInternal(u_int chars)
 }
 
 
-void fxStr::resize(u_int chars, fxBool)
+void fxStr::resize(u_int chars, bool)
 {
     resizeInternal(chars);
     if (chars != 0) {
@@ -370,92 +370,92 @@ void fxStr::append(char a)
     data[slength-1] = 0;
 }
 
-fxBool operator==(const fxStr& a,const fxStr& b)
+bool operator==(const fxStr& a,const fxStr& b)
 {
     return (a.slength == b.slength) && (memcmp(a.data,b.data,a.slength) == 0);
 }
 
-fxBool operator==(const fxStr& a,const char* b)
+bool operator==(const fxStr& a,const char* b)
 {
     return (a.slength == strlen(b)+1) && (memcmp(a.data,b,a.slength) == 0);
 }
 
-fxBool operator==(const char* b, const fxStr& a)
+bool operator==(const char* b, const fxStr& a)
 {
     return (a.slength == strlen(b)+1) && (memcmp(a.data,b,a.slength) == 0);
 } 
 
-fxBool operator!=(const fxStr& a,const fxStr& b)
+bool operator!=(const fxStr& a,const fxStr& b)
 {
     return (a.slength != b.slength) || (memcmp(a.data,b.data,a.slength) != 0);
 }
 
-fxBool operator!=(const fxStr& a,const char* b)
+bool operator!=(const fxStr& a,const char* b)
 {
     return (a.slength != strlen(b)+1) || (memcmp(a.data,b,a.slength) != 0);
 }
 
-fxBool operator!=(const char* b, const fxStr& a)
+bool operator!=(const char* b, const fxStr& a)
 {
     return (a.slength != strlen(b)+1) || (memcmp(a.data,b,a.slength) != 0);
 } 
 
-fxBool operator>=(const fxStr& a,const fxStr& b)
+bool operator>=(const fxStr& a,const fxStr& b)
 {
     return strcmp(a,b) >= 0;
 }
 
-fxBool operator>=(const fxStr& a,const char* b)
+bool operator>=(const fxStr& a,const char* b)
 {
     return strcmp(a,b) >= 0;
 }
 
-fxBool operator>=(const char* a, const fxStr& b)
+bool operator>=(const char* a, const fxStr& b)
 {
     return strcmp(a,b) >= 0;
 } 
 
-fxBool operator>(const fxStr& a,const fxStr& b)
+bool operator>(const fxStr& a,const fxStr& b)
 {
     return strcmp(a,b) > 0;
 }
 
-fxBool operator>(const fxStr& a,const char* b)
+bool operator>(const fxStr& a,const char* b)
 {
     return strcmp(a,b) > 0;
 }
 
-fxBool operator>(const char* a, const fxStr& b)
+bool operator>(const char* a, const fxStr& b)
 {
     return strcmp(a,b) > 0;
 } 
 
-fxBool operator<=(const fxStr& a,const fxStr& b)
+bool operator<=(const fxStr& a,const fxStr& b)
 {
     return strcmp(a,b) <= 0;
 }
 
-fxBool operator<=(const fxStr& a,const char* b)
+bool operator<=(const fxStr& a,const char* b)
 {
     return strcmp(a,b) <= 0;
 }
 
-fxBool operator<=(const char* a, const fxStr& b)
+bool operator<=(const char* a, const fxStr& b)
 {
     return strcmp(a,b) <= 0;
 } 
 
-fxBool operator<(const fxStr& a,const fxStr& b)
+bool operator<(const fxStr& a,const fxStr& b)
 {
     return strcmp(a,b) < 0;
 }
 
-fxBool operator<(const fxStr& a,const char* b)
+bool operator<(const fxStr& a,const char* b)
 {
     return strcmp(a,b) < 0;
 }
 
-fxBool operator<(const char* a, const fxStr& b)
+bool operator<(const char* a, const fxStr& b)
 {
     return strcmp(a,b) < 0;
 } 
index 6585a7d358d7fa8f051cfcf22d8ac648b9049b80..bd86888bb2288e3c718d95ff4ed6e6a25f256f71 100644 (file)
@@ -125,29 +125,29 @@ public:
 
     /////////////////////////////////////////////////////
     // Comparison
-    friend fxBool operator==(fxStr const&, fxStr const&);
-    friend fxBool operator==(fxStr const&, char const*);
-    friend fxBool operator==(char const*, fxStr const&);
+    friend bool operator==(fxStr const&, fxStr const&);
+    friend bool operator==(fxStr const&, char const*);
+    friend bool operator==(char const*, fxStr const&);
 
-    friend fxBool operator!=(fxStr const&, fxStr const&);
-    friend fxBool operator!=(fxStr const&, char const*);
-    friend fxBool operator!=(char const*, fxStr const&);
+    friend bool operator!=(fxStr const&, fxStr const&);
+    friend bool operator!=(fxStr const&, char const*);
+    friend bool operator!=(char const*, fxStr const&);
 
-    friend fxBool operator>=(fxStr const&, fxStr const&);
-    friend fxBool operator>=(fxStr const&, char const*);
-    friend fxBool operator>=(char const*, fxStr const&);
+    friend bool operator>=(fxStr const&, fxStr const&);
+    friend bool operator>=(fxStr const&, char const*);
+    friend bool operator>=(char const*, fxStr const&);
 
-    friend fxBool operator<=(fxStr const&, fxStr const&);
-    friend fxBool operator<=(fxStr const&, char const*);
-    friend fxBool operator<=(char const*, fxStr const&);
+    friend bool operator<=(fxStr const&, fxStr const&);
+    friend bool operator<=(fxStr const&, char const*);
+    friend bool operator<=(char const*, fxStr const&);
 
-    friend fxBool operator>(fxStr const&, fxStr const&);
-    friend fxBool operator>(fxStr const&, char const*);
-    friend fxBool operator>(char const*, fxStr const&);
+    friend bool operator>(fxStr const&, fxStr const&);
+    friend bool operator>(fxStr const&, char const*);
+    friend bool operator>(char const*, fxStr const&);
 
-    friend fxBool operator<(fxStr const&, fxStr const&);
-    friend fxBool operator<(fxStr const&, char const*);
-    friend fxBool operator<(char const*, fxStr const&);
+    friend bool operator<(fxStr const&, fxStr const&);
+    friend bool operator<(fxStr const&, char const*);
+    friend bool operator<(char const*, fxStr const&);
 
     int compare(fxStr const *a) const { return ::compare(*this, *a); }
     friend int compare(fxStr const&, fxStr const&);
@@ -175,7 +175,7 @@ public:
 
     void remove(u_int posn,u_int len=1);
 
-    void resize(u_int len, fxBool reallocate = FALSE);
+    void resize(u_int len, bool reallocate = false);
     void setMaxLength(u_int maxlen);
 
     void append(char a);
index cf426c7d62cdf416c23d46cce51df156a5c151eb..0ee673b9e55d8fb9f191e21c0c7d7d6252da80fe 100644 (file)
  * Wrapper functions for C library calls.
  */
 
-fxBool
+bool
 Sys::isRegularFile(const char* filename)
 {
     struct stat sb;
     return (Sys::stat(filename, sb) >= 0 && (sb.st_mode&S_IFMT) == S_IFREG);
 }
 
-fxBool
+bool
 Sys::isSocketFile(const char* filename)
 {
 #ifdef S_IFSOCK
     struct stat sb;
     return (Sys::stat(filename, sb) >= 0 && (sb.st_mode&S_IFMT) == S_IFSOCK);
 #else
-    return (FALSE);
+    return (false);
 #endif
 }
 
-fxBool
+bool
 Sys::isFIFOFile(const char* filename)
 {
     struct stat sb;
     return (Sys::stat(filename, sb) >= 0 && (sb.st_mode&S_IFMT) == S_IFIFO);
 }
 
-fxBool
+bool
 Sys::isFIFOFile(int fd)
 {
     struct stat sb;
     return (Sys::fstat(fd, sb) >= 0 && (sb.st_mode&S_IFMT) == S_IFIFO);
 }
 
-fxBool
+bool
 Sys::isCharSpecialFile(const char* filename, struct stat& sb)
 {
 #ifdef S_IFCHR
     return (Sys::stat(filename, sb) >= 0 && (sb.st_mode&S_IFMT) == S_IFCHR);
 #else
-    return (FALSE);
+    return (false);
 #endif
 }
 
-fxBool
+bool
 Sys::isCharSpecialFile(const char* filename)
 {
     struct stat sb;
index 98787874c6e3bab440c816f5a1d5dc7466ec26c7..0591710d69cd1892fdc771e9e1a3b70976b207c5 100644 (file)
@@ -64,12 +64,12 @@ public:
        { return ::stat(file, &sb); }
     static int fstat(int fd, struct stat& sb)
        { return ::fstat(fd, &sb); }
-    static fxBool isRegularFile(const char* filename);
-    static fxBool isFIFOFile(const char* filename);
-    static fxBool isSocketFile(const char* filename);
-    static fxBool isFIFOFile(int fd);
-    static fxBool isCharSpecialFile(const char* filename);
-    static fxBool isCharSpecialFile(const char* filename, struct stat&);
+    static bool isRegularFile(const char* filename);
+    static bool isFIFOFile(const char* filename);
+    static bool isSocketFile(const char* filename);
+    static bool isFIFOFile(int fd);
+    static bool isCharSpecialFile(const char* filename);
+    static bool isCharSpecialFile(const char* filename, struct stat&);
     static int link(const char* file1, const char* file2)
        { return ::link(file1, file2); }
     static int rename(const char* file1, const char* file2)
index b36f9d2801a7adc342a70d5d910c86ac5ca4d8bf..bb891ba4d00008115fb1c15f50a7e7b55338eb9d 100644 (file)
@@ -71,7 +71,7 @@ TextFmt::TextFmt()
     firstPageNum = 1;          // starting page number
     column = 1;                        // current text column # (1..numcol)
     pageNum = 1;               // current page number
-    workStarted = FALSE;
+    workStarted = false;
 
     fonts = new FontDict;
     curFont = addFont("Roman", "Courier");
@@ -146,9 +146,9 @@ void TextFmt::setFontPath(const char* path) { TextFont::fontPath = path; }
 
 void TextFmt::setOutputFile(FILE* f)           { output = f; }
 void TextFmt::setNumberOfColumns(u_int n)      { numcol = n; }
-void TextFmt::setPageHeaders(fxBool b)         { headers = b; }
-void TextFmt::setISO8859(fxBool b)             { useISO8859 = b; }
-void TextFmt::setLineWrapping(fxBool b)                { wrapLines = b; }
+void TextFmt::setPageHeaders(bool b)           { headers = b; }
+void TextFmt::setISO8859(bool b)               { useISO8859 = b; }
+void TextFmt::setLineWrapping(bool b)          { wrapLines = b; }
 void TextFmt::setOutlineMargin(TextCoord o)    { outline = o; }
 void TextFmt::setTextPointSize(TextCoord p)    { pointSize = p; }
 void TextFmt::setPageOrientation(u_int o)      { landscape = (o == LANDSCAPE); }
@@ -158,32 +158,32 @@ void TextFmt::setTitle(const char* cp)            { title = cp; }
 void TextFmt::setFilename(const char* cp)      { curFile = cp; }
 
 void
-TextFmt::setGaudyHeaders(fxBool b)     
+TextFmt::setGaudyHeaders(bool b)       
 {
     if (gaudy = b)
-       headers = TRUE;
+       headers = true;
 }
 
-fxBool
+bool
 TextFmt::setTextFont(const char* name)
 {
     if (TextFont::findFont(name)) {
        (*fonts)["Roman"]->family = name;
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 
 /*
  * Parse margin syntax: l=#,r=#,t=#,b=#
  */
-fxBool
+bool
 TextFmt::setPageMargins(const char* s)
 {
     for (const char* cp = s; cp && cp[0];) {
        if (cp[1] != '=')
-           return (FALSE);
+           return (false);
        TextCoord v = inch(&cp[2]);
        switch (tolower(cp[0])) {
        case 'b': bm = v; break;
@@ -191,13 +191,13 @@ TextFmt::setPageMargins(const char* s)
        case 'r': rm = v; break;
        case 't': tm = v; break;
        default:
-           return (FALSE);
+           return (false);
        }
        cp = strchr(cp, ',');
        if (cp)
            cp++;
     }
-    return (TRUE);
+    return (true);
 }
 
 void
@@ -209,7 +209,7 @@ TextFmt::setPageMargins(TextCoord l, TextCoord r, TextCoord b, TextCoord t)
     tm = t;
 }
 
-fxBool
+bool
 TextFmt::setPageSize(const char* name)
 {
     PageSizeInfo* info = PageSizeInfo::getPageSizeByName(name);
@@ -217,9 +217,9 @@ TextFmt::setPageSize(const char* name)
        setPageWidth(info->width() / 25.4);
        setPageHeight(info->height() / 25.4);
        delete info;
-       return (TRUE);
+       return (true);
     } else
-       return (FALSE);
+       return (false);
 }
 
 void TextFmt::setPageWidth(float pw)           { physPageWidth = pw; }
@@ -291,7 +291,7 @@ TextFmt::beginFormatting(FILE* o)
      */
     if (lineHeight <= 0)
        lineHeight = (pointSize * 12L) / 10L;
-    workStarted = TRUE;
+    workStarted = true;
 }
 
 void
@@ -322,7 +322,7 @@ TextFmt::endFormatting(void)
     tf = NULL;
     emitTrailer();
     fflush(output);
-    workStarted = FALSE;
+    workStarted = false;
 }
 
 /* copy bytes b1..b2 to stdout */
@@ -584,8 +584,8 @@ TextFmt::newPage(void)
     y = pageHeight - tm - lineHeight;          // y at page top
     level = 0;                                 // string paren level reset
     column = 1;
-    boc = TRUE;
-    bop = TRUE;
+    boc = true;
+    bop = true;
 }
 
 void
@@ -596,7 +596,7 @@ TextFmt::newCol(void)
     y = pageHeight - tm - lineHeight;          // y at page top
     level = 0;
     column++;
-    boc = TRUE;
+    boc = true;
 }
 
 static void
@@ -647,7 +647,7 @@ void
 TextFmt::beginLine(void)
 {
     if (boc)
-       beginCol(), boc = FALSE, bop = FALSE;
+       beginCol(), boc = false, bop = false;
     fputc('B', tf);
 }
 
@@ -680,8 +680,8 @@ TextFmt::beginFile(void)
 {
     newPage();                         // each file starts on a new page
 
-    bol = TRUE;                                // force line start
-    bot = TRUE;                                // force text start
+    bol = true;                                // force line start
+    bot = true;                                // force text start
     xoff = col_width * (column-1);
 }
 
@@ -759,7 +759,7 @@ TextFmt::format(FILE* fp)
            break;
        case '\f':                      // form feed
            endTextCol();
-           bol = bot = TRUE;
+           bol = bot = true;
            break;
        case '\n':                      // line break
            if (bol)
@@ -774,7 +774,7 @@ TextFmt::format(FILE* fp)
                break;
            }
            closeStrings("O\n");        // do overstriking
-           bot = TRUE;                 // start new string
+           bot = true;                 // start new string
            break;
        default:
            TextCoord hm;
@@ -816,16 +816,16 @@ TextFmt::format(FILE* fp)
                endTextLine();
            }
            if (bol)
-               beginLine(), bol = FALSE;
+               beginLine(), bol = false;
            if (c == '\t') {            // close open PS string and do motion
                if (hm > 0) {
                    closeStrings("LN");
-                   bot = TRUE;         // force new string
+                   bot = true;         // force new string
                    hrMove(hm);
                }
            } else {                    // append to open PS string
                if (bot)
-                   beginText(), bot = FALSE;
+                   beginText(), bot = false;
                if (040 <= c && c <= 0176) {
                    if (c == '(' || c == ')' || c == '\\')
                        fputc('\\',tf);
@@ -850,7 +850,7 @@ TextFmt::format(const char* cp, u_int cc)
            break;
        case '\f':                      // form feed
            endTextCol();
-           bol = bot = TRUE;
+           bol = bot = true;
            break;
        case '\n':                      // line break
            if (bol)
@@ -864,7 +864,7 @@ TextFmt::format(const char* cp, u_int cc)
                break;                  // collapse \r\n => \n
            cp++;                       // count character
            closeStrings("O\n");        // do overstriking
-           bot = TRUE;                 // start new string
+           bot = true;                 // start new string
            break;
        default:
            TextCoord hm;
@@ -906,16 +906,16 @@ TextFmt::format(const char* cp, u_int cc)
                endTextLine();
            }
            if (bol)
-               beginLine(), bol = FALSE;
+               beginLine(), bol = false;
            if (c == '\t') {            // close open PS string and do motion
                if (hm > 0) {
                    closeStrings("LN");
                    fprintf(tf, " %ld M ", hm);
-                   bot = TRUE;         // force new string
+                   bot = true;         // force new string
                }
            } else {                    // append to open PS string
                if (bot)
-                   beginText(), bot = FALSE;
+                   beginText(), bot = false;
                if (040 <= c && c <= 0176) {
                    if (c == '(' || c == ')' || c == '\\')
                        fputc('\\',tf);
@@ -981,7 +981,7 @@ TextFmt::endTextLine(void)
     if ((y -= lineHeight) < bm)
        endCol();
     xoff = col_width * (column-1);
-    bol = bot = TRUE;
+    bol = bot = true;
 }
 
 void
@@ -1048,12 +1048,12 @@ TextFmt::inch(const char* s)
 void
 TextFmt::setupConfig()
 {
-    gaudy      = FALSE;        // emit gaudy headers
-    landscape  = FALSE;        // horizontal landscape mode output
-    useISO8859 = TRUE;         // use the ISO 8859-1 character encoding
-    reverse    = FALSE;        // page reversal flag
-    wrapLines  = TRUE;         // wrap/truncate lines
-    headers    = TRUE;         // emit page headers
+    gaudy      = false;        // emit gaudy headers
+    landscape  = false;        // horizontal landscape mode output
+    useISO8859 = true;         // use the ISO 8859-1 character encoding
+    reverse    = false;        // page reversal flag
+    wrapLines  = true;         // wrap/truncate lines
+    headers    = true;         // emit page headers
 
     pointSize = -1;            // font point size in big points
     lm = inch("0.25in");       // left margin
@@ -1080,7 +1080,7 @@ void TextFmt::configTrace(const char* ...) {}
 #undef streq
 #define        streq(a,b)      (strcasecmp(a,b)==0)
 
-fxBool
+bool
 TextFmt::setConfigItem(const char* tag, const char* value)
 {
     if (streq(tag, "columns"))
@@ -1120,8 +1120,8 @@ TextFmt::setConfigItem(const char* tag, const char* value)
     else if (streq(tag, "fontpath"))
        setFontPath(value);
     else
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 
 #define        NCHARS  (sizeof (widths) / sizeof (widths[0]))
@@ -1138,7 +1138,7 @@ TextFont::TextFont(const char* cp) : family(cp)
 }
 TextFont::~TextFont() {}
 
-fxBool
+bool
 TextFont::decodeFontName(const char* name, fxStr& filename, fxStr& emsg)
 {
     struct stat junk;
@@ -1213,7 +1213,7 @@ TextFont::decodeFontName(const char* name, fxStr& filename, fxStr& emsg)
                             fpath.remove(0, index2);
                            if (fpath.length() > 0) fpath.remove(0, 1);
                        }
-                       fxBool result = stat(filename, &junk) ? FALSE : TRUE;
+                       bool result = stat(filename, &junk) ? false : true;
                        if (!result)
                            emsg = fxStr::format(
                                "Warning: %s invalid Fontmap entry - no filename present", (const char*)val);
@@ -1233,15 +1233,15 @@ TextFont::decodeFontName(const char* name, fxStr& filename, fxStr& emsg)
         filename = path.head(index) | "/" | name | ".afm";
         path.remove(0, index);
         if (path.length() > 0) path.remove(0, 1);
-        if (stat(filename, &junk) == 0) return TRUE;
+        if (stat(filename, &junk) == 0) return true;
        filename.resize(filename.length()-4);   // strip ``.afm''
-        if (stat(filename, &junk) == 0) return TRUE;
+        if (stat(filename, &junk) == 0) return true;
         index = path.next(0, ':');
     }
-    return FALSE;
+    return false;
 }
 
-fxBool
+bool
 TextFont::findFont(const char* name)
 {
     fxStr myname, emsg;
@@ -1259,7 +1259,7 @@ static const char* defRegularFont = "\
 ";
 
 void
-TextFont::defFont(FILE* fd, TextCoord ps, fxBool useISO8859) const
+TextFont::defFont(FILE* fd, TextCoord ps, bool useISO8859) const
 {
     if (useISO8859) {
        fprintf(fd, defISOFont, (const char*) setproc,
@@ -1321,21 +1321,21 @@ TextFont::loadFixedMetrics(TextCoord w)
        widths[i] = w;
 }
 
-fxBool
+bool
 TextFont::getAFMLine(FILE* fp, char* buf, int bsize)
 {
     if (fgets(buf, bsize, fp) == NULL)
-       return (FALSE);
+       return (false);
     char* cp = strchr(buf, '\n');
     if (cp == NULL) {                  // line too long, skip it
        int c;
        while ((c = getc(fp)) != '\n')  // skip to end of line
            if (c == EOF)
-               return (FALSE);
+               return (false);
        cp = buf;                       // force line to be skipped
     }
     *cp = '\0';
-    return (TRUE);
+    return (true);
 }
 
 FILE*
@@ -1349,8 +1349,8 @@ TextFont::openAFMFile(fxStr& fontpath)
     return Sys::fopen(fontpath, "r");
 }
 
-fxBool
-TextFont::readMetrics(TextCoord ps, fxBool useISO8859, fxStr& emsg)
+bool
+TextFont::readMetrics(TextCoord ps, bool useISO8859, fxStr& emsg)
 {
     fxStr file;
     FILE *fp = openAFMFile(file);
@@ -1359,7 +1359,7 @@ TextFont::readMetrics(TextCoord ps, fxBool useISO8859, fxStr& emsg)
            "%s: Can not open font metrics file; using fixed widths",
            (const char*) file);
        loadFixedMetrics(625*ps/1000L);         // NB: use fixed width metrics
-       return (FALSE);
+       return (false);
     }
     /*
      * Since many ISO-encoded fonts don't include metrics for
@@ -1383,7 +1383,7 @@ TextFont::readMetrics(TextCoord ps, fxBool useISO8859, fxStr& emsg)
             * (I don't know if this does or does not cause any problem.)
             */
            loadFixedMetrics(625*ps/1000L);     // NB: use fixed width metrics
-           return (FALSE);
+           return (false);
        }
        lineno++;
     } while (strncmp(buf, "StartCharMetrics", 16));
@@ -1395,7 +1395,7 @@ TextFont::readMetrics(TextCoord ps, fxBool useISO8859, fxStr& emsg)
            emsg = fxStr::format("%s, line %u: format error",
                (const char*) file, lineno);
            fclose(fp);
-           return (FALSE);
+           return (false);
        }
        if (ix == -1)                   // end of unencoded glyphs
            break;
@@ -1413,5 +1413,5 @@ TextFont::readMetrics(TextCoord ps, fxBool useISO8859, fxStr& emsg)
            widths[ix] = w*ps/1000L;
     }
     fclose(fp);
-    return (TRUE);
+    return (true);
 }
index 191afed9b2b617fe1b2db7ef9733cb1e03d04327..3e58548ec522b009aef3371ed5c82c4d007291b4 100644 (file)
@@ -49,15 +49,15 @@ private:
 
     void loadFixedMetrics(TextCoord w);
     FILE* openAFMFile(fxStr& pathname);
-    fxBool getAFMLine(FILE* fp, char* buf, int bsize);
-    static fxBool decodeFontName(const char*, fxStr&, fxStr&);
+    bool getAFMLine(FILE* fp, char* buf, int bsize);
+    static bool decodeFontName(const char*, fxStr&, fxStr&);
 public:
     TextFont(const char*);
     ~TextFont();
 
-    static fxBool findFont(const char* name);
+    static bool findFont(const char* name);
 
-    void defFont(FILE*, TextCoord pointSize, fxBool useISO8859) const;
+    void defFont(FILE*, TextCoord pointSize, bool useISO8859) const;
     void setfont(FILE*) const;
     TextCoord show(FILE*, const char*, int len) const;
     TextCoord show(FILE*, const fxStr&) const;
@@ -66,7 +66,7 @@ public:
 
     const char* getFamily(void) const;
 
-    fxBool readMetrics(TextCoord pointsize, fxBool useISO8859, fxStr& emsg);
+    bool readMetrics(TextCoord pointsize, bool useISO8859, fxStr& emsg);
 };
 /*
  * we have to use unsigned const char
@@ -88,13 +88,13 @@ public:
        REVERSE
     };
 private:
-    fxBool     gaudy;          // emit gaudy headers
-    fxBool     landscape;      // horizontal landscape mode output
-    fxBool     useISO8859;     // use the ISO 8859-1 character encoding
-    fxBool     reverse;        // page reversal flag
-    fxBool     wrapLines;      // wrap/truncate lines
-    fxBool     headers;        // emit page headers
-    fxBool     workStarted;    // formatting work begun
+    bool       gaudy;          // emit gaudy headers
+    bool       landscape;      // horizontal landscape mode output
+    bool       useISO8859;     // use the ISO 8859-1 character encoding
+    bool       reverse;        // page reversal flag
+    bool       wrapLines;      // wrap/truncate lines
+    bool       headers;        // emit page headers
+    bool       workStarted;    // formatting work begun
     FILE*      output;         // output file stream
     FILE*      tf;             // temporary output file
     OfftArray* pageOff;        // page offset table
@@ -112,10 +112,10 @@ private:
     TextCoord  lm, rm;         // left, right margins in local coordinates
     TextCoord  tm, bm;         // top, bottom margin in local coordinates
     TextCoord  lineHeight;     // inter-line spacing
-    fxBool     boc;            // at beginning of a column
-    fxBool     bop;            // at beginning of a page
-    fxBool     bol;            // at beginning of a line
-    fxBool     bot;            // at beginning of a text string
+    bool       boc;            // at beginning of a column
+    bool       bop;            // at beginning of a page
+    bool       bol;            // at beginning of a line
+    bool       bot;            // at beginning of a text string
     int                numcol;         // number of text columns
     int                column;         // current text column # (1..numcol)
     TextCoord  col_margin;     // inter-column margin
@@ -145,7 +145,7 @@ protected:
     virtual void fatal(const char* fmt ...) const;
 
     virtual void setupConfig(void);
-    virtual fxBool setConfigItem(const char* tag, const char* value);
+    virtual bool setConfigItem(const char* tag, const char* value);
     virtual void configError(const char* fmt ...);
     virtual void configTrace(const char* fmt ...);
 public:
@@ -157,21 +157,21 @@ public:
     static TextCoord inch(const char*);
 
     void setNumberOfColumns(u_int n);
-    void setPageHeaders(fxBool);
-    fxBool getPageHeaders(void) const;
-    void setLineWrapping(fxBool);
-    fxBool getLineWrapping(void) const;
-    void setISO8859(fxBool);
-    fxBool getISO8859(void) const;
-    fxBool setTextFont(const char* fontName);
-    void setGaudyHeaders(fxBool);
-    fxBool setPageMargins(const char*);
+    void setPageHeaders(bool);
+    bool getPageHeaders(void) const;
+    void setLineWrapping(bool);
+    bool getLineWrapping(void) const;
+    void setISO8859(bool);
+    bool getISO8859(void) const;
+    bool setTextFont(const char* fontName);
+    void setGaudyHeaders(bool);
+    bool setPageMargins(const char*);
     void setPageMargins(TextCoord l, TextCoord r, TextCoord b, TextCoord t);
     void setOutlineMargin(TextCoord);
     void setTextPointSize(TextCoord);
     TextCoord getTextPointSize(void) const;
     void setPageOrientation(u_int);
-    fxBool setPageSize(const char*);
+    bool setPageSize(const char*);
     void setPageWidth(float);
     void setPageHeight(float);
     void setPageCollation(u_int);
@@ -221,13 +221,13 @@ public:
     void reserveVSpace(TextCoord);
 };
 
-inline fxBool TextFmt::getLineWrapping(void) const     { return wrapLines; }
-inline fxBool TextFmt::getPageHeaders(void) const      { return headers; }
+inline bool TextFmt::getLineWrapping(void) const       { return wrapLines; }
+inline bool TextFmt::getPageHeaders(void) const        { return headers; }
 inline TextCoord TextFmt::getTextPointSize(void) const { return pointSize; }
 inline TextCoord TextFmt::getXOff(void) const          { return xoff; }
 inline TextCoord TextFmt::getRHS(void) const           { return right_x; }
 inline TextCoord TextFmt::getTextLineHeight(void) const        { return lineHeight; }
-inline fxBool TextFmt::getISO8859(void) const          { return useISO8859; }
+inline bool TextFmt::getISO8859(void) const            { return useISO8859; }
 inline const TextFont* TextFmt::getFont(void) const    { return curFont; }
 inline FILE* TextFmt::getOutputFile(void)              { return tf; }
 #endif /* _TextFmt_ */
index fdcde0921a579b611515db31e545b7c661803c2b..44f6084eab17ac2453313951d76fb9969ae7c331 100644 (file)
@@ -28,7 +28,7 @@
 #include <sys/time.h>
 #include "Timeout.h"
 
-fxBool Timeout::timerExpired = FALSE;
+bool Timeout::timerExpired = false;
 
 Timeout::Timeout() {}
 Timeout::~Timeout() {}
@@ -37,7 +37,7 @@ void Timeout::traceTimer(const char* ...) {}
 void
 Timeout::sigAlarm(int)
 {
-    Timeout::timerExpired = TRUE;
+    Timeout::timerExpired = true;
 }
 
 #ifndef SA_INTERRUPT
@@ -47,7 +47,7 @@ Timeout::sigAlarm(int)
 void
 Timeout::startTimeout(long ms)
 {
-    timerExpired = FALSE;
+    timerExpired = false;
 #ifdef SV_INTERRUPT                    /* BSD-style */
     static struct sigvec sv;
     sv.sv_handler = fxSIGVECHANDLER(Timeout::sigAlarm);
index 5a4bb737671c3d3847ba692f8c78ae03e6556ad7..ba237d359e43d9fecf821039fe4e255a9f4e4448 100644 (file)
@@ -32,7 +32,7 @@
  */
 class Timeout {
 private:
-    static fxBool timerExpired;
+    static bool timerExpired;
     static void sigAlarm(int);
 protected:
     virtual void traceTimer(const char* fmt ...);
@@ -43,6 +43,6 @@ public:
     void startTimeout(long ms);
     void stopTimeout();
 
-    fxBool wasTimeout() const          { return Timeout::timerExpired; }
+    bool wasTimeout() const            { return Timeout::timerExpired; }
 };
 #endif /* _Timeout_ */
index 0a600618efa24852ad7be2070f46dd5485783eaa..5c6f7edbe6d3dcc06617f312220ae88106a18c36 100644 (file)
@@ -34,7 +34,7 @@
 
 Transport::Transport(FaxClient& c) : client(c) {}
 Transport::~Transport() {}
-fxBool Transport::hangupServer()       { return (TRUE); }
+bool Transport::hangupServer() { return (true); }
 
 void
 Transport::closeDataConn(int fd)
@@ -65,16 +65,16 @@ Transport::getTransport(FaxClient& client, const char* address)
     }
 }
 
-fxBool
+bool
 Transport::abortCmd(fxStr& emsg)
 {
     static const char msg[] = { 'A', 'B', 'O', 'R', '\r', '\n' };
     int s = fileno(client.getCtrlFd());
     if (Sys::write(s, msg, sizeof (msg)) != sizeof (msg)) {
        emsg = fxStr::format("send(ABOR\\r\\n): %s", strerror(errno));
-       return (FALSE);
+       return (false);
     }
-    return (TRUE);
+    return (true);
 }
 
 void
index de7dc2fe4d76a33ee547b7393f0191cfadd34ac4..56d535cb62992c0a678e8ec5bcb4079a9bdfdb9c 100644 (file)
@@ -43,12 +43,12 @@ public:
 
     static Transport& getTransport(FaxClient&, const char* address);
 
-    virtual fxBool callServer(fxStr& emsg) = 0;
-    virtual fxBool hangupServer(void);
-    virtual fxBool abortCmd(fxStr& emsg);
+    virtual bool callServer(fxStr& emsg) = 0;
+    virtual bool hangupServer(void);
+    virtual bool abortCmd(fxStr& emsg);
 
-    virtual fxBool initDataConn(fxStr& emsg) = 0;
-    virtual fxBool openDataConn(fxStr& emsg) = 0;
+    virtual bool initDataConn(fxStr& emsg) = 0;
+    virtual bool openDataConn(fxStr& emsg) = 0;
     virtual void closeDataConn(int);
 };
 #endif /* _Transport_ */
index 8f1c5bdca4e7b0c9e3d9fb86be3344e084cad7ae..8d47c68ec80db9e61f8b41191f532cb6032a3a65 100644 (file)
@@ -56,8 +56,8 @@ static const char* opNames[] =
     { "<any>", "=", "!=", "<", "<=", ">", ">=", "&", "^", "!" };
 static const char* resultNames[] = { "tiff", "postscript", "error" };
 
-fxBool
-TypeRule::match(const void* data, u_int size, fxBool verbose) const
+bool
+TypeRule::match(const void* data, u_int size, bool verbose) const
 {
     if (verbose) {
        printf("rule: %soffset %#lx %s %s",
@@ -79,9 +79,9 @@ TypeRule::match(const void* data, u_int size, fxBool verbose) const
     if (off > size) {
        if (verbose)
            printf("failed (offset past data)\n");
-       return (FALSE);
+       return (false);
     }
-    fxBool ok = FALSE;
+    bool ok = false;
     u_long v = 0;
     const u_char* cp = (const u_char*) data;
     switch (type) {
@@ -91,9 +91,9 @@ TypeRule::match(const void* data, u_int size, fxBool verbose) const
            if (!isprint(cp[i]) && !isspace(cp[i])) {
                if (verbose)
                    printf("failed (unprintable char %#x)\n", cp[i]);
-               return (FALSE);
+               return (false);
            }
-       ok = TRUE;
+       ok = true;
        goto done;
     case STRING:
        ok = (strncmp((const char*)(cp+off), value.s,
@@ -114,7 +114,7 @@ TypeRule::match(const void* data, u_int size, fxBool verbose) const
        }
        if (verbose)
            printf("failed (insufficient data)\n");
-       return (FALSE);
+       return (false);
     case LONG:
        if (off + 4 < size) {
            memcpy(&v, cp+off, 4);
@@ -123,13 +123,13 @@ TypeRule::match(const void* data, u_int size, fxBool verbose) const
        }
        if (verbose)
            printf("failed (insufficient data)\n");
-       return (FALSE);
+       return (false);
     }
     /*
      * Numeric value, use operation.
      */
     switch (op) {
-    case ANY:  ok = TRUE; break;
+    case ANY:  ok = true; break;
     case EQ:   ok = (v == value.v); break;
     case NE:   ok = (v != value.v); break;
     case LT:   ok = (v  < value.v); break;
@@ -211,7 +211,7 @@ fxIMPLEMENT_ObjArray(TypeRuleArray, TypeRule)
 
 TypeRules::TypeRules()
 {
-    verbose = FALSE;
+    verbose = false;
     rules = new TypeRuleArray;
 }
 
@@ -221,14 +221,14 @@ TypeRules::~TypeRules()
 }
 
 void
-TypeRules::setVerbose(fxBool b)
+TypeRules::setVerbose(bool b)
 {
     verbose = b;
 }
 
 #include <ctype.h>
 
-static fxBool
+static bool
 appendLine(fxStr& s, const char* line)
 {
     const char* cp = line;
@@ -243,14 +243,14 @@ appendLine(fxStr& s, const char* line)
            if (cp[-1] == '\\') {
                if (*cp == '\n') {      // continue cmd string on next line
                    s.append(cmd, cp-1 - cmd);
-                   return (TRUE);
+                   return (true);
                } else if (*cp)         // accept anything but \\0
                    cp++;
            }
        } while (*cp != '\0' && *cp != '\n' && *cp != '#');
        s.append(fxStr(cmd, cp-cmd));
     }
-    return (FALSE);
+    return (false);
 }
 
 #include <stdarg.h>
@@ -286,10 +286,10 @@ TypeRules::read(const fxStr& file)
            continue;
        TypeRule rule;
        if (*cp == '>') {               // continuation
-           rule.cont = TRUE;
+           rule.cont = true;
            cp++;
        } else
-           rule.cont = FALSE;
+           rule.cont = false;
        const char *op = cp;
        rule.off = strtoul(op, &cp, 0); // file offset
        if (cp == op) {
@@ -387,7 +387,7 @@ TypeRules::read(const fxStr& file)
            cp++;
        const char* cmd = cp;           // collect cmd string
        if (*cp != '\0' && *cp != '\n' && *cp != '#') {
-           fxBool done = FALSE;        // XXX workaround compiler limitation
+           bool done = false;  // XXX workaround compiler limitation
            do {
                cp++;
                if (cp[-1] == '\\') {
@@ -396,7 +396,7 @@ TypeRules::read(const fxStr& file)
                        while (fgets(line, sizeof (line), fp) != NULL &&
                          appendLine(rule.cmd, line))
                            ;
-                       done = TRUE;
+                       done = true;
                    } else if (*cp)     // accept anything but \\0
                        cp++;
                }
@@ -414,7 +414,7 @@ TypeRules::read(const fxStr& file)
  * Check secondary matching rules after a primary match.
  */
 u_int
-TypeRules::match2(u_int base, const void* data, u_int size, fxBool verb) const
+TypeRules::match2(u_int base, const void* data, u_int size, bool verb) const
 {
     for (u_int i = 1, n = (*rules).length() - base; i < n; i++) {
        TypeRule& rule = (*rules)[base+i];
index 64aeaf04e5ce749af22961857bb777da640822b7..1983b88f3456d832eaa32bae0febd7208a39e56f 100644 (file)
@@ -98,14 +98,14 @@ public:
 
     static TypeRules* read(const fxStr& file); // read rule database
 
-    void setVerbose(fxBool);
+    void setVerbose(bool);
 
     const TypeRule* match(const void* data, u_int size) const;
 private:
     TypeRuleArray* rules;
-    fxBool     verbose;                        // while matching
+    bool       verbose;                        // while matching
 
-    u_int match2(u_int base, const void* data, u_int size, fxBool verb) const;
+    u_int match2(u_int base, const void* data, u_int size, bool verb) const;
 };
 
 typedef unsigned int TypeResult;               // conversion result
@@ -127,7 +127,7 @@ public:
     };
 private:
     off_t      off;    // byte offset in file
-    fxBool     cont;   // continuation
+    bool       cont;   // continuation
     enum {
        ASCII,          // ascii-only string
        STRING,         // byte string
@@ -161,8 +161,8 @@ public:
     TypeRule(const TypeRule& other);
     virtual ~TypeRule();
 
-    fxBool     match(const void*, u_int size, fxBool verbose = FALSE) const;
-    fxBool     isContinuation() const;
+    bool       match(const void*, u_int size, bool verbose = false) const;
+    bool       isContinuation() const;
 
     TypeResult getResult() const;
     const fxStr& getCmd() const;
@@ -172,7 +172,7 @@ public:
                    const fxStr& df,
                    const fxStr& pname) const;
 };
-inline fxBool TypeRule::isContinuation() const { return cont; }
+inline bool TypeRule::isContinuation() const   { return cont; }
 inline TypeResult TypeRule::getResult() const  { return result; }
 inline const fxStr& TypeRule::getCmd() const   { return cmd; }
 inline fxStr TypeRule::getErrMsg() const       { return cmd; }
index c76b025a012d190b3bb58707e83795e036b9ee78..5bc94ec8372d39fdab6d05b9fbba96708c3ba7b6 100644 (file)
 #include "sys/types.h"
 #include "port.h"
 
-// Boolean type
-typedef unsigned char fxBool;
-#undef TRUE
-#define        TRUE    ((fxBool)1)
-#undef FALSE
-#define        FALSE   ((fxBool)0)
-
 // minimum of two numbers
 inline int fxmin(int a, int b)         { return (a < b) ? a : b; }
 inline u_long fxmin(u_long a, u_long b)        { return (a < b) ? a : b; }
index 9198ccb0a6c1ec6e8aea6b523a011ab12342c139..26ae4d148f68ce5223fec9b036ea3a1011e02c55 100644 (file)
@@ -31,7 +31,7 @@
 UnixTransport::UnixTransport(FaxClient& c) : Transport(c) {}
 UnixTransport::~UnixTransport() {}
 
-fxBool
+bool
 UnixTransport::isA(const char* address)
 {
      return Sys::isSocketFile(address);
@@ -44,13 +44,13 @@ extern "C" {
 #include <sys/un.h>
 }
 
-fxBool
+bool
 UnixTransport::callServer(fxStr& emsg)
 {
     int fd = socket(AF_UNIX, SOCK_STREAM, 0);
     if (fd < 0) {
        emsg = "Can not create socket to connect to server.";
-       return (FALSE);
+       return (false);
     }
     struct sockaddr_un Sun;
     memset(&Sun, 0, sizeof (Sun));
@@ -61,16 +61,16 @@ UnixTransport::callServer(fxStr& emsg)
            (const char*) client.getHost());
     if (Socket::connect(fd, &Sun, sizeof (Sun)) >= 0) {
        client.setCtrlFds(fd, dup(fd));
-       return (TRUE);
+       return (true);
     } else {
        emsg = fxStr::format("Can not reach server at Unix domain socket \"%s\".",
            (const char*) client.getHost());
        Sys::close(fd), fd = -1;
-       return (FALSE);
+       return (false);
     }
 }
 
-fxBool
+bool
 UnixTransport::initDataConn(fxStr&)
 {
 #ifdef notdef
@@ -78,13 +78,13 @@ UnixTransport::initDataConn(fxStr&)
     Socket::socklen_t dlen = sizeof (data_addr);
     if (Socket::getsockname(fileno(client.getCtrlFd()), &data_addr, &dlen) < 0) {
        emsg = fxStr::format("getsockname(ctrl): %s", strerror(errno));
-       return (FALSE);
+       return (false);
     }
     data_addr.sin_port = 0;            // let system allocate port
     fd = socket(AF_INET, SOCK_STREAM, 0);
     if (fd < 0) {
        emsg = fxStr::format("socket: %s", strerror(errno));
-       return (FALSE);
+       return (false);
     }
     if (Socket::bind(fd, &data_addr, sizeof (data_addr)) < 0) {
        emsg = fxStr::format("bind: %s", strerror(errno));
@@ -105,37 +105,37 @@ UnixTransport::initDataConn(fxStr&)
     if (client.command("PORT %u,%u,%u,%u,%u,%u",
        UC(a[0]), UC(a[1]), UC(a[2]), UC(a[3]),
        UC(p[0]), UC(p[1])) != COMPLETE)
-       return (FALSE);
+       return (false);
 #undef UC
     client.setDataFd(fd);
-    return (TRUE);
+    return (true);
 bad:
     Sys::close(fd), fd = -1;
 #endif
-    return (FALSE);
+    return (false);
 }
 
-fxBool
+bool
 UnixTransport::openDataConn(fxStr&)
 {
 #ifdef notdef
     int s = Socket::accept(fileno(client.getDataFd()), NULL, NULL);
     if (s >= 0) {
        client.setDataFd(s);
-       return (TRUE);
+       return (true);
     } else {
        emsg = fxStr::format("accept: %s", strerror(errno));
-       return (FALSE);
+       return (false);
     }
 #else
-    return (FALSE);
+    return (false);
 #endif
 }
 #else
-fxBool UnixTransport::callServer(fxStr& emsg)
-    { notConfigured("Unix domain", emsg); return (FALSE); }
-fxBool UnixTransport::initDataConn(fxStr& emsg)
-    { notConfigured("Unix domain", emsg); return (FALSE); }
-fxBool UnixTransport::openDataConn(fxStr& emsg)
-    { notConfigured("Unix domain", emsg); return (FALSE); }
+bool UnixTransport::callServer(fxStr& emsg)
+    { notConfigured("Unix domain", emsg); return (false); }
+bool UnixTransport::initDataConn(fxStr& emsg)
+    { notConfigured("Unix domain", emsg); return (false); }
+bool UnixTransport::openDataConn(fxStr& emsg)
+    { notConfigured("Unix domain", emsg); return (false); }
 #endif
index 9a48a5c770ac5277dfac2400cf75eee6f3aaf52f..1994e0de66d2c9d1850f7379fd7b09f10c952e70 100644 (file)
@@ -35,11 +35,11 @@ public:
     UnixTransport(FaxClient&);
     ~UnixTransport();
 
-    static fxBool isA(const char*);
+    static bool isA(const char*);
 
-    fxBool callServer(fxStr& emsg);
+    bool callServer(fxStr& emsg);
 
-    fxBool initDataConn(fxStr& emsg);
-    fxBool openDataConn(fxStr& emsg);
+    bool initDataConn(fxStr& emsg);
+    bool openDataConn(fxStr& emsg);
 };
 #endif /* _UnixTransport_ */
index c20a6dbb72a73f54ee6236962a94a130065fbbb0..f3fbb8ef72c144c707de5be5f7e5e6636312ed14 100644 (file)
@@ -65,7 +65,7 @@ main(int argc, char* argv[])
     char* countryCode = "1";
     char* internationalPrefix = "011";
     char* longDistancePrefix = "1";
-    fxBool verbose = FALSE;
+    bool verbose = false;
     extern int optind, opterr;
     extern char* optarg;
     int c;
@@ -86,7 +86,7 @@ main(int argc, char* argv[])
            longDistancePrefix = optarg;
            break;
        case 'v':
-           verbose = TRUE;
+           verbose = true;
            break;
        case '?':
            usage();
@@ -95,7 +95,7 @@ main(int argc, char* argv[])
     if (argc - optind != 1)
        usage();
     DialStringRules rules(argv[optind]);
-    rules.setVerbose(TRUE);
+    rules.setVerbose(true);
     rules.def("AreaCode", areaCode);
     rules.def("CountryCode", countryCode);
     rules.def("InternationalPrefix", internationalPrefix);
index 7a977563396f8af95f5ca3e566f1f02bb4cdfcd9..4e9934b90e5d1c238340fed2ae4d746b24389e22 100644 (file)
@@ -39,11 +39,11 @@ public:
 faxFetchApp::faxFetchApp() {}
 faxFetchApp::~faxFetchApp() {}
 
-static fxBool
+static bool
 writeStdout(void*, const char* buf, int cc, fxStr&)
 {
     (void) Sys::write(STDOUT_FILENO, buf, cc);
-    return (TRUE);
+    return (true);
 }
 
 void
@@ -77,7 +77,7 @@ faxFetchApp::run(int argc, char** argv)
            mode = MODE_S;
            break;
        case 'v':                       // enable protocol tracing
-           setVerbose(TRUE);
+           setVerbose(true);
            break;
        case 'z':
            mode = MODE_Z;
index 4c1455debac21c5cb3bec225f4d176ab6407f0a1..25f555d3a9aa0b20eb4716a27d3e45245dabadd3 100644 (file)
 
 extern const char* fmtTime(time_t t);
 
-static fxBool
+static bool
 isFAXImage(TIFF* tif)
 {
     uint16 w;
     if (TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &w) && w != 1)
-       return (FALSE);
+       return (false);
     if (TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &w) && w != 1)
-       return (FALSE);
+       return (false);
     if (!TIFFGetField(tif, TIFFTAG_COMPRESSION, &w) ||
       (w != COMPRESSION_CCITTFAX3 && w != COMPRESSION_CCITTFAX4))
-       return (FALSE);
+       return (false);
     if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &w) ||
       (w != PHOTOMETRIC_MINISWHITE && w != PHOTOMETRIC_MINISBLACK))
-       return (FALSE);
-    return (TRUE);
+       return (false);
+    return (true);
 }
 
 static void
@@ -67,11 +67,11 @@ sanitize(fxStr& s)
 int
 main(int argc, char** argv)
 {
-    fxBool showFilename = TRUE;
+    bool showFilename = true;
     const char* appName = argv[0];
 
     if (argc > 2 && streq(argv[1], "-n")) {
-       showFilename = FALSE;
+       showFilename = false;
        argc--, argv++;
     }
     if (argc != 2) {
@@ -87,7 +87,7 @@ main(int argc, char** argv)
        printf("Could not open %s; either not TIFF or corrupted.\n", argv[1]);
        return (0);
     }
-    fxBool ok = isFAXImage(tif);
+    bool ok = isFAXImage(tif);
     if (!ok) {
        printf("Does not look like a facsimile?\n");
        return (0);
index 4d7ada488c00d8bc050ffe6928943b7ac6d8ea24..ca789edf5bd88ce8108e660dcd8ee74a7d5dca27 100644 (file)
@@ -45,14 +45,14 @@ public:
 watchApp::watchApp() {}
 watchApp::~watchApp() {}
 
-static fxBool
+static bool
 writeData(void* arg, const char* buf, int cc, fxStr& emsg)
 {
     if (Sys::write((int) arg, buf, cc) != cc) {
        emsg = fxStr::format("write error: %s", strerror(errno));
-       return (FALSE);
+       return (false);
     } else
-       return (TRUE);
+       return (true);
 }
 
 void
@@ -83,7 +83,7 @@ watchApp::run(int argc, char** argv)
            break;
        case 'v':                       // verbose mode
            setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
-           FaxClient::setVerbose(TRUE);// protocol tracing
+           FaxClient::setVerbose(true);// protocol tracing
            break;
        case '?':
            usage();
index 99214d9ac49648ee45799beb73d0716de77de831..add3cb9fbb26910f7f1d26309eab9defb36b4b6c 100644 (file)
@@ -95,13 +95,13 @@ main(int argc, char* argv[])
            fmt.setNumberOfColumns(c - '0');
            break;
        case 'B':
-           fmt.setPageHeaders(FALSE);
+           fmt.setPageHeaders(false);
            break;
        case 'c':               // clip/cut instead of wrapping lines
-           fmt.setLineWrapping(FALSE);
+           fmt.setLineWrapping(false);
            break;
        case 'D':               // don't use ISO 8859-1 encoding
-           fmt.setISO8859(FALSE);
+           fmt.setISO8859(false);
            break;
        case 'f':               // body font
            if (!fmt.setTextFont(optarg)) {
@@ -115,7 +115,7 @@ main(int argc, char* argv[])
            fmt.setFontPath(optarg);
            break;
        case 'G':               // gaudy mode
-           fmt.setGaudyHeaders(TRUE);
+           fmt.setGaudyHeaders(true);
            break;
        case 'm':               // multi-column output
            fmt.setNumberOfColumns(atoi(optarg));
index c8f82d3ea2c385b6343d539e5053de4045249ddc..f832bc448ffe084b6b4c1b6a374f3f1a70a140a4 100644 (file)
@@ -117,7 +117,7 @@ main(int argc, char* argv[])
        fprintf(stderr, "Unable to setup file typing and conversion rules\n");
        return (-1);
     }
-    typeRules->setVerbose(TRUE);
+    typeRules->setVerbose(true);
     for (; optind < argc; optind++)
        (void) fileType(argv[optind]);
     return (0);