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

@@ -160,7 +160,7 @@ int check_flo(faddr *node, char *filename, char flavor)
{
char *flofile, *ticfile, *buf;
FILE *fp;
long filepos, newpos;
int filepos, newpos;
char tpl = '~';
int rc = 0;

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Batch reading
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -32,7 +32,7 @@
#include "mbselib.h"
static long counter = 0L;
static int counter = 0L;
static int batchmode = -1;
int usetmp = 0;
@@ -42,18 +42,18 @@ char *bgets(char *buf, int count, FILE *fp)
return fgets(buf,count,fp);
}
if ((batchmode == 1) && (counter > 0L) && (counter < (long)(count-1)))
count=(int)(counter+1L);
if ((batchmode == 1) && (counter > 0L) && (counter < (count-1)))
count=(counter+1);
if (fgets(buf,count,fp) == NULL)
return NULL;
switch (batchmode) {
case -1: if (!strncmp(buf,"#! rnews ",9) || !strncmp(buf,"#!rnews ",8)) {
batchmode=1;
sscanf(buf+8,"%ld",&counter);
Syslog('m', "first chunk of input batch: %ld",counter);
if (counter < (long)(count-1))
count=(int)(counter+1L);
sscanf(buf+8,"%d",&counter);
Syslog('m', "first chunk of input batch: %d",counter);
if (counter < (count-1))
count=(counter+1);
if (fgets(buf,count,fp) == NULL)
return NULL;
else {
@@ -73,12 +73,12 @@ char *bgets(char *buf, int count, FILE *fp)
if (fgets(buf,count,fp) == NULL)
return NULL;
}
sscanf(buf+8,"%ld",&counter);
Syslog('m', "next chunk of input batch: %ld",counter);
sscanf(buf+8,"%d",&counter);
Syslog('m', "next chunk of input batch: %d",counter);
return NULL;
} else {
counter -= (long)strlen(buf);
Syslog('m', "bread \"%s\", %ld left of this chunk", buf,counter);
counter -= strlen(buf);
Syslog('m', "bread \"%s\", %d left of this chunk", buf,counter);
return buf;
}
}

View File

