]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 255] small patch for NetBSD, Japanization, and 64-bit systems
authorDarren Nickerson <darren.nickerson@ifax.com>
Fri, 3 May 2002 18:17:41 +0000 (18:17 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Fri, 3 May 2002 18:17:41 +0000 (18:17 +0000)
configure
faxd/FaxModem.c++
faxd/FaxModem.h
util/TypeRules.c++
util/TypeRules.h
util/typerules

index 1b49574bd865a3e31d3de78787ae148dd324f7ec..05c8c6ecd64a5acec847af1db1a621b5d0bcaf1b 100755 (executable)
--- a/configure
+++ b/configure
@@ -3570,6 +3570,7 @@ Note "Using uid $FAXUID and gid $FAXGID for controlling access to fax stuff."
 if [ -z "$SYSGID" ]; then
     case $TARGET in
     *-aix*)    SYSGID=sys;;
+    *netbsd*)  SYSGID=wheel;;
     *bsd*)     SYSGID=bin;;
     *-hpux*)   SYSGID=bin;;
     *-irix*)   SYSGID=sys;;
index 498d11b18b211b2b2c3f7c634f327a9a42093d63..7dbc691ce93cd38389c92611475997cd628daffa 100644 (file)
@@ -814,7 +814,7 @@ u_char* MemoryDecoder::cutExtraRTC()
 }
 
 void
-FaxModem::correctPhaseCData(u_char* buf, u_long* pBufSize,
+FaxModem::correctPhaseCData(u_char* buf, uint32* pBufSize,
                             u_int fillorder, const Class2Params& params)
 {
     MemoryDecoder dec1(buf, params.pageWidth(), *pBufSize, fillorder, params.is2D());
index b258a101c4522f934124cde54ce3bb02bd4d605a..b3be479adb2adb2dab5817804c63070c3a454e25 100644 (file)
@@ -144,7 +144,7 @@ protected:
 /*
  * Correct if neccessary Phase C (T.4) data (remove extra RTC etc.)
  */
-    void        correctPhaseCData(u_char* buf, u_long* pBufSize,
+    void        correctPhaseCData(u_char* buf, uint32* pBufSize,
                                   u_int fillorder, const Class2Params& params);
 public:
     enum {                     // FaxModem::RTNHandling
index 8d47c68ec80db9e61f8b41191f532cb6032a3a65..8875622f7f7e8ca70ea45cfea07190179b4355f1 100644 (file)
@@ -36,6 +36,14 @@ extern "C" {
 #include <netinet/in.h>
 }
 
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
 TypeRule::TypeRule() {}
 TypeRule::~TypeRule() {}
 TypeRule::TypeRule(const TypeRule& other)
@@ -51,7 +59,7 @@ TypeRule::TypeRule(const TypeRule& other)
 }
 
 static const char* typeNames[] =
-    { "ascii", "string", "address", "byte", "short", "long" };
+    { "ascii", "asciiesc", "string", "address", "byte", "short", "long" };
 static const char* opNames[] =
     { "<any>", "=", "!=", "<", "<=", ">", ">=", "&", "^", "!" };
 static const char* resultNames[] = { "tiff", "postscript", "error" };
@@ -68,7 +76,7 @@ TypeRule::match(const void* data, u_int size, bool verbose) const
        );
        if (type == STRING)
            printf(" \"%s\"", value.s);
-       else if (type != ASCII) {
+       else if (type != ASCII && type != ASCIIESC) {
            if (op == ANY)
                printf(" <any value>");
            else
@@ -95,6 +103,16 @@ TypeRule::match(const void* data, u_int size, bool verbose) const
            }
        ok = true;
        goto done;
+    case ASCIIESC:
+       u_int i;
+       for (i = 0; i < size; i++)
+           if (!isprint(cp[i]) && !isspace(cp[i]) && cp[i] != '\033') {
+               if (verbose)
+                   printf("failed (unprintable char %#x)\n", cp[i]);
+               return (FALSE);
+           }
+       ok = TRUE;
+       goto done;
     case STRING:
        ok = (strncmp((const char*)(cp+off), value.s,
            fxmin((u_int) strlen(value.s), (u_int)(size-off))) == 0);
@@ -311,6 +329,8 @@ TypeRules::read(const fxStr& file)
            rule.type = TypeRule::STRING;
        else if (strncasecmp(tp, "ascii", cp-tp) == 0)
            rule.type = TypeRule::ASCII;
+       else if (strncasecmp(tp, "asciiesc", cp-tp) == 0)
+           rule.type = TypeRule::ASCIIESC;
        else if (strncasecmp(tp, "addr", cp-tp) == 0)
            rule.type = TypeRule::ADDR;
        else {
@@ -321,7 +341,8 @@ TypeRules::read(const fxStr& file)
            cp++;
        rule.op = TypeRule::EQ;         // default is '='
        const char* vp = cp;
-       if (rule.type != TypeRule::STRING && rule.type != TypeRule::ASCII) {
+       if (rule.type != TypeRule::STRING && rule.type != TypeRule::ASCII
+        && rule.type != TypeRule::ASCIIESC) {
            // numeric value
            switch (*vp) {
            case '=':   rule.op = TypeRule::EQ; cp++; break;
index 1983b88f3456d832eaa32bae0febd7208a39e56f..073e116c65cae26356ae0fb11141cf8dbae572a2 100644 (file)
@@ -130,6 +130,7 @@ private:
     bool       cont;   // continuation
     enum {
        ASCII,          // ascii-only string
+       ASCIIESC,       // ascii-only string + escape char (iso-2022 variants)
        STRING,         // byte string
        ADDR,           // address of match
        BYTE,           // 8 bits
index 7f0ef4d925cd77daf6c8a1fe9d7f4f42837edd71..efbfd0f35e182f9cd0ba515196ecb63e61331243 100644 (file)
 >15     string          binary         error   binary IRIS Inventor file
 >15     string          ascii          ps      %F/textfmt -B -f Courier-Bold\
                                                -Ml=0.4in -p 11 -s %s >%o <%i
+#
+# Japanization (should help other iso-2022 variants too)
+#
+#>15   string          asciiesc        ps      a2ps-j -l '' -p -ns -nt <%i >%o
+#0     asciiesc        x               ps      a2ps-j -l '' -p -ns -nt <%i >%o
+#
+
 #
 # This causes anything else with ascii-only data to be treated as text.
 #