First stage port to 64 bit

This commit is contained in:
Michiel Broek
2005-10-11 20:49:41 +00:00
parent ac4e2dce0a
commit 1dfaf10c20
222 changed files with 1620 additions and 1563 deletions

View File

@@ -65,7 +65,7 @@ int PrepARC(char *Queue, fidoaddr Dest)
}
pktfile = calloc(PATH_MAX, sizeof(char));
snprintf(pktfile, PATH_MAX, "%s/%d.%d.%d.%d/%08lx.pkt", CFG.out_queue, Dest.zone, Dest.net, Dest.node, Dest.point, sequencer());
snprintf(pktfile, PATH_MAX, "%s/%d.%d.%d.%d/%08x.pkt", CFG.out_queue, Dest.zone, Dest.net, Dest.node, Dest.point, sequencer());
Syslog('p', "Rename .pkt to %s", pktfile);
if (rename(Queue, pktfile)) {

View File

@@ -44,7 +44,7 @@
extern int do_quiet; /* Suppress screen output */
struct _filerecord T_File; /* Internal announce record */
int TotalFiles; /* Total announced files */
unsigned long TotalSize; /* Total size in KBytes. */
unsigned int TotalSize; /* Total size in KBytes. */
int MsgCount; /* Message counter */
@@ -112,7 +112,7 @@ void Uploads()
T_File.Size = fdb.Size;
T_File.SizeKb = fdb.Size / 1024;
T_File.Fdate = fdb.FileDate;
snprintf(T_File.Crc, 9, "%08lx", fdb.Crc32);
snprintf(T_File.Crc, 9, "%08x", fdb.Crc32);
snprintf(T_File.Desc, 256, "%s %s %s %s", fdb.Desc[0], fdb.Desc[1], fdb.Desc[2], fdb.Desc[3]);
k = 0;
for (j = 0; j < 25; j++) {
@@ -159,8 +159,8 @@ void Uploads()
long StartMsg(void);
long StartMsg(void)
int StartMsg(void);
int StartMsg(void)
{
if (!Msg_Open(newfiles.Area))
return -1;
@@ -196,8 +196,8 @@ long StartMsg(void)
void FinishMsg(int, long);
void FinishMsg(int Final, long filepos)
void FinishMsg(int, int);
void FinishMsg(int Final, int filepos)
{
char *temp;
FILE *fp, *fi;
@@ -226,7 +226,7 @@ void FinishMsg(int Final, long filepos)
snprintf(temp, PATH_MAX, "%s/tmp/echomail.jam", getenv("MBSE_ROOT"));
if ((fp = fopen(temp, "a")) != NULL) {
fprintf(fp, "%s %lu\n", newfiles.Area, Msg.Id);
fprintf(fp, "%s %u\n", newfiles.Area, Msg.Id);
fclose(fp);
}
Msg_Close();
@@ -239,14 +239,14 @@ void FinishMsg(int Final, long filepos)
/*
* Report one group block of new files.
*/
long Report(gr_list *, long);
long Report(gr_list *ta, long filepos)
int Report(gr_list *, int);
int Report(gr_list *ta, int filepos)
{
FILE *fp, *fi;
char *temp, *line;
int i, Total = 0;
unsigned long Size = 0;
long filepos1 = 0, filepos2, filepos3 = 0, finalpos = 0;
unsigned int Size = 0;
int filepos1 = 0, filepos2, filepos3 = 0, finalpos = 0;
time_t ftime;
temp = calloc(PATH_MAX, sizeof(char));
@@ -370,7 +370,7 @@ int Announce()
char *temp;
FILE *fp;
int Count = 0, rc = FALSE;
long filepos, filepos1, filepos2;
int filepos, filepos1, filepos2;
char group[13];
int i, groups, any;

View File

@@ -63,7 +63,7 @@ int a_query = FALSE; /* Send AreaMgr query */
int a_stat = FALSE; /* Send AreaMgr status */
int a_unlnk = FALSE; /* Send AreaMgr unlinked */
int a_flow = FALSE; /* Send AreaMgr flow */
unsigned long a_msgs = 0; /* Messages to rescan */
unsigned int a_msgs = 0; /* Messages to rescan */
@@ -120,7 +120,7 @@ void A_List(faddr *t, char *replyid, int Notify)
char Stat[5];
faddr *f, *g, *Temp;
sysconnect System;
long msgptr;
int msgptr;
fpos_t fileptr,fileptr1,fileptr2;
subject = calloc(255, sizeof(char));
@@ -312,8 +312,8 @@ void A_Flow(faddr *t, char *replyid, int Notify)
time_t Now;
struct tm *tt;
int lmonth;
long rlw, rlm, rlt, plw, plm, plt;
long msgptr;
int rlw, rlm, rlt, plw, plm, plt;
int msgptr;
fpos_t fileptr, fileptr1, fileptr2;
Now = time(NULL);
@@ -781,7 +781,7 @@ void A_All(faddr *t, int Connect, FILE *tmp, char *Grp)
faddr *f, *Temp;
int i, Link, First = TRUE, Cons;
sysconnect Sys;
long Pos;
int Pos;
if (Grp == NULL) {
if (Connect)

View File

@@ -4,7 +4,7 @@
* Purpose ...............: MBSE BBS Mail Gate
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -33,11 +33,11 @@
#include "atoul.h"
unsigned long atoul(char *str)
unsigned int atoul(char *str)
{
unsigned long x;
unsigned int x;
if (sscanf(str,"%lu",&x) == 1)
if (sscanf(str,"%u",&x) == 1)
return x;
else
return 0xffffffff;

View File

@@ -1,8 +1,9 @@
#ifndef _ATOUL_H
#define _ATOUL_H
/* $Id$ */
unsigned long atoul(char*);
unsigned int atoul(char*);
#endif

View File

@@ -90,7 +90,7 @@ int Bounce(faddr *f, faddr *t, FILE *fp, char *reason)
/*
* Add MSGID, REPLY and PID
*/
fprintf(np, "\001MSGID: %s %08lx\r", ascfnode(from, 0x1f), sequencer());
fprintf(np, "\001MSGID: %s %08x\r", ascfnode(from, 0x1f), sequencer());
while ((fgets(Buf, MAX_LINE_LENGTH, fp)) != NULL) {
Striplf(Buf);
if (strncmp(Buf, "\001MSGID:", 7) == 0) {

View File

@@ -4,7 +4,7 @@
* Purpose ...............: MBSE BBS Mail Gate
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -51,9 +51,9 @@ int iwrite(int i, FILE *fp)
/*
* write long (32bit) integer in "standart" byte order
* write 32bit integer in "standart" byte order
*/
int lwrite(long i, FILE *fp)
int lwrite(int i, FILE *fp)
{
int c;

View File

@@ -1,11 +1,12 @@
#ifndef _BWRITE_H
#define _BWRITE_H
int iwrite(int,FILE *);
int lwrite(long,FILE *);
int awrite(char *,FILE *);
int cwrite(char *,FILE *, int);
int kwrite(char *,FILE *, int);
/* $Id$ */
int iwrite(int, FILE *);
int lwrite(int, FILE *);
int awrite(char *, FILE *);
int cwrite(char *, FILE *, int);
int kwrite(char *, FILE *, int);
#endif

View File

@@ -88,7 +88,7 @@ int CheckTicGroup(char *Area, int SendUplink, faddr *f)
{
char *temp, *buf, *tag = NULL, *desc = NULL, *p, *raid = NULL, *flow = NULL;
FILE *ap, *mp, *fp;
long offset, AreaNr;
int offset, AreaNr;
int i, rc = 0, Found = FALSE;
sysconnect System;
faddr *From, *To;

View File

@@ -91,7 +91,7 @@ int CheckEchoGroup(char *Area, int SendUplink, faddr *f)
{
char *temp, *buf, *tag, *desc, *p;
FILE *ap, *mp;
long offset;
int offset;
int i, rc = 0;
sysconnect System;
faddr *From, *To;

View File

@@ -142,7 +142,7 @@ int dirinbound(void)
{
FILE *fp;
char *temp, *from, *too;
long fileptr;
int fileptr;
struct dirent *de;
DIR *dp;
int Something = FALSE;

View File

@@ -118,7 +118,7 @@ void tidy_rflist(rf_list ** fdp)
/*
* Add a reply file to the array
*/
void fill_rflist(rf_list **fdp, char *fname, unsigned long larea)
void fill_rflist(rf_list **fdp, char *fname, unsigned int larea)
{
rf_list *tmp, *ta;

View File

@@ -1,6 +1,7 @@
#ifndef _FFLIST_H_
#define _FFLIST_H
/* $Id$ */
typedef struct _ff_list { /* Filefind array */
struct _ff_list *next;
@@ -11,7 +12,7 @@ typedef struct _ff_list { /* Filefind array */
unsigned short node; /* Original node */
unsigned short point; /* Original point */
char msgid[81]; /* Original msgid */
unsigned long msgnr; /* Original message number */
unsigned int msgnr; /* Original message number */
unsigned done : 1; /* True if processed with success */
} ff_list;
@@ -20,15 +21,14 @@ typedef struct _ff_list { /* Filefind array */
typedef struct _rf_list { /* Reply filenames array */
struct _rf_list *next;
char filename[15]; /* Filename found */
unsigned long area; /* BBS file area number */
unsigned int area; /* BBS file area number */
} rf_list;
void tidy_fflist(ff_list **);
void fill_fflist(ff_list **);
void tidy_rflist(rf_list **);
void fill_rflist(rf_list **, char *, unsigned long);
void fill_rflist(rf_list **, char *, unsigned int);
#endif

View File

@@ -91,7 +91,7 @@ void Clean(int count)
void ScanArea(ff_list **);
void ScanArea(ff_list **ffl)
{
unsigned long Number, Highest;
unsigned int Number, Highest;
if (!do_quiet) {
mbse_colour(CYAN, BLACK);
@@ -108,7 +108,7 @@ void ScanArea(ff_list **ffl)
do {
if (!do_quiet) {
printf("%6lu / %6lu", Number, Highest);
printf("%6u / %6u", Number, Highest);
Back(15);
}
@@ -117,7 +117,7 @@ void ScanArea(ff_list **ffl)
if (Msg_ReadHeader(Number) == TRUE) {
if (((!strcasecmp(Msg.To, "allfix")) || (!strcasecmp(Msg.To, "filefind"))) && (!Msg.Received)) {
Syslog('m', "Msg: %s (%lu) [%s]", Msg.From, Number, Msg.Subject);
Syslog('m', "Msg: %s (%u) [%s]", Msg.From, Number, Msg.Subject);
Msg.Received = TRUE;
Msg.Read = time(NULL);
if (Msg_Lock(30L)) {
@@ -145,11 +145,11 @@ void ScanArea(ff_list **ffl)
long StartReply(ff_list *);
long StartReply(ff_list *ffl)
int StartReply(ff_list *);
int StartReply(ff_list *ffl)
{
char *temp;
unsigned long crc = -1;
unsigned int crc = -1;
if (strlen(scanmgr.ReplBoard)) {
if (!Msg_Open(scanmgr.ReplBoard))
@@ -199,8 +199,8 @@ long StartReply(ff_list *ffl)
void FinishReply(int, int, long);
void FinishReply(int Reported, int Total, long filepos)
void FinishReply(int, int, int);
void FinishReply(int Reported, int Total, int filepos)
{
char *temp;
FILE *fp, *fi;
@@ -226,9 +226,9 @@ void FinishReply(int Reported, int Total, long filepos)
snprintf(temp, PATH_MAX, "%s/tmp/%smail.jam", getenv("MBSE_ROOT"), scanmgr.NetReply?"net":"echo");
if ((fp = fopen(temp, "a")) != NULL) {
if (strlen(scanmgr.ReplBoard))
fprintf(fp, "%s %lu\n", scanmgr.ReplBoard, Msg.Id);
fprintf(fp, "%s %u\n", scanmgr.ReplBoard, Msg.Id);
else
fprintf(fp, "%s %lu\n", scanmgr.ScanBoard, Msg.Id);
fprintf(fp, "%s %u\n", scanmgr.ScanBoard, Msg.Id);
fclose(fp);
}
@@ -246,11 +246,11 @@ void ScanFiles(ff_list *tmp)
{
char *temp, *kwd, *BigDesc, *line;
FILE *pAreas, *fi;
unsigned long areanr = 0, found = 0, SubSize = 0;
unsigned int areanr = 0, found = 0, SubSize = 0;
int i, j, k, keywrd, Found;
rf_list *rfl = NULL, *rft;
int Rep = 0, Sub = 0, Stop = FALSE;
long filepos, filepos1 = 0, filepos2 = 0, filepos3 = 0, filepos4 = 0;
int filepos, filepos1 = 0, filepos2 = 0, filepos3 = 0, filepos4 = 0;
struct _fdbarea *fdb_area = NULL;
/*
@@ -288,7 +288,7 @@ void ScanFiles(ff_list *tmp)
msleep(1);
if (!do_quiet) {
printf("%6lu / %6lu", areanr, found);
printf("%6u / %6u", areanr, found);
Back(15);
}
if (area.Available && area.FileFind) {

View File

@@ -109,7 +109,7 @@ void F_List(faddr *t, char *replyid, int Notify)
char Stat[4];
faddr *f, *g, *Temp;
sysconnect System;
long msgptr;
int msgptr;
fpos_t fileptr,fileptr1,fileptr2;
subject = calloc(255, sizeof(char));
@@ -589,7 +589,7 @@ void F_All(faddr *t, int Connect, FILE *tmp, char *Grp)
faddr *f, *Temp;
int i, Link, First = TRUE, Cons;
sysconnect Sys;
long Pos;
int Pos;
if (Grp == NULL) {
if (Connect)

View File

@@ -101,7 +101,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl)
ticfile = calloc(PATH_MAX, sizeof(char));
ticname = calloc(15, sizeof(char));
if (nodes.Tic) {
snprintf(ticname, 15, "%08lx.tic", sequencer());
snprintf(ticname, 15, "%08x.tic", sequencer());
subject = xstrcat(subject, (char *)" ");
subject = xstrcat(subject, ticname);
snprintf(ticfile, PATH_MAX, "%s/%s", CFG.ticout, ticname);
@@ -175,7 +175,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl)
if (strlen(TIC.NewFullName))
fprintf(fp, "Fullname %s\r\n", TIC.NewFullName);
}
fprintf(fp, "Size %ld\r\n", (long)(TIC.FileSize));
fprintf(fp, "Size %d\r\n", (int)(TIC.FileSize));
fprintf(fp, "Desc %s\r\n", TIC.TicIn.Desc);
fprintf(fp, "Crc %s\r\n", TIC.TicIn.Crc);
if (nodes.TIC_To) {
@@ -199,7 +199,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl)
subject = ctime(&now);
Striplf(subject);
ba = bestaka_s(dest);
fprintf(fp, "Path %s %lu %s %s\r\n", ascfnode(ba, 0x1f), (long)mktime(localtime(&now)), subject, tzname[0]);
fprintf(fp, "Path %s %u %s %s\r\n", ascfnode(ba, 0x1f), (int)mktime(localtime(&now)), subject, tzname[0]);
tidy_faddr(ba);
if (nodes.TIC_AdvSB) {

View File

@@ -102,7 +102,7 @@ char *rfcmsgid(char *, faddr *);
char *rfcmsgid(char *msgid, faddr *bestaka)
{
char *p, *q, *r;
unsigned long id = 0L;
unsigned int id = 0L;
faddr *ta = NULL;
size_t bufsize;
@@ -136,7 +136,7 @@ char *rfcmsgid(char *msgid, faddr *bestaka)
* here we have a parseable address
*/
*p = '\0';
sscanf(p+1, "%lx", &id);
sscanf(p+1, "%x", &id);
ta = parsefnode(msgid);
*p=' ';
}
@@ -149,7 +149,7 @@ char *rfcmsgid(char *msgid, faddr *bestaka)
* isn't the case. By cheking also (ta->net) we avoid that
*/
if ((ta) && (ta->net)) {
snprintf(rbuf, bufsize, "<%lu@%s.ftn>", id, ascinode(ta,0x1f));
snprintf(rbuf, bufsize, "<%u@%s.ftn>", id, ascinode(ta,0x1f));
} else {
p = xstrcpy(msgid);
if ((q = strchr(p,' ')))
@@ -180,12 +180,12 @@ char *rfcmsgid(char *msgid, faddr *bestaka)
*q = '%';
}
} else {
snprintf(rbuf, bufsize, "<%lu@%s>", id, p);
snprintf(rbuf, bufsize, "<%u@%s>", id, p);
}
free(p);
}
} else {
snprintf(rbuf, bufsize, "<%lu@%s.ftn>", (unsigned long)sequencer(), ascinode(bestaka,0x1f));
snprintf(rbuf, bufsize, "<%u@%s.ftn>", (unsigned int)sequencer(), ascinode(bestaka,0x1f));
}
tidy_faddr(ta);
if (r)
@@ -270,7 +270,7 @@ void Send(int, char *);
void Send(int newsmode, char *outstr)
{
char *p;
unsigned long crc;
unsigned int crc;
charwrite(outstr, nfp);
Syslog('m', "+ %s", printable(outstr, 0));
@@ -400,7 +400,7 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
if (!strcmp(l,"Via") && (via_off == 0L)) {
via_off = ftell(fp);
Syslog('m', "^AVia \"%s\" at offset %ld", printable(buf, 0), (long)via_off);
Syslog('m', "^AVia \"%s\" at offset %d", printable(buf, 0), (int)via_off);
}
} else {
/*
@@ -428,7 +428,7 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
(*tmsg)->key = xstrcpy((char *)"Origin");
(*tmsg)->val = xstrcpy(buf+11);
tmsg = &((*tmsg)->next);
Syslog('M', "origin \"%s\" at offset %ld", buf,(long)orig_off);
Syslog('M', "origin \"%s\" at offset %d", buf,(int)orig_off);
p = buf+10;
while (*p == ' ')
p++;
@@ -1492,7 +1492,7 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
}
if (ftell(fp) > endmsg_off) {
Syslog('m', "line \"%s\" past message end %ld %ld", buf,(long)endmsg_off, ftell(fp));
Syslog('m', "line \"%s\" past message end %d %d", buf,(int)endmsg_off, ftell(fp));
pass=0;
}
if (pass) {

View File

@@ -34,18 +34,18 @@
#include "lhash.h"
void hash_update_s(unsigned long *id, char *mod)
void hash_update_s(unsigned int *id, char *mod)
{
*id ^= lh_strhash(mod);
}
void hash_update_n(unsigned long *id, unsigned long mod)
void hash_update_n(unsigned int *id, unsigned int mod)
{
char buf[32];
snprintf(buf,32, "%030lu",mod);
snprintf(buf,32, "%030u",mod);
*id ^= lh_strhash(buf);
}

View File

@@ -1,8 +1,9 @@
#ifndef HASH_H
#define HASH_H
void hash_update_s(unsigned long *, char *);
void hash_update_n(unsigned long *, unsigned long);
/* $Id$ */
void hash_update_s(unsigned int *, char *);
void hash_update_n(unsigned int *, unsigned int);
#endif

View File

@@ -176,7 +176,7 @@ int CheckHatch(char *temp)
}
}
fprintf(Tf, "\r\n");
fprintf(Tf, "Crc %08lx\r\n", file_crc(de->d_name, CFG.slow_util && do_quiet));
fprintf(Tf, "Crc %08x\r\n", file_crc(de->d_name, CFG.slow_util && do_quiet));
fprintf(Tf, "Pw %s\r\n", CFG.hatchpasswd);
fclose(Tf);
Hatched++;

View File

@@ -4,7 +4,7 @@
* Purpose ...............: MBSE BBS Mail Gate
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -127,7 +127,7 @@ char *lh_version=(char *)"lhash part of SSLeay 0.6.4 30-Aug-1996";
#define P_CPP char *,char *
static void expand(LHASH *lh);
static void contract(LHASH *lh);
static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash);
static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned int *rhash);
#else
@@ -139,7 +139,7 @@ static LHASH_NODE **getrn();
#endif
LHASH *lh_new(unsigned long (*h)(char *), int (*c)(char *, char *))
LHASH *lh_new(unsigned int (*h)(char *), int (*c)(char *, char *))
{
LHASH *ret;
int i;
@@ -151,7 +151,7 @@ LHASH *lh_new(unsigned long (*h)(char *), int (*c)(char *, char *))
for (i=0; i<MIN_NODES; i++)
ret->b[i]=NULL;
ret->comp=((c == NULL)?(int (*)(char *, char *))strcmp:c);
ret->hash=((h == NULL)?(unsigned long (*)(char *))lh_strhash:h);
ret->hash=((h == NULL)?(unsigned int (*)(char *))lh_strhash:h);
ret->num_nodes=MIN_NODES/2;
ret->num_alloc_nodes=MIN_NODES;
ret->p=0;
@@ -206,7 +206,7 @@ void lh_free(LHASH *lh)
char *lh_insert(LHASH *lh, char *data)
{
unsigned long hash;
unsigned int hash;
LHASH_NODE *nn,**rn;
char *ret;
@@ -240,7 +240,7 @@ char *lh_insert(LHASH *lh, char *data)
char *lh_delete(LHASH *lh, char *data)
{
unsigned long hash;
unsigned int hash;
LHASH_NODE *nn,**rn;
char *ret;
@@ -272,7 +272,7 @@ char *lh_delete(LHASH *lh, char *data)
char *lh_retrieve(LHASH *lh, char *data)
{
unsigned long hash;
unsigned int hash;
LHASH_NODE **rn;
char *ret;
@@ -327,7 +327,7 @@ static void expand(LHASH *lh)
{
LHASH_NODE **n,**n1,**n2,*np;
unsigned int p,i,j;
unsigned long hash,nni;
unsigned int hash,nni;
lh->num_nodes++;
lh->num_expands++;
@@ -415,10 +415,10 @@ static void contract(LHASH *lh)
static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash)
static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned int *rhash)
{
LHASH_NODE **ret,*n1;
unsigned long hash,nn;
unsigned int hash,nn;
int (*cf)(char *, char *);
hash=(*(lh->hash))(data);
@@ -469,11 +469,11 @@ char *str;
* no collisions on /usr/dict/words and it distributes on %2^n quite
* well, not as good as MD5, but still good.
*/
unsigned long lh_strhash(char *c)
unsigned int lh_strhash(char *c)
{
unsigned long ret=0;
long n;
unsigned long v;
unsigned int ret=0;
int n;
unsigned int v;
int r;
if ((c == NULL) || (*c == '\0'))

View File

@@ -61,7 +61,7 @@ typedef struct lhash_node_st
char *data;
struct lhash_node_st *next;
#ifndef NO_HASH_COMP
unsigned long hash;
unsigned int hash;
#endif
} LHASH_NODE;
@@ -69,41 +69,41 @@ typedef struct lhash_st
{
LHASH_NODE **b;
int (*comp)(char *, char *);
unsigned long (*hash)(char *);
unsigned int (*hash)(char *);
unsigned int num_nodes;
unsigned int num_alloc_nodes;
unsigned int p;
unsigned int pmax;
unsigned long up_load; /* load times 256 */
unsigned long down_load; /* load times 256 */
unsigned long num_items;
unsigned int up_load; /* load times 256 */
unsigned int down_load; /* load times 256 */
unsigned int num_items;
unsigned long num_expands;
unsigned long num_expand_reallocs;
unsigned long num_contracts;
unsigned long num_contract_reallocs;
unsigned long num_hash_calls;
unsigned long num_comp_calls;
unsigned long num_insert;
unsigned long num_replace;
unsigned long num_delete;
unsigned long num_no_delete;
unsigned long num_retreve;
unsigned long num_retreve_miss;
unsigned long num_hash_comps;
unsigned int num_expands;
unsigned int num_expand_reallocs;
unsigned int num_contracts;
unsigned int num_contract_reallocs;
unsigned int num_hash_calls;
unsigned int num_comp_calls;
unsigned int num_insert;
unsigned int num_replace;
unsigned int num_delete;
unsigned int num_no_delete;
unsigned int num_retreve;
unsigned int num_retreve_miss;
unsigned int num_hash_comps;
} LHASH;
#define LH_LOAD_MULT 256
#ifndef NOPROTO
LHASH *lh_new(unsigned long (*h)(char *), int (*c)(char *, char *));
LHASH *lh_new(unsigned int (*h)(char *), int (*c)(char *, char *));
void lh_free(LHASH *lh);
char *lh_insert(LHASH *lh, char *data);
char *lh_delete(LHASH *lh, char *data);
char *lh_retrieve(LHASH *lh, char *data);
void lh_doall(LHASH *lh, void (*func)(char *, char *));
void lh_doall_arg(LHASH *lh, void (*func)(char *, char *),char *arg);
unsigned long lh_strhash(char *c);
unsigned int lh_strhash(char *c);
#ifndef WIN16
void lh_stats(LHASH *lh, FILE *out);
@@ -128,7 +128,7 @@ char *lh_delete();
char *lh_retrieve();
void lh_doall();
void lh_doall_arg();
unsigned long lh_strhash();
unsigned int lh_strhash();
#ifndef WIN16
void lh_stats();

View File

@@ -37,7 +37,7 @@
#include "magic.h"
long MagicNr; /* Current magic record number */
int MagicNr; /* Current magic record number */
int Magics = 0; /* Processed magics */

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Make Web statistics
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -113,7 +113,7 @@ void MakeStat(void)
char *name, *p, *q;
int i, Total, Lm, Area;
struct _history hist;
long fileptr = 0;
int fileptr = 0;
if (!strlen(CFG.www_root)) {
Syslog('!', "Warning, WWW root not defined, skip statistical html creation");

View File

@@ -45,7 +45,7 @@ int iErrors = 0;
int iTotal = 0;
int iAreasNew = 0;
void CheckArea(long); /* Check a single area */
void CheckArea(int); /* Check a single area */
/*
@@ -63,11 +63,11 @@ void CheckArea(long); /* Check a single area */
* Remarks: Maybe if the crc check fails, and the date and time are
* ok, the file is damaged and must be made unavailable.
*/
void Check(long AreaNr)
void Check(int AreaNr)
{
FILE *pAreas, *pFile;
char *sAreas, *fAreas, *newdir, *temp, *mname;
long i, iAreas;
int i, iAreas;
DIR *dp;
struct dirent *de;
int Found;
@@ -120,7 +120,7 @@ void Check(long AreaNr)
} else {
if (strlen(area.Name) == 0) {
snprintf(fAreas, PATH_MAX, "%s/fdb/file%ld.data", getenv("MBSE_ROOT"), i);
snprintf(fAreas, PATH_MAX, "%s/fdb/file%d.data", getenv("MBSE_ROOT"), i);
if (unlink(fAreas) == 0) {
Syslog('+', "Removed obsolete %s", fAreas);
}
@@ -198,7 +198,7 @@ void Check(long AreaNr)
void CheckArea(long Area)
void CheckArea(int Area)
{
int j, Fix, inArea, rc;
char *newdir, *temp, *mname, *tname;
@@ -218,7 +218,7 @@ void CheckArea(long Area)
IsDoing("Check area %ld", Area);
if (!do_quiet) {
printf("\r%4ld => %-44s \b\b\b\b", Area, area.Name);
printf("\r%4d => %-44s \b\b\b\b", Area, area.Name);
fflush(stdout);
}

View File

@@ -1,8 +1,8 @@
/* $Id$ */
#ifndef _MBFCHECK_H_
#ifndef _MBFCHECK_H
#define _MBFCHECK_H
void Check(long); /* Check file database */
/* $Id$ */
void Check(int); /* Check file database */
#endif

View File

@@ -40,7 +40,7 @@
extern int do_quiet; /* Suppress screen output */
int lastfile; /* Last file number */
long gfilepos = 0; /* Global file position */
int gfilepos = 0; /* Global file position */
int TotalHtml = 0; /* Total html files */
int AreasHtml = 0; /* Total html areas */
int aUpdate = 0; /* Updated areas */
@@ -321,7 +321,7 @@ void ReqIndex(void);
void ReqIndex(void)
{
FILE *pAreas, *pIndex, *fp;
unsigned long i, iAreas, iAreasNew = 0, record;
unsigned int i, iAreas, iAreasNew = 0, record;
int iTotal = 0, j, z, x = 0;
int fbAreas = 0, fbFiles = 0, fbUpdate = 0;
char *sAreas, *newdir = NULL, *sIndex, *temp;
@@ -367,7 +367,7 @@ void ReqIndex(void)
die(MBERR_DISK_FULL);
if (!do_quiet) {
printf("\r%4ld => %-44s \b\b\b\b", i, area.Name);
printf("\r%4d => %-44s \b\b\b\b", i, area.Name);
fflush(stdout);
}
@@ -386,7 +386,7 @@ void ReqIndex(void)
if ((fdb_area = mbsedb_OpenFDB(i, 30)) == NULL)
die(MBERR_GENERAL);
snprintf(temp, PATH_MAX, "%s/var/fdb/file%ld.data", getenv("MBSE_ROOT"), i);
snprintf(temp, PATH_MAX, "%s/var/fdb/file%d.data", getenv("MBSE_ROOT"), i);
db_time = (int) file_time(temp);
/*
@@ -431,7 +431,7 @@ void ReqIndex(void)
while (fread(&fdb, fdbhdr.recsize, 1, fdb_area->fp) == 1) {
if (!fdb.Deleted) {
fbFiles++;
fprintf(fp, "%-12s [%ld] %s\r\n", fdb.Name, fdb.TimesDL, fdb.Desc[0]);
fprintf(fp, "%-12s [%d] %s\r\n", fdb.Name, fdb.TimesDL, fdb.Desc[0]);
for (j = 1; j < 25; j++)
if (strlen(fdb.Desc[j]))
fprintf(fp, " +%s\r\n", fdb.Desc[j]);
@@ -481,7 +481,7 @@ void ReqIndex(void)
for (z = 0; z <= 25; z++) {
if (strlen(fdb.Desc[z])) {
if (z == 0)
fprintf(fp, "%-12s %7luK %s ", fdb.Name, (long)(fdb.Size / 1024),
fprintf(fp, "%-12s %7uK %s ", fdb.Name, (int)(fdb.Size / 1024),
StrDateDMY(fdb.UploadDate));
else
fprintf(fp, " ");
@@ -528,13 +528,13 @@ void HtmlIndex(char *);
void HtmlIndex(char *Lang)
{
FILE *pAreas, *fa, *fb = NULL, *fm, *fi = NULL;
unsigned long i, iAreas, KSize = 0L, aSize = 0;
unsigned int i, iAreas, KSize = 0L, aSize = 0;
int AreaNr = 0, j, k, x = 0, isthumb;
int aTotal = 0, inArea = 0, filenr;
char *sAreas, *fn, *temp;
char linebuf[1024], outbuf[1024], desc[6400], namebuf[1024];
time_t last = 0L, later, db_time, obj_time;
long fileptr = 0, fileptr1 = 0;
int fileptr = 0, fileptr1 = 0;
struct _fdbarea *fdb_area = NULL;
sAreas = calloc(PATH_MAX, sizeof(char));
@@ -616,13 +616,13 @@ void HtmlIndex(char *Lang)
die(MBERR_DISK_FULL);
if (!do_quiet) {
printf("\r%4ld => %-44s \b\b\b\b", i, area.Name);
printf("\r%4d => %-44s \b\b\b\b", i, area.Name);
fflush(stdout);
}
if ((fdb_area = mbsedb_OpenFDB(i, 30)) == NULL)
die(MBERR_GENERAL);
snprintf(temp, PATH_MAX, "%s/var/fdb/file%ld.data", getenv("MBSE_ROOT"), i);
snprintf(temp, PATH_MAX, "%s/var/fdb/file%d.data", getenv("MBSE_ROOT"), i);
db_time = (int) file_time(temp);
snprintf(temp, PATH_MAX, "%s/index.html", area.Path);
obj_time = (int) file_time(temp);
@@ -708,7 +708,7 @@ void HtmlIndex(char *Lang)
MacroVars("fghi", "dsss", 0, outbuf, fdb.LName, "");
}
snprintf(outbuf, 1024, "%lu Kb.", (long)(fdb.Size / 1024));
snprintf(outbuf, 1024, "%u Kb.", (int)(fdb.Size / 1024));
MacroVars("jkl", "ssd", StrDateDMY(fdb.FileDate), outbuf, fdb.TimesDL);
memset(&desc, 0, sizeof(desc));
k = 0;
@@ -781,9 +781,9 @@ void HtmlIndex(char *Lang)
html_massage(linebuf, namebuf, 1024);
snprintf(linebuf, 1024, "%s/%s%s/index.html", CFG.www_url, CFG.www_link2ftp, area.Path+strlen(CFG.ftp_base));
if (aSize > 1048576)
snprintf(outbuf, 1024, "%ld Mb.", aSize / 1048576);
snprintf(outbuf, 1024, "%d Mb.", aSize / 1048576);
else
snprintf(outbuf, 1024, "%ld Kb.", aSize / 1024);
snprintf(outbuf, 1024, "%d Kb.", aSize / 1024);
MacroVars("efghi", "dssds", AreaNr, linebuf, namebuf, aTotal, outbuf);
if (last == 0L)
MacroVars("j", "s", "&nbsp;");
@@ -797,7 +797,7 @@ void HtmlIndex(char *Lang)
}
if (fm) {
snprintf(linebuf, 1024, "%ld Mb.", KSize / 1024);
snprintf(linebuf, 1024, "%d Mb.", KSize / 1024);
MacroVars("cd", "ds", TotalHtml, linebuf);
MacroRead(fi, fm);
fclose(fi);

View File

@@ -44,7 +44,7 @@ void ListFileAreas(int Area)
{
FILE *pAreas, *pTic;
int i, iAreas, fcount, tcount = 0, iTotal = 0, columns = 80;
long fsize, tsize = 0;
int fsize, tsize = 0;
char *sAreas, *fAreas, *sTic, flags[6], *ticarea;
struct _fdbarea *fdb_area = NULL;
@@ -130,8 +130,8 @@ void ListFileAreas(int Area)
flags[2] = 'A';
fdb.LName[columns - 60] = '\0';
printf("%-12s %5ld %s %4ld %s %-20s %s\n", fdb.Name, (long)(fdb.Size / 1024), StrDateDMY(fdb.FileDate),
(long)(fdb.TimesDL), flags, fdb.TicArea, fdb.LName);
printf("%-12s %5d %s %4d %s %-20s %s\n", fdb.Name, (int)(fdb.Size / 1024), StrDateDMY(fdb.FileDate),
(int)(fdb.TimesDL), flags, fdb.TicArea, fdb.LName);
fcount++;
fsize = fsize + fdb.Size;
}
@@ -142,7 +142,7 @@ void ListFileAreas(int Area)
for (i = 60; i < columns; i++)
printf("-");
printf("\n");
printf("%d file%s, %ld Kbytes\n", fcount, (fcount == 1) ? "":"s", fsize);
printf("%d file%s, %d Kbytes\n", fcount, (fcount == 1) ? "":"s", fsize);
mbsedb_CloseFDB(fdb_area);
} else {
@@ -183,7 +183,7 @@ void ListFileAreas(int Area)
tcount += fcount;
tsize += fsize;
printf("%5d %5d %5ld %-12s %s\n", i, fcount, fsize, area.BbsGroup, area.Name);
printf("%5d %5d %5d %-12s %s\n", i, fcount, fsize, area.BbsGroup, area.Name);
iTotal++;
mbsedb_CloseFDB(fdb_area);
}
@@ -191,7 +191,7 @@ void ListFileAreas(int Area)
mbse_colour(CYAN, BLACK);
printf("----- ----- ----- ---------------------------------------------------------\n");
printf("%5d %5d %5ld \n", iTotal, tcount, tsize);
printf("%5d %5d %5d \n", iTotal, tcount, tsize);
fclose(pAreas);
free(ticarea);
free(sAreas);

View File

@@ -51,6 +51,7 @@ void ReArc(int Area, char *File)
int i, rc = -1, count = 0, errors = 0;
struct utimbuf ut;
struct _fdbarea *fdb_area = NULL;
time_t tt;
IsDoing("ReArc file(s)");
mbse_colour(LIGHTRED, BLACK);
@@ -158,8 +159,9 @@ void ReArc(int Area, char *File)
Syslog('f', "%s %s", fdb.Name, fdb.LName);
fdb.Size = file_size(temp);
fdb.Crc32 = file_crc(temp, FALSE);
ut.actime = mktime(localtime(&fdb.FileDate));
ut.modtime = mktime(localtime(&fdb.FileDate));
tt = fdb.FileDate;
ut.actime = mktime(localtime(&tt));
ut.modtime = mktime(localtime(&tt));
utime(temp, &ut);
/*

View File

@@ -68,9 +68,9 @@ void ToBeRep(void)
mbse_colour(LIGHTGRAY, BLACK);
while (fread(&rep, sizeof(rep), 1, fp) == 1) {
printf("%-20s %-12s %-12s %5ld %s %s\n",
printf("%-20s %-12s %-12s %5d %s %s\n",
rep.Echo, rep.Group, rep.Name, rep.SizeKb, StrDateDMY(rep.Fdate), rep.Announce ? "Yes":"No ");
Syslog('f', "%-20s %-12s %-12s %5ld %s %s",
Syslog('f', "%-20s %-12s %-12s %5d %s %s",
rep.Echo, rep.Group, rep.Name, rep.SizeKb, StrDateDMY(rep.Fdate), rep.Announce ? "Yes":"No ");
}

View File

@@ -50,7 +50,7 @@ typedef struct _nl_user {
FILE *ifp, *ufp, *ffp;
long total = 0, entries = 0, users = 0;
int total = 0, entries = 0, users = 0;
int filenr = 0;
unsigned short regio;
nl_list *nll = NULL;
@@ -652,7 +652,7 @@ int compile(char *nlname, unsigned short zo, unsigned short ne, unsigned short n
Syslog('+', "%d entries", entries);
if (!do_quiet) {
printf(" %ld entries\n", entries);
printf(" %d entries\n", entries);
fflush(stdout);
}

View File

@@ -44,7 +44,7 @@ int do_link = FALSE; /* Link messages */
int do_post = FALSE; /* Post a Message */
extern int do_quiet; /* Quiet flag */
extern int show_log; /* Show loglines */
long do_area = 0; /* Do only one area */
int do_area = 0; /* Do only one area */
time_t t_start; /* Start time */
time_t t_end; /* End time */
int are_tot = 0; /* Total areas */
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
int i;
char *cmd, *too = NULL, *subj = NULL, *mfile = NULL, *flavor = NULL;
struct passwd *pw;
long tarea = 0;
int tarea = 0;
InitConfig();
@@ -246,7 +246,7 @@ void DoMsgBase()
{
FILE *pAreas;
char *sAreas, *Name;
long arearec;
int arearec;
int Del = 0;
sAreas = calloc(PATH_MAX, sizeof(char));
@@ -281,7 +281,7 @@ void DoMsgBase()
if (!do_quiet) {
mbse_colour(CYAN, BLACK);
printf("\r%5ld .. %-40s", do_area, msgs.Name);
printf("\r%5d .. %-40s", do_area, msgs.Name);
fflush(stdout);
}
are_tot++;
@@ -309,7 +309,7 @@ void DoMsgBase()
Nopper();
if (!do_quiet) {
mbse_colour(CYAN, BLACK);
printf("\r%5ld .. %-40s", arearec, msgs.Name);
printf("\r%5d .. %-40s", arearec, msgs.Name);
fflush(stdout);
}
are_tot++;
@@ -403,7 +403,7 @@ void DoMsgBase()
void LinkArea(char *Path, long Areanr)
void LinkArea(char *Path, int Areanr)
{
int rc;
@@ -421,9 +421,9 @@ void LinkArea(char *Path, long Areanr)
/*
* Kill messages according to age and max messages.
*/
void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, long Areanr)
void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, int Areanr)
{
unsigned long Number, TotalMsgs = 0, Highest, *Active, Counter = 0;
unsigned int Number, TotalMsgs = 0, Highest, *Active, Counter = 0;
int i, DelCount = 0, DelAge = 0, Done;
time_t Today, MsgDate;
@@ -444,7 +444,7 @@ void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, long Areanr)
TotalMsgs = Msg_Number();
if (TotalMsgs) {
if ((Active = (unsigned long *)malloc((size_t)((TotalMsgs + 100L) * sizeof(unsigned long)))) != NULL) {
if ((Active = (unsigned int *)malloc((size_t)((TotalMsgs + 100L) * sizeof(unsigned int)))) != NULL) {
i = 0;
Number = Msg_Lowest();
do {
@@ -462,7 +462,7 @@ void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, long Areanr)
msleep(1);
if ((!do_quiet) && ((Counter % 10L) == 0)) {
printf("%6lu / %6lu\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", Counter, TotalMsgs);
printf("%6u / %6u\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", Counter, TotalMsgs);
fflush(stdout);
}
if ((Counter % 10L) == 0)
@@ -539,7 +539,7 @@ void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, long Areanr)
/*
* Pack message area if there are deleted messages.
*/
void PackArea(char *Path, long Areanr)
void PackArea(char *Path, int Areanr)
{
IsDoing("Packing %ld", Areanr);
if (Msg_Open(Path)) {

View File

@@ -7,9 +7,9 @@ void ProgName(void);
void Help(void);
void die(int);
void DoMsgBase(void);
void PackArea(char *, long);
void LinkArea(char *, long);
void KillArea(char *, char *, int, int, long);
void PackArea(char *, int);
void LinkArea(char *, int);
void KillArea(char *, char *, int, int, int);
#endif

View File

@@ -4,7 +4,7 @@
* Purpose ...............: give a hexadecimal sequence to stdout
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -39,7 +39,7 @@
int main(int argc, char **argv)
{
struct passwd *pw;
unsigned long seq;
unsigned int seq;
InitConfig();
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
seq = sequencer();
Syslog('+', "Sequence string %08lx", seq);
printf("%08lx", seq);
printf("%08x", seq);
fflush(stdout);
Syslog(' ', "MBSEQ finished");

View File

@@ -391,7 +391,7 @@ int UplinkRequest(faddr *t, faddr *From, int FileMgr, char *cmd)
/*
* Add MSGID, REPLY and PID
*/
fprintf(qp, "\001MSGID: %s %08lx\r", aka2str(Orig), sequencer());
fprintf(qp, "\001MSGID: %s %08x\r", aka2str(Orig), sequencer());
fprintf(qp, "\001PID: MBSE-FIDO %s (%s-%s)\r", VERSION, OsName(), OsCPU());
fprintf(qp, "\001TZUTC: %s\r", gmtoffset(Now));

View File

@@ -4,7 +4,7 @@
* Purpose ...............: MBSE BBS Mail Gate
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -64,10 +64,10 @@ faddr *bestaka;
int ftnmsgid(char *msgid, char **s, unsigned long *n, char *areaname)
int ftnmsgid(char *msgid, char **s, unsigned int *n, char *areaname)
{
char *buf, *l, *r, *p;
unsigned long nid = 0L;
unsigned int nid = 0L;
faddr *tmp;
static int ftnorigin = 0;
@@ -120,7 +120,7 @@ int ftnmsgid(char *msgid, char **s, unsigned long *n, char *areaname)
*r++ = '\0';
*s = xstrcpy(l+6);
if (r)
sscanf(r,"%lx",&nid);
sscanf(r,"%x",&nid);
ftnorigin = 1;
/* <NOMSGID_mimeanything_abcd1234@ftn.domain> */
} else if (strncmp(l,"NOMSGID_",8) == 0) {
@@ -144,7 +144,7 @@ int ftnmsgid(char *msgid, char **s, unsigned long *n, char *areaname)
r=strchr(l+4,'_');
*r++='\0';
*s=xstrcpy(l+4);
sscanf(r,"%lx",&nid);
sscanf(r,"%x",&nid);
ftnorigin=1;
/* <wgcid$3$g712$h610$i22$kfidonet$j6596dbf5@brazerko.com> */
} else if (strncmp(l,"wgcid$",6) == 0) {
@@ -176,7 +176,7 @@ int ftnmsgid(char *msgid, char **s, unsigned long *n, char *areaname)
if ((r=strstr(l,"$j"))) {
*r='\0';
*s=xstrcat(*s,l);
sscanf(r+2,"%lx",&nid);
sscanf(r+2,"%x",&nid);
}
} else {
*r='\0';

View File

@@ -2,7 +2,7 @@
#define _MKFTNHDR_H
int ftnmsgid(char *,char **,unsigned long *,char *);
int ftnmsgid(char *,char **,unsigned int *,char *);
ftnmsg *mkftnhdr(rfcmsg *, int, faddr *);

View File

@@ -369,7 +369,7 @@ int toss_onemsg(char *msgname)
do_scan = TRUE;
snprintf(temp, PATH_MAX, "%s/tmp/netmail.jam", getenv("MBSE_ROOT"));
if ((np = fopen(temp, "a")) != NULL) {
fprintf(np, "%s %lu\n", msgs.Base, Msg.Id);
fprintf(np, "%s %u\n", msgs.Base, Msg.Id);
fclose(np);
}
}

View File

@@ -69,10 +69,10 @@ char lotab[] = {
void Msg_Id(fidoaddr aka)
{
char *temp;
unsigned long crc = -1;
unsigned int crc = -1;
temp = calloc(81, sizeof(char));
snprintf(temp, 81, "\001MSGID: %s %08lx", aka2str(aka), sequencer());
snprintf(temp, 81, "\001MSGID: %s %08x", aka2str(aka), sequencer());
MsgText_Add2(temp);
Msg.MsgIdCRC = upd_crc32(temp, crc, strlen(temp));
Msg.ReplyCRC = 0xffffffff;
@@ -143,11 +143,11 @@ void Msg_Macro(FILE *fi)
long Msg_Top(char *template, int language, fidoaddr aka)
int Msg_Top(char *template, int language, fidoaddr aka)
{
char *temp, *line;
FILE *fp, *fi;
long fileptr, fileptr1 = -1L;
int fileptr, fileptr1 = -1L;
int hasmodems = FALSE;
temp = calloc(PATH_MAX, sizeof(char));

View File

@@ -7,7 +7,7 @@
void Msg_Id(fidoaddr);
void Msg_Pid(void);
void Msg_Macro(FILE *);
long Msg_Top(char *, int, fidoaddr);
int Msg_Top(char *, int, fidoaddr);
void Msg_Bot(fidoaddr, char *, char *);
void CountPosted(char *);
char *To_Low(char *, int);

View File

@@ -45,7 +45,7 @@ int newspost(void)
{
int start = TRUE, fatal = FALSE;
char *buf, *p;
long curpos, count, seqnr;
int curpos, count, seqnr;
FILE *ofp = NULL, *nb;
struct utsname utsbuf;
@@ -138,7 +138,7 @@ int newspost(void)
if (!count)
break;
fseek(nfp, curpos, SEEK_SET);
fprintf(ofp, "#! rnews %ld\n", count);
fprintf(ofp, "#! rnews %d\n", count);
while (fgets(buf, 10240, nfp)) {
if (strcmp(buf, ".\n")) {
fprintf(ofp, buf);
@@ -194,17 +194,17 @@ int newspost(void)
return TRUE;
}
snprintf(buf, 10240, "%s/C.%s%lx", CFG.rnewspath, CFG.nntpnode, seqnr);
snprintf(buf, 10240, "%s/C.%s%x", CFG.rnewspath, CFG.nntpnode, seqnr);
if ((nb = fopen(buf, "a")) == NULL) {
WriteError("Can't create %s", buf);
newsopen = FALSE;
return TRUE;
}
seqnr = sequencer();
fprintf(nb, "E D.%s%lx D.%s%lx news -C D.%s%lx 0666 \"\" 0 rnews\n",
fprintf(nb, "E D.%s%x D.%s%x news -C D.%s%x 0666 \"\" 0 rnews\n",
utsbuf.nodename, seqnr, utsbuf.nodename, seqnr, utsbuf.nodename, seqnr);
fclose(nb);
snprintf(buf, 10240, "%s/D.%s%lx", CFG.rnewspath, utsbuf.nodename, seqnr);
snprintf(buf, 10240, "%s/D.%s%x", CFG.rnewspath, utsbuf.nodename, seqnr);
if ((nb = fopen(buf, "a")) == NULL) {
WriteError("Can't create %s", buf);
newsopen = FALSE;

View File

@@ -94,7 +94,7 @@ int Ping(faddr *f, faddr *t, FILE *fp, int intransit)
/*
* Add MSGID, REPLY and PID
*/
fprintf(np, "\001MSGID: %s %08lx\r", ascfnode(from, 0x1f), sequencer());
fprintf(np, "\001MSGID: %s %08x\r", ascfnode(from, 0x1f), sequencer());
while ((fgets(Buf, MAX_LINE_LENGTH, fp)) != NULL) {
Striplf(Buf);
if (strncmp(Buf, "\001MSGID:", 7) == 0) {

View File

@@ -41,12 +41,12 @@ extern int do_quiet; /* Suppress screen output */
int Post(char *To, long Area, char *Subj, char *File, char *Flavor)
int Post(char *To, int Area, char *Subj, char *File, char *Flavor)
{
int i, rc = FALSE, has_tear = FALSE, has_origin = FALSE;
char *aka, *temp, *sAreas;
FILE *fp, *tp;
unsigned long crc = -1;
unsigned int crc = -1;
time_t tt;
struct tm *t;
@@ -54,11 +54,11 @@ int Post(char *To, long Area, char *Subj, char *File, char *Flavor)
if (!do_quiet) {
mbse_colour(CYAN, BLACK);
printf("Post \"%s\" to \"%s\" in area %ld\n", File, To, Area);
printf("Post \"%s\" to \"%s\" in area %d\n", File, To, Area);
}
IsDoing("Posting");
Syslog('+', "Post \"%s\" area %ld to \"%s\" flavor %s", File, Area, To, Flavor);
Syslog('+', "Post \"%s\" area %d to \"%s\" flavor %s", File, Area, To, Flavor);
Syslog('+', "Subject: \"%s\"", Subj);
if ((tp = fopen(File, "r")) == NULL) {
@@ -213,7 +213,7 @@ int Post(char *To, long Area, char *Subj, char *File, char *Flavor)
}
temp = calloc(PATH_MAX, sizeof(char));
snprintf(temp, PATH_MAX, "\001MSGID: %s %08lx", aka2str(msgs.Aka), sequencer());
snprintf(temp, PATH_MAX, "\001MSGID: %s %08x", aka2str(msgs.Aka), sequencer());
MsgText_Add2(temp);
Msg.MsgIdCRC = upd_crc32(temp, crc, strlen(temp));
Msg.ReplyCRC = 0xffffffff;
@@ -275,7 +275,7 @@ int Post(char *To, long Area, char *Subj, char *File, char *Flavor)
if (msgs.Type != LOCALMAIL) {
snprintf(temp, PATH_MAX, "%s/tmp/%smail.jam", getenv("MBSE_ROOT"), (msgs.Type == ECHOMAIL) ? "echo" : "net");
if ((fp = fopen(temp, "a")) != NULL) {
fprintf(fp, "%s %lu\n", msgs.Base, Msg.Id);
fprintf(fp, "%s %u\n", msgs.Base, Msg.Id);
fclose(fp);
}
CreateSema((char *)"mailout");

View File

@@ -3,7 +3,7 @@
/* $Id$ */
int Post(char *, long, char *, char *, char *); /* Post a Message */
int Post(char *, int, char *, char *, char *); /* Post a Message */
#endif

View File

@@ -136,7 +136,7 @@ int postecho(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj, time_t m
char *buf, *msgid = NULL, *reply = NULL, *p, *q, sbe[16];
int First = TRUE, rc = 0, i, kludges = TRUE, dupe = FALSE, bad = TRUE, seenlen, oldnet;
faddr *Faddr;
unsigned long crc;
unsigned int crc;
sysconnect Link;
fa_list *sbl = NULL, *ptl = NULL, *tmpl;
qualify *qal = NULL, *tmpq;

View File

@@ -72,7 +72,7 @@ int ProcessTic(fa_list **sbl)
int UnPacked = FALSE, IsArchive = FALSE, rc, i, j, k, File_Id = FALSE;
char *Temp, *unarc = NULL, *cmd = NULL;
char temp1[PATH_MAX], temp2[PATH_MAX], sbe[24], TDesc[256];
unsigned long crc, crc2, Kb;
unsigned int crc, crc2, Kb;
sysconnect Link;
FILE *fp;
struct utimbuf ut;

View File

@@ -71,7 +71,7 @@ void flush_dir(char *ndir)
faddr noden, *bestaka;
fidoaddr nodenr;
int flavor, mode, Attach, fage, first, bread, rc;
long fsize;
int fsize;
char *p, *temp, *fname, *arcfile, *pktfile, *ext, maxnr, nr, oldnr, *buf;
time_t Now;
struct tm *ptm;
@@ -185,7 +185,7 @@ void flush_dir(char *ndir)
/*
* Generate ARCfile name from the CRC of the ASCII string of the node address.
*/
snprintf(arcfile, PATH_MAX, "%s/%08lx.%s0", nodes.Dir_out_path, StringCRC32(ascfnode(&noden, 0x1f)), ext);
snprintf(arcfile, PATH_MAX, "%s/%08x.%s0", nodes.Dir_out_path, StringCRC32(ascfnode(&noden, 0x1f)), ext);
} else {
bestaka = bestaka_s(&noden);
@@ -216,7 +216,7 @@ void flush_dir(char *ndir)
fname = calloc(PATH_MAX, sizeof(char));
snprintf(fname, PATH_MAX, "%s/mailpkt.qqq", temp);
if (access(fname, W_OK) == 0) {
snprintf(pktfile, PATH_MAX, "%s/%08lx.pkt", temp, sequencer());
snprintf(pktfile, PATH_MAX, "%s/%08x.pkt", temp, sequencer());
if (rename(fname, pktfile)) {
WriteError("$Can't rename %s to %s", fname, pktfile);
} else {
@@ -464,7 +464,7 @@ void flush_dir(char *ndir)
flavor = 'o';
if (nodes.Session_out == S_DIR) {
snprintf(arcfile, PATH_MAX, "%s/%08lx.pkt", nodes.Dir_out_path, sequencer());
snprintf(arcfile, PATH_MAX, "%s/%08x.pkt", nodes.Dir_out_path, sequencer());
} else {
snprintf(arcfile, PATH_MAX, "%s", pktname(&noden, flavor));
}

View File

@@ -138,7 +138,7 @@ int rfc2ftn(FILE *fp, faddr *recipient)
FILE *ofp;
fa_list *sbl = NULL, *ptl = NULL, *tmpl;
faddr *ta, *fta;
unsigned long svmsgid, svreply, acup_n = 0;
unsigned int svmsgid, svreply, acup_n = 0;
int sot_kludge = FALSE, eot_kludge = FALSE, tinyorigin = FALSE;
int needsplit, hdrsize, datasize, splitpart, forbidsplit, rfcheaders;
time_t Now;
@@ -385,11 +385,11 @@ int rfc2ftn(FILE *fp, faddr *recipient)
Syslog('!', "Rfc2ftn: warning, no MSGID %s %08lx", MBSE_SS(fmsg->msgid_a), fmsg->msgid_n);
}
fprintf(ofp, "\001MSGID: %s %08lx\n", MBSE_SS(fmsg->msgid_a),fmsg->msgid_n);
fprintf(ofp, "\001MSGID: %s %08x\n", MBSE_SS(fmsg->msgid_a),fmsg->msgid_n);
if (fmsg->reply_s)
fprintf(ofp, "\1REPLY: %s\n", fmsg->reply_s);
else if (fmsg->reply_a)
fprintf(ofp, "\1REPLY: %s %08lx\n", fmsg->reply_a, fmsg->reply_n);
fprintf(ofp, "\1REPLY: %s %08x\n", fmsg->reply_a, fmsg->reply_n);
Now = time(NULL) - (gmt_offset((time_t)0) * 60);
fprintf(ofp, "\001TZUTC: %s\n", gmtoffset(Now));
fprintf(ofp, "\001CHRS: %s\n", getftnchrs(msgs.Charset));
@@ -453,7 +453,7 @@ int rfc2ftn(FILE *fp, faddr *recipient)
if (acup_a) {
hash_update_s(&acup_n,fmsg->area);
hdrsize += 26 + strlen(acup_a);
fprintf(ofp,"\1ACUPDATE: DELETE %s %08lx\n", acup_a,acup_n);
fprintf(ofp,"\1ACUPDATE: DELETE %s %08x\n", acup_a,acup_n);
}
}
}
@@ -462,7 +462,7 @@ int rfc2ftn(FILE *fp, faddr *recipient)
if (acup_a) {
hash_update_s(&acup_n,fmsg->area);
hdrsize += 26 + strlen(acup_a);
fprintf(ofp,"\1ACUPDATE: MODIFY %s %08lx\n", acup_a,acup_n);
fprintf(ofp,"\1ACUPDATE: MODIFY %s %08x\n", acup_a,acup_n);
}
}
if (!(hdr((char *)"X-FTN-Tearline", msg)) && !(hdr((char *)"X-FTN-TID", msg))) {

View File

@@ -479,7 +479,7 @@ static int UnpackOne(int *fdp, int *countp)
cargv[0] = (char *)"gzip";
cargv[1] = (char *)"-d";
cargv[2] = NULL;
lseek(*fdp, (long) 0, 0); /* Back to the beginning */
lseek(*fdp, (int) 0, 0); /* Back to the beginning */
*fdp = StartChild(*fdp, (char*)_PATH_GZIP, cargv);
if (*fdp < 0)
return FALSE;
@@ -565,7 +565,7 @@ void ProcessOne(FILE *fp)
{
char *p, *fn, *buf, *gbuf, *mbuf, *group, *groups[25];
int i, nrofgroups;
unsigned long crc;
unsigned int crc;
buf = calloc(UUCPBUF, sizeof(char));
fn = calloc(PATH_MAX, sizeof(char));

View File

@@ -36,7 +36,7 @@
extern int do_quiet;
void StatAdd(statcnt *S, unsigned long V)
void StatAdd(statcnt *S, unsigned int V)
{
S->total += V;
S->tweek += V;

View File

@@ -1,10 +1,9 @@
#ifndef _ROLLOVER_H
#define _ROLLOVER_H
/* $Id$ */
void StatAdd(statcnt *, unsigned long);
void StatAdd(statcnt *, unsigned int);
void Rollover(void);
#endif

View File

@@ -60,11 +60,11 @@ int scanned;
* Internal prototypes
*/
void ScanFull(void);
void ScanOne(char *, unsigned long);
void ExportEcho(sysconnect, unsigned long, fa_list **);
void ExportNews( unsigned long, fa_list **);
void ExportNet(unsigned long, int);
void ExportEmail(unsigned long);
void ScanOne(char *, unsigned int);
void ExportEcho(sysconnect, unsigned int, fa_list **);
void ExportNews( unsigned int, fa_list **);
void ExportNet(unsigned int, int);
void ExportEmail(unsigned int);
@@ -76,7 +76,7 @@ void ExportEmail(unsigned long);
void ScanMail(int DoAll)
{
int DoFull = FALSE, i = 0;
unsigned long msg;
unsigned int msg;
char *Fname = NULL, *temp, *msgstr, *path;
FILE *fp;
@@ -147,8 +147,8 @@ void ScanFull()
{
char *sAreas, sbe[128];
FILE *pAreas;
long arearec = 0, sysstart, nextstart;
unsigned long Total, Number;
int arearec = 0, sysstart, nextstart;
unsigned int Total, Number;
int i;
sysconnect Link;
fa_list *sbl = NULL;
@@ -189,7 +189,7 @@ void ScanFull()
msleep(1);
if (((Number % 10) == 0) && (!do_quiet)) {
printf("%6lu\b\b\b\b\b\b", Number);
printf("%6u\b\b\b\b\b\b", Number);
fflush(stdout);
}
@@ -238,7 +238,7 @@ void ScanFull()
Nopper();
if (!do_quiet) {
mbse_colour(CYAN, BLACK);
printf("\r%5ld .. %-40s", arearec, msgs.Name);
printf("\r%5d .. %-40s", arearec, msgs.Name);
mbse_colour(LIGHTMAGENTA, BLACK);
fflush(stdout);
}
@@ -252,7 +252,7 @@ void ScanFull()
msleep(1);
if (((Number % 10) == 0) && (!do_quiet)) {
printf("%6lu\b\b\b\b\b\b", Number);
printf("%6u\b\b\b\b\b\b", Number);
fflush(stdout);
}
@@ -339,12 +339,12 @@ void ScanFull()
void ScanOne(char *path, unsigned long MsgNum)
void ScanOne(char *path, unsigned int MsgNum)
{
char *sAreas, sbe[128];
FILE *pAreas;
long sysstart;
unsigned long Total, Area = 0;
int sysstart;
unsigned int Total, Area = 0;
int i;
sysconnect Link;
fa_list *sbl = NULL;
@@ -406,7 +406,7 @@ void ScanOne(char *path, unsigned long MsgNum)
if ((msgs.Active) && (msgs.Type == ECHOMAIL || msgs.Type == NETMAIL || msgs.Type == NEWS)) {
if (!do_quiet) {
mbse_colour(CYAN, BLACK);
printf("\r%5ld .. %-40s", Area, msgs.Name);
printf("\r%5d .. %-40s", Area, msgs.Name);
mbse_colour(LIGHTMAGENTA, BLACK);
fflush(stdout);
}
@@ -485,16 +485,16 @@ void ScanOne(char *path, unsigned long MsgNum)
int RescanOne(faddr *L, char *marea, unsigned long Num)
int RescanOne(faddr *L, char *marea, unsigned int Num)
// Return: 0 -> Ok
// 1 -> Unknown area
// 2 -> Node cant rescan this area
{
unsigned long Total, MsgNum, Area = 0;
unsigned int Total, MsgNum, Area = 0;
fa_list *sbl = NULL;
fidoaddr *l;
int First, Found;
unsigned long rescanned;
unsigned int rescanned;
sysconnect Link;
IsDoing("ReScan mail");
@@ -530,7 +530,7 @@ int RescanOne(faddr *L, char *marea, unsigned long Num)
if ((msgs.Active) && ((msgs.Type == ECHOMAIL) || (msgs.Type == NEWS) || (msgs.Type == LIST))) {
if (!do_quiet) {
mbse_colour(CYAN, BLACK);
printf("\r%5ld .. %-40s", Area, msgs.Name);
printf("\r%5d .. %-40s", Area, msgs.Name);
mbse_colour(LIGHTMAGENTA, BLACK);
fflush(stdout);
}
@@ -573,7 +573,7 @@ int RescanOne(faddr *L, char *marea, unsigned long Num)
/*
* Export message to downlink. The messagebase is locked.
*/
void ExportEcho(sysconnect L, unsigned long MsgNum, fa_list **sbl)
void ExportEcho(sysconnect L, unsigned int MsgNum, fa_list **sbl)
{
int rc, seenlen, oldnet, flags = 0, kludges = TRUE;
char *p, sbe[128], ext[4];
@@ -680,7 +680,7 @@ void ExportEcho(sysconnect L, unsigned long MsgNum, fa_list **sbl)
/*
* Export message to the newsserver. The messagebase is locked.
*/
void ExportNews(unsigned long MsgNum, fa_list **sbl)
void ExportNews(unsigned int MsgNum, fa_list **sbl)
{
char *p;
int i, seenlen, oldnet, flags = 0;
@@ -783,7 +783,7 @@ void ExportNews(unsigned long MsgNum, fa_list **sbl)
/*
* Export Netmail message, the messagebase is locked.
*/
void ExportNet(unsigned long MsgNum, int UUCPgate)
void ExportNet(unsigned int MsgNum, int UUCPgate)
{
char *p, *q, ext[4], fromname[37], flavor, MailFrom[128], MailTo[128];
int i, rc, flags = 0, first, is_fmpt = FALSE, is_topt = FALSE, is_intl = FALSE, mypoint = FALSE, empty = TRUE;
@@ -1091,7 +1091,7 @@ void ExportNet(unsigned long MsgNum, int UUCPgate)
/*
* Export Email message, the messagebase is locked.
*/
void ExportEmail(unsigned long MsgNum)
void ExportEmail(unsigned int MsgNum)
{
char *p, *q, MailFrom[128], MailTo[128];
FILE *qp;

View File

@@ -1,10 +1,9 @@
#ifndef _SCAN_H
#define _SCAN_H
/* $Id$ */
void ScanMail(int);
int RescanOne(faddr *, char *, unsigned long);
int RescanOne(faddr *, char *, unsigned int);
#endif

View File

@@ -75,10 +75,10 @@ extern char *replyaddr;
* Internal functions
*/
int do_one_group(List **, char *, char *, int);
int get_xover(char *, long, long, List **);
int get_xover(char *, int, int, List **);
int get_xoverview(void);
void tidy_artlist(List **);
void fill_artlist(List **, char *, long, int);
void fill_artlist(List **, char *, int, int);
void Marker(void);
int get_article(char *, char *);
@@ -100,7 +100,7 @@ void tidy_artlist(List **fdp)
/*
* Add article to the list
*/
void fill_artlist(List **fdp, char *id, long nr, int dupe)
void fill_artlist(List **fdp, char *id, int nr, int dupe)
{
List **tmp;
@@ -255,7 +255,7 @@ int do_one_group(List **art, char *grpname, char *ftntag, int maxarticles)
List *tmp;
char temp[128], *resp;
int retval, fetched = 0;
long total, start, end;
int total, start, end;
Syslog('m', "do_one_group(%s, %s)", grpname, ftntag);
IsDoing((char *)"Scan %s", grpname);
@@ -388,15 +388,15 @@ int get_article(char *msgid, char *ftntag)
int get_xover(char *grpname, long startnr, long endnr, List **art)
int get_xover(char *grpname, int startnr, int endnr, List **art)
{
char cmd[81], *ptr, *ptr2, *resp, *p;
int retval, dupe, done = FALSE;
long nr;
unsigned long crc;
int nr;
unsigned int crc;
POverview pov;
snprintf(cmd, 81, "XOVER %ld-%ld\r\n", startnr, endnr);
snprintf(cmd, 81, "XOVER %d-%d\r\n", startnr, endnr);
if ((retval = nntp_cmd(cmd, 224))) {
switch (retval) {
case 412: WriteError("No newsgroup selected");

View File

@@ -1,6 +1,8 @@
#ifndef _SCANNEWS_H
#define _SCANNEWS_H
/* $Id$ */
#define MAX_MSGID_LEN 196
#define MAX_GRP_LEN 128
@@ -23,7 +25,7 @@ typedef struct XOVERVIEW {
typedef struct LinkList {
struct LinkList *next;
char msgid[MAX_MSGID_LEN];
long nr;
int nr;
int isdupe;
} List, *PList;
@@ -35,4 +37,3 @@ void ScanNews(void);
#endif

View File

@@ -116,7 +116,7 @@ FILE *SendMgrMail(faddr *t, int Keep, int FileAttach, char *bymgr, char *subj, c
/*
* Add MSGID, REPLY and PID
*/
fprintf(qp, "\001MSGID: %s %08lx\r", aka2str(Orig), sequencer());
fprintf(qp, "\001MSGID: %s %08x\r", aka2str(Orig), sequencer());
if (reply != NULL)
fprintf(qp, "\001REPLY: %s\r", reply);
fprintf(qp, "\001PID: MBSE-FIDO %s (%s-%s)\r", VERSION, OsName(), OsCPU());

View File

@@ -57,7 +57,7 @@ extern int do_quiet; /* Quiet flag */
int storeecho(faddr *f, faddr *t, time_t mdate, int flags, char *subj, char *msgid, char *reply, int bad, int dupe, FILE *fp)
{
int result;
unsigned long crc2;
unsigned int crc2;
char *buf;
mbse_CleanSubject(subj);

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Import a netmail message in the message base.
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -59,7 +59,7 @@ extern int net_bad; /* Bad netmails (tracking errors */
int storenet(faddr *f, faddr *t, time_t mdate, int flags, char *Subj, char *msgid, char *reply, FILE *fp, char *flagstr)
{
int result = FALSE, i, empty = TRUE, bad;
unsigned long crc2;
unsigned int crc2;
char *Buf;
mbse_CleanSubject(Subj);

View File

@@ -247,7 +247,7 @@ int LoadTic(char *inb, char *tfn)
} else if (strncasecmp(Temp, "crc ", 4) == 0) {
TIC.Crc_Int = strtoul(Temp+4, (char **)NULL, 16);
snprintf(TIC.TicIn.Crc, 9, "%08lX", TIC.Crc_Int);
snprintf(TIC.TicIn.Crc, 9, "%08X", TIC.Crc_Int);
strcpy(T_File.Crc, TIC.TicIn.Crc);
} else if (strncasecmp(Temp, "pw ", 3) == 0) {

View File

@@ -1,7 +1,7 @@
/* $Id$ */
#ifndef _TIC_H
#define _TIC_H
#ifndef _TIC_H
#define _TIC_H
/* $Id$ */
typedef struct _tic_in {
@@ -23,7 +23,7 @@ typedef struct _tic_in {
char Pw[21]; /* Password */
char AreaDesc[61]; /* Area description */
char Date[61]; /* Date field */
long Cost; /* Uplink cost */
int Cost; /* Uplink cost */
off_t Size; /* Size of file */
char LDesc[25][81]; /* Long description */
int TotLDesc; /* Total lines */
@@ -43,7 +43,7 @@ typedef struct _TICrec {
char NewFullName[256]; /* New LFN name */
char File_Id[25][49]; /* Description */
int File_Id_Ct; /* Nr of lines */
unsigned long Crc_Int; /* Crc value */
unsigned int Crc_Int; /* Crc value */
int KeepNum; /* Keep number of files */
off_t FileSize; /* Size of file */
time_t FileDate; /* Date of file */
@@ -53,7 +53,7 @@ typedef struct _TICrec {
unsigned PassThru : 1; /* PassThru file */
unsigned NewAlias : 1; /* New alias is set */
unsigned Orphaned : 1; /* File is Orphaned */
long FileCost; /* Cost for this file */
int FileCost; /* Cost for this file */
char BBSpath[PATH_MAX]; /* Path to import in */
char BBSdesc[55]; /* Area description */
} TICrec;
@@ -70,4 +70,3 @@ int LoadTic(char *, char *);
#endif

View File

@@ -37,7 +37,7 @@
extern char nodes_fil[81];
extern long nodes_pos;
extern int nodes_pos;
/*
* Internal prototypes
@@ -161,7 +161,7 @@ int GetTableRoute(char *ftn, fidoaddr *res)
faddr *dest;
fidoaddr mask;
int match, last;
long ptr;
int ptr;
FILE *fil;
/*

View File

@@ -45,7 +45,7 @@ char *MakeTicName()
static char buf[13];
buf[12] = '\0';
snprintf(buf, 13, "%08lx.tic", sequencer());
snprintf(buf, 13, "%08x.tic", sequencer());
buf[0] = 'm';
buf[1] = 'b';
@@ -173,7 +173,7 @@ void Bad(char *format, ...)
void ReCalcCrc(char *fn)
{
TIC.Crc_Int = file_crc(fn, CFG.slow_util && do_quiet);
snprintf(TIC.TicIn.Crc, 9, "%08lX", TIC.Crc_Int);
snprintf(TIC.TicIn.Crc, 9, "%08X", TIC.Crc_Int);
strcpy(T_File.Crc, TIC.TicIn.Crc);
}