Current state of my dtmail work.

Mostly #ifdefs and casts; also, do not redefine strcasestr().  This will
probably be needed for Linux too when compiling without -fpermissive.
This commit is contained in:
Pascal Stumpf
2012-08-11 13:57:26 +02:00
committed by Jon Trulson
parent 7c3a972d32
commit e3ad7e24e3
23 changed files with 75 additions and 57 deletions

View File

@@ -169,7 +169,8 @@ RFCFormat::writeHeaders(DtMailEnv & error,
hnd && !error.isSet();
value.clear(), hnd = env->getNextHeader(error, hnd, &name, value)) {
for (const char ** hdr = suppress_headers; *hdr; hdr++) {
const char **hdr;
for (hdr = suppress_headers; *hdr; hdr++) {
if (strcasecmp(name, *hdr) == 0)
break;
}
@@ -185,7 +186,8 @@ RFCFormat::writeHeaders(DtMailEnv & error,
for (int val = 0; val < value.length(); val++) {
//
// If the value is null or empty do not emit this field
for (const char *valPtr = *(value[val]);
const char *valPtr;
for (valPtr = *(value[val]);
*valPtr && (isspace((unsigned char)*valPtr));
valPtr++)
{}

View File

@@ -63,7 +63,7 @@
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/uio.h>
#if !defined(__aix) && !defined(__hpux) && !defined(linux)
#if !defined(__aix) && !defined(__hpux) && !defined(linux) && !defined(CSRG_BASED)
#include <sys/systeminfo.h>
#endif
#include <sys/wait.h>
@@ -112,7 +112,7 @@ extern "C" ssize_t pread(int, void *, size_t, off_t);
#define LCL_SIG_HANDLER_SIGNATURE
#elif defined(__hpux)
#define LCL_SIG_HANDLER_SIGNATURE __harg
#elif defined(__aix) || defined(__alpha) || defined(linux)
#elif defined(__aix) || defined(__alpha) || defined(linux) || defined(CSRG_BASED)
#define LCL_SIG_HANDLER_SIGNATURE int
#elif defined(__uxp__)
#define LCL_SIG_HANDLER_SIGNATURE
@@ -674,7 +674,7 @@ RFCMailBox::append(DtMailEnv &error, char *buf, int len)
path, errno, error.errnoMessage(errno));
break;
#if defined(__osf__)
#if defined(__osf__) || defined(CSRG_BASED)
case ENOTDIR:
#else
case ENOLINK:
@@ -3011,7 +3011,7 @@ RFCMailBox::createTemporaryMailboxFile(DtMailEnv & error, char *tmp_name)
error.setError(DTME_CannotCreateTemporaryMailboxFile_NoSuchFile);
break;
#if defined(__osf__)
#if defined(__osf__) || defined(CSRG_BASED)
case ENOTDIR:
#else
case ENOLINK:
@@ -3336,7 +3336,7 @@ RFCMailBox::writeMailBox(DtMailEnv &error, DtMailBoolean hide_access)
DTME_CannotWriteToTemporaryMailboxFile_ProcessLimitsExceeded);
break;
#if defined(__osf__)
#if defined(__osf__) || defined(CSRG_BASED)
case ENOTDIR:
#else
case ENOLINK:
@@ -3696,7 +3696,7 @@ RFCMailBox::generateUniqueLockId(void)
char theId[128];
char hwserialbuf[64];
#if !defined(__aix) && !defined(__hpux) && !defined(__osf__) && !defined(linux)
#if !defined(__aix) && !defined(__hpux) && !defined(__osf__) && !defined(linux) && !defined(CSRG_BASED)
if (sysinfo(SI_HW_SERIAL, (char *)hwserialbuf, sizeof(hwserialbuf)-1) == -1)
#endif
strcpy(hwserialbuf, "dtmail");
@@ -3832,7 +3832,7 @@ RFCMailBox::linkLockFile(DtMailEnv & error, char *tempLockFileName)
error.setError(DTME_CannotCreateMailboxLockFile_NoSuchFile);
break;
#if defined(__osf__)
#if defined(__osf__) || defined(CSRG_BASED)
case ENOTDIR:
#else
case ENOLINK:
@@ -4200,7 +4200,7 @@ RFCMailBox::dotDtmailLock(DtMailEnv & error)
case ENOENT:
error.setError(DTME_CannotCreateMailboxLockFile_NoSuchFile);
break;
#if defined(__osf__)
#if defined(__osf__) || defined(CSRG_BASED)
case ENOTDIR:
#else
case ENOLINK:
@@ -4814,27 +4814,27 @@ extern "C" void *
RFCMetaFactory(const char * op)
{
if (strcmp(op, QueryImplEntryOp) == 0) {
return(RFCQueryImpl);
return((void *)RFCQueryImpl);
}
if (strcmp(op, QueryOpenEntryOp) == 0) {
return(RFCQueryOpen);
return((void *)RFCQueryOpen);
}
if (strcmp(op, MailBoxConstructEntryOp) == 0) {
return(RFCMailBoxConstruct);
return((void *)RFCMailBoxConstruct);
}
if (strcmp(op, QueryMessageEntryOp) == 0) {
return(RFCMessageQuery);
return((void *)RFCMessageQuery);
}
if (strcmp(op, MessageConstructEntryOp) == 0) {
return(RFCMessageConstruct);
return((void *)RFCMessageConstruct);
}
if (strcmp(op, TransportConstructEntryOp) == 0) {
return(RFCMIMETransportConstruct);
return((void *)RFCMIMETransportConstruct);
}
return(NULL);
@@ -4873,27 +4873,27 @@ extern "C" void *
V3MetaFactory(const char * op)
{
if (strcmp(op, QueryImplEntryOp) == 0) {
return(RFCQueryImpl);
return((void *)RFCQueryImpl);
}
if (strcmp(op, QueryOpenEntryOp) == 0) {
return(RFCQueryOpen);
return((void *)RFCQueryOpen);
}
if (strcmp(op, MailBoxConstructEntryOp) == 0) {
return(V3MailBoxConstruct);
return((void *)V3MailBoxConstruct);
}
if (strcmp(op, QueryMessageEntryOp) == 0) {
return(RFCMessageQuery);
return((void *)RFCMessageQuery);
}
if (strcmp(op, MessageConstructEntryOp) == 0) {
return(RFCMessageConstruct);
return((void *)RFCMessageConstruct);
}
if (strcmp(op, TransportConstructEntryOp) == 0) {
return(RFCV3TransportConstruct);
return((void *)RFCV3TransportConstruct);
}
return(NULL);

View File

@@ -51,6 +51,7 @@
#include <strings.h>
#endif
#include <ctype.h>
#include <stdint.h>
#include <DtMail/IO.hh>
#include "RFCImpl.hh"
@@ -490,7 +491,9 @@ RFCValue::toDate(void)
new_time.tm_isdst = -1;
date.dtm_date = SafeMktime(&new_time);
date.dtm_tz_offset_secs = (int) timezone;
#ifdef SVR4
date.dtm_tz_offset_secs = timezone;
#endif
}
else {
// In this format, we should have a day of the month.
@@ -536,15 +539,19 @@ RFCValue::toDate(void)
time_t offset = parseTZ(token_begin[this_token], token_end[this_token]);
time_t orig_zone = (time_t) timezone;
#ifdef SVR4
time_t orig_zone = timezone;
timezone = offset;
#endif
// Tell "mktime" to figure "dst" on or not.
new_time.tm_isdst = -1;
date.dtm_date = SafeMktime(&new_time);
date.dtm_tz_offset_secs = offset;
#ifdef SVR4
timezone = orig_zone;
#endif
}
return(date);

View File

@@ -973,7 +973,7 @@ RFCTransport::signalRegister(void)
initialized = 1;
#if defined(hpux) || defined(_aix) || defined(__osf__) || defined(linux) || \
(defined(sun) && OSMAJORVERSION>=5 && OSMINORVERSION>4)
(defined(sun) && OSMAJORVERSION>=5 && OSMINORVERSION>4) || defined(CSRG_BASED)
// SunOS 5.5 and above defined prototype for signal handler
act.sa_handler = (void (*)(int))&RFCTransport::childHandler;
#else