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:
committed by
Jon Trulson
parent
7c3a972d32
commit
e3ad7e24e3
@@ -156,6 +156,8 @@ struct cmd cmdtab[] = {
|
||||
#define SYSTEM_MAILRC "/usr/share/lib/mailx.rc"
|
||||
#elif defined(__uxp__)
|
||||
#define SYSTEM_MAILRC "/etc/mail/mailx.rc"
|
||||
#elif defined(CSRG_BASED)
|
||||
#define SYSTEM_MAILRC "/etc/mail.rc"
|
||||
#endif
|
||||
|
||||
// constructor
|
||||
@@ -1072,6 +1074,7 @@ int DtMail::MailRc::execute(char linebuf[])
|
||||
* include the newline at the end.
|
||||
*/
|
||||
|
||||
int
|
||||
DtMail::MailRc::readline(FILE *ibuf, char *linebuf)
|
||||
{
|
||||
register char *cp;
|
||||
|
||||
@@ -78,13 +78,14 @@ void *
|
||||
HashTableImpl::lookup(ObjectKey & key)
|
||||
{
|
||||
short hash_key = key.hashValue();
|
||||
HashEntry *chain;
|
||||
|
||||
int slot = hash_key % _table_size;
|
||||
|
||||
// Search the slot looking for the value. Return NULL if there
|
||||
// are no objects matching this key.
|
||||
//
|
||||
for (HashEntry * chain = &_hash_table[slot]; chain; chain = chain->next) {
|
||||
for (chain = &_hash_table[slot]; chain; chain = chain->next) {
|
||||
if (chain->key && key == *(chain->key)) {
|
||||
break;
|
||||
}
|
||||
@@ -102,6 +103,7 @@ HashTableImpl::set(ObjectKey & key, void * value)
|
||||
{
|
||||
short hash_key = key.hashValue();
|
||||
int slot = hash_key % _table_size;
|
||||
HashEntry *chain;
|
||||
|
||||
// See if we have already filled the slot.
|
||||
//
|
||||
@@ -116,7 +118,7 @@ HashTableImpl::set(ObjectKey & key, void * value)
|
||||
// We either have a collision or a duplicate. In the case of duplicates
|
||||
// we simply replace the value.
|
||||
//
|
||||
for (HashEntry * chain = &_hash_table[slot]; chain->next; chain = chain->next) {
|
||||
for (chain = &_hash_table[slot]; chain->next; chain = chain->next) {
|
||||
// If this item is already stored then update the value.
|
||||
//
|
||||
if (key == *(chain->key)) {
|
||||
@@ -139,6 +141,7 @@ HashTableImpl::remove(ObjectKey & key)
|
||||
short hash_val = key.hashValue();
|
||||
int slot = hash_val % _table_size;
|
||||
void * removed_val = NULL;
|
||||
HashEntry *chain;
|
||||
|
||||
// See if we even have this object.
|
||||
//
|
||||
@@ -151,7 +154,7 @@ HashTableImpl::remove(ObjectKey & key)
|
||||
// Try to find it in the chain.
|
||||
//
|
||||
HashEntry * last = NULL;
|
||||
for (HashEntry * chain = &_hash_table[slot]; chain; chain = chain->next) {
|
||||
for (chain = &_hash_table[slot]; chain; chain = chain->next) {
|
||||
if (key == *(chain->key)) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -819,7 +819,7 @@ GetPasswordEntry(passwd & result)
|
||||
memcpy(&passwordEntry, tresult, sizeof(struct passwd));
|
||||
passwordEntry.pw_name = strdup(passwordEntry.pw_name);
|
||||
passwordEntry.pw_passwd = strdup(passwordEntry.pw_passwd);
|
||||
#if !defined(_AIX) && !defined(linux)
|
||||
#if !defined(_AIX) && !defined(linux) && !defined(CSRG_BASED)
|
||||
#ifndef __osf__
|
||||
passwordEntry.pw_age = strdup(passwordEntry.pw_age);
|
||||
#endif
|
||||
|
||||
@@ -66,8 +66,8 @@ extern "C" void * RFCMetaFactory(const char * op);
|
||||
extern "C" void * V3MetaFactory(const char * op);
|
||||
|
||||
static const SymTable symbol_table[] = {
|
||||
{ "RFCMetaFactory", RFCMetaFactory },
|
||||
{ "V3MetaFactory", V3MetaFactory },
|
||||
{ "RFCMetaFactory", (void *)RFCMetaFactory },
|
||||
{ "V3MetaFactory", (void *)V3MetaFactory },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user