First stage port to 64 bit
This commit is contained in:
parent
ac4e2dce0a
commit
1dfaf10c20
@ -8,6 +8,19 @@ development only. There are no secrets in this file because it's public
|
||||
available.
|
||||
|
||||
|
||||
Wordlengths.
|
||||
|
||||
From bits/types.h:
|
||||
|
||||
Here we assume what is presently the case in all the GCC configurations
|
||||
we support: long long is always 64 bits, long is always word/address size,
|
||||
and int is always 32 bits.
|
||||
|
||||
IOW: Never use long in the sources because it breaks between 32/64 bit
|
||||
hardware.
|
||||
|
||||
How about time_t, it seems an alias for long!
|
||||
|
||||
|
||||
CVS tags.
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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 */
|
||||
|
||||
|
||||
|
||||
|
44
lib/clcomm.c
44
lib/clcomm.c
@ -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());
|
||||
|
70
lib/crc.c
70
lib/crc.c
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
16
lib/dbdupe.c
16
lib/dbdupe.c
@ -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);
|
||||
|
34
lib/dbfdb.c
34
lib/dbfdb.c
@ -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);
|
||||
|
12
lib/dbmsgs.c
12
lib/dbmsgs.c
@ -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)
|
||||
|
10
lib/dbnode.c
10
lib/dbnode.c
@ -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)
|
||||
|
12
lib/dbtic.c
12
lib/dbtic.c
@ -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)
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
18
lib/ftnmsg.c
18
lib/ftnmsg.c
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
52
lib/jammsg.c
52
lib/jammsg.c
@ -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;
|
||||
|
20
lib/jammsg.h
20
lib/jammsg.h
@ -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
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
48
lib/mbfile.c
48
lib/mbfile.c
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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 *);
|
||||
|
344
lib/mbselib.h
344
lib/mbselib.h
@ -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;
|
||||
|
||||
|
54
lib/msg.c
54
lib/msg.c
@ -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);
|
||||
}
|
||||
|
||||
|
54
lib/msg.h
54
lib/msg.h
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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)
|
||||
|
@ -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",
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
30
lib/users.h
30
lib/users.h
@ -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 */
|
||||
|
@ -46,8 +46,8 @@
|
||||
|
||||
extern int carrier, online;
|
||||
extern time_t c_start, c_end;
|
||||
extern unsigned long sentbytes;
|
||||
extern unsigned long rcvdbytes;
|
||||
extern unsigned int sentbytes;
|
||||
extern unsigned int rcvdbytes;
|
||||
extern int Loaded;
|
||||
|
||||
int answer(char *stype)
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Purpose ...............: Fidonet mailer
|
||||
*
|
||||
*****************************************************************************
|
||||
* 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;
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
#ifndef _ATOUL_H
|
||||
#define _ATOUL_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
unsigned long atoul(char *);
|
||||
unsigned int atoul(char *);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -80,8 +80,8 @@ extern int crashme;
|
||||
int gotblock = 0;
|
||||
|
||||
|
||||
extern unsigned long sentbytes;
|
||||
extern unsigned long rcvdbytes;
|
||||
extern unsigned int sentbytes;
|
||||
extern unsigned int rcvdbytes;
|
||||
|
||||
typedef enum {RxWaitF, RxAccF, RxReceD, RxWriteD, RxEOB, RxDone} RxType;
|
||||
typedef enum {TxGNF, TxTryR, TxReadS, TxWLA, TxDone} TxType;
|
||||
@ -154,8 +154,8 @@ struct binkprec {
|
||||
unsigned short header; /* Frame header */
|
||||
int rc; /* General return code */
|
||||
|
||||
long rsize; /* Receiver filesize */
|
||||
long roffs; /* Receiver offset */
|
||||
int rsize; /* Receiver filesize */
|
||||
int roffs; /* Receiver offset */
|
||||
char *rname; /* Receiver filename */
|
||||
time_t rtime; /* Receiver filetime */
|
||||
FILE *rxfp; /* Receiver file */
|
||||
@ -174,13 +174,13 @@ struct binkprec {
|
||||
int stxpos; /* Transmitter start position */
|
||||
int txcompressed; /* Transmitter compressed bytes */
|
||||
int tmode; /* Transmitter compression mode */
|
||||
long tfsize; /* Transmitter filesize */
|
||||
int tfsize; /* Transmitter filesize */
|
||||
|
||||
int local_EOB; /* Local EOB sent */
|
||||
int remote_EOB; /* Got EOB from remote */
|
||||
int messages; /* Messages sent + rcvd */
|
||||
unsigned long nethold; /* Netmail on hold */
|
||||
unsigned long mailhold; /* Packed mail on hold */
|
||||
unsigned int nethold; /* Netmail on hold */
|
||||
unsigned int mailhold; /* Packed mail on hold */
|
||||
|
||||
int batchnr;
|
||||
int msgs_on_queue; /* Messages on the queue */
|
||||
@ -229,7 +229,7 @@ int binkp_expired(void); /* Timer expired? */
|
||||
int binkp_banner(int); /* Send system banner */
|
||||
int binkp_send_comp_opts(void); /* Send compression options */
|
||||
void binkp_set_comp_state(void); /* Set compression state */
|
||||
int binkp_recv_command(char *, unsigned long *, int *); /* Receive command frame */
|
||||
int binkp_recv_command(char *, unsigned int *, int *); /* Receive command frame */
|
||||
void parse_m_nul(char *); /* Parse M_NUL message */
|
||||
int binkp_poll_frame(void); /* Poll for a frame */
|
||||
void binkp_add_message(char *frame); /* Add cmd frame to queue */
|
||||
@ -390,7 +390,7 @@ SM_EDECL
|
||||
faddr *primary;
|
||||
char *p, *q, *pwd;
|
||||
int i, rc = 0, cmd, dupe, SendPass = FALSE, akas = 0;
|
||||
unsigned long bufl;
|
||||
unsigned int bufl;
|
||||
fa_list **tmp, *tmpa;
|
||||
faddr *fa, ra;
|
||||
callstat *cst;
|
||||
@ -664,7 +664,7 @@ SM_NAMES
|
||||
SM_EDECL
|
||||
char *p, *q, *pw;
|
||||
int i, rc, cmd, dupe, we_have_pwd = FALSE, akas = 0;
|
||||
unsigned long bufl;
|
||||
unsigned int bufl;
|
||||
fa_list **tmp, *tmpa;
|
||||
faddr *fa;
|
||||
callstat *cst;
|
||||
@ -1041,7 +1041,7 @@ int file_transfer(void)
|
||||
TrType binkp_receiver(void)
|
||||
{
|
||||
struct statfs sfs;
|
||||
long written;
|
||||
int written;
|
||||
off_t rxbytes;
|
||||
int bcmd, rc = 0;
|
||||
int rc1 = 0, nget = bp.blklen, zavail, nput;
|
||||
@ -1181,8 +1181,8 @@ TrType binkp_receiver(void)
|
||||
|
||||
if (statfs(tempinbound, &sfs) == 0) {
|
||||
if ((bp.rsize / (sfs.f_bsize + 1)) >= sfs.f_bfree) {
|
||||
Syslog('!', "Binkp: only %lu blocks free (need %lu) in %s for this file", sfs.f_bfree,
|
||||
(unsigned long)(bp.rsize / (sfs.f_bsize + 1)), tempinbound);
|
||||
Syslog('!', "Binkp: only %u blocks free (need %u) in %s for this file", sfs.f_bfree,
|
||||
(unsigned int)(bp.rsize / (sfs.f_bsize + 1)), tempinbound);
|
||||
bclosefile(FALSE);
|
||||
bp.rxfp = NULL; /* Force SKIP command */
|
||||
}
|
||||
@ -1521,10 +1521,10 @@ TrType binkp_transmitter(void)
|
||||
bp.txcompressed = 0;
|
||||
bp.tfsize = tmp->size;
|
||||
Syslog('+', "Binkp: send \"%s\" as \"%s\"", MBSE_SS(tmp->local), MBSE_SS(tmp->remote));
|
||||
Syslog('+', "Binkp: size %lu bytes, dated %s, comp %s",
|
||||
(unsigned long)tmp->size, date(tmp->date), cpstate[bp.tmode]);
|
||||
rc = binkp_send_command(MM_FILE, "%s %lu %ld %ld%s", MBSE_SS(tmp->remote),
|
||||
(unsigned long)tmp->size, (long)tmp->date, (unsigned long)tmp->offset, extra);
|
||||
Syslog('+', "Binkp: size %u bytes, dated %s, comp %s",
|
||||
(unsigned int)tmp->size, date(tmp->date), cpstate[bp.tmode]);
|
||||
rc = binkp_send_command(MM_FILE, "%s %u %d %d%s", MBSE_SS(tmp->remote),
|
||||
(unsigned int)tmp->size, (int)tmp->date, (unsigned int)tmp->offset, extra);
|
||||
if (rc) {
|
||||
bp.TxState = TxDone;
|
||||
return Failure;
|
||||
@ -1772,7 +1772,7 @@ int binkp_send_frame(int cmd, char *buf, int len)
|
||||
int rc, id;
|
||||
#ifdef HAVE_ZLIB_H
|
||||
int rcz, last;
|
||||
unsigned long zlen;
|
||||
uLongf zlen;
|
||||
char *zbuf;
|
||||
|
||||
if ((len >= BINKP_PLZ_BLOCK) && (bp.PLZwe == Active)) {
|
||||
@ -2077,7 +2077,7 @@ void binkp_set_comp_state(void)
|
||||
/*
|
||||
* Receive command frame
|
||||
*/
|
||||
int binkp_recv_command(char *buf, unsigned long *len, int *cmd)
|
||||
int binkp_recv_command(char *buf, unsigned int *len, int *cmd)
|
||||
{
|
||||
int b0, b1;
|
||||
|
||||
@ -2244,7 +2244,7 @@ int binkp_poll_frame(void)
|
||||
{
|
||||
int c, rc = 0, bcmd;
|
||||
#ifdef HAVE_ZLIB_H
|
||||
unsigned long zlen;
|
||||
uLongf zlen;
|
||||
char *zbuf;
|
||||
#endif
|
||||
|
||||
@ -2380,7 +2380,7 @@ int binkp_process_messages(void)
|
||||
int Found, rmode;
|
||||
char *lname, *ropts;
|
||||
time_t ltime;
|
||||
long lsize, loffs;
|
||||
int lsize, loffs;
|
||||
|
||||
Syslog('b', "Binkp: Process The Messages Queue Start");
|
||||
|
||||
|
@ -55,7 +55,7 @@ FILE *bopenfile(char *fname, time_t remtime, off_t remsize, off_t *resofs)
|
||||
|
||||
strcpy(ctt,date(remtime));
|
||||
|
||||
Syslog('b', "Binkp: bopenfile(\"%s\",%s,%lu)", MBSE_SS(fname), MBSE_SS(ctt), (unsigned long)remsize);
|
||||
Syslog('b', "Binkp: bopenfile(\"%s\",%s,%u)", MBSE_SS(fname), MBSE_SS(ctt), (unsigned int)remsize);
|
||||
|
||||
if ((fname == NULL) || (fname[0] == '\0')) {
|
||||
Syslog('+', "Binkp: bopenfile fname=NULL");
|
||||
@ -100,8 +100,8 @@ FILE *bopenfile(char *fname, time_t remtime, off_t remsize, off_t *resofs)
|
||||
temp = calloc(PATH_MAX, sizeof(char));
|
||||
snprintf(temp, PATH_MAX, "%s.state", infpath);
|
||||
if ((fp = fopen(temp, "w"))) {
|
||||
fprintf(fp, "%lu\n", (unsigned long)remtime);
|
||||
fprintf(fp, "%lu\n", (unsigned long)remsize);
|
||||
fprintf(fp, "%u\n", (unsigned int)remtime);
|
||||
fprintf(fp, "%u\n", (unsigned int)remsize);
|
||||
fclose(fp);
|
||||
}
|
||||
free(temp);
|
||||
@ -116,7 +116,7 @@ FILE *bopenfile(char *fname, time_t remtime, off_t remsize, off_t *resofs)
|
||||
freqname = xstrcat(freqname, fname);
|
||||
}
|
||||
|
||||
Syslog('b', "Binkp: opened file \"%s\", restart at %lu", infpath, (unsigned long)*resofs);
|
||||
Syslog('b', "Binkp: opened file \"%s\", restart at %u", infpath, (unsigned int)*resofs);
|
||||
return infp;
|
||||
}
|
||||
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
extern long configtime;
|
||||
extern long maxfsize;
|
||||
extern long maxmsize;
|
||||
extern int configtime;
|
||||
extern int maxfsize;
|
||||
extern int maxmsize;
|
||||
|
||||
|
||||
extern char *name;
|
||||
|
@ -45,8 +45,8 @@ extern time_t c_end;
|
||||
extern int online;
|
||||
extern int master;
|
||||
int carrier;
|
||||
extern long sentbytes;
|
||||
extern long rcvdbytes;
|
||||
extern int sentbytes;
|
||||
extern int rcvdbytes;
|
||||
extern int Loaded;
|
||||
|
||||
|
||||
|
@ -220,7 +220,7 @@ char *mkemsidat(int caller)
|
||||
p=xstrcat(p,phone?emsiencode(phone):(char *)"-Unpublished-");
|
||||
p=xstrcat(p,(char *)"][");
|
||||
if ((CFG.IP_Speed) && (emsi_local_protos & PROT_TCP))
|
||||
snprintf(cbuf,16,"%ld",CFG.IP_Speed);
|
||||
snprintf(cbuf,16,"%d",CFG.IP_Speed);
|
||||
else
|
||||
strcpy(cbuf,"9600");
|
||||
p=xstrcat(p,cbuf);
|
||||
@ -228,7 +228,7 @@ char *mkemsidat(int caller)
|
||||
p=xstrcat(p,flags?emsiencode(flags):(char *)"");
|
||||
p=xstrcat(p,(char *)"]}{TRX#}{[");
|
||||
tt = time(NULL);
|
||||
snprintf(cbuf,16,"%08lX", (unsigned long)mtime2sl(tt));
|
||||
snprintf(cbuf,16,"%08X", (unsigned int)mtime2sl(tt));
|
||||
p=xstrcat(p,cbuf);
|
||||
p=xstrcat(p,(char *)"]}{TZUTC}{[");
|
||||
p=xstrcat(p,gmtoffset(tt));
|
||||
@ -489,21 +489,21 @@ int scanemsidat(char *buf)
|
||||
} else
|
||||
Syslog('+', "remote TRX#: %s",p);
|
||||
} else if (strcasecmp(p, "TRAF") == 0) {
|
||||
unsigned long tt, tt1;
|
||||
unsigned int tt, tt1;
|
||||
|
||||
p = sel_brace(NULL);
|
||||
if (sscanf(p, "%08lx %08lx", &tt, &tt1) == 2) {
|
||||
if (sscanf(p, "%08x %08x", &tt, &tt1) == 2) {
|
||||
Syslog('+', "netmail : %u byte(s)", tt);
|
||||
Syslog('+', "echomail: %u byte(s)", tt1);
|
||||
} else {
|
||||
Syslog('+', "TRAF : %s", p);
|
||||
}
|
||||
} else if (strcasecmp(p, "MOH#") == 0) {
|
||||
unsigned long tt;
|
||||
unsigned int tt;
|
||||
|
||||
p = sel_brace(NULL);
|
||||
p = sel_bracket(p);
|
||||
if (sscanf(p, "%08lx", &tt) == 1)
|
||||
if (sscanf(p, "%08x", &tt) == 1)
|
||||
Syslog('+', "on hold : %u byte(s)", tt);
|
||||
else
|
||||
Syslog('+', "MOH# : %s", p);
|
||||
|
@ -53,7 +53,7 @@ static char *tmpkname(void)
|
||||
{
|
||||
static char buf[16];
|
||||
|
||||
snprintf(buf,16,"%08lx.pkt", sequencer());
|
||||
snprintf(buf,16,"%08x.pkt", sequencer());
|
||||
return buf;
|
||||
}
|
||||
|
||||
@ -490,9 +490,9 @@ file_list *create_filelist(fa_list *al, char *fl, int create)
|
||||
}
|
||||
|
||||
for (tmpf = st; tmpf; tmpf = tmpf->next)
|
||||
Syslog('o',"flist: \"%s\" -> \"%s\" dsp:%d flofp:%lu floff:%lu",
|
||||
Syslog('o',"flist: \"%s\" -> \"%s\" dsp:%d flofp:%u floff:%u",
|
||||
MBSE_SS(tmpf->local), MBSE_SS(tmpf->remote), tmpf->disposition,
|
||||
(unsigned long)tmpf->flofp, (unsigned long)tmpf->floff);
|
||||
(unsigned int)tmpf->flofp, (unsigned int)tmpf->floff);
|
||||
|
||||
return st;
|
||||
}
|
||||
@ -612,7 +612,7 @@ void execute_disposition(file_list *fl)
|
||||
*/
|
||||
if (fseek(fl->flofp, fl->floff, 0) == 0) {
|
||||
if (fwrite(&tpl,1,1,fl->flofp) != 1) {
|
||||
WriteError("$Error writing '~' to .flo at %lu", (unsigned long)fl->floff);
|
||||
WriteError("$Error writing '~' to .flo at %u", (unsigned int)fl->floff);
|
||||
} else {
|
||||
Syslog('o', "Marked file \"%s\" as sent", MBSE_SS(nm));
|
||||
}
|
||||
@ -625,7 +625,7 @@ void execute_disposition(file_list *fl)
|
||||
#endif
|
||||
#endif
|
||||
} else
|
||||
WriteError("$error seeking in .flo to %lu", (unsigned long)fl->floff);
|
||||
WriteError("$error seeking in .flo to %u", (unsigned int)fl->floff);
|
||||
}
|
||||
}
|
||||
|
||||
@ -658,7 +658,7 @@ void execute_disposition(file_list *fl)
|
||||
|
||||
|
||||
|
||||
char *transfertime(struct timeval start, struct timeval end, long bytes, int sent)
|
||||
char *transfertime(struct timeval start, struct timeval end, int bytes, int sent)
|
||||
{
|
||||
static char resp[81];
|
||||
double long startms, endms, elapsed;
|
||||
@ -670,21 +670,21 @@ char *transfertime(struct timeval start, struct timeval end, long bytes, int sen
|
||||
if (!elapsed)
|
||||
elapsed = 1L;
|
||||
if (bytes > 1000000)
|
||||
snprintf(resp, 81, "%ld bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)",
|
||||
snprintf(resp, 81, "%d bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)",
|
||||
bytes, sent?"sent":"received", elapsed / 1000.000, ((bytes / elapsed) * 1000) / 1024);
|
||||
else
|
||||
snprintf(resp, 81, "%ld bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)",
|
||||
snprintf(resp, 81, "%d bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)",
|
||||
bytes, sent?"sent":"received", elapsed / 1000.000, ((bytes * 1000) / elapsed) / 1024);
|
||||
return resp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *compress_stat(long original, long saved)
|
||||
char *compress_stat(int original, int saved)
|
||||
{
|
||||
static char resp[81];
|
||||
|
||||
snprintf(resp, 81, "compressed %ld bytes, compression %0.1f%%", saved, ((saved * 100.0) / original));
|
||||
snprintf(resp, 81, "compressed %d bytes, compression %0.1f%%", saved, ((saved * 100.0) / original));
|
||||
return resp;
|
||||
}
|
||||
|
||||
|
@ -9,8 +9,8 @@ file_list *create_filelist(fa_list *, char *, int);
|
||||
file_list *create_freqlist(fa_list *);
|
||||
void tidy_filelist(file_list *, int);
|
||||
void execute_disposition(file_list *);
|
||||
char *transfertime(struct timeval, struct timeval, long, int);
|
||||
char *compress_stat(long, long);
|
||||
char *transfertime(struct timeval, struct timeval, int, int);
|
||||
char *compress_stat(int, int);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -368,7 +368,7 @@ SM_START(recv_packet)
|
||||
|
||||
SM_STATE(recv_packet)
|
||||
|
||||
snprintf(recvpktname,16, "%08lx.pkt",(unsigned long)sequencer());
|
||||
snprintf(recvpktname,16, "%08x.pkt", sequencer());
|
||||
if ((rc = xmrecv(recvpktname)) == 1) {
|
||||
SM_SUCCESS;
|
||||
} else if (rc == 0) {
|
||||
|
@ -68,19 +68,19 @@ static int put_binbyte(char *outbuf, char c);
|
||||
static int put_hexbyte(char *outbuf, char c);
|
||||
static enum HyPktTypes hyrxpkt(char *rxbuf, int *rxlen, int tot);
|
||||
static void hytxpkt(enum HyPktTypes pkttype, char *txbuf, int txlen);
|
||||
static int put_flags(char *buf, unsigned long Flags);
|
||||
static unsigned long get_flags(char *buf);
|
||||
static int put_flags(char *buf, unsigned int Flags);
|
||||
static unsigned int get_flags(char *buf);
|
||||
static int resync(off_t off);
|
||||
static int hydra_batch(int role, file_list *to_send);
|
||||
|
||||
extern unsigned long sentbytes;
|
||||
extern unsigned long rcvdbytes;
|
||||
extern unsigned int sentbytes;
|
||||
extern unsigned int rcvdbytes;
|
||||
|
||||
|
||||
|
||||
static struct h_flags_struct {
|
||||
char *str;
|
||||
unsigned long val;
|
||||
unsigned int val;
|
||||
} h_flags[] =
|
||||
{
|
||||
{ (char *)"XON", HOPT_XONXOFF },
|
||||
@ -103,28 +103,28 @@ static struct h_flags_struct {
|
||||
static int txoptions, rxoptions;
|
||||
|
||||
|
||||
static char *put_long(char *buffer, long val)
|
||||
static char *put_long(char *buffer, int val)
|
||||
{
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
buffer[0] = (unsigned long) val & 0xff;
|
||||
buffer[1] = ((unsigned long) val >> 8) & 0xff;
|
||||
buffer[2] = ((unsigned long) val >> 16) & 0xff;
|
||||
buffer[3] = ((unsigned long) val >> 24) & 0xff;
|
||||
buffer[0] = (unsigned int) val & 0xff;
|
||||
buffer[1] = ((unsigned int) val >> 8) & 0xff;
|
||||
buffer[2] = ((unsigned int) val >> 16) & 0xff;
|
||||
buffer[3] = ((unsigned int) val >> 24) & 0xff;
|
||||
#else
|
||||
*(unsigned long *) buffer = (unsigned long) val;
|
||||
*(unsigned int *) buffer = (unsigned int) val;
|
||||
#endif
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static long get_long(char *buffer)
|
||||
static int get_long(char *buffer)
|
||||
{
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
return ((unsigned long) ((unsigned char) buffer[0])) | ((unsigned long) ((unsigned char) buffer[1]) << 8) |
|
||||
((unsigned long) ((unsigned char) buffer[2]) << 16) | ((unsigned long) ((unsigned char) buffer[3]) << 24);
|
||||
return ((unsigned int) ((unsigned char) buffer[0])) | ((unsigned int) ((unsigned char) buffer[1]) << 8) |
|
||||
((unsigned int) ((unsigned char) buffer[2]) << 16) | ((unsigned int) ((unsigned char) buffer[3]) << 24);
|
||||
#else
|
||||
return *(long *) buffer;
|
||||
return *(int *) buffer;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -390,7 +390,7 @@ void hytxpkt(enum HyPktTypes pkttype, char *txbuf, int txlen)
|
||||
* check if we can use 32-bit CRC's
|
||||
*/
|
||||
if ((format != HCHR_HEXPKT) && (txoptions & HOPT_CRC32)) {
|
||||
unsigned long crc;
|
||||
unsigned int crc;
|
||||
|
||||
/*
|
||||
* Calc CRC-32 of data + pkttype
|
||||
@ -471,7 +471,7 @@ void hytxpkt(enum HyPktTypes pkttype, char *txbuf, int txlen)
|
||||
|
||||
|
||||
|
||||
int put_flags(char *buf, unsigned long Flags)
|
||||
int put_flags(char *buf, unsigned int Flags)
|
||||
{
|
||||
int i, count = 0;
|
||||
|
||||
@ -494,9 +494,9 @@ int put_flags(char *buf, unsigned long Flags)
|
||||
|
||||
|
||||
|
||||
unsigned long get_flags(char *buf)
|
||||
unsigned int get_flags(char *buf)
|
||||
{
|
||||
unsigned long Flags = 0L;
|
||||
unsigned int Flags = 0L;
|
||||
char *p;
|
||||
int i;
|
||||
|
||||
@ -530,11 +530,11 @@ int hydra_batch(int role, file_list *to_send)
|
||||
FILE *rxfp = NULL; /* file currently being received */
|
||||
char *inbuf, *outbuf;
|
||||
int rxlen, txlen; /* length of receive/transmit buffer */
|
||||
long txwindow, rxwindow; /* window sizes */
|
||||
long txpos;
|
||||
int txwindow, rxwindow; /* window sizes */
|
||||
int txpos;
|
||||
off_t rxpos; /* file positions */
|
||||
long stxpos, srxpos;
|
||||
long longnum;
|
||||
int stxpos, srxpos;
|
||||
int longnum;
|
||||
int hdxlink = FALSE;
|
||||
int txretries, rxretries;
|
||||
int txlastack, txsyncid;
|
||||
@ -556,7 +556,7 @@ int hydra_batch(int role, file_list *to_send)
|
||||
int txcompressed, rxctries;
|
||||
#ifdef HAVE_ZLIB_H
|
||||
static char txzbuf[H_ZIPBUFLEN], rxzbuf[H_ZIPBUFLEN];
|
||||
unsigned long rxzlen, txzlen; /* length of receive/transmit compressed buffer */
|
||||
unsigned int rxzlen, txzlen; /* length of receive/transmit compressed buffer */
|
||||
int rcz, cmpblksize;
|
||||
#endif
|
||||
|
||||
@ -645,9 +645,9 @@ int hydra_batch(int role, file_list *to_send)
|
||||
if ((pkttype == HPKT_RPOS) && (rxlen == 12)
|
||||
&& ((txstate == HTX_DATA) || (txstate == HTX_DATAACK)
|
||||
|| (txstate == HTX_XWAIT) || (txstate == HTX_EOFACK))) {
|
||||
long rpos_pos = get_long(rxbuf);
|
||||
long rpos_blksize = get_long(rxbuf + 4);
|
||||
long rpos_id = get_long(rxbuf + 8);
|
||||
int rpos_pos = get_long(rxbuf);
|
||||
int rpos_blksize = get_long(rxbuf + 4);
|
||||
int rpos_id = get_long(rxbuf + 8);
|
||||
|
||||
#ifdef HAVE_ZLIB_H
|
||||
/*
|
||||
@ -875,7 +875,7 @@ int hydra_batch(int role, file_list *to_send)
|
||||
}
|
||||
|
||||
Syslog('+', "Hydra: send \"%s\" as \"%s\"", MBSE_SS(to_send->local), MBSE_SS(to_send->remote));
|
||||
Syslog('+', "Hydra: size %lu bytes, dated %s",(unsigned long)txstat.st_size, date(txstat.st_mtime));
|
||||
Syslog('+', "Hydra: size %lu bytes, dated %s",(unsigned int)txstat.st_size, date(txstat.st_mtime));
|
||||
gettimeofday(&txstarttime, &tz);
|
||||
}
|
||||
|
||||
@ -901,9 +901,9 @@ int hydra_batch(int role, file_list *to_send)
|
||||
break;
|
||||
} else {
|
||||
if (to_send) {
|
||||
txlen = snprintf(txbuf, H_ZIPBUFLEN, "%08lx%08lx%08lx%08lx%08lx",
|
||||
(long)mtime2sl(txstat.st_mtime+(txstat.st_mtime%2)),
|
||||
(long)(txstat.st_size), 0UL, 0UL, 0UL);
|
||||
txlen = snprintf(txbuf, H_ZIPBUFLEN, "%08x%08x%08x%08x%08x",
|
||||
(int)mtime2sl(txstat.st_mtime+(txstat.st_mtime%2)),
|
||||
(int)(txstat.st_size), 0U, 0U, 0U);
|
||||
|
||||
/*
|
||||
* convert file name to DOS-format
|
||||
@ -1038,9 +1038,12 @@ int hydra_batch(int role, file_list *to_send)
|
||||
Syslog('h', "Hydra: set BRAIN timer %d", H_BRAINDEAD); // 03-11-2003 MB.
|
||||
SETTIMER(TIMERNO_BRAIN, H_BRAINDEAD); // 03-11-2003 MB.
|
||||
#ifdef HAVE_ZLIB_H
|
||||
uLongf destLen;
|
||||
if (compstate == HCMP_GZ) {
|
||||
txzlen = H_ZIPBUFLEN - 4;
|
||||
rcz = compress2(txzbuf + 4, &txzlen, txbuf + 4, txlen, 9);
|
||||
destLen = (uLongf)txzlen;
|
||||
rcz = compress2(txzbuf + 4, &destLen, txbuf + 4, txlen, 9);
|
||||
txzlen = (int)destLen;
|
||||
if (rcz == Z_OK) {
|
||||
Syslog('h', "Hydra: compressed OK, srclen=%d, destlen=%d, will send compressed=%s", txlen, txzlen,
|
||||
(txzlen < txlen) ?"yes":"no");
|
||||
@ -1357,7 +1360,7 @@ int hydra_batch(int role, file_list *to_send)
|
||||
* get desired window sizes
|
||||
*/
|
||||
txwindow = rxwindow = 0;
|
||||
sscanf(inbuf, "%08lx%08lx", &rxwindow, &txwindow);
|
||||
sscanf(inbuf, "%08x%08x", &rxwindow, &txwindow);
|
||||
|
||||
if (rxwindow < 0)
|
||||
rxwindow = 0;
|
||||
@ -1403,10 +1406,11 @@ int hydra_batch(int role, file_list *to_send)
|
||||
else if ((rxlen > 41) && (rxbuf[rxlen - 1] == 0)) {
|
||||
time_t timestamp;
|
||||
time_t orgstamp;
|
||||
long filesize;
|
||||
int filesize, tt;
|
||||
char dosname[8 + 1 + 3 + 1], *Name;
|
||||
|
||||
sscanf(rxbuf, "%08lx%08lx%*08x%*08x%*08x", ×tamp, &filesize);
|
||||
sscanf(rxbuf, "%08x%08x%*08x%*08x%*08x", &tt, &filesize);
|
||||
timestamp = (time_t)tt;
|
||||
|
||||
/* convert timestamp to UNIX time */
|
||||
orgstamp = timestamp;
|
||||
@ -1496,9 +1500,12 @@ int hydra_batch(int role, file_list *to_send)
|
||||
/*
|
||||
* If data packet is a zlib compressed packet, uncompress it first.
|
||||
*/
|
||||
uLongf destLen;
|
||||
if (pkttype == HPKT_ZIPDATA) {
|
||||
rxzlen = H_ZIPBUFLEN;
|
||||
rcz = uncompress(rxzbuf, &rxzlen, rxbuf + 4, rxlen - 4);
|
||||
destLen = (uLongf)rxzlen;
|
||||
rcz = uncompress(rxzbuf, &destLen, rxbuf + 4, rxlen - 4);
|
||||
rxzlen = (int)destLen;
|
||||
if (rcz == Z_OK) {
|
||||
/*
|
||||
* Uncompress data and put the data into the normal receive buffer.
|
||||
@ -1684,7 +1691,7 @@ int hydra_batch(int role, file_list *to_send)
|
||||
*/
|
||||
if ((compstate != HCMP_NONE) && (rxctries > 2)) {
|
||||
Syslog('+', "Hydra: too much compress errors, instructing remote to stop compression");
|
||||
put_long(txbuf + 8, (long)-1L);
|
||||
put_long(txbuf + 8, (int)-1L);
|
||||
} else {
|
||||
put_long(txbuf + 8, rxsyncid);
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ int inbound_close(int success)
|
||||
/*
|
||||
* Get the free space size in the temp inbound directory.
|
||||
*/
|
||||
long inbound_space(void)
|
||||
int inbound_space(void)
|
||||
{
|
||||
struct statfs sfs;
|
||||
|
||||
|
@ -34,6 +34,6 @@
|
||||
|
||||
int inbound_open(faddr *, int, int); /* Open temp inbound */
|
||||
int inbound_close(int); /* Close temp inbound */
|
||||
long inbound_space(void); /* Get free inbound space */
|
||||
int inbound_space(void); /* Get free inbound space */
|
||||
|
||||
#endif
|
||||
|
@ -86,7 +86,7 @@ int IsZMH()
|
||||
}
|
||||
|
||||
|
||||
unsigned long rnd (void)
|
||||
unsigned int rnd (void)
|
||||
{
|
||||
static int i;
|
||||
|
||||
|
@ -6,6 +6,6 @@
|
||||
void setmyname(char *);
|
||||
char *date(time_t);
|
||||
int IsZMH(void);
|
||||
unsigned long rnd(void);
|
||||
unsigned int rnd(void);
|
||||
|
||||
#endif
|
||||
|
@ -56,8 +56,8 @@ time_t t_end;
|
||||
time_t c_start;
|
||||
time_t c_end;
|
||||
int online = 0;
|
||||
unsigned long sentbytes = 0;
|
||||
unsigned long rcvdbytes = 0;
|
||||
unsigned int sentbytes = 0;
|
||||
unsigned int rcvdbytes = 0;
|
||||
int tcp_mode = TCPMODE_NONE;
|
||||
int Loaded = FALSE;
|
||||
int telnet = FALSE;
|
||||
|
@ -38,7 +38,7 @@ typedef unsigned char *POINTER;
|
||||
/* UINT2 defines a two byte word */
|
||||
typedef unsigned short int UINT2;
|
||||
/* UINT4 defines a four byte word */
|
||||
typedef unsigned long int UINT4;
|
||||
typedef unsigned int UINT4;
|
||||
|
||||
/* end of GLOBAL.H ---------------------------------------------------------- */
|
||||
|
||||
|
@ -61,10 +61,10 @@ FILE *openfile(char *fname, time_t remtime, off_t remsize, off_t *resofs, int(*r
|
||||
|
||||
strcpy(ctt,date(remtime));
|
||||
|
||||
Syslog('s', "openfile(\"%s\",%s,%lu,...)", MBSE_SS(fname), MBSE_SS(ctt), (unsigned long)remsize);
|
||||
Syslog('s', "openfile(\"%s\",%s,%lu,...)", MBSE_SS(fname), MBSE_SS(ctt), (unsigned int)remsize);
|
||||
|
||||
if ((fname == NULL) || (fname[0] == '\0')) {
|
||||
snprintf(tmpfname,16,"%08lx.pkt",(unsigned long)sequencer());
|
||||
snprintf(tmpfname,16,"%08x.pkt",sequencer());
|
||||
fname=tmpfname;
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ FILE *openfile(char *fname, time_t remtime, off_t remsize, off_t *resofs, int(*r
|
||||
rc = 1;
|
||||
p = strrchr(infpath,'/');
|
||||
*p = '\0';
|
||||
snprintf(ctt,32,"%08lx.doe",(unsigned long)sequencer());
|
||||
snprintf(ctt,32,"%08x.doe",sequencer());
|
||||
free(infpath);
|
||||
infpath = xstrcpy(p);
|
||||
infpath = xstrcat(infpath, ctt);
|
||||
@ -158,7 +158,7 @@ FILE *openfile(char *fname, time_t remtime, off_t remsize, off_t *resofs, int(*r
|
||||
case 0: /* Success */
|
||||
opentype = (char *)"a+";
|
||||
*resofs = st.st_size;
|
||||
Syslog('+', "Resyncing at offset %lu of \"%s\"", (unsigned long)st.st_size, infpath);
|
||||
Syslog('+', "Resyncing at offset %lu of \"%s\"", (unsigned int)st.st_size, infpath);
|
||||
break;
|
||||
case -1: /* Binkp did send a GET, return here and do not open file */
|
||||
free(infpath);
|
||||
@ -184,7 +184,7 @@ FILE *openfile(char *fname, time_t remtime, off_t remsize, off_t *resofs, int(*r
|
||||
freqname = xstrcpy(infpath);
|
||||
}
|
||||
|
||||
Syslog('s', "opened file \"%s\" for \"%s\", restart at %lu", infpath,opentype,(unsigned long)*resofs);
|
||||
Syslog('s', "opened file \"%s\" for \"%s\", restart at %lu", infpath,opentype,(unsigned int)*resofs);
|
||||
return infp;
|
||||
}
|
||||
|
||||
|
@ -52,8 +52,8 @@ extern time_t c_end;
|
||||
extern int online;
|
||||
extern int master;
|
||||
extern int carrier;
|
||||
extern long sentbytes;
|
||||
extern long rcvdbytes;
|
||||
extern int sentbytes;
|
||||
extern int rcvdbytes;
|
||||
extern int Loaded;
|
||||
static int tcp_is_open = FALSE;
|
||||
|
||||
|
@ -301,8 +301,8 @@ int outstat()
|
||||
cst = getstatus(&(tmp->addr));
|
||||
age = time(NULL);
|
||||
age -= tmp->time;
|
||||
snprintf(temp, PATH_MAX -1, "%s %3d %9lu %s %s",
|
||||
flstr, cst->tryno, (long)tmp->size, str_time(age), ascfnode(&(tmp->addr), 0x1f));
|
||||
snprintf(temp, PATH_MAX -1, "%s %3d %9u %s %s",
|
||||
flstr, cst->tryno, (int)tmp->size, str_time(age), ascfnode(&(tmp->addr), 0x1f));
|
||||
|
||||
if (!do_quiet)
|
||||
printf("%s\n", temp);
|
||||
|
@ -55,8 +55,8 @@ extern char *freqname;
|
||||
static void attach_report(file_list**);
|
||||
static void add_report(char *, ...);
|
||||
static char *report_text = NULL;
|
||||
static unsigned long report_total = 0L;
|
||||
static unsigned long report_count = 0L;
|
||||
static unsigned int report_total = 0L;
|
||||
static unsigned int report_count = 0L;
|
||||
static int no_more = FALSE;
|
||||
|
||||
|
||||
@ -159,7 +159,7 @@ file_list *respfreq(char *nm, char *pw, char *dt)
|
||||
time_t upd = 0L;
|
||||
int newer = 1, Send;
|
||||
FILE *fa, *fi;
|
||||
long Area;
|
||||
int Area;
|
||||
struct FILEIndex idx;
|
||||
struct _fdbarea *fdb_area = NULL;
|
||||
|
||||
@ -432,13 +432,13 @@ file_list *respmagic(char *cmd) /* must free(cmd) before exit */
|
||||
int i, escaped;
|
||||
file_list *fl = NULL;
|
||||
FILE *fp, *ft;
|
||||
long zeroes = 0L;
|
||||
int zeroes = 0L;
|
||||
ftnmsg fmsg;
|
||||
char *svname;
|
||||
|
||||
Syslog('+', "Magic execute: %s", strrchr(xstrcpy(cmd), '/')+1);
|
||||
add_report((char *)"RQ: Magic \"%s\"",cmd);
|
||||
snprintf(tmpfn, PATH_MAX -1, "%s/tmp/%08lX", getenv((char *)"MBSE_ROOT"), (unsigned long)sequencer());
|
||||
snprintf(tmpfn, PATH_MAX -1, "%s/tmp/%08X", getenv((char *)"MBSE_ROOT"), (unsigned int)sequencer());
|
||||
Syslog('+', "tmpfn \"%s\"", tmpfn);
|
||||
if ((p = strrchr(cmd,'/')))
|
||||
p++;
|
||||
@ -483,7 +483,7 @@ file_list *respmagic(char *cmd) /* must free(cmd) before exit */
|
||||
unlink(tmpfn);
|
||||
} else {
|
||||
if (stat(tmpfn, &st) == 0) {
|
||||
snprintf(tmptx, PATH_MAX -1, "%s/tmp/%08lX", getenv((char *)"MBSE_ROOT"), (unsigned long)sequencer());
|
||||
snprintf(tmptx, PATH_MAX -1, "%s/tmp/%08X", getenv((char *)"MBSE_ROOT"), (unsigned int)sequencer());
|
||||
Syslog('+', "tmptx \"%s\"", tmptx);
|
||||
|
||||
if ((fp = fopen(tmptx, "w"))) {
|
||||
@ -523,7 +523,7 @@ file_list *respmagic(char *cmd) /* must free(cmd) before exit */
|
||||
}
|
||||
fwrite(&zeroes, 1, 3, fp);
|
||||
fclose(fp);
|
||||
snprintf(remname, 32, "%08lX.PKT", (unsigned long)sequencer());
|
||||
snprintf(remname, 32, "%08X.PKT", (unsigned int)sequencer());
|
||||
|
||||
add_list(&fl, tmptx, remname, KFS, 0L, NULL, 0);
|
||||
fmsg.from->name = svname;
|
||||
@ -549,7 +549,7 @@ static void attach_report(file_list **fl)
|
||||
FILE *fp;
|
||||
char *tmpfn;
|
||||
char remname[14];
|
||||
long zeroes = 0L, recno, records;
|
||||
int zeroes = 0L, recno, records;
|
||||
ftnmsg fmsg;
|
||||
char *svname;
|
||||
|
||||
@ -595,7 +595,7 @@ static void attach_report(file_list **fl)
|
||||
|
||||
add_report((char *)"\r%s\r", TearLine());
|
||||
|
||||
snprintf(tmpfn, PATH_MAX -1, "%s/tmp/%08lX.rpl", getenv((char *)"MBSE_ROOT"), (unsigned long)sequencer());
|
||||
snprintf(tmpfn, PATH_MAX -1, "%s/tmp/%08X.rpl", getenv((char *)"MBSE_ROOT"), (unsigned int)sequencer());
|
||||
if ((fp = fopen(tmpfn,"w"))) {
|
||||
fmsg.flags = M_PVT|M_KILLSENT;
|
||||
fmsg.from = bestaka_s(remote->addr);
|
||||
@ -622,7 +622,7 @@ static void attach_report(file_list **fl)
|
||||
fwrite(report_text, 1, strlen(report_text), fp);
|
||||
fwrite(&zeroes, 1, 3, fp);
|
||||
fclose(fp);
|
||||
snprintf(remname, 14, "%08lX.PKT", (unsigned long)sequencer());
|
||||
snprintf(remname, 14, "%08X.PKT", (unsigned int)sequencer());
|
||||
add_list(fl, tmpfn, remname, KFS, 0L, NULL, 0);
|
||||
fmsg.from->name = svname;
|
||||
} else {
|
||||
|
@ -58,7 +58,7 @@ static FILE *in;
|
||||
static char txbuf[TCP_BLKSIZE];
|
||||
static char rxbuf[TCP_BLKSIZE];
|
||||
static int rx_type;
|
||||
static long sbytes;
|
||||
static int sbytes;
|
||||
struct timeval starttime, endtime;
|
||||
struct timezone tz;
|
||||
static off_t rxbytes;
|
||||
@ -72,8 +72,8 @@ static int tcp_sblk(char *,int,int);
|
||||
static int tcp_rblk(char *,int *);
|
||||
static int getsync(void);
|
||||
|
||||
extern unsigned long sentbytes;
|
||||
extern unsigned long rcvdbytes;
|
||||
extern unsigned int sentbytes;
|
||||
extern unsigned int rcvdbytes;
|
||||
extern char *ttystat[];
|
||||
|
||||
|
||||
@ -124,7 +124,7 @@ int tcpsndfiles(file_list *lst)
|
||||
int tcprcvfiles(void)
|
||||
{
|
||||
int rc, bufl;
|
||||
long filesize, filetime;
|
||||
int filesize, filetime;
|
||||
char *filename = NULL, *p;
|
||||
|
||||
Syslog('+', "TCP: start receive files");
|
||||
@ -183,7 +183,7 @@ static int sendtfile(char *ln, char *rn)
|
||||
struct stat st;
|
||||
struct flock fl;
|
||||
int bufl, sverr;
|
||||
long offset;
|
||||
int offset;
|
||||
|
||||
fl.l_type = F_RDLCK;
|
||||
fl.l_whence = 0;
|
||||
@ -215,14 +215,14 @@ static int sendtfile(char *ln, char *rn)
|
||||
|
||||
if (st.st_size > 0) {
|
||||
Syslog('+', "TCP: send \"%s\" as \"%s\"", MBSE_SS(ln), MBSE_SS(rn));
|
||||
Syslog('+', "TCP: size %lu bytes, dated %s", (unsigned long)st.st_size, date(st.st_mtime));
|
||||
Syslog('+', "TCP: size %lu bytes, dated %s", (unsigned int)st.st_size, date(st.st_mtime));
|
||||
gettimeofday(&starttime, &tz);
|
||||
} else {
|
||||
Syslog('+', "TCP: file \"%s\" has 0 size, skiped",ln);
|
||||
return 0;
|
||||
}
|
||||
|
||||
snprintf(txbuf,TCP_BLKSIZE, "S %s %lu %lu",rn,(unsigned long)st.st_size,(unsigned long)st.st_mtime+(st.st_mtime%2));
|
||||
snprintf(txbuf,TCP_BLKSIZE, "S %s %u %u",rn,(unsigned int)st.st_size,(unsigned int)st.st_mtime+(unsigned int)(st.st_mtime%2));
|
||||
bufl = strlen(txbuf);
|
||||
rc = tcp_sblk(txbuf, bufl, TCP_CMD);
|
||||
rc = tcp_rblk(rxbuf, &bufl);
|
||||
@ -261,7 +261,7 @@ static int sendtfile(char *ln, char *rn)
|
||||
gettimeofday(&endtime, &tz);
|
||||
Syslog('a', "st_size %d, offset %d",st.st_size,offset);
|
||||
Syslog('+', "TCP: OK %s", transfertime(starttime, endtime, st.st_size-offset, TRUE));
|
||||
sentbytes += (unsigned long)st.st_size - offset;
|
||||
sentbytes += (unsigned int)st.st_size - offset;
|
||||
return 0;
|
||||
} else if(strncmp(rxbuf,"FERROR",6) == 0){
|
||||
WriteError("TCP: remote file error",ln);
|
||||
@ -274,7 +274,7 @@ static int sendtfile(char *ln, char *rn)
|
||||
|
||||
static int resync(off_t off)
|
||||
{
|
||||
snprintf(txbuf, TCP_BLKSIZE, "ROK %ld",(long)off);
|
||||
snprintf(txbuf, TCP_BLKSIZE, "ROK %d",(int)off);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Purpose ...............: Fidonet mailer
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2004
|
||||
* Copyright (C) 1997-2005
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@ -57,9 +57,9 @@ static int last;
|
||||
struct timeval starttime, endtime;
|
||||
struct timezone tz;
|
||||
static off_t startofs;
|
||||
static long recv_blk;
|
||||
static int recv_blk;
|
||||
|
||||
extern unsigned long rcvdbytes;
|
||||
extern unsigned int rcvdbytes;
|
||||
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ int closeit(int success)
|
||||
Syslog('+', "Xmodem: OK %s", transfertime(starttime, endtime, endofs-startofs, FALSE));
|
||||
else
|
||||
Syslog('+', "Xmodem: dropped after %ld bytes", endofs-startofs);
|
||||
rcvdbytes += (unsigned long)(endofs-startofs);
|
||||
rcvdbytes += (unsigned int)(endofs-startofs);
|
||||
fp = NULL;
|
||||
return closefile();
|
||||
}
|
||||
@ -136,9 +136,9 @@ SM_EDECL
|
||||
} xmblk;
|
||||
unsigned short localcrc,remotecrc;
|
||||
unsigned char localcs,remotecs;
|
||||
long ackd_blk=-1L;
|
||||
long next_blk=1L;
|
||||
long last_blk=0L;
|
||||
int ackd_blk=-1L;
|
||||
int next_blk=1L;
|
||||
int last_blk=0L;
|
||||
off_t resofs;
|
||||
char tmpfname[16];
|
||||
off_t wsize;
|
||||
@ -550,12 +550,12 @@ int resync(off_t resofs)
|
||||
int count=0;
|
||||
int gotack,gotnak;
|
||||
int c;
|
||||
long sblk;
|
||||
int sblk;
|
||||
|
||||
Syslog('x', "trying to resync at offset %ld",resofs);
|
||||
Syslog('x', "trying to resync at offset %d", (int)resofs);
|
||||
|
||||
sblk=resofs/XMBLKSIZ+1;
|
||||
snprintf(resynbuf,16,"%ld",sblk);
|
||||
snprintf(resynbuf,16,"%d",sblk);
|
||||
lcrc=crc16xmodem(resynbuf,strlen(resynbuf));
|
||||
gotack=0;
|
||||
gotnak=0;
|
||||
|
@ -48,7 +48,7 @@ static char *ln,*rn;
|
||||
static int flg;
|
||||
static int xm_send(void);
|
||||
|
||||
extern unsigned long sentbytes;
|
||||
extern unsigned int sentbytes;
|
||||
|
||||
|
||||
int xmsend(char *local, char *Remote, int fl)
|
||||
@ -109,11 +109,11 @@ SM_EDECL
|
||||
int count=0;
|
||||
int cancount=0;
|
||||
int window;
|
||||
long last_blk;
|
||||
long send_blk;
|
||||
long next_blk;
|
||||
long ackd_blk;
|
||||
long tmp;
|
||||
int last_blk;
|
||||
int send_blk;
|
||||
int next_blk;
|
||||
int ackd_blk;
|
||||
int tmp;
|
||||
char resynbuf[16];
|
||||
|
||||
fl.l_type=F_RDLCK;
|
||||
|
@ -83,8 +83,8 @@ int Rxhlen; /* Length of header received */
|
||||
int Rxcount; /* Count of data bytes received */
|
||||
char Rxhdr[ZMAXHLEN]; /* Received header */
|
||||
char Txhdr[ZMAXHLEN]; /* Transmitted header */
|
||||
long Rxpos; /* Received file position */
|
||||
long Txpos; /* Transmitted file position */
|
||||
int Rxpos; /* Received file position */
|
||||
int Txpos; /* Transmitted file position */
|
||||
int Txfcs32; /* TRUE means send binary frames with 32 bit FCS */
|
||||
int Crc32t; /* Controls 32 bit CRC being sent */
|
||||
/* 1 == CRC32, 2 == CRC32 + RLE */
|
||||
@ -230,7 +230,7 @@ void zsbhdr(int len, int type, register char *shdr)
|
||||
void zsbh32(int len, register char *shdr, int type, int flavour)
|
||||
{
|
||||
register int n;
|
||||
register unsigned long crc;
|
||||
register unsigned int crc;
|
||||
|
||||
BUFFER_BYTE(flavour);
|
||||
if (Usevhdrs)
|
||||
@ -338,7 +338,7 @@ void zsdata(register char *buf, int length, int frameend)
|
||||
void zsda32(register char *buf, int length, int frameend)
|
||||
{
|
||||
register int c;
|
||||
register unsigned long crc;
|
||||
register unsigned int crc;
|
||||
|
||||
crc = 0xFFFFFFFFL;
|
||||
for (;--length >= 0; ++buf) {
|
||||
@ -429,7 +429,7 @@ crcfoo:
|
||||
int zrdat32(register char *buf, int length)
|
||||
{
|
||||
register int c;
|
||||
register unsigned long crc;
|
||||
register unsigned int crc;
|
||||
register char *end;
|
||||
register int d;
|
||||
|
||||
@ -704,7 +704,7 @@ int zrbhdr(register char *shdr)
|
||||
int zrbhd32(register char *shdr)
|
||||
{
|
||||
register int c, n;
|
||||
register unsigned long crc;
|
||||
register unsigned int crc;
|
||||
|
||||
if ((c = zdlread()) & ~0377)
|
||||
return c;
|
||||
@ -967,7 +967,7 @@ int noxrd7(void)
|
||||
/*
|
||||
* Store long integer pos in Txhdr
|
||||
*/
|
||||
void stohdr(long pos)
|
||||
void stohdr(int pos)
|
||||
{
|
||||
Txhdr[ZP0] = pos;
|
||||
Txhdr[ZP1] = pos>>8;
|
||||
@ -980,9 +980,9 @@ void stohdr(long pos)
|
||||
/*
|
||||
* Recover a long integer from a header
|
||||
*/
|
||||
long rclhdr(register char *shdr)
|
||||
int rclhdr(register char *shdr)
|
||||
{
|
||||
register long l;
|
||||
register int l;
|
||||
|
||||
l = (shdr[ZP3] & 0377);
|
||||
l = (l << 8) | (shdr[ZP2] & 0377);
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef ZMODEM_H
|
||||
#define ZMODEM_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
@ -141,14 +143,14 @@
|
||||
/* Parameters for ZCOMMAND frame ZF0 (otherwise 0) */
|
||||
#define ZCACK1 1 /* Acknowledge, then do command */
|
||||
|
||||
long rclhdr(register char *);
|
||||
int rclhdr(register char *);
|
||||
|
||||
/* Globals used by ZMODEM functions */
|
||||
extern int Rxframeind; /* ZBIN ZBIN32, or ZHEX type of frame */
|
||||
extern int Rxtype; /* Type of header received */
|
||||
extern int Rxcount; /* Count of data bytes received */
|
||||
extern int long Rxpos; /* Received file position */
|
||||
extern int long Txpos; /* Transmitted file position */
|
||||
extern int Rxpos; /* Received file position */
|
||||
extern int Txpos; /* Transmitted file position */
|
||||
extern int Txfcs32; /* TURE means send binary frames with 32 bit FCS */
|
||||
extern int Crc32t; /* Display flag indicating 32 bit CRC being sent */
|
||||
extern int Crc32r; /* Display flag indicating 32 bit CRC being received */
|
||||
@ -170,7 +172,7 @@ extern int Effbaud;
|
||||
extern int Zmodem;
|
||||
extern int Zctlesc;
|
||||
extern int Filesleft;
|
||||
extern long Totalleft;
|
||||
extern int Totalleft;
|
||||
|
||||
extern char *frametypes[];
|
||||
#define FTOFFSET 16
|
||||
@ -180,7 +182,7 @@ extern void zshhdr(int,int,char*);
|
||||
extern int zgethdr(char*);
|
||||
extern void zsdata(char*,int,int);
|
||||
extern int zrdata(char*,int);
|
||||
extern void stohdr(long);
|
||||
extern void stohdr(int);
|
||||
|
||||
extern void zsendline(int);
|
||||
extern void zsdar32(char*,int,int);
|
||||
@ -188,7 +190,7 @@ extern int zrdatr32(char*,int);
|
||||
extern int zdlread(void);
|
||||
|
||||
extern unsigned short crc16xmodemtab[];
|
||||
extern unsigned long crc32tab[];
|
||||
extern unsigned int crc32tab[];
|
||||
#define updcrc16(cp,crc) (crc16xmodemtab[(((int)crc >> 8) & 0xff)] ^ (crc << 8) ^ cp)
|
||||
#define updcrc32(cp,crc) (crc32tab[((int)crc ^ cp) & 0xff] ^ ((crc >> 8) & 0x00ffffff))
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Purpose ...............: Fidonet mailer
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2003
|
||||
* Copyright (C) 1997-2005
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@ -48,13 +48,13 @@ static int Usevhdrs;
|
||||
static off_t rxbytes;
|
||||
static int Eofseen; /* indicates cpm eof (^Z) has been received */
|
||||
static int errors;
|
||||
static long sbytes;
|
||||
static int sbytes;
|
||||
struct timeval starttime, endtime;
|
||||
struct timezone tz;
|
||||
|
||||
#define DEFBYTL 2000000000L /* default rx file size */
|
||||
static long Bytesleft; /* number of bytes of incoming file left */
|
||||
static long Modtime; /* Unix style mod time for incoming file */
|
||||
static int Bytesleft; /* number of bytes of incoming file left */
|
||||
static int Modtime; /* Unix style mod time for incoming file */
|
||||
static int Filemode; /* Unix style mode for incoming file */
|
||||
|
||||
static int Thisbinary; /* current file is to be received in bin mode */
|
||||
@ -77,13 +77,13 @@ int closeit(int);
|
||||
static int putsec(char*,int);
|
||||
static int procheader(char*);
|
||||
static int ackbibi(void);
|
||||
static long getfree(void);
|
||||
static int getfree(void);
|
||||
|
||||
|
||||
void get_frame_buffer(void);
|
||||
void free_frame_buffer(void);
|
||||
|
||||
extern unsigned long rcvdbytes;
|
||||
extern unsigned int rcvdbytes;
|
||||
|
||||
|
||||
|
||||
@ -503,9 +503,9 @@ int procheader(char *Name)
|
||||
Modtime = 0L;
|
||||
|
||||
p = Name + 1 + strlen(Name);
|
||||
sscanf(p, "%ld%lo%o%o%d%d%d%d", &Bytesleft, &Modtime, &Filemode, &dummy, &dummy, &dummy, &dummy, &dummy);
|
||||
sscanf(p, "%d%o%o%o%d%d%d%d", &Bytesleft, &Modtime, &Filemode, &dummy, &dummy, &dummy, &dummy, &dummy);
|
||||
strcpy(ctt,date(Modtime));
|
||||
Syslog('+', "Zmodem: \"%s\" %ld bytes, %s mode %o", Name, Bytesleft, ctt, Filemode);
|
||||
Syslog('+', "Zmodem: \"%s\" %d bytes, %s mode %o", Name, Bytesleft, ctt, Filemode);
|
||||
|
||||
fout = openfile(Name,Modtime,Bytesleft,&rxbytes,resync);
|
||||
gettimeofday(&starttime, &tz);
|
||||
@ -556,7 +556,7 @@ int putsec(char *buf, int n)
|
||||
|
||||
|
||||
|
||||
long getfree(void)
|
||||
int getfree(void)
|
||||
{
|
||||
struct statfs sfs;
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
||||
void zsdar32(char *buf, int length, int frameend)
|
||||
{
|
||||
register int c, l, n;
|
||||
register unsigned long crc;
|
||||
register unsigned int crc;
|
||||
|
||||
crc = 0xFFFFFFFFL; l = *buf++ & 0377;
|
||||
if (length == 1) {
|
||||
@ -112,7 +112,7 @@ void zsdar32(char *buf, int length, int frameend)
|
||||
int zrdatr32(register char *buf, int length)
|
||||
{
|
||||
register int c;
|
||||
register unsigned long crc;
|
||||
register unsigned int crc;
|
||||
register char *end;
|
||||
register int d;
|
||||
|
||||
|
@ -64,7 +64,7 @@ static int blklen = 128; /* Length of transmitted records */
|
||||
static int blkopt; /* Override value for zmodem blklen */
|
||||
static int errors;
|
||||
static int Lastsync;
|
||||
static long bytcnt;
|
||||
static int bytcnt;
|
||||
static int Lrxpos=0;
|
||||
static int Lztrans=0;
|
||||
static int Lzmanag=0;
|
||||
@ -72,11 +72,11 @@ static int Lskipnocor=0;
|
||||
static int Lzconv=0;
|
||||
static int Beenhereb4;
|
||||
static char Myattn[]={0};
|
||||
static long skipsize;
|
||||
static int skipsize;
|
||||
struct timeval starttime, endtime;
|
||||
struct timezone tz;
|
||||
|
||||
extern unsigned long sentbytes;
|
||||
extern unsigned int sentbytes;
|
||||
extern int Rxhlen;
|
||||
extern void get_frame_buffer(void);
|
||||
extern void free_frame_buffer(void);
|
||||
@ -210,11 +210,11 @@ static int sendzfile(char *ln, char *rn)
|
||||
}
|
||||
|
||||
Syslog('+', "Zmodem: send \"%s\" as \"%s\"", MBSE_SS(ln), MBSE_SS(rn));
|
||||
Syslog('+', "Zmodem: size %lu bytes, dated %s", (unsigned long)st.st_size, date(st.st_mtime));
|
||||
Syslog('+', "Zmodem: size %lu bytes, dated %s", (unsigned int)st.st_size, date(st.st_mtime));
|
||||
gettimeofday(&starttime, &tz);
|
||||
|
||||
snprintf(txbuf,MAXBLOCK, "%s %lu %lo %o 0 0 0", rn,
|
||||
(unsigned long)st.st_size, (long)st.st_mtime+((long)st.st_mtime%2), st.st_mode);
|
||||
snprintf(txbuf,MAXBLOCK, "%s %u %o %o 0 0 0", rn,
|
||||
(unsigned int)st.st_size, (int)st.st_mtime+((int)st.st_mtime%2), st.st_mode);
|
||||
bufl = strlen(txbuf);
|
||||
*(strchr(txbuf,' ')) = '\0'; /*hope no blanks in filename*/
|
||||
|
||||
@ -225,8 +225,8 @@ static int sendzfile(char *ln, char *rn)
|
||||
return 0;
|
||||
} else if ((rc == OK) && (st.st_size - skipsize)) {
|
||||
gettimeofday(&endtime, &tz);
|
||||
Syslog('+', "Zmodem: OK %s", transfertime(starttime, endtime, (unsigned long)st.st_size - skipsize, TRUE));
|
||||
sentbytes += (unsigned long)st.st_size - skipsize;
|
||||
Syslog('+', "Zmodem: OK %s", transfertime(starttime, endtime, (unsigned int)st.st_size - skipsize, TRUE));
|
||||
sentbytes += (unsigned int)st.st_size - skipsize;
|
||||
return 0;
|
||||
} else
|
||||
return 2;
|
||||
@ -358,8 +358,8 @@ int zfilbuf(void)
|
||||
int zsendfile(char *buf, int blen)
|
||||
{
|
||||
int c;
|
||||
register unsigned long crc = -1;
|
||||
long lastcrcrq = -1;
|
||||
register unsigned int crc = -1;
|
||||
int lastcrcrq = -1;
|
||||
|
||||
Syslog('z', "zsendfile %s (%d)", buf, blen);
|
||||
for (errors=0; ++errors<11;) {
|
||||
|
@ -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)) {
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -1,8 +1,9 @@
|
||||
#ifndef _ATOUL_H
|
||||
#define _ATOUL_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
unsigned long atoul(char*);
|
||||
unsigned int atoul(char*);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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)
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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++;
|
||||
|
@ -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'))
|
||||
|
@ -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();
|
||||
|
@ -37,7 +37,7 @@
|
||||
#include "magic.h"
|
||||
|
||||
|
||||
long MagicNr; /* Current magic record number */
|
||||
int MagicNr; /* Current magic record number */
|
||||
int Magics = 0; /* Processed magics */
|
||||
|
||||
|
||||
|
@ -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");
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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", " ");
|
||||
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
/*
|
||||
|
@ -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 ");
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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)) {
|
||||
|
@ -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
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user