@@ -93,8 +93,8 @@ typedef signed char tCHAR; /* 8 bit signed values */
typedef unsigned char tBYTE; /* 8 bit unsigned values */
typedef signed short tINT; /* 16 bit signed values */
typedef unsigned short tWORD; /* 16 bit unsigned values */
typedef signed long tLONG; /* 32 bit signed values */
typedef unsigned long tDWORD; /* 32 bit unsigned values */
typedef int tLONG; /* 32 bit signed values */
typedef unsigned int tDWORD; /* 32 bit unsigned values */

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Client/Server communications
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -41,9 +41,9 @@ char logdebug[PATH_MAX]; /* Debug logfile */
char logfile[PATH_MAX]; /* Normal logfile */
char errfile[PATH_MAX]; /* Error logfile */
char mgrfile[PATH_MAX]; /* Area/File- mgr logfile */
long loggrade; /* Logging grade */
int loggrade; /* Logging grade */
pid_t mypid; /* Original parent pid if child */
unsigned long lcrc = 0, tcrc = 1; /* CRC value of logstring */
unsigned int lcrc = 0, tcrc = 1; /* CRC value of logstring */
int lcnt = 0; /* Same message counter */
static char *pbuff = NULL;
extern char cpath[108];
@@ -100,7 +100,7 @@ char *xstrcat(char *src, char *add)
void InitClient(char *user, char *myname, char *where, char *logfname, long loggr, char *err, char *mgr, char *debug)
void InitClient(char *user, char *myname, char *where, char *logfname, int loggr, char *err, char *mgr, char *debug)
{
if ((getenv("MBSE_ROOT")) == NULL) {
printf("Could not get the MBSE_ROOT environment variable\n");
@@ -261,7 +261,7 @@ void Syslog(int level, const char *format, ...)
*/
void Syslogp(int level, char *outstr)
{
long mask = 0;
int mask = 0;
int i, upper, debug;
debug = isalpha(level);
@@ -412,7 +412,7 @@ void DoNop()
static time_t nop = 0;
static int32_t nop = 0;
/*
* This function can be called very often but will only send once a minute
@@ -445,23 +445,23 @@ void Altime(int altime)
unsigned long sequencer()
unsigned int sequencer()
{
char *buf, *res;
unsigned long seq = 0;
char *buf, *res;
unsigned int seq = 0;
buf = calloc(SS_BUFSIZE, sizeof(char));
snprintf(buf, SS_BUFSIZE, "SSEQ:0;");
buf = calloc(SS_BUFSIZE, sizeof(char));
snprintf(buf, SS_BUFSIZE, "SSEQ:0;");
if (socket_send(buf) == 0) {
free(buf);
buf = socket_receive();
res = strtok(buf, ",");
res = strtok(NULL, ";");
seq = atol(res);
}
if (socket_send(buf) == 0) {
free(buf);
buf = socket_receive();
res = strtok(buf, ",");
res = strtok(NULL, ";");
seq = atol(res);
}
return seq;
return seq;
}
@@ -470,14 +470,14 @@ unsigned long sequencer()
* Check enough diskspace.
* return 0=No, 1=Yes, 2=Unknown, 3=Error
*/
int enoughspace(unsigned long needed)
int enoughspace(unsigned int needed)
{
char *buf, *res;
int rc = 3, cnt;
unsigned long avail = 0L;
unsigned int avail = 0L;
buf = calloc(SS_BUFSIZE, sizeof(char));
snprintf(buf, SS_BUFSIZE, "DSPC:1,%ld;", needed);
snprintf(buf, SS_BUFSIZE, "DSPC:1,%d;", needed);
if (socket_send(buf) == 0) {
snprintf(buf, SS_BUFSIZE, "%s", socket_receive());

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Crc32 and Crc16 calculations
*
*****************************************************************************
* Copyright (C) 1993-2004
* Copyright (C) 1993-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -70,7 +70,7 @@
/* using byte-swap instructions. */
unsigned long crc32tab[] = { /* CRC polynomial 0xedb88320 */
unsigned int crc32tab[] = { /* CRC polynomial 0xedb88320 */
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
@@ -181,14 +181,14 @@ unsigned short crc16ccitttab[256] = /* CRC polynomial 0x8408 */
unsigned long crc32ccitt(char *str, int l)
unsigned int crc32ccitt(char *str, int l)
{
unsigned long crc;
unsigned int crc;
for (crc = 0xffffffffL; l--; str++)
crc = crc32tab[((int) crc ^ (*str)) & 0xff] ^ ((crc >> 8) & 0x00ffffffL);
for (crc = 0xffffffffL; l--; str++)
crc = crc32tab[((int) crc ^ (*str)) & 0xff] ^ ((crc >> 8) & 0x00ffffffL);
return crc;
return crc;
}
@@ -209,24 +209,24 @@ unsigned short crc16ccitt(char *str, int l)
/*
* Calculate the CRC of a string.
*/
unsigned long str_crc32(char *str)
unsigned int str_crc32(char *str)
{
unsigned long crc;
unsigned int crc;
for (crc=0L; *str; str++)
crc = crc32tab[((int)crc^(*str)) & 0xff] ^ ((crc>>8) & 0x00ffffffL);
return crc;
for (crc=0L; *str; str++)
crc = crc32tab[((int)crc^(*str)) & 0xff] ^ ((crc>>8) & 0x00ffffffL);
return crc;
}
unsigned long StringCRC32(char *str)
unsigned int StringCRC32(char *str)
{
unsigned long crc;
unsigned int crc;
for (crc = 0xffffffffL; *str; str++)
crc = crc32tab[((int)crc^(*str)) & 0xff] ^ ((crc>>8) & 0x00ffffffL);
return crc;
for (crc = 0xffffffffL; *str; str++)
crc = crc32tab[((int)crc^(*str)) & 0xff] ^ ((crc>>8) & 0x00ffffffL);
return crc;
}
@@ -234,16 +234,16 @@ unsigned long StringCRC32(char *str)
/*
* Update CRC32, first initialize crc with 0xffffffff
*/
unsigned long upd_crc32(char *buf, unsigned long crc, int len)
unsigned int upd_crc32(char *buf, unsigned int crc, int len)
{
int i;
unsigned long cr;
int i;
unsigned int cr;
cr = crc;
for (i = 0; i < len; i++) {
cr = (crc32tab[((int)cr ^ ((long)buf[i])) & 0xff] ^ ((((unsigned long)cr) >> 8) & 0x00ffffffL));
}
return cr;
cr = crc;
for (i = 0; i < len; i++) {
cr = (crc32tab[((int)cr ^ ((int)buf[i])) & 0xff] ^ ((((unsigned int)cr) >> 8) & 0x00ffffffL));
}
return cr;
}
@@ -252,18 +252,18 @@ unsigned long upd_crc32(char *buf, unsigned long crc, int len)
* return normalized CRC32 value, which means put al bytes in the
* normal (not for comms) order.
*/
unsigned long norm_crc32(unsigned long crc)
unsigned int norm_crc32(unsigned int crc)
{
unsigned long L;
unsigned int L;
L = crc & 0x000000ffL;
L <<= 8;
L |= ((crc >> 8) & 0x000000ffL);
L <<= 8;
L |= ((crc >> 16) & 0x000000ffL);
L <<= 8;
L |= ((crc >> 24) & 0x000000ffL);
return L;
L = crc & 0x000000ffL;
L <<= 8;
L |= ((crc >> 8) & 0x000000ffL);
L <<= 8;
L |= ((crc >> 16) & 0x000000ffL);
L <<= 8;
L |= ((crc >> 24) & 0x000000ffL);
return L;
}

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Dupe checking.
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -37,7 +37,7 @@
typedef struct _dupesrec {
unsigned long *crcs;
unsigned int *crcs;
int loaded;
int changed;
int count;
@@ -70,11 +70,11 @@ void InitDupes()
int CheckDupe(unsigned long crc, int idx, int max)
int CheckDupe(unsigned int crc, int idx, int max)
{
char *dfile;
FILE *fil;
unsigned long test;
unsigned int test;
int i, size = 0;
if (!dupes[idx].loaded) {
@@ -93,7 +93,7 @@ int CheckDupe(unsigned long crc, int idx, int max)
fil = fopen(dfile, "r+");
} else {
fseek(fil, 0L, SEEK_END);
size = ftell(fil) / sizeof(unsigned long);
size = ftell(fil) / sizeof(unsigned int);
fseek(fil, 0L, SEEK_SET);
}
@@ -104,8 +104,8 @@ int CheckDupe(unsigned long crc, int idx, int max)
dupes[idx].peak = size + 5000;
else
dupes[idx].peak = max + 5000;
dupes[idx].crcs = (unsigned long *)malloc(dupes[idx].peak * sizeof(unsigned long));
memset(dupes[idx].crcs, 0, dupes[idx].peak * sizeof(unsigned long));
dupes[idx].crcs = (unsigned int *)malloc(dupes[idx].peak * sizeof(unsigned int));
memset(dupes[idx].crcs, 0, dupes[idx].peak * sizeof(unsigned int));
/*
* Load dupe records
@@ -158,7 +158,7 @@ void CloseDdb(int idx)
snprintf(dfile, PATH_MAX -1, "%s/etc/%s.dupe", getenv("MBSE_ROOT"), files[idx]);
if ((fil = fopen(dfile, "w"))) {
for (j = start; j < dupes[idx].count; j++)
fwrite(&dupes[idx].crcs[j], sizeof(unsigned long), 1, fil);
fwrite(&dupes[idx].crcs[j], sizeof(unsigned int), 1, fil);
fclose(fil);
} else {
WriteError("$Can't write %s", dfile);

View File

@@ -40,7 +40,7 @@
* Open files database Area number. Do some checks and abort
* if they fail.
*/
struct _fdbarea *mbsedb_OpenFDB(long Area, int Timeout)
struct _fdbarea *mbsedb_OpenFDB(int Area, int Timeout)
{
char *temp;
struct _fdbarea *fdb_area = NULL;
@@ -50,23 +50,23 @@ struct _fdbarea *mbsedb_OpenFDB(long Area, int Timeout)
temp = calloc(PATH_MAX, sizeof(char));
fdb_area = malloc(sizeof(struct _fdbarea)); /* Will be freed by CloseFDB */
snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%ld.data", getenv("MBSE_ROOT"), Area);
snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%d.data", getenv("MBSE_ROOT"), Area);
/*
* Open the file database, if it's locked, just wait.
*/
while (((fp = fopen(temp, "r+")) == NULL) && ((errno == EACCES) || (errno == EAGAIN))) {
if (++Tries >= (Timeout * 4)) {
WriteError("Can't open file area %ld, timeout", Area);
WriteError("Can't open file area %d, timeout", Area);
free(temp);
return NULL;
}
msleep(250);
Syslog('f', "Open file area %ld, try %d", Area, Tries);
Syslog('f', "Open file area %d, try %d", Area, Tries);
}
if (fp == NULL) {
if (errno == ENOENT) {
Syslog('+', "Create empty FDB for area %ld", Area);
Syslog('+', "Create empty FDB for area %d", Area);
fdbhdr.hdrsize = sizeof(fdbhdr);
fdbhdr.recsize = sizeof(fdb);
if ((fp = fopen(temp, "w+"))) {
@@ -100,7 +100,7 @@ struct _fdbarea *mbsedb_OpenFDB(long Area, int Timeout)
fseek(fp, 0, SEEK_END);
if ((ftell(fp) - fdbhdr.hdrsize) % fdbhdr.recsize) {
WriteError("Files database area %ld is corrupt, unalligned records", Area);
WriteError("Files database area %d is corrupt, unalligned records", Area);
fclose(fp);
return NULL;
}
@@ -146,7 +146,7 @@ int mbsedb_LockFDB(struct _fdbarea *fdb_area, int Timeout)
while ((rc = fcntl(fileno(fdb_area->fp), F_SETLK, &fl)) && ((errno == EACCES) || (errno == EAGAIN))) {
if (++Tries >= (Timeout * 4)) {
fcntl(fileno(fdb_area->fp), F_GETLK, &fl);
WriteError("FDB %ld is locked by pid %d", fdb_area->area, fl.l_pid);
WriteError("FDB %d is locked by pid %d", fdb_area->area, fl.l_pid);
return FALSE;
}
msleep(250);
@@ -154,7 +154,7 @@ int mbsedb_LockFDB(struct _fdbarea *fdb_area, int Timeout)
}
if (rc) {
WriteError("$FDB %ld lock error", fdb_area->area);
WriteError("$FDB %d lock error", fdb_area->area);
return FALSE;
}
@@ -187,8 +187,8 @@ int mbsedb_UnlockFDB(struct _fdbarea *fdb_area)
void mbsedb_Temp2Data(unsigned long);
void mbsedb_Temp2Data(unsigned long fdb_area)
void mbsedb_Temp2Data(unsigned int);
void mbsedb_Temp2Data(unsigned int fdb_area)
{
char *temp1, *temp2;
@@ -200,12 +200,12 @@ void mbsedb_Temp2Data(unsigned long fdb_area)
* we will give that a new name on disk. Then we move the temp in place.
* Finaly remove the old (still locked) original file.
*/
snprintf(temp2, PATH_MAX -1, "%s/var/fdb/file%ld.data", getenv("MBSE_ROOT"), fdb_area);
snprintf(temp1, PATH_MAX -1, "%s/var/fdb/file%ld.xxxx", getenv("MBSE_ROOT"), fdb_area);
snprintf(temp2, PATH_MAX -1, "%s/var/fdb/file%d.data", getenv("MBSE_ROOT"), fdb_area);
snprintf(temp1, PATH_MAX -1, "%s/var/fdb/file%d.xxxx", getenv("MBSE_ROOT"), fdb_area);
rename(temp2, temp1);
snprintf(temp1, PATH_MAX -1, "%s/var/fdb/file%ld.temp", getenv("MBSE_ROOT"), fdb_area);
snprintf(temp1, PATH_MAX -1, "%s/var/fdb/file%d.temp", getenv("MBSE_ROOT"), fdb_area);
rename(temp1, temp2);
snprintf(temp1, PATH_MAX -1, "%s/var/fdb/file%ld.xxxx", getenv("MBSE_ROOT"), fdb_area);
snprintf(temp1, PATH_MAX -1, "%s/var/fdb/file%d.xxxx", getenv("MBSE_ROOT"), fdb_area);
unlink(temp1);
free(temp1);
@@ -241,7 +241,7 @@ int mbsedb_InsertFDB(struct _fdbarea *fdb_area, struct FILE_record frec, int Add
* There are files, search the insert point.
*/
temp = calloc(PATH_MAX, sizeof(char));
snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%ld.temp", getenv("MBSE_ROOT"), fdb_area->area);
snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%d.temp", getenv("MBSE_ROOT"), fdb_area->area);
fseek(fdb_area->fp, fdbhdr.hdrsize, SEEK_SET);
Insert = 0;
do {
@@ -356,7 +356,7 @@ int mbsedb_PackFDB(struct _fdbarea *fdb_area)
* There are files, copy the remaining entries
*/
temp = calloc(PATH_MAX, sizeof(char));
snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%ld.temp", getenv("MBSE_ROOT"), fdb_area->area);
snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%d.temp", getenv("MBSE_ROOT"), fdb_area->area);
if ((fp = fopen(temp, "a+")) == NULL) {
WriteError("$Can't create %s", temp);
mbsedb_UnlockFDB(fdb_area);
@@ -494,7 +494,7 @@ int mbsedb_SortFDB(struct _fdbarea *fdb_area)
}
temp = calloc(PATH_MAX, sizeof(char));
snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%ld.temp", getenv("MBSE_ROOT"), fdb_area->area);
snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%d.temp", getenv("MBSE_ROOT"), fdb_area->area);
if ((fp = fopen(temp, "a+")) == NULL) {
WriteError("$Can't create %s", temp);
mbsedb_UnlockFDB(fdb_area);

View File

@@ -36,11 +36,11 @@
char msgs_fil[PATH_MAX]; /* Database filename */
char mgrp_fil[PATH_MAX]; /* Group database filename */
long msgs_pos = -1; /* Current record position */
long mgrp_pos = -1; /* Current group position */
unsigned long msgs_crc = -1; /* CRC value of current record */
unsigned long mgrp_crc = -1; /* CRC value of group record */
static long sysstart, sysrecord;
int msgs_pos = -1; /* Current record position */
int mgrp_pos = -1; /* Current group position */
unsigned int msgs_crc = -1; /* CRC value of current record */
unsigned int mgrp_crc = -1; /* CRC value of group record */
static int sysstart, sysrecord;
@@ -324,7 +324,7 @@ int SearchNetBoard(unsigned short zone, unsigned short net)
void UpdateMsgs()
{
unsigned long crc = 0xffffffff;
unsigned int crc = 0xffffffff;
FILE *fil;
if (msgs_pos == -1)

View File

@@ -36,10 +36,10 @@
char nodes_fil[PATH_MAX]; /* Nodes database filename */
long nodes_pos = -1; /* Noderecord position */
long nodes_fgp = -1; /* Nodes files group position */
long nodes_mgp = -1; /* Nodes message group position */
unsigned long nodes_crc = -1; /* Noderecord crc value */
int nodes_pos = -1; /* Noderecord position */
int nodes_fgp = -1; /* Nodes files group position */
int nodes_mgp = -1; /* Nodes message group position */
unsigned int nodes_crc = -1; /* Noderecord crc value */
@@ -130,7 +130,7 @@ int SearchNode(fidoaddr aka)
*/
int UpdateNode()
{
unsigned long crc;
unsigned int crc;
FILE *fil;
if (nodes_pos == -1)

View File

@@ -37,11 +37,11 @@
char tic_fil[PATH_MAX]; /* Database filename */
char tgrp_fil[PATH_MAX]; /* Group database filename */
long tic_pos = -1; /* Current record position */
long tgrp_pos = -1; /* Current group position */
unsigned long tic_crc = -1; /* CRC value of current record */
unsigned long tgrp_crc = -1; /* CRC value of group record */
static long sysstart, sysrecord;
int tic_pos = -1; /* Current record position */
int tgrp_pos = -1; /* Current group position */
unsigned int tic_crc = -1; /* CRC value of current record */
unsigned int tgrp_crc = -1; /* CRC value of group record */
static int sysstart, sysrecord;
@@ -263,7 +263,7 @@ int GetTicSystem(sysconnect * Sys, int First)
void UpdateTic()
{
unsigned long crc = 0xffffffff;
unsigned int crc = 0xffffffff;
FILE *fil;
if (tic_pos == -1)

View File

@@ -1321,7 +1321,7 @@ Mfunc(f_time)
{
ArgCount(0, 0);
V snprintf(output, MAXSTR, "%ld", (long) time((time_t *) NULL));
V snprintf(output, MAXSTR, "%d", (int32_t) time((time_t *) NULL));
return TRUE;
}
#endif /* UNIXTENSIONS */

View File

@@ -215,7 +215,7 @@ faddr *parsefaddr(char *s)
int gotzone = 0, gotnet = 0, gotnode = 0, gotpoint = 0;
int zone = 0, net = 0, noden = 0, point = 0;
char *domain = NULL, *freename = NULL;
long num;
int num;
char *p = NULL,*q = NULL,*t = NULL;
int l, quoted;
FILE *fp;

View File

@@ -44,17 +44,17 @@ static char *months[] = {
char *ftndate(time_t t)
{
static char buf[32];
struct tm *ptm;
static char buf[32];
struct tm *ptm;
ptm = localtime(&t);
if (ptm->tm_sec > 59)
ptm->tm_sec = 59;
ptm = localtime(&t);
if (ptm->tm_sec > 59)
ptm->tm_sec = 59;
snprintf(buf, 32, "%02d %s %02d %02d:%02d:%02d",ptm->tm_mday,
snprintf(buf, 32, "%02d %s %02d %02d:%02d:%02d",ptm->tm_mday,
months[ptm->tm_mon], ptm->tm_year%100,
ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
return buf;
return buf;
}
@@ -120,14 +120,14 @@ FILE *ftnmsghdr(ftnmsg *fmsg, FILE *pkt, faddr *routeaddr, char flavor, char *Pi
if (fmsg->msgid_s)
fprintf(pkt, "\1MSGID: %s\r", fmsg->msgid_s);
else if (fmsg->msgid_a)
fprintf(pkt, "\1MSGID: %s %08lx\r",
fprintf(pkt, "\1MSGID: %s %08x\r",
fmsg->msgid_a,
fmsg->msgid_n);
if (fmsg->reply_s)
fprintf(pkt, "\1REPLY: %s\r", fmsg->reply_s);
else if (fmsg->reply_a)
fprintf(pkt, "\1REPLY: %s %08lx\r",
fprintf(pkt, "\1REPLY: %s %08x\r",
fmsg->reply_a,
fmsg->reply_n);

View File

@@ -54,7 +54,7 @@ int getheader(faddr *f, faddr *t, FILE *pkt, char *pname, int session)
unsigned char buffer[0x3a];
int i, capword, prodx, major, minor = 0, tome = FALSE;
char *p, *prodn = NULL, *fa, *ta, buf[5];
long year, month, day, hour, min, sec;
int year, month, day, hour, min, sec;
f->domain = NULL;
f->name = NULL;

View File

@@ -38,40 +38,40 @@
* Returns the offset from your location to UTC. So in the MET timezone
* this returns -60 (wintertime). People in the USA get positive results.
*/
long gmt_offset(time_t now)
int gmt_offset(time_t now)
{
struct tm ptm;
struct tm gtm;
long offset;
struct tm ptm;
struct tm gtm;
int offset;
if (!now)
now = time(NULL);
ptm = *localtime(&now);
if (!now)
now = time(NULL);
ptm = *localtime(&now);
/*
* To get the timezone, compare localtime with GMT.
*/
gtm = *gmtime(&now);
/*
* To get the timezone, compare localtime with GMT.
*/
gtm = *gmtime(&now);
/*
* Assume we are never more than 24 hours away.
*/
offset = gtm.tm_yday - ptm.tm_yday;
if (offset > 1)
offset = -24;
else if (offset < -1)
offset = 24;
else
offset *= 24;
/*
* Assume we are never more than 24 hours away.
*/
offset = gtm.tm_yday - ptm.tm_yday;
if (offset > 1)
offset = -24;
else if (offset < -1)
offset = 24;
else
offset *= 24;
/*
* Scale in the hours and minutes; ignore seconds.
*/
offset += gtm.tm_hour - ptm.tm_hour;
offset *= 60;
offset += gtm.tm_min - ptm.tm_min;
/*
* Scale in the hours and minutes; ignore seconds.
*/
offset += gtm.tm_hour - ptm.tm_hour;
offset *= 60;
offset += gtm.tm_min - ptm.tm_min;
return offset;
return offset;
}
@@ -85,7 +85,7 @@ char *gmtoffset(time_t now)
static char buf[6]="+0000";
char sign;
int hr, min;
long offset;
int offset;
offset = gmt_offset(now);

View File

@@ -55,15 +55,15 @@ char szBuff[MAX_LINE_LENGTH + 1];
char szLine[MAX_LINE_LENGTH + 1];
JAMHDRINFO jamHdrInfo;
JAMHDR jamHdr;
unsigned long LastReadRec;
unsigned int LastReadRec;
unsigned long AddSubfield(unsigned int, char *);
unsigned long AddSubfield(unsigned int JamSFld, char *SubStr)
unsigned int AddSubfield(unsigned int, char *);
unsigned int AddSubfield(unsigned int JamSFld, char *SubStr)
{
JAMSUBFIELD jamSubfield;
unsigned long Len;
unsigned int Len;
jamSubfield.HiID = 0;
jamSubfield.LoID = JamSFld;
@@ -127,7 +127,7 @@ void JAMset_flags()
int JAM_AddMsg()
{
int i, RetVal = TRUE;
unsigned long ulMsg = JAM_Highest() + 1L;
unsigned int ulMsg = JAM_Highest() + 1L;
char *pszText, *Sign= (char *)HEADERSIGNATURE;
JAMIDXREC jamIdx;
int Oke;
@@ -286,7 +286,7 @@ void JAM_Close(void)
/*
* Delete message number
*/
int JAM_Delete(unsigned long ulMsg)
int JAM_Delete(unsigned int ulMsg)
{
int RetVal = FALSE;
JAMIDXREC jamIdx;
@@ -362,9 +362,9 @@ int JAM_GetLastRead(lastread *LR)
/*
* Get highest message number
*/
unsigned long JAM_Highest(void)
unsigned int JAM_Highest(void)
{
unsigned long RetVal = 0L;
unsigned int RetVal = 0L;
JAMIDXREC jamIdx;
if (jamHdrInfo.ActiveMsgs > 0L) {
@@ -383,7 +383,7 @@ unsigned long JAM_Highest(void)
int JAM_Lock(unsigned long ulTimeout)
int JAM_Lock(unsigned int ulTimeout)
{
int rc, Tries = 0;
struct flock fl;
@@ -416,9 +416,9 @@ int JAM_Lock(unsigned long ulTimeout)
/*
* Get lowest message number
*/
unsigned long JAM_Lowest(void)
unsigned int JAM_Lowest(void)
{
unsigned long RetVal = 0L;
unsigned int RetVal = 0L;
JAMIDXREC jamIdx;
if (jamHdrInfo.ActiveMsgs > 0L) {
@@ -453,11 +453,11 @@ int JAM_NewLastRead(lastread LR)
int JAM_Next(unsigned long * ulMsg)
int JAM_Next(unsigned int * ulMsg)
{
int RetVal = FALSE, MayBeNext = FALSE;
JAMIDXREC jamIdx;
unsigned long _Msg;
unsigned int _Msg;
_Msg = *ulMsg;
@@ -509,7 +509,7 @@ int JAM_Next(unsigned long * ulMsg)
Msg.Id = _Msg;
}
memcpy(ulMsg, &_Msg, sizeof(unsigned long));
memcpy(ulMsg, &_Msg, sizeof(unsigned int));
return RetVal;
}
@@ -518,7 +518,7 @@ int JAM_Next(unsigned long * ulMsg)
/*
* Return number of messages
*/
unsigned long JAM_Number(void)
unsigned int JAM_Number(void)
{
return jamHdrInfo.ActiveMsgs;
}
@@ -595,7 +595,7 @@ void JAM_Pack(void)
int ToRead, Readed, i, count;
char *File, *New, *Subfield, *Temp;
JAMIDXREC jamIdx;
unsigned long NewNumber = 0, RefNumber = 0, Written = 0;
unsigned int NewNumber = 0, RefNumber = 0, Written = 0;
lastread LR;
File = calloc(PATH_MAX, sizeof(char));
@@ -784,12 +784,12 @@ void JAM_Pack(void)
int JAM_Previous (unsigned long *ulMsg)
int JAM_Previous (unsigned int *ulMsg)
{
int RetVal = FALSE, MayBeNext = FALSE;
long Pos;
int Pos;
JAMIDXREC jamIdx;
unsigned long _Msg;
unsigned int _Msg;
_Msg = *ulMsg;
@@ -846,17 +846,17 @@ int JAM_Previous (unsigned long *ulMsg)
Msg.Id = _Msg;
}
memcpy(ulMsg, &_Msg, sizeof(unsigned long));
memcpy(ulMsg, &_Msg, sizeof(unsigned int));
return (RetVal);
}
int JAM_ReadHeader (unsigned long ulMsg)
int JAM_ReadHeader (unsigned int ulMsg)
{
int i, RetVal = FALSE;
unsigned char *pPos;
unsigned long ulSubfieldLen, tmp;
unsigned int ulSubfieldLen, tmp;
JAMIDXREC jamIdx;
JAMBINSUBFIELD *jamSubField;
@@ -1065,12 +1065,12 @@ int JAM_ReadHeader (unsigned long ulMsg)
/*
* Read message
*/
int JAM_Read(unsigned long ulMsg, int nWidth)
int JAM_Read(unsigned int ulMsg, int nWidth)
{
int RetVal = FALSE, SkipNext;
int i, nReaded, nCol, nRead;
unsigned char *pPos;
unsigned long ulTxtLen, ulSubfieldLen;
unsigned int ulTxtLen, ulSubfieldLen;
JAMIDXREC jamIdx;
JAMBINSUBFIELD *jamSubField;
LDATA *Bottom = NULL, *New;
@@ -1230,7 +1230,7 @@ int JAM_Read(unsigned long ulMsg, int nWidth)
SkipNext = FALSE;
do {
if ((unsigned long)(nRead = sizeof (szBuff)) > ulTxtLen)
if ((unsigned int)(nRead = sizeof (szBuff)) > ulTxtLen)
nRead = (int)ulTxtLen;
nReaded = (int)read (fdJdt, szBuff, nRead);
@@ -1346,7 +1346,7 @@ void JAM_UnLock(void)
/*
* Write message header
*/
int JAM_WriteHeader (unsigned long ulMsg)
int JAM_WriteHeader (unsigned int ulMsg)
{
int RetVal = FALSE;
JAMIDXREC jamIdx;

View File

@@ -6,24 +6,24 @@
int JAM_AddMsg(void);
void JAM_Close(void);
int JAM_Delete(unsigned long);
int JAM_Delete(unsigned int);
void JAM_DeleteJAM(char *);
int JAM_GetLastRead(lastread *);
unsigned long JAM_Highest(void);
int JAM_Lock(unsigned long);
unsigned long JAM_Lowest(void);
unsigned int JAM_Highest(void);
int JAM_Lock(unsigned int);
unsigned int JAM_Lowest(void);
void JAM_New(void);
int JAM_NewLastRead(lastread);
int JAM_Next(unsigned long *);
unsigned long JAM_Number(void);
int JAM_Next(unsigned int *);
unsigned int JAM_Number(void);
int JAM_Open(char *);
void JAM_Pack(void);
int JAM_Previous(unsigned long *);
int JAM_ReadHeader(unsigned long);
int JAM_Read(unsigned long, int);
int JAM_Previous(unsigned int *);
int JAM_ReadHeader(unsigned int);
int JAM_Read(unsigned int, int);
int JAM_SetLastRead(lastread);
void JAM_UnLock(void);
int JAM_WriteHeader(unsigned long);
int JAM_WriteHeader(unsigned int);
#endif

View File

@@ -1,4 +1,6 @@
/*
** $Id$
**
** JAM(mbp) - The Joaquim-Andrew-Mats Message Base Proposal
**
** C API
@@ -44,8 +46,8 @@
** _QC Microsoft Quick C
*/
typedef long INT32; /* 32 bits signed integer */
typedef unsigned long UINT32; /* 32 bits unsigned integer */
typedef int INT32; /* 32 bits signed integer */
typedef unsigned int UINT32; /* 32 bits unsigned integer */
typedef short int INT16; /* 16 bits signed integer */
typedef unsigned short int UINT16; /* 16 bits unsigned integer */
typedef char CHAR8; /* 8 bits signed integer */

View File

@@ -5,7 +5,7 @@
* Author ................: Martin Junius, for Fidogate
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -123,17 +123,17 @@ int is_space(int c)
* comments (starting with `#'), and empty lines. cf_getline() returns
* a pointer to the first non-whitespace in buffer.
*/
static long cf_lineno = 0;
static int cf_lineno = 0;
long cf_lineno_get(void)
int cf_lineno_get(void)
{
return cf_lineno;
}
long cf_lineno_set(long n)
int cf_lineno_set(int n)
{
long old;
int old;
old = cf_lineno;
cf_lineno = n;
@@ -225,7 +225,7 @@ int charset_do_line(char *line)
w1 = strtok(NULL, " \t");
w2 = strtok(NULL, " \t");
if(!w1 || !w2) {
fprintf(stderr, "%s:%ld: argument(s) for alias missing\n", PROGRAM, cf_lineno_get());
fprintf(stderr, "%s:%d: argument(s) for alias missing\n", PROGRAM, cf_lineno_get());
return FALSE;
}
@@ -239,7 +239,7 @@ int charset_do_line(char *line)
w1 = strtok(NULL, " \t");
w2 = strtok(NULL, " \t");
if(!w1 || !w2) {
fprintf(stderr, "%s:%ld: argument(s) for table missing\n", PROGRAM, cf_lineno_get());
fprintf(stderr, "%s:%d: argument(s) for table missing\n", PROGRAM, cf_lineno_get());
return FALSE;
}
@@ -252,7 +252,7 @@ int charset_do_line(char *line)
else if (strieq(key, "map")) {
w1 = strtok(NULL, " \t");
if (!w1) {
fprintf(stderr, "%s:%ld: argument for map missing\n", PROGRAM, cf_lineno_get());
fprintf(stderr, "%s:%d: argument for map missing\n", PROGRAM, cf_lineno_get());
return FALSE;
}
@@ -281,17 +281,17 @@ int charset_do_line(char *line)
/* Normal mapping */
else {
if ((c1 = charset_parse_c(w1)) == ERROR) {
fprintf(stderr, "%s:%ld: illegal char %s\n", PROGRAM, cf_lineno_get(), w1);
fprintf(stderr, "%s:%d: illegal char %s\n", PROGRAM, cf_lineno_get(), w1);
return FALSE;
}
if (c1 < 0x80) {
fprintf(stderr, "%s:%ld: illegal char %s, must be >= 0x80\n", PROGRAM, cf_lineno_get(), w1);
fprintf(stderr, "%s:%d: illegal char %s, must be >= 0x80\n", PROGRAM, cf_lineno_get(), w1);
return FALSE;
}
for (i=0; i<MAX_CHARSET_OUT-1 && (w2 = strtok(NULL, " \t")); i++ ) {
if( (c2 = charset_parse_c(w2)) == ERROR) {
fprintf(stderr, "%s:%ld: illegal char definition %s\n", PROGRAM, cf_lineno_get(), w2);
fprintf(stderr, "%s:%d: illegal char definition %s\n", PROGRAM, cf_lineno_get(), w2);
return FALSE;
}
pt->map[c1 & 0x7f][i] = c2;
@@ -302,7 +302,7 @@ int charset_do_line(char *line)
}
/* Error */
else {
fprintf(stderr, "%s:%ld: illegal key word %s\n", PROGRAM, cf_lineno_get(), key);
fprintf(stderr, "%s:%d: illegal key word %s\n", PROGRAM, cf_lineno_get(), key);
return FALSE;
}
@@ -318,7 +318,7 @@ int charset_do_file(char *name)
{
FILE *fp;
char *p;
long oldn;
int oldn;
if(!name)
return FALSE;

View File

@@ -193,7 +193,7 @@ void Cookie(int HtmlMode)
{
FILE *olf;
char *fname, outbuf[256];
long recno, records;
int recno, records;
MacroVars("F", "s", "");
fname = calloc(PATH_MAX, sizeof(char));

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Basic File I/O
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -159,7 +159,7 @@ int file_exist(char *path, int mode)
/*
* Return size of file, or -1 if file doesn't exist
*/
long file_size(char *path)
int file_size(char *path)
{
static struct stat sb;
@@ -172,30 +172,30 @@ long file_size(char *path)
/*
* Claclulate the 32 bit CRC of a file. Return -1 if file not found.
* Calculate the 32 bit CRC of a file. Return -1 if file not found.
*/
long file_crc(char *path, int slow)
int file_crc(char *path, int slow)
{
static long crc;
int bread;
FILE *fp;
char *line;
static int crc;
int bread;
FILE *fp;
char *line;
if ((fp = fopen(path, "r")) == NULL)
return -1;
if ((fp = fopen(path, "r")) == NULL)
return -1;
line = malloc(32768);
crc = 0xffffffff;
line = malloc(32768);
crc = 0xffffffff;
do {
bread = fread(line, 1, 32768, fp);
crc = upd_crc32(line, crc, bread);
Nopper(); // For large files on slow systems.
} while (bread > 0);
do {
bread = fread(line, 1, 32768, fp);
crc = upd_crc32(line, crc, bread);
Nopper(); // For large files on slow systems.
} while (bread > 0);
free(line);
fclose(fp);
return crc ^ 0xffffffff;
free(line);
fclose(fp);
return crc ^ 0xffffffff;
}
@@ -207,12 +207,12 @@ long file_crc(char *path, int slow)
*/
time_t file_time(char *path)
{
static struct stat sb;
static struct stat sb;
if (stat(path, &sb) == -1)
return -1;
if (stat(path, &sb) == -1)
return -1;
return sb.st_mtime;
return sb.st_mtime;
}

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Global variables for MBSE BBS
*
*****************************************************************************
* Copyright (C) 1997-2001
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -36,7 +36,7 @@
typedef struct _TagRec {
long Area; /* File Area number */
int Area; /* File Area number */
int Active; /* Not deleted from taglist */
int Cost; /* Free download */
off_t Size; /* File Size */

View File

@@ -43,7 +43,7 @@ int IsOurAka(fidoaddr); /* Check if our aka */
typedef enum {D_ECHOMAIL, D_FILEECHO, D_NEWS} DUPETYPE;
void InitDupes(void);
int CheckDupe(unsigned long, int, int);
int CheckDupe(unsigned int, int, int);
void CloseDupes(void);
@@ -138,13 +138,13 @@ void UpdateMsgs(void); /* Update current messages record */
* Structure of current open file area
*/
struct _fdbarea {
long area; /* Area number */
int area; /* Area number */
int locked; /* Is area locked */
FILE *fp; /* File pointer */
};
struct _fdbarea *mbsedb_OpenFDB(long, int);
struct _fdbarea *mbsedb_OpenFDB(int, int);
int mbsedb_CloseFDB(struct _fdbarea *);
int mbsedb_LockFDB(struct _fdbarea *, int);
int mbsedb_UnlockFDB(struct _fdbarea *);

View File

@@ -123,8 +123,8 @@ struct termios;
# include <sgtty.h>
# define USE_SGTTY
# ifdef LLITOUT
extern long Locmode; /* Saved "local mode" for 4.x BSD "new driver" */
extern long Locbit; /* Bit SUPPOSED to disable output translations */
extern int Locmode; /* Saved "local mode" for 4.x BSD "new driver" */
extern int Locbit; /* Bit SUPPOSED to disable output translations */
# endif
# else
# error neither termio.h nor sgtty.h found. Cannot continue.
@@ -513,7 +513,7 @@ typedef struct _nlidx {
unsigned char type; /* Node type */
unsigned char pflag; /* Node status */
unsigned short fileno; /* Nodelist number */
long offset; /* Offset in nodelist */
int offset; /* Offset in nodelist */
} nlidx;
@@ -569,8 +569,8 @@ typedef struct _nlusr {
*/
typedef struct _security {
unsigned int level; /* Security level */
unsigned long flags; /* Access flags */
unsigned long notflags; /* No Access flags */
unsigned int flags; /* Access flags */
unsigned int notflags; /* No Access flags */
} securityrec;
#endif
@@ -616,12 +616,12 @@ typedef struct _sysconnect {
* Statistic counters structure
*/
typedef struct _statcnt {
unsigned long tdow[7]; /* Days of current week */
unsigned long ldow[7]; /* Days of previous week */
unsigned long tweek; /* Week total counters */
unsigned long lweek; /* Last week counters */
unsigned long month[12]; /* Monthly total counters */
unsigned long total; /* The ever growing total */
unsigned int tdow[7]; /* Days of current week */
unsigned int ldow[7]; /* Days of previous week */
unsigned int tweek; /* Week total counters */
unsigned int lweek; /* Last week counters */
unsigned int month[12]; /* Monthly total counters */
unsigned int total; /* The ever growing total */
} statcnt;
@@ -680,9 +680,9 @@ struct taskrec {
* Special mail services (service.data)
*/
struct servicehdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
time_t lastupd; /* Last updated at */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
int32_t lastupd; /* Last updated at */
};
struct servicerec {
@@ -698,9 +698,9 @@ struct servicerec {
* Domain translation (domain.data)
*/
struct domhdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
time_t lastupd; /* Last updated at */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
int32_t lastupd; /* Last updated at */
};
struct domrec {
@@ -716,15 +716,15 @@ struct domrec {
* System Control Structures (sysinfo.data)
*/
struct sysrec {
unsigned long SystemCalls; /* Total # of system calls */
unsigned long Pots; /* POTS calls */
unsigned long ISDN; /* ISDN calls */
unsigned long Network; /* Network (internet) calls*/
unsigned long Local; /* Local calls */
unsigned long xADSL; /* */
time_t StartDate; /* Start Date of BBS */
unsigned int SystemCalls; /* Total # of system calls */
unsigned int Pots; /* POTS calls */
unsigned int ISDN; /* ISDN calls */
unsigned int Network; /* Network (internet) calls*/
unsigned int Local; /* Local calls */
unsigned int xADSL; /* */
int32_t StartDate; /* Start Date of BBS */
char LastCaller[37]; /* Last Caller to BBS */
time_t LastTime; /* Time of last caller */
int32_t LastTime; /* Time of last caller */
};
@@ -733,8 +733,8 @@ struct sysrec {
* Protocol Control Structure (protocol.data)
*/
struct prothdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
};
struct prot {
@@ -758,8 +758,8 @@ struct prot {
* Oneliners Control Structure (oneline.data)
*/
struct onelinehdr {
long hdrsize; /* Size of header */
long recsize; /* Size of record */
int hdrsize; /* Size of header */
int recsize; /* Size of record */
};
struct oneline {
@@ -775,8 +775,8 @@ struct oneline {
* File Areas Control Structure (fareas.data)
*/
struct fileareashdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
};
struct fileareas {
@@ -816,8 +816,8 @@ struct fileareas {
struct FILEIndex {
char Name[13]; /* Short DOS name */
char LName[81]; /* Long filename */
long AreaNum; /* File area number */
long Record; /* Record in database */
int AreaNum; /* File area number */
int Record; /* Record in database */
};
@@ -826,8 +826,8 @@ struct FILEIndex {
* Files database (file#.data)
*/
struct FILE_recordhdr {
long hdrsize; /* Size of header */
long recsize; /* Record size */
int hdrsize; /* Size of header */
int recsize; /* Record size */
};
@@ -836,12 +836,12 @@ struct FILE_record {
char LName[81]; /* Long filename */
char TicArea[21]; /* Tic area file came in */
off_t Size; /* File Size */
unsigned long Crc32; /* File CRC-32 */
unsigned int Crc32; /* File CRC-32 */
char Uploader[36]; /* Uploader name */
time_t UploadDate; /* Date/Time uploaded */
time_t FileDate; /* Real file date */
time_t LastDL; /* Last Download date */
unsigned long TimesDL; /* Times file was dl'ed */
int32_t UploadDate; /* Date/Time uploaded */
int32_t FileDate; /* Real file date */
int32_t LastDL; /* Last Download date */
unsigned int TimesDL; /* Times file was dl'ed */
char Password[16]; /* File password */
char Desc[25][49]; /* file description */
char Magic[21]; /* Magic request name */
@@ -860,16 +860,16 @@ struct OldFILERecord {
char Name[13]; /* DOS style filename */
char LName[81]; /* Long filename */
char xTicArea[9]; /* Tic area file came in */
unsigned long TicAreaCRC; /* CRC of TIC area name */
unsigned int TicAreaCRC; /* CRC of TIC area name */
off_t Size; /* File Size */
unsigned long Crc32; /* File CRC-32 */
unsigned int Crc32; /* File CRC-32 */
char Uploader[36]; /* Uploader name */
time_t UploadDate; /* Date/Time uploaded */
time_t FileDate; /* Real file date */
time_t LastDL; /* Last Download date */
unsigned long TimesDL; /* Times file was dl'ed */
unsigned long TimesFTP; /* Times file was FTP'ed */
unsigned long TimesReq; /* Times file was frequed */
int32_t UploadDate; /* Date/Time uploaded */
int32_t FileDate; /* Real file date */
int32_t LastDL; /* Last Download date */
unsigned int TimesDL; /* Times file was dl'ed */
unsigned int TimesFTP; /* Times file was FTP'ed */
unsigned int TimesReq; /* Times file was frequed */
char Password[16]; /* File password */
char Desc[25][49]; /* file description */
int Cost; /* File cost */
@@ -887,8 +887,8 @@ struct OldFILERecord {
* BBS List Control Structure (bbslist.data)
*/
struct bbslisthdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
};
struct bbslist {
@@ -915,8 +915,8 @@ struct bbslist {
* Last Callers Control Structure (lastcall.data)
*/
struct lastcallershdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
};
struct lastcallers {
@@ -1002,7 +1002,7 @@ struct sysconfig {
/* before every d/l or u/l */
unsigned sysop_access; /* Sysop Access Security */
int password_length; /* Minimum Password Length */
long bbs_loglevel; /* Logging level for BBS */
int bbs_loglevel; /* Logging level for BBS */
int iPasswd_Char; /* Password Character */
int iQuota; /* User homedir quota in MB */
int idleout; /* Idleout Value */
@@ -1097,7 +1097,7 @@ struct sysconfig {
char xTimeRatio[7];
char xByteRatio[7];
long new_groups; /* Maximum newfiles groups */
int new_groups; /* Maximum newfiles groups */
int new_split; /* Split reports at KB. */
int new_force; /* Force split at KB. */
char startname[9]; /* BBS startup name */
@@ -1119,11 +1119,11 @@ struct sysconfig {
int OLR_MaxReq; /* Max nr of Freq's */
int tic_days; /* Keep on hold for n days */
char hatchpasswd[21]; /* Internal Hatch Passwd */
unsigned long xdrspace;
unsigned int xdrspace;
char xmgrname[5][21]; /* Areamgr names */
long tic_systems; /* Systems in database */
long tic_groups; /* Groups in database */
long tic_dupes; /* TIC dupes dabase size */
int tic_systems; /* Systems in database */
int tic_groups; /* Groups in database */
int tic_dupes; /* TIC dupes dabase size */
char badtic[65]; /* Bad TIC's path */
char ticout[65]; /* TIC queue */
@@ -1133,7 +1133,7 @@ struct sysconfig {
int maxarcsize; /* Maximum archive size */
int toss_old; /* Reject older then days */
char xtoss_log[11];
long util_loglevel; /* Logging level for utils */
int util_loglevel; /* Logging level for utils */
char badboard[65]; /* Bad Mail board */
char dupboard[65]; /* Dupe Mail board */
char popnode[65]; /* Node with pop3 boxes */
@@ -1143,8 +1143,8 @@ struct sysconfig {
int defmsgs; /* Default purge messages */
int defdays; /* Default purge days */
int freespace; /* Free diskspace in MBytes */
long toss_systems; /* Systems in database */
long toss_groups; /* Groups in database */
int toss_systems; /* Systems in database */
int toss_groups; /* Groups in database */
char xareamgr[5][21]; /* Areamgr names */
/* Flags */
@@ -1152,10 +1152,10 @@ struct sysconfig {
fidoaddr aka[40]; /* Fidonet AKA's */
unsigned short akavalid[40]; /* Fidonet AKA valid/not */
long cico_loglevel; /* Mailer loglevel */
long timeoutreset; /* Reset timeout */
long timeoutconnect; /* Connect timeout */
long dialdelay; /* Delay between calls */
int cico_loglevel; /* Mailer loglevel */
int timeoutreset; /* Reset timeout */
int timeoutconnect; /* Connect timeout */
int dialdelay; /* Delay between calls */
unsigned NoFreqs : 1; /* Don't allow requests */
unsigned NoCall : 1; /* Don't call */
unsigned NoMD5 : 1; /* Don't do MD5 */
@@ -1172,7 +1172,7 @@ struct sysconfig {
unsigned xNoIFC : 1;
char IP_Phone[21]; /* TCP/IP phonenumber */
unsigned long IP_Speed; /* TCP/IP linespeed */
unsigned int IP_Speed; /* TCP/IP linespeed */
char IP_Flags[31]; /* TCP/IP EMSI flags */
int Req_Files; /* Maximum files request */
int Req_MBytes; /* Maximum MBytes request */
@@ -1232,7 +1232,7 @@ struct sysconfig {
unsigned dontregate : 1; /* Don't regate gated msgs */
char nntpuser[16]; /* NNTP username */
char nntppass[16]; /* NNTP password */
long nntpdupes; /* NNTP dupes database size */
int nntpdupes; /* NNTP dupes database size */
int newsfeed; /* Newsfeed mode */
int maxarticles; /* Default max articles */
char bbs_macros[65]; /* Default macros path */
@@ -1266,14 +1266,14 @@ struct sysconfig {
* Limits Control Structure (limits.data)
*/
struct limitshdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
};
struct limits {
unsigned long Security; /* Security Level */
long Time; /* Amount of time per call */
unsigned long DownK; /* Download KB per call */
unsigned int Security; /* Security Level */
int Time; /* Amount of time per call */
unsigned int DownK; /* Download KB per call */
unsigned int DownF; /* Download files per call */
char Description[41]; /* Description for level */
unsigned Available : 1; /* Is this limit available */
@@ -1315,7 +1315,7 @@ struct menufile {
unsigned SingleUser : 1; /* Single user door */
unsigned HideDoor : 1; /* Hide door from lists */
#endif
long xUnused;
int xUnused;
int HiForeGnd; /* High ForeGround color */
int HiBackGnd; /* High ForeGround color */
int ForeGnd; /* Normal ForeGround color */
@@ -1329,7 +1329,7 @@ struct menufile {
*/
struct newsdupes {
char NewsGroup[65]; /* Name of the group */
unsigned long Crc; /* CRC32 of msgid */
unsigned int Crc; /* CRC32 of msgid */
};
@@ -1339,10 +1339,10 @@ struct newsdupes {
* This is also used for echomail, netmail and news
*/
struct msgareashdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
long syssize; /* Size for systems */
time_t lastupd; /* Last date stats updated */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
int syssize; /* Size for systems */
int32_t lastupd; /* Last date stats updated */
};
struct msgareas {
@@ -1384,8 +1384,8 @@ struct msgareas {
unsigned xUplDisc : 1;
statcnt Received; /* Received messages */
statcnt Posted; /* Posted messages */
time_t LastRcvd; /* Last time msg received */
time_t LastPosted; /* Last time msg posted */
int32_t LastRcvd; /* Last time msg received */
int32_t LastPosted; /* Last time msg posted */
char Newsgroup[81]; /* Newsgroup/Mailinglist */
char xDistribution[17]; /* Ng distribution */
char xModerator[65];
@@ -1393,7 +1393,7 @@ struct msgareas {
int Charset; /* FTN characterset */
int MaxArticles; /* Max. newsarticles to get */
securityrec LinkSec; /* Link security flags */
time_t Created; /* Area creation date */
int32_t Created; /* Area creation date */
};
@@ -1402,8 +1402,8 @@ struct msgareas {
* Structure for Language file (language.data)
*/
struct languagehdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
};
struct language {
@@ -1434,8 +1434,8 @@ struct langdata {
* Fidonet Networks (fidonet.data)
*/
struct _fidonethdr {
long hdrsize; /* Size of header record */
long recsize; /* Size of records */
int hdrsize; /* Size of header record */
int recsize; /* Size of records */
};
typedef struct _seclist {
@@ -1461,8 +1461,8 @@ struct _fidonet {
* Archiver programs (archiver.data)
*/
struct _archiverhdr {
long hdrsize; /* Size of header record */
long recsize; /* Size of records */
int hdrsize; /* Size of header record */
int recsize; /* Size of records */
};
struct _archiver {
@@ -1486,8 +1486,8 @@ struct _archiver {
* Virus scanners (virscan.data)
*/
struct _virscanhdr {
long hdrsize; /* Size of header record */
long recsize; /* Size of records */
int hdrsize; /* Size of header record */
int recsize; /* Size of records */
};
struct _virscan {
@@ -1505,8 +1505,8 @@ struct _virscan {
* TTY information
*/
struct _ttyinfohdr {
long hdrsize; /* Size of header record */
long recsize; /* Size of records */
int hdrsize; /* Size of header record */
int recsize; /* Size of records */
};
struct _ttyinfo {
@@ -1523,7 +1523,7 @@ struct _ttyinfo {
unsigned callout : 1; /* Callout allowed */
char modem[31]; /* Modem type */
char name[36]; /* EMSI line name */
long portspeed; /* Locked portspeed */
int portspeed; /* Locked portspeed */
};
@@ -1532,8 +1532,8 @@ struct _ttyinfo {
* Modem definitions.
*/
struct _modemhdr {
long hdrsize; /* Size of header record */
long recsize; /* Size of records */
int hdrsize; /* Size of header record */
int recsize; /* Size of records */
};
struct _modem {
@@ -1559,28 +1559,28 @@ struct _modem {
* Structure for TIC areas (tic.data)
*/
struct _tichdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
long syssize; /* Size for systems */
time_t lastupd; /* Last statistic update */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
int syssize; /* Size for systems */
int lastupd; /* Last statistic update */
};
struct _tic {
char Name[21]; /* Area name */
char Comment[56]; /* Area comment */
long FileArea; /* The BBS filearea */
int FileArea; /* The BBS filearea */
char Message[15]; /* Message file */
char Group[13]; /* FDN group */
int KeepLatest; /* Keep latest n files */
long xOld[6];
time_t AreaStart; /* Startdate */
int xOld[6];
int32_t AreaStart; /* Startdate */
fidoaddr Aka; /* Fidonet address */
char Convert[6]; /* Archiver to convert */
time_t LastAction; /* Last Action in this area*/
int32_t LastAction; /* Last Action in this area*/
char Banner[15]; /* Banner file */
long xUnitCost;
long xUnitSize;
long xAddPerc;
int xUnitCost;
int xUnitSize;
int xAddPerc;
unsigned Replace : 1; /* Allow Replace */
unsigned DupCheck : 1; /* Dupe Check */
unsigned Secure : 1; /* Check for secure system */
@@ -1608,11 +1608,11 @@ struct _tic {
* Nodes, up- and downlinks. (nodes.data)
*/
struct _nodeshdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
long filegrp; /* Size for file groups */
long mailgrp; /* Size for mail groups */
time_t lastupd; /* Last statistic update */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
int filegrp; /* Size for file groups */
int mailgrp; /* Size for mail groups */
int lastupd; /* Last statistic update */
};
struct _nodes {
@@ -1663,13 +1663,13 @@ struct _nodes {
unsigned IgnHold : 1; /* Ignore Hold/Down status */
char xExtra[94];
time_t StartDate; /* Node start date */
time_t LastDate; /* Last action date */
long xCredit; /* Node's credit */
long xDebet; /* Node's debet */
long xAddPerc; /* Add Percentage */
long xWarnLevel; /* Warning level */
long xStopLevel; /* Stop level */
int32_t StartDate; /* Node start date */
int32_t LastDate; /* Last action date */
int xCredit; /* Node's credit */
int xDebet; /* Node's debet */
int xAddPerc; /* Add Percentage */
int xWarnLevel; /* Warning level */
int xStopLevel; /* Stop level */
fidoaddr RouteVia; /* Routing address */
int Language; /* Language for netmail */
statcnt FilesSent; /* Files sent to node */
@@ -1743,9 +1743,9 @@ struct _nodes {
* Groups for file areas. (fgroups.data)
*/
struct _fgrouphdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
time_t lastupd; /* Last statistics update */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
int lastupd; /* Last statistics update */
};
struct _fgroup {
@@ -1756,16 +1756,16 @@ struct _fgroup {
unsigned xDivideCost : 1; /* Divide cost over links */
fidoaddr UseAka; /* Aka to use */
fidoaddr UpLink; /* Uplink address */
long xUnitCost; /* Cost per unit */
long xUnitSize; /* Size per unit */
long xAddProm; /* Promillage to add */
time_t StartDate; /* Start Date */
time_t LastDate; /* Last active date */
int xUnitCost; /* Cost per unit */
int xUnitSize; /* Size per unit */
int xAddProm; /* Promillage to add */
int StartDate; /* Start Date */
int LastDate; /* Last active date */
char AreaFile[13]; /* Areas filename */
statcnt Files; /* Files processed */
statcnt KBytes; /* KBytes msgs or files */
/* Auto add area options */
long StartArea; /* Lowest filearea nr. */
int StartArea; /* Lowest filearea nr. */
char Banner[15]; /* Banner to add */
char Convert[6]; /* Archiver to convert */
unsigned FileGate : 1; /* List is in filegate fmt */
@@ -1800,9 +1800,9 @@ struct _fgroup {
* Groups for message areas. (mgroups.data)
*/
struct _mgrouphdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
time_t lastupd; /* Last statistics update */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
int lastupd; /* Last statistics update */
};
struct _mgroup {
@@ -1812,9 +1812,9 @@ struct _mgroup {
unsigned Deleted : 1; /* Group is deleted */
fidoaddr UseAka; /* Aka to use */
fidoaddr UpLink; /* Uplink address */
long xOld[6];
time_t StartDate; /* Start Date */
time_t LastDate; /* Last active date */
int xOld[6];
int StartDate; /* Start Date */
int LastDate; /* Last active date */
char AreaFile[13]; /* Areas filename */
statcnt MsgsRcvd; /* Received messages */
statcnt MsgsSent; /* Sent messages */
@@ -1843,8 +1843,8 @@ struct _mgroup {
* Groups for newfiles announce. (ngroups.data)
*/
struct _ngrouphdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
};
struct _ngroup {
@@ -1860,9 +1860,9 @@ struct _ngroup {
* Hatch manager (hatch.data)
*/
struct _hatchhdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
time_t lastupd; /* Last stats update */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
int lastupd; /* Last stats update */
};
struct _hatch {
@@ -1896,8 +1896,8 @@ typedef enum {
} MAGICTYPE;
struct _magichdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
};
struct _magic {
@@ -1919,9 +1919,9 @@ struct _magic {
* Newfile reports (newfiles.data)
*/
struct _newfileshdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
long grpsize; /* Size of groups */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
int grpsize; /* Size of groups */
};
struct _newfiles {
@@ -1945,8 +1945,8 @@ struct _newfiles {
* Scanmanager (scanmgr.data)
*/
struct _scanmgrhdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
};
struct _scanmgr {
@@ -1976,8 +1976,8 @@ struct _filerecord {
char Name[13]; /* File Name */
char LName[81]; /* Long FileName */
off_t Size; /* File Size */
unsigned long SizeKb; /* File Size in Kb */
time_t Fdate; /* File Date */
unsigned int SizeKb; /* File Size in Kb */
int32_t Fdate; /* File Date */
char Origin[24]; /* Origin system */
char From[24]; /* From system */
char Crc[9]; /* CRC 32 */
@@ -2003,10 +2003,10 @@ struct _history {
char sysop[36]; /* Sysop name */
char location[36]; /* System location */
char tty[7]; /* Tty of connection */
time_t online; /* Starttime of session */
time_t offline; /* Endtime of session */
unsigned long sent_bytes; /* Bytes sent */
unsigned long rcvd_bytes; /* Bytes received */
int online; /* Starttime of session */
int offline; /* Endtime of session */
unsigned int sent_bytes; /* Bytes sent */
unsigned int rcvd_bytes; /* Bytes received */
int cost; /* Session cost */
unsigned inbound : 1; /* Inbound session */
};
@@ -2023,8 +2023,8 @@ struct _history {
* extra things can be done for netmail to a specific person.
*/
struct _routehdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
};
@@ -2044,8 +2044,8 @@ struct _route {
* IBC servers to connect to.
*/
struct _ibcsrvhdr {
long hdrsize; /* Size of header */
long recsize; /* Size of record */
int hdrsize; /* Size of header */
int recsize; /* Size of record */
};
@@ -2067,7 +2067,7 @@ struct _ibcsrv {
char *xmalloc(size_t);
char *xstrcpy(char *);
char *xstrcat(char *, char *);
void InitClient(char *, char *, char *, char *, long, char *, char *, char *);
void InitClient(char *, char *, char *, char *, int, char *, char *, char *);
void ExitClient(int);
void SockS(const char *, ...);
char *SockR(const char *, ...);
@@ -2082,8 +2082,8 @@ void UserCity(pid_t, char *, char *);
void DoNop(void);
void Nopper(void);
void Altime(int);
int enoughspace(unsigned long);
unsigned long sequencer(void);
int enoughspace(unsigned int);
unsigned int sequencer(void);
char *printable(char *, int);
char *printablec(char);
@@ -2103,12 +2103,12 @@ int socket_shutdown(pid_t);
/*
* From crc.c
*/
unsigned long crc32ccitt(char *, int);
unsigned int crc32ccitt(char *, int);
unsigned short crc16ccitt(char *, int);
unsigned long str_crc32(char *str);
unsigned long StringCRC32(char *);
unsigned long upd_crc32(char *buf, unsigned long crc, int len);
unsigned long norm_crc32(unsigned long crc);
unsigned int str_crc32(char *str);
unsigned int StringCRC32(char *);
unsigned int upd_crc32(char *buf, unsigned int crc, int len);
unsigned int norm_crc32(unsigned int crc);
unsigned short crc16xmodem(char *, int);
unsigned char checksum(char *, int);
@@ -2163,14 +2163,14 @@ typedef struct _ftnmsg {
int ftnorigin;
faddr *to;
faddr *from;
time_t date;
int date;
char *subj;
char *msgid_s;
char *msgid_a;
unsigned long msgid_n;
unsigned int msgid_n;
char *reply_s;
char *reply_a;
unsigned long reply_n;
unsigned int reply_n;
char *origin;
char *area;
} ftnmsg;
@@ -2281,7 +2281,7 @@ int getheader(faddr *, faddr *, FILE *, char *, int);
/*
* From gmtoffset.c
*/
long gmt_offset(time_t);
int gmt_offset(time_t);
char *gmtoffset(time_t);
char *str_time(time_t);
char *t_elapsed(time_t, time_t);
@@ -2294,8 +2294,8 @@ int file_cp(char *from, char *to);
int file_rm(char *path);
int file_mv(char *oldpath, char *newpath);
int file_exist(char *path, int mode);
long file_size(char *path);
long file_crc(char *path, int);
int file_size(char *path);
int file_crc(char *path, int);
time_t file_time(char *path);
int mkdirs(char *name, mode_t);
int getfilecase(char *, char *);
@@ -2337,7 +2337,7 @@ char *arcname(faddr *, unsigned short, int);
void mbse_Setraw(void); /* Set raw mode */
void mbse_Unsetraw(void); /* Unset raw mode */
unsigned char mbse_Getone(void); /* Get one raw character */
long mbse_Speed(void); /* Get (locked) tty speed */
int mbse_Speed(void); /* Get (locked) tty speed */
int mbse_Waitchar(unsigned char *, int); /* Wait n * 10mSec for char */
int mbse_Escapechar(unsigned char *); /* Escape sequence test */
unsigned char mbse_Readkey(void); /* Read a translated key */
@@ -2448,8 +2448,8 @@ char *bgets(char *, int, FILE *);
*/
typedef struct _TIMEINFO {
time_t time;
long usec;
long tzone;
int usec;
int tzone;
} TIMEINFO;
/*
@@ -2461,7 +2461,7 @@ typedef enum _MERIDIAN {
typedef union {
time_t Number;
int32_t Number;
enum _MERIDIAN Meridian;
} CYYSTYPE;

View File

@@ -64,24 +64,24 @@ char *strupr (char *s)
long filelength(int fd)
int filelength(int fd)
{
long retval = -1L;
struct stat buf;
int retval = -1L;
struct stat buf;
if (fd != -1) {
fstat(fd, &buf);
retval = buf.st_size;
}
if (fd != -1) {
fstat(fd, &buf);
retval = buf.st_size;
}
return (retval);
return (retval);
}
long tell(int fd)
int tell(int fd)
{
long retval = -1L;
int retval = -1L;
if (fd != -1)
retval = lseek(fd, 0L, SEEK_CUR);
@@ -122,7 +122,7 @@ void Msg_Close(void)
/*
* Delete message number
*/
int Msg_Delete(unsigned long ulMsg)
int Msg_Delete(unsigned int ulMsg)
{
if (!MsgBase.Locked)
return FALSE;
@@ -152,14 +152,14 @@ int Msg_GetLastRead(lastread *LR)
/*
* Get highest message number
*/
unsigned long Msg_Highest(void)
unsigned int Msg_Highest(void)
{
return MsgBase.Highest = JAM_Highest();
}
int Msg_Lock(unsigned long ulTimeout)
int Msg_Lock(unsigned int ulTimeout)
{
return MsgBase.Locked = JAM_Lock(ulTimeout);
}
@@ -169,7 +169,7 @@ int Msg_Lock(unsigned long ulTimeout)
/*
* Get lowest message number
*/
unsigned long Msg_Lowest(void)
unsigned int Msg_Lowest(void)
{
return MsgBase.Lowest = JAM_Lowest();
}
@@ -190,7 +190,7 @@ int Msg_NewLastRead(lastread LR)
int Msg_Next(unsigned long * ulMsg)
int Msg_Next(unsigned int * ulMsg)
{
return JAM_Next(ulMsg);
}
@@ -200,7 +200,7 @@ int Msg_Next(unsigned long * ulMsg)
/*
* Return number of messages
*/
unsigned long Msg_Number(void)
unsigned int Msg_Number(void)
{
return MsgBase.Total = JAM_Number();
}
@@ -244,14 +244,14 @@ void Msg_Pack(void)
int Msg_Previous (unsigned long * ulMsg)
int Msg_Previous (unsigned int * ulMsg)
{
return JAM_Previous(ulMsg);
}
int Msg_ReadHeader (unsigned long ulMsg)
int Msg_ReadHeader (unsigned int ulMsg)
{
return JAM_ReadHeader(ulMsg);
}
@@ -261,7 +261,7 @@ int Msg_ReadHeader (unsigned long ulMsg)
/*
* Read message
*/
int Msg_Read(unsigned long ulMsg, int nWidth)
int Msg_Read(unsigned int ulMsg, int nWidth)
{
return JAM_Read(ulMsg, nWidth);
}
@@ -292,7 +292,7 @@ void Msg_UnLock(void)
/*
* Write message header
*/
int Msg_WriteHeader (unsigned long ulMsg)
int Msg_WriteHeader (unsigned int ulMsg)
{
if (!MsgBase.Locked)
return FALSE;
@@ -318,8 +318,8 @@ void Msg_Write(FILE *fp)
typedef struct {
unsigned long Subject;
unsigned long Number;
unsigned int Subject;
unsigned int Number;
} MSGLINK;
@@ -380,7 +380,7 @@ void msg_colour(int fg, int bg)
int Msg_Link(char *Path, int do_quiet, int slow_util)
{
int i, m, msg_link = 0;
unsigned long Number, Prev, Next, Crc, Total;
unsigned int Number, Prev, Next, Crc, Total;
char Temp[128], *p;
MSGLINK *Link;
@@ -415,13 +415,13 @@ int Msg_Link(char *Path, int do_quiet, int slow_util)
i++;
if (((i % 10) == 0) && (!do_quiet)) {
printf("%6d / %6lu\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total);
printf("%6d / %6u\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total);
fflush(stdout);
}
} while(Msg_Next(&Number) == TRUE);
if (!do_quiet) {
printf("%6d / %6lu\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total);
printf("%6d / %6u\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total);
fflush(stdout);
}
Number = Msg_Lowest();
@@ -445,7 +445,7 @@ int Msg_Link(char *Path, int do_quiet, int slow_util)
}
if (((i % 10) == 0) && (!do_quiet)) {
printf("%6d / %6lu\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total);
printf("%6d / %6u\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total);
fflush(stdout);
}
@@ -461,7 +461,7 @@ int Msg_Link(char *Path, int do_quiet, int slow_util)
} while(Msg_Next(&Number) == TRUE);
if (!do_quiet) {
printf("%6d / %6lu\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total);
printf("%6d / %6u\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total);
fflush(stdout);
}

View File

@@ -14,8 +14,8 @@
* Global message buffer
*/
typedef struct _msgbuf {
unsigned long Id;
unsigned long Current;
unsigned int Id;
unsigned int Current;
char From[101]; /* From name */
char To[101]; /* To name */
char Subject[101]; /* Message subject */
@@ -56,15 +56,15 @@ typedef struct _msgbuf {
time_t Read; /* Date message is received */
char FromAddress[101]; /* From address */
char ToAddress[101]; /* To address */
unsigned long Reply; /* Message is reply to */
unsigned long Original; /* Original message */
unsigned long MsgIdCRC; /* Message Id CRC */
unsigned long ReplyCRC; /* Reply CRC */
unsigned int Reply; /* Message is reply to */
unsigned int Original; /* Original message */
unsigned int MsgIdCRC; /* Message Id CRC */
unsigned int ReplyCRC; /* Reply CRC */
char Msgid[81]; /* Msgid string */
char Replyid[81]; /* Replyid string */
char ReplyAddr[81]; /* Gated Reply Address */
char ReplyTo[81]; /* Gated Reply To */
long Size; /* Message size during write*/
int Size; /* Message size during write*/
} msgbuf;
@@ -76,10 +76,10 @@ typedef struct _msgbase {
char Path[PATH_MAX]; /* Path to message base */
unsigned Open : 1; /* If base is open */
unsigned Locked : 1; /* If base is locked */
unsigned long LastNum; /* Lastread message number */
unsigned long Lowest; /* Lowest message number */
unsigned long Highest; /* Highest message number */
unsigned long Total; /* Total number of msgs */
unsigned int LastNum; /* Lastread message number */
unsigned int Lowest; /* Lowest message number */
unsigned int Highest; /* Highest message number */
unsigned int Total; /* Total number of msgs */
} msgbase;
@@ -88,10 +88,10 @@ typedef struct _msgbase {
* LastRead structure
*/
typedef struct _lastread {
unsigned long UserCRC; /* CRC32 lowercase username */
unsigned long UserID; /* Unique user-id */
unsigned long LastReadMsg; /* Last Read message number */
unsigned long HighReadMsg; /* Highes read message */
unsigned int UserCRC; /* CRC32 lowercase username */
unsigned int UserID; /* Unique user-id */
unsigned int LastReadMsg; /* Last Read message number */
unsigned int HighReadMsg; /* Highes read message */
} lastread;
@@ -112,8 +112,8 @@ char szWrp[MAX_LINE_LENGTH + 1];
*/
char *strlwr(char *);
char *strupr(char *);
long filelength(int);
long tell(int);
int filelength(int);
int tell(int);
char *Fgets(char *, int, FILE *);
@@ -123,24 +123,24 @@ char *Fgets(char *, int, FILE *);
*/
int Msg_AddMsg(void);
void Msg_Close(void);
int Msg_Delete(unsigned long);
int Msg_Delete(unsigned int);
void Msg_DeleteMsgBase(char *);
int Msg_GetLastRead(lastread *);
unsigned long Msg_Highest(void);
int Msg_Lock(unsigned long);
unsigned long Msg_Lowest(void);
unsigned int Msg_Highest(void);
int Msg_Lock(unsigned int);
unsigned int Msg_Lowest(void);
void Msg_New(void);
int Msg_NewLastRead(lastread);
int Msg_Next(unsigned long *);
unsigned long Msg_Number(void);
int Msg_Next(unsigned int *);
unsigned int Msg_Number(void);
int Msg_Open(char *);
void Msg_Pack(void);
int Msg_Previous(unsigned long *);
int Msg_ReadHeader(unsigned long);
int Msg_Read(unsigned long, int);
int Msg_Previous(unsigned int *);
int Msg_ReadHeader(unsigned int);
int Msg_Read(unsigned int, int);
int Msg_SetLastRead(lastread);
void Msg_UnLock(void);
int Msg_WriteHeader(unsigned long);
int Msg_WriteHeader(unsigned int);
void Msg_Write(FILE *);
int Msg_Link(char *, int, int);

View File

@@ -40,7 +40,7 @@ static char *k, *v;
static char *nlpath = NULL;
static int nlinitdone = FALSE;
static int linecnt = 0;
static unsigned long mypots = 0, myisdn = 0, mytcpip =0;
static unsigned int mypots = 0, myisdn = 0, mytcpip =0;
static int getkwd(char**);
@@ -76,12 +76,12 @@ static struct _keytab {
/*
* Get a keyword, string, unsigned long
* Get a keyword, string, unsigned int
*/
static int getkwd(char **dest)
{
char *p;
unsigned long tmp;
unsigned int tmp;
nodelist_flag **tmpm;
for (p = v; *p && !isspace(*p); p++);
@@ -107,12 +107,12 @@ static int getkwd(char **dest)
/*
* Get a keyword, string, unsigned long, unsigned long
* Get a keyword, string, unsigned int, unsigned int
*/
static int getmdm(char **dest)
{
char *p, *q;
unsigned long tmp1, tmp2;
unsigned int tmp1, tmp2;
nodelist_modem **tmpm;
for (p = v; *p && !isspace(*p); p++);
@@ -202,12 +202,12 @@ static int getdom(char **dest)
/*
* Get a keyword, string, string, unsigned long
* Get a keyword, string, string, unsigned int
*/
static int getsrv(char **dest)
{
char *p, *q;
unsigned long tmp;
unsigned int tmp;
nodelist_service **tmpm;
for (p = v; *p && !isspace(*p); p++);
@@ -540,7 +540,7 @@ node *getnlent(faddr *addr)
char *mydomain, *path, *r;
struct _nlfil fdx;
struct _nlidx ndx;
long lowest, highest, current;
int lowest, highest, current;
struct _nodeshdr ndhdr;
static struct _nodes nd;
nodelist_modem **tmpm;
@@ -548,7 +548,7 @@ node *getnlent(faddr *addr)
nodelist_service **tmps;
nodelist_array **tmpa, **tmpaa;
nodelist_domsuf **tmpd;
unsigned long tport = 0;
unsigned int tport = 0;
Syslog('n', "getnlent: %s", ascfnode(addr,0xff));
@@ -1090,7 +1090,7 @@ node *getnlent(faddr *addr)
* No optional port number, add one from the default
* for this protocol.
*/
snprintf(tbuf, 256, ":%lu", tport);
snprintf(tbuf, 256, ":%u", tport);
nodebuf.url = xstrcat(nodebuf.url, tbuf);
}
@@ -1146,7 +1146,7 @@ node *getnlent(faddr *addr)
return &nodebuf;
badsyntax:
WriteError("nodelist %d offset +%lu: bad syntax in line \"%s\"", ndx.fileno, (unsigned long)ndx.offset, buf);
WriteError("nodelist %d offset +%lu: bad syntax in line \"%s\"", ndx.fileno, (unsigned int)ndx.offset, buf);
/* fallthrough */
retdummy:
@@ -1165,7 +1165,7 @@ retdummy:
void olflags(unsigned long flags)
void olflags(unsigned int flags)
{
char *t;
nodelist_flag **tmpm;
@@ -1183,7 +1183,7 @@ void olflags(unsigned long flags)
void rqflags(unsigned long flags)
void rqflags(unsigned int flags)
{
char *t;
nodelist_flag **tmpm;
@@ -1208,7 +1208,7 @@ void rqflags(unsigned long flags)
void moflags(unsigned long flags)
void moflags(unsigned int flags)
{
char *t;
nodelist_modem **tmpm;
@@ -1228,7 +1228,7 @@ void moflags(unsigned long flags)
void diflags(unsigned long flags)
void diflags(unsigned int flags)
{
char *t;
nodelist_modem **tmpm;
@@ -1248,7 +1248,7 @@ void diflags(unsigned long flags)
void ipflags(unsigned long flags)
void ipflags(unsigned int flags)
{
char *t;
nodelist_modem **tmpm;

View File

@@ -24,11 +24,11 @@ typedef struct _node {
char *sysop; /* Sysop name */
char *phone; /* Phone number */
unsigned speed; /* Baudrate */
unsigned long mflags; /* Modem flags */
unsigned long dflags; /* ISDN flags */
unsigned long iflags; /* TCP-IP flags */
unsigned long oflags; /* Online flags */
unsigned long xflags; /* Request flags */
unsigned int mflags; /* Modem flags */
unsigned int dflags; /* ISDN flags */
unsigned int iflags; /* TCP-IP flags */
unsigned int oflags; /* Online flags */
unsigned int xflags; /* Request flags */
char *uflags[MAXUFLAGS]; /* User flags */
int t1; /* T flag, first char */
int t2; /* T flag, second char */
@@ -47,15 +47,15 @@ typedef struct _node {
typedef struct _nodelist_flag {
struct _nodelist_flag *next;
char *name;
unsigned long value;
unsigned int value;
} nodelist_flag;
typedef struct _nodelist_modem {
struct _nodelist_modem *next;
char *name;
unsigned long mask;
unsigned long value;
unsigned int mask;
unsigned int value;
} nodelist_modem;
@@ -76,8 +76,8 @@ typedef struct _nodelist_service {
struct _nodelist_service *next;
char *flag;
char *service;
unsigned long defport; /* Configured default port */
unsigned long tmpport; /* Override port for call */
unsigned int defport; /* Configured default port */
unsigned int tmpport; /* Override port for call */
} nodelist_service;
@@ -122,11 +122,11 @@ nodelist_service *nl_service;
int initnl(void);
void deinitnl(void);
node *getnlent(faddr *);
void olflags(unsigned long);
void rqflags(unsigned long);
void moflags(unsigned long);
void diflags(unsigned long);
void ipflags(unsigned long);
void olflags(unsigned int);
void rqflags(unsigned int);
void moflags(unsigned int);
void diflags(unsigned int);
void ipflags(unsigned int);
#endif

View File

@@ -104,7 +104,7 @@ int nodelock(faddr *addr, pid_t mypid)
*/
ltime = file_time(fn);
now = time(NULL);
if (CFG.ZeroLocks && (rc != 1) && (((unsigned long)now - (unsigned long)ltime) > 21600)) {
if (CFG.ZeroLocks && (rc != 1) && (((unsigned int)now - (unsigned int)ltime) > 21600)) {
Syslog('+', "Found zero byte lock older then 6 hours for %s, unlink", ascfnode(addr,0x1f));
unlink(fn);
} else if (CFG.ZeroLocks && (rc != 1)) {
@@ -115,7 +115,7 @@ int nodelock(faddr *addr, pid_t mypid)
} else if (kill(pid, 0) && (errno == ESRCH)) {
Syslog('+', "Found stale bsy file for %s, unlink", ascfnode(addr,0x1f));
unlink(fn);
} else if (((unsigned long)now - (unsigned long)ltime) > 21600) {
} else if (((unsigned int)now - (unsigned int)ltime) > 21600) {
Syslog('+', "Found lock older then 6 hours for %s, unlink", ascfnode(addr,0x1f));
unlink(fn);
} else {

View File

@@ -1408,8 +1408,8 @@ date_error(s)
int GetTimeInfo(TIMEINFO *Now)
{
static time_t NextHour;
static long LastTzone;
static int32_t NextHour;
static int LastTzone;
struct tm *tm;
int secondsUntilNextHour;
#if defined(HAVE_GETTIMEOFDAY)

View File

@@ -257,7 +257,7 @@ char *arcname(faddr *addr, unsigned short Zone, int ARCmailCompat)
* Generate ARCfile name from the CRC of the ASCII string
* of the node address.
*/
snprintf(p, PATH_MAX -1, "/%08lx.%s0", StringCRC32(ascfnode(addr, 0x1f)), ext);
snprintf(p, PATH_MAX -1, "/%08x.%s0", StringCRC32(ascfnode(addr, 0x1f)), ext);
} else {
if (addr->point) {
snprintf(p, PATH_MAX -1, "/%04x%04x.%s0",

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Raw I/O routines.
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -117,7 +117,7 @@ unsigned char mbse_Getone()
/*
* Read the (locked) speed from the tty
*/
long mbse_Speed(void)
int mbse_Speed(void)
{
speed_t mspeed;

View File

@@ -143,7 +143,7 @@ char *rfcdate(time_t now)
struct tm ptm, gtm;
char sign;
int hr, min;
long offset;
int offset;
if (!now)
now = time(NULL);

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Common string functions
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -40,12 +40,12 @@ char *padleft(char *str, int size, char pad)
static char temp[256];
strcpy(stri, str);
memset(temp, pad, (long)size);
memset(temp, pad, (size_t)size);
temp[size] = '\0';
if (strlen(stri) <= size)
memmove(temp, stri, (long)strlen(stri));
memmove(temp, stri, (size_t)strlen(stri));
else
memmove(temp, stri, (long)size);
memmove(temp, stri, (size_t)size);
return temp;
}
@@ -258,12 +258,12 @@ void strreplace(char *sStr, char *sFind, char *sReplace)
*/
char *StrTimeHM(time_t date)
{
static char ttime[6];
struct tm *l_d;
static char ttime[6];
struct tm *l_d;
l_d = localtime(&date);
snprintf(ttime, 6, "%02d:%02d", l_d->tm_hour, l_d->tm_min);
return ttime;
l_d = localtime(&date);
snprintf(ttime, 6, "%02d:%02d", l_d->tm_hour, l_d->tm_min);
return ttime;
}

View File

@@ -54,8 +54,8 @@ typedef enum {LINEEDIT, FSEDIT, EXTEDIT} MSGEDITOR;
*/
typedef struct _security {
unsigned int level; /* Security level */
unsigned long flags; /* Access flags */
unsigned long notflags; /* No Access flags */
unsigned int flags; /* Access flags */
unsigned int notflags; /* No Access flags */
} securityrec;
#endif
@@ -73,21 +73,21 @@ typedef struct _security {
* Users Control Structures (users.data)
*/
struct userhdr {
long hdrsize; /* Size of header */
long recsize; /* Size of records */
int hdrsize; /* Size of header */
int recsize; /* Size of records */
};
struct userrec {
char sUserName[36]; /* User First and Last Name */
char Name[9]; /* Unix name */
unsigned long xPassword;
unsigned int xPassword;
char sVoicePhone[20]; /* Voice Number */
char sDataPhone[20]; /* Data/Business Number */
char sLocation[28]; /* Users Location */
char address[3][41]; /* Users address */
char sDateOfBirth[12]; /* Date of Birth */
time_t tFirstLoginDate; /* Date of First Login */
time_t tLastLoginDate; /* Date of Last Login */
int32_t tFirstLoginDate; /* Date of First Login */
int32_t tLastLoginDate; /* Date of Last Login */
securityrec Security; /* User Security Level */
char sComment[81]; /* User Comment */
char sExpiryDate[12]; /* User Expiry Date */
@@ -113,9 +113,9 @@ struct userrec {
int iConnectTime; /* Connect time this call */
int iTimeUsed; /* Time used today */
int xScreenLen;
time_t tLastPwdChange; /* Date last password chg */
int32_t tLastPwdChange; /* Date last password chg */
unsigned xHangUps;
long Credit; /* Users credit */
int Credit; /* Users credit */
int Paged; /* Times paged today */
int MsgEditor; /* Message Editor to use */
int LastPktNum; /* Todays Last packet number*/
@@ -124,12 +124,12 @@ struct userrec {
int iLastFileArea; /* Number of last file area */
int iLastFileGroup; /* Number of last file group*/
char sProtocol[21]; /* Users default protocol */
unsigned long Downloads; /* Total number of d/l's */
unsigned long Uploads; /* Total number of uploads */
unsigned long UploadK; /* Upload KiloBytes */
unsigned long DownloadK; /* Download KiloBytes */
long DownloadKToday; /* KB Downloaded today */
long UploadKToday; /* KB Uploaded today */
unsigned int Downloads; /* Total number of d/l's */
unsigned int Uploads; /* Total number of uploads */
unsigned int UploadK; /* Upload KiloBytes */
unsigned int DownloadK; /* Download KiloBytes */
int DownloadKToday; /* KB Downloaded today */
int UploadKToday; /* KB Uploaded today */
int iTransferTime; /* Last file transfer time */
int iLastMsgArea; /* Number of last msg area */
int iLastMsgGroup; /* Number of last msg group */