Tab chars (0x9) was replaced with spaces

This commit is contained in:
Ianos Gnatiuc 2005-10-23 04:39:25 +00:00
parent 1f4f8695e5
commit 9813ce1e91
34 changed files with 5256 additions and 5256 deletions

View File

@ -54,7 +54,7 @@ status_t beos_unlock(int file_handle)
port_id pid = 0;
status_t status = look_for_port(file_handle, false, &pid);
if(status == B_BUSY)
status = delete_port(pid);
status = delete_port(pid);
return status;
}

View File

@ -32,14 +32,14 @@ can be used for any purposes in any form without any warranties.
sprintf(name, "FidoLock:%08X:%08X", stat_info.st_dev, stat_info.st_ino);
3) Look for existing port with this name:
pid = find_port(name);
if(pid == B_NAME_NOT_FOUND)
{
4) Create such port.
pid = create_port(1, name);
pid = create_port(1, name);
}
else

View File

@ -81,7 +81,7 @@ extern __inline__ int isxalnum(char c) {
* It's also not possible to use setlocale() to change it's behaviour. =-(
*/
#undef iscntrl
# define iscntrl(c) ((c < 0x7f) ? __isctype((c), _IScntrl) : 0)
# define iscntrl(c) ((c < 0x7f) ? __isctype((c), _IScntrl) : 0)
#endif /* __BEOS__ */
/* --------------------------------------------------------------- */

View File

@ -55,7 +55,7 @@ gdirentry::~gdirentry()
gposixdir::gposixdir() : dirname(), ret(), entries()
{
ok = false;
ok = false;
}
@ -63,7 +63,7 @@ gposixdir::gposixdir() : dirname(), ret(), entries()
gposixdir::gposixdir(const char *name) : dirname(), ret(), entries()
{
cd(name);
cd(name);
}
@ -79,73 +79,73 @@ gposixdir::~gposixdir()
#ifndef _MSC_VER
void gposixdir::cd(const char *name, bool relative)
{
std::string ndirname;
if(not *name)
name = ".";
if(relative) {
dirname += "/";
dirname += name;
} else
dirname = name;
ok = maketruepath(dirname);
entries.clear();
DIR *d = opendir(dirname.c_str());
if(d == NULL)
ok = false;
else {
struct dirent *de;
while((de=readdir(d)) != NULL) {
ndirname = de->d_name;
std::string ndirname;
if(not *name)
name = ".";
if(relative) {
dirname += "/";
dirname += name;
} else
dirname = name;
ok = maketruepath(dirname);
entries.clear();
DIR *d = opendir(dirname.c_str());
if(d == NULL)
ok = false;
else {
struct dirent *de;
while((de=readdir(d)) != NULL) {
ndirname = de->d_name;
#ifdef __HAVE_DRIVES__
if((ndirname != ".") and not ((ndirname == "..") and streql(dirname.c_str()+1, ":/")))
if((ndirname != ".") and not ((ndirname == "..") and streql(dirname.c_str()+1, ":/")))
#else
if((ndirname != ".") and not ((ndirname == "..") and (dirname == "/")))
if((ndirname != ".") and not ((ndirname == "..") and (dirname == "/")))
#endif
entries.push_back(ndirname);
}
closedir(d);
rewind();
}
entries.push_back(ndirname);
}
closedir(d);
rewind();
}
}
#else
void gposixdir::cd(const char *name, bool relative)
{
std::string ndirname;
if(not *name)
name = ".";
if(relative) {
dirname += "/";
dirname += name;
} else
dirname = name;
ok = maketruepath(dirname);
entries.clear();
ndirname = dirname;
if ((ndirname.end() > ndirname.begin()) && (*(ndirname.end()-1) == '/'))
ndirname += "*";
else
ndirname += "/*";
struct _finddata_t de;
long d = _findfirst(ndirname.c_str(), &de);
if(d == -1) {
if(is_dir(dirname))
ok = true;
else
ok = false;
}
else {
do {
ndirname = de.name;
std::string ndirname;
if(not *name)
name = ".";
if(relative) {
dirname += "/";
dirname += name;
} else
dirname = name;
ok = maketruepath(dirname);
entries.clear();
ndirname = dirname;
if ((ndirname.end() > ndirname.begin()) && (*(ndirname.end()-1) == '/'))
ndirname += "*";
else
ndirname += "/*";
struct _finddata_t de;
long d = _findfirst(ndirname.c_str(), &de);
if(d == -1) {
if(is_dir(dirname))
ok = true;
else
ok = false;
}
else {
do {
ndirname = de.name;
#ifdef __HAVE_DRIVES__
if((ndirname != ".") and not ((ndirname == "..") and streql(dirname.c_str()+1, ":/")))
if((ndirname != ".") and not ((ndirname == "..") and streql(dirname.c_str()+1, ":/")))
#else
if((ndirname != ".") and not ((ndirname == "..") and (dirname == "/")))
if((ndirname != ".") and not ((ndirname == "..") and (dirname == "/")))
#endif
entries.push_back(ndirname);
} while(_findnext(d, &de) == 0);
_findclose(d);
rewind();
}
entries.push_back(ndirname);
} while(_findnext(d, &de) == 0);
_findclose(d);
rewind();
}
}
#endif
@ -153,26 +153,26 @@ void gposixdir::cd(const char *name, bool relative)
const gdirentry *gposixdir::nextentry(const char *mask, bool nameonly)
{
while(last_entry < entries.size()) {
if(mask and not gwildmat(entries[last_entry].c_str(), mask)) {
++last_entry;
continue;
}
ret.name = entries[last_entry];
ret.dirname = dirname.c_str();
if(not nameonly) {
std::string pn = ret.dirname;
pn += "/";
pn += ret.name;
size_t skipfrom;
while((skipfrom=pn.find("//")) != pn.npos)
pn.erase(skipfrom, 1);
stat(pn.c_str(), &ret.stat_info);
}
++last_entry;
return &ret;
}
return NULL;
while(last_entry < entries.size()) {
if(mask and not gwildmat(entries[last_entry].c_str(), mask)) {
++last_entry;
continue;
}
ret.name = entries[last_entry];
ret.dirname = dirname.c_str();
if(not nameonly) {
std::string pn = ret.dirname;
pn += "/";
pn += ret.name;
size_t skipfrom;
while((skipfrom=pn.find("//")) != pn.npos)
pn.erase(skipfrom, 1);
stat(pn.c_str(), &ret.stat_info);
}
++last_entry;
return &ret;
}
return NULL;
}

View File

@ -39,13 +39,13 @@
class gdirentry {
public:
std::string name;
struct stat stat_info;
const char *dirname;
gdirentry();
~gdirentry();
bool is_directory() const { return S_ISDIR(stat_info.st_mode); }
bool is_file() const { return S_ISREG(stat_info.st_mode); }
std::string name;
struct stat stat_info;
const char *dirname;
gdirentry();
~gdirentry();
bool is_directory() const { return S_ISDIR(stat_info.st_mode); }
bool is_file() const { return S_ISREG(stat_info.st_mode); }
};
@ -54,20 +54,20 @@ public:
class gposixdir {
private:
std::string dirname;
gdirentry ret;
gstrarray entries;
uint32_t last_entry;
std::string dirname;
gdirentry ret;
gstrarray entries;
uint32_t last_entry;
public:
bool ok;
gposixdir();
gposixdir(const char *name);
~gposixdir();
void cd(const char *name, bool relative=false);
inline void rewind() { last_entry = 0; }
const gdirentry *nextentry(const char *mask=NULL, bool nameonly=false);
inline const char *fullpath() { return dirname.c_str(); }
bool ok;
gposixdir();
gposixdir(const char *name);
~gposixdir();
void cd(const char *name, bool relative=false);
inline void rewind() { last_entry = 0; }
const gdirentry *nextentry(const char *mask=NULL, bool nameonly=false);
inline const char *fullpath() { return dirname.c_str(); }
};

View File

@ -40,10 +40,10 @@
#undef SH_COMPAT
#endif
#elif !defined(SH_DENYNO)
#define SH_DENYRW 0x10 // Deny read/write
#define SH_DENYWR 0x20 // Deny write
#define SH_DENYRD 0x30 // Deny read
#define SH_DENYNO 0x40 // Deny nothing
#define SH_DENYRW 0x10 // Deny read/write
#define SH_DENYWR 0x20 // Deny write
#define SH_DENYRD 0x30 // Deny read
#define SH_DENYNO 0x40 // Deny nothing
#endif
#ifndef SH_COMPAT

View File

@ -45,15 +45,15 @@ typedef std::vector<std::string> gstrarray;
// ------------------------------------------------------------------
inline void tokenize(gstrarray& array, const char* str, const char* delim = NULL) {
if(delim == NULL)
delim = ", \t";
char* tmp = throw_xstrdup(str);
char* token = strtok(tmp, delim);
while(token) {
array.push_back(token);
token = strtok(NULL, delim);
}
throw_xfree(tmp);
if(delim == NULL)
delim = ", \t";
char* tmp = throw_xstrdup(str);
char* token = strtok(tmp, delim);
while(token) {
array.push_back(token);
token = strtok(NULL, delim);
}
throw_xfree(tmp);
}

View File

@ -299,60 +299,60 @@ char *gcpuid(char *_cpuname)
/* Step 1. Try to toggle alignment check flag; does not exist on 386. */
"pushfl\n\t"
"popl %%eax\n\t"
"movl %%eax,%%ecx\n\t"
"orl $0x00040000,%%eax\n\t" /* sets a alignment check flag */
"pushl %%eax\n\t"
"popl %%eax\n\t"
"movl %%eax,%%ecx\n\t"
"orl $0x00040000,%%eax\n\t" /* sets a alignment check flag */
"pushl %%eax\n\t"
"popfl\n\t"
"pushfl\n\t"
"popl %%eax\n\t"
"xorl %%ecx,%%eax\n\t"
"andl $0x00040000,%%eax\n\t" /* test alignment check flag */
"pushl %%ecx\n\t"
"popl %%eax\n\t"
"xorl %%ecx,%%eax\n\t"
"andl $0x00040000,%%eax\n\t" /* test alignment check flag */
"pushl %%ecx\n\t"
"popfl\n\t"
"testl %%eax,%%eax\n\t" /* alignment check flag is set? */
"jnz try486\n\t"
"testl %%eax,%%eax\n\t" /* alignment check flag is set? */
"jnz try486\n\t"
/* NexGen CPU does not have aligment check flag. */
"pushfl\n\t"
"movl $0x5555, %%eax\n\t"
"xorl %%edx, %%edx\n\t"
"movl $2, %%ecx\n\t"
"movl $0x5555, %%eax\n\t"
"xorl %%edx, %%edx\n\t"
"movl $2, %%ecx\n\t"
"clc\n\t"
"divl %%ecx\n\t"
"jz nexgen\n\t"
"divl %%ecx\n\t"
"jz nexgen\n\t"
"popfl\n\t"
"movl $3,%0\n\t" /* CPU 386 */
"jmp end\n"
"movl $3,%0\n\t" /* CPU 386 */
"jmp end\n"
"nexgen:"
"popfl\n\t"
"movl $5,%0\n\t" /* CPU NX586 */
"movl $0x4778654e,%1\n\t" /* store vendor string */
"movl $0x72446e65,%1+4\n\t" /* "NexGenDriven" */
"movl $0x6e657669,%1+8\n\t"
// "movl $0,%1+12\n\t" // vendor is zero-filled already
"jmp end\n"
"movl $5,%0\n\t" /* CPU NX586 */
"movl $0x4778654e,%1\n\t" /* store vendor string */
"movl $0x72446e65,%1+4\n\t" /* "NexGenDriven" */
"movl $0x6e657669,%1+8\n\t"
// "movl $0,%1+12\n\t" // vendor is zero-filled already
"jmp end\n"
/* Step2. Try to toggle identification flag; does not exist on early 486s.*/
"try486:"
"pushfl\n\t"
"popl %%eax\n\t"
"movl %%eax,%%ecx\n\t"
"xorl $0x00200000,%%eax\n\t" /* sets a identification bit */
"pushl %%eax\n\t"
"popl %%eax\n\t"
"movl %%eax,%%ecx\n\t"
"xorl $0x00200000,%%eax\n\t" /* sets a identification bit */
"pushl %%eax\n\t"
"popfl\n\t"
"pushfl\n\t"
"popl %%eax\n\t"
"xorl %%ecx,%%eax\n\t"
"andl $0x00200000,%%eax\n\t" /* test identification bit */
"pushl %%ecx\n\t"
"popl %%eax\n\t"
"xorl %%ecx,%%eax\n\t"
"andl $0x00200000,%%eax\n\t" /* test identification bit */
"pushl %%ecx\n\t"
"popfl\n\t"
"testl %%eax,%%eax\n\t" /* if identification flag is set then cpuid CPU's command may be used */
"jnz trycpuid\n\t"
"movl $4,%0\n\t" /* CPU 486 */
"testl %%eax,%%eax\n\t" /* if identification flag is set then cpuid CPU's command may be used */
"jnz trycpuid\n\t"
"movl $4,%0\n\t" /* CPU 486 */
/*
* Check Cyrix CPU
@ -362,14 +362,14 @@ char *gcpuid(char *_cpuname)
* Note: CPUID is enabled on M2, so it passes another way.
*/
"pushfl\n\t"
"movl $0x5555, %%eax\n\t"
"xorl %%edx, %%edx\n\t"
"movl $2, %%ecx\n\t"
"movl $0x5555, %%eax\n\t"
"xorl %%edx, %%edx\n\t"
"movl $2, %%ecx\n\t"
"clc\n\t"
"divl %%ecx\n\t"
"jnc trycyrix\n\t"
"divl %%ecx\n\t"
"jnc trycyrix\n\t"
"popfl\n\t"
"jmp end\n" /* You may use Intel CPU */
"jmp end\n" /* You may use Intel CPU */
"trycyrix:"
"popfl\n\t"
@ -379,44 +379,44 @@ char *gcpuid(char *_cpuname)
* CPU, we couldn't distinguish it from Cyrix's (including IBM
* brand of Cyrix CPUs).
*/
"movl $0x69727943,%1\n\t" /* store vendor string */
"movl $0x736e4978,%1+4\n\t" /* "CyrixInstead" */
"movl $0x64616574,%1+8\n\t"
"jmp end\n"
"movl $0x69727943,%1\n\t" /* store vendor string */
"movl $0x736e4978,%1+4\n\t" /* "CyrixInstead" */
"movl $0x64616574,%1+8\n\t"
"jmp end\n"
/* Step 3. Use the `cpuid' instruction. */
"trycpuid:"
"xorl %%eax,%%eax\n\t"
".byte 0x0f,0xa2\n\t" /* cpuid 0 */
"movl %%eax,%2\n\t" /* "cpuid 1" capability */
"movl %%ebx,%1\n\t" /* store vendor string */
"movl %%edx,%1+4\n\t"
"movl %%ecx,%1+8\n\t"
// "movb $0,%1+12\n\t" // vendor is zero-filled already
"xorl %%eax,%%eax\n\t"
".byte 0x0f,0xa2\n\t" /* cpuid 0 */
"movl %%eax,%2\n\t" /* "cpuid 1" capability */
"movl %%ebx,%1\n\t" /* store vendor string */
"movl %%edx,%1+4\n\t"
"movl %%ecx,%1+8\n\t"
// "movb $0,%1+12\n\t" // vendor is zero-filled already
"andl %%eax,%%eax\n\t" /* "cpuid 1" is allowed? (eax==1?) */
"jz i586\n\t" /* no, skip "cpuid 1" */
"movl $1,%%eax\n\t"
".byte 0x0f,0xa2\n\t" // cpuid 1
// "movl %%eax,%6\n\t" // store cpu_id
// "movl %%edx,%7\n\t" // store cpu_feature
"movl $1,%%eax\n\t"
".byte 0x0f,0xa2\n\t" // cpuid 1
// "movl %%eax,%6\n\t" // store cpu_id
// "movl %%edx,%7\n\t" // store cpu_feature
"movb %%al,%%bl\n\t"
"shrb $4,%%bl\n\t" // extract CPU model
"movb %%bl,%4\n\t" // store model
"movb %%al,%%bl\n\t"
"shrb $4,%%bl\n\t" // extract CPU model
"movb %%bl,%4\n\t" // store model
"andl $0x0F0F,%%eax\n\t" // extract CPU family type and stepping
"movb %%al,%5\n\t" // store stepping
"movb %%ah,%3\n\t" // store family
"cmpb $5,%%ah\n\t"
"jae i586\n\t"
"andl $0x0F0F,%%eax\n\t" // extract CPU family type and stepping
"movb %%al,%5\n\t" // store stepping
"movb %%ah,%3\n\t" // store family
"cmpb $5,%%ah\n\t"
"jae i586\n\t"
/* less than Pentium; must be 486 */
"movl $4,%0\n\t" /* CPU 486 */
"jmp end\n"
"movl $4,%0\n\t" /* CPU 486 */
"jmp end\n"
"i586:\n\t" /* Pentium and greater. Store family type into CPU type var */
"movb %%ah,%0\n"
"movb %%ah,%0\n"
"end:\n\t"
"nop\n\t"

View File

@ -48,25 +48,25 @@
/* CONFIG.flags */
/********************************************************/
#define RETEAR 0x00000001l
#define AUTOCREATE 0x00000002l
#define KILLEMPTY 0x00000004l
#define KILLDUPES 0x00000008l
#define FRONTDOOR 0x00000010l
#define DBRIDGE 0x00000020l
#define BINKLEY 0x00000040l
#define INTERMAIL 0x00000080l
#define AUTOCREATE 0x00000002l
#define KILLEMPTY 0x00000004l
#define KILLDUPES 0x00000008l
#define FRONTDOOR 0x00000010l
#define DBRIDGE 0x00000020l
#define BINKLEY 0x00000040l
#define INTERMAIL 0x00000080l
//#define SWAP_XMS 0x00000100l
//#define SWAP_EMS 0x00000200l
//#define SWAP_DISK 0x00000400l
#define PURGE_PROCESSDATE 0x00008000l
#define MAILER_RESCAN 0x00010000l
#define EXCLUDE_USERS 0x00020000l
#define EXCLUDE_SYSOPS 0x00040000l
#define CHECK_DESTINATION 0x00080000l
#define EXCLUDE_USERS 0x00020000l
#define EXCLUDE_SYSOPS 0x00040000l
#define CHECK_DESTINATION 0x00080000l
#define UPDATE_BBS_CONFIG 0x00100000l
#define KILL_GRUNGED_DATE 0x00200000l
#define NOT_BUFFER_EMS 0x00400000l
#define KEEP_NETMAILS 0x00800000l
#define KEEP_NETMAILS 0x00800000l
#define NOT_UPDATE_MAILER 0x01000000l
#define NOT_CHECK_SEMAPHORES 0x02000000l
#define CREATE_SEMAPHORES 0x04000000l
@ -83,14 +83,14 @@ enum BBSSoft { NoBBSSoft = 0, RemoteAccess111, QuickBBS,
/* CONFIG.CC.what */
/********************************************************/
#define FROM 1
#define TO 2
#define SUBJECT 3
#define TO 2
#define SUBJECT 3
/********************************************************/
/* CONFIG.QuietLevel */
/********************************************************/
#define QUIET_PACK 0x0001
#define QUIET_UNPACK 0x0002
#define QUIET_UNPACK 0x0002
#define QUIET_EXTERN 0x0004
/********************************************************/
@ -108,13 +108,13 @@ enum ARCmailExt { ARCDigits = 0, ARCHex, ARCAlpha };
/********************************************************/
/* CONFIG.AreaFixFlags */
/********************************************************/
#define ALLOWRESCAN 0x0001
#define KEEPREQUEST 0x0002
#define KEEPRECEIPT 0x0004
#define ALLOWREMOTE 0x0008
#define DETAILEDLIST 0x0010
#define ALLOWPASSWORD 0x0020
#define ALLOWPKTPWD 0x0040
#define ALLOWRESCAN 0x0001
#define KEEPREQUEST 0x0002
#define KEEPRECEIPT 0x0004
#define ALLOWREMOTE 0x0008
#define DETAILEDLIST 0x0010
#define ALLOWPASSWORD 0x0020
#define ALLOWPKTPWD 0x0040
/********************************************************/
/* Area.board (1-200 = QBBS) */
@ -126,10 +126,10 @@ enum ARCmailExt { ARCDigits = 0, ARCHex, ARCAlpha };
/* Area.flags.type */
/********************************************************/
#define QBBS 0
#define FIDO 1
#define SQUISH 2
#define FIDO 1
#define SQUISH 2
#define JAM 3
#define PT_BOARD 7
#define PT_BOARD 7
/********************************************************/
/* Area.type */
@ -138,26 +138,26 @@ enum ARCmailExt { ARCDigits = 0, ARCHex, ARCAlpha };
#define AREA_NETMAIL 1
#define AREA_LOCAL 2
#define AREA_BADMAILBOARD 3
#define AREA_DUPEBOARD 4
#define AREA_DUPEBOARD 4
/********************************************************/
/* Node.flags */
/********************************************************/
#define DDDD 0x0001
#define TOSSCAN 0x0002
#define DIRECT 0x0004
#define CRASH 0x0008
#define UMLAUT_NET 0x0010
#define TOSSCAN 0x0002
#define DIRECT 0x0004
#define CRASH 0x0008
#define UMLAUT_NET 0x0010
#define ALLOW_AF_REMOTE 0x0020
#define RESCANDISABLED 0x0040
#define HOLD 0x0080
#define ARCMAIL060 0x0200
#define PASSIVE 0x0400
#define HOLD 0x0080
#define ARCMAIL060 0x0200
#define PASSIVE 0x0400
#define ALLOWAREACREATE 0x0800
#define PACKER 0xF000
#define PACKS(x) (int)(((x)&PACKER)>>12) /* Index of used Packer */
/* 0xf = .PKT, don't pack */
/* 0xf = .PKT, don't pack */
/********************************************************/
/* Node.advflags */
@ -166,7 +166,7 @@ enum ARCmailExt { ARCDigits = 0, ARCHex, ARCAlpha };
#define NOT_NOTIFY 0x0002
#define NOT_HELP 0x0004
#define NOATTACH 0x0008
#define NET_HOLD 0x0010
#define NET_HOLD 0x0010
#define NET_CRASH 0x0020
#define NET_DIRECT 0x0040
@ -215,7 +215,7 @@ typedef struct CONFIGURATION4
{
char tag[4];
char name[_MAXPATH-2];
char list[2]; /* List prefix character */
char list[2]; /* List prefix character */
} Packer[8];
struct
{
@ -271,7 +271,7 @@ typedef struct CONFIGURATION4
char TempInBound[_MAXPATH];
char resv2[832];
dword offset; /* This is the offset from the current
file-pointer to the 1st Node */
file-pointer to the 1st Node */
} CONFIG4;
/* To directly access the 'Nodes' and/or 'Areas' while bypassing the */
@ -289,9 +289,9 @@ typedef struct
char newgroup; /* Default group for new areas */
Address routes[15]; /* netmail routing */
byte areas[124]; /* Bit-field with 992 bits, Byte 0/Bit 7 */
/* is conference 0, etc. */
/* is conference 0, etc. */
dword groups; /* Bit-field, Byte 0/Bit 7 = 'A' etc. */
/* false means group is active */
/* false means group is active */
char areafixpw[9];
byte advflags;
} FeNode4;
@ -427,7 +427,7 @@ typedef struct
#define EH_QBBS_MSG 0x0101
#define EH_SBBS_MSG 0x0102
#define EH_PB122_MSG 0x0103
#define EH_TAG_MSG 0x0104
#define EH_TAG_MSG 0x0104
#define EH_RA200_MSG 0x0105 /* See BBS package's documentation */
#define EH_PB130_MSG 0x0106 /* for details */

View File

@ -44,38 +44,38 @@
#define MAX_NODES 1024 /* max # of nodes */
#define MAX_GROUPS 26 /* max # of groups */
#define MAX_AKAS 16 /* max # of akas */
#define MAX_ROUTE 15 /* max # of 'vias' */
#define MAX_ROUTE 15 /* max # of 'vias' */
/*
Note: The MAX_AREAS and MAX_NODES are only the absolute maximums
as the handling is flexible. To get the maximums which are
used for the config file you read, you have to examine the
CONFIG.MaxAreas and CONFIG.MaxNodes variables !
as the handling is flexible. To get the maximums which are
used for the config file you read, you have to examine the
CONFIG.MaxAreas and CONFIG.MaxNodes variables !
*/
/********************************************************/
/* CONFIG.flags */
/********************************************************/
#define RETEAR 0x00000001l
#define AUTOCREATE 0x00000002l
#define KILLEMPTY 0x00000004l
#define KILLDUPES 0x00000008l
#define FRONTDOOR 0x00000010l
#define DBRIDGE 0x00000020l
#define BINKLEY 0x00000040l
#define INTERMAIL 0x00000080l
#define AUTOCREATE 0x00000002l
#define KILLEMPTY 0x00000004l
#define KILLDUPES 0x00000008l
#define FRONTDOOR 0x00000010l
#define DBRIDGE 0x00000020l
#define BINKLEY 0x00000040l
#define INTERMAIL 0x00000080l
//#define SWAP_XMS 0x00000100l
//#define SWAP_EMS 0x00000200l
//#define SWAP_DISK 0x00000400l
#define PURGE_PROCESSDATE 0x00008000l
#define MAILER_RESCAN 0x00010000l
#define EXCLUDE_USERS 0x00020000l
#define EXCLUDE_SYSOPS 0x00040000l
#define CHECK_DESTINATION 0x00080000l
#define EXCLUDE_USERS 0x00020000l
#define EXCLUDE_SYSOPS 0x00040000l
#define CHECK_DESTINATION 0x00080000l
#define UPDATE_BBS_CONFIG 0x00100000l
#define KILL_GRUNGED_DATE 0x00200000l
#define NOT_BUFFER_EMS 0x00400000l
#define KEEP_NETMAILS 0x00800000l
#define KEEP_NETMAILS 0x00800000l
#define NOT_UPDATE_MAILER 0x01000000l
#define NOT_CHECK_SEMAPHORES 0x02000000l
#define CREATE_SEMAPHORES 0x04000000l
@ -86,20 +86,20 @@
/********************************************************/
enum BBSSoft { NoBBSSoft = 0, RemoteAccess111, QuickBBS,
SuperBBS, ProBoard122, TagBBS, RemoteAccess200,
ProBoard130};
ProBoard130};
/********************************************************/
/* CONFIG.CC.what */
/********************************************************/
#define FROM 1
#define TO 2
#define SUBJECT 3
#define TO 2
#define SUBJECT 3
/********************************************************/
/* CONFIG.QuietLevel */
/********************************************************/
#define QUIET_PACK 0x0001
#define QUIET_UNPACK 0x0002
#define QUIET_UNPACK 0x0002
#define QUIET_EXTERN 0x0004
/********************************************************/
@ -117,13 +117,13 @@ enum ARCmailExt { ARCDigits = 0, ARCHex, ARCAlpha };
/********************************************************/
/* CONFIG.AreaFixFlags */
/********************************************************/
#define ALLOWRESCAN 0x0001
#define KEEPREQUEST 0x0002
#define KEEPRECEIPT 0x0004
#define ALLOWREMOTE 0x0008
#define DETAILEDLIST 0x0010
#define ALLOWPASSWORD 0x0020
#define ALLOWPKTPWD 0x0040
#define ALLOWRESCAN 0x0001
#define KEEPREQUEST 0x0002
#define KEEPRECEIPT 0x0004
#define ALLOWREMOTE 0x0008
#define DETAILEDLIST 0x0010
#define ALLOWPASSWORD 0x0020
#define ALLOWPKTPWD 0x0040
/********************************************************/
/* Area.board (1-200 = QBBS) */
@ -135,10 +135,10 @@ enum ARCmailExt { ARCDigits = 0, ARCHex, ARCAlpha };
/* Area.flags.type */
/********************************************************/
#define QBBS 0
#define FIDO 1
#define SQUISH 2
#define FIDO 1
#define SQUISH 2
#define JAM 3
#define PT_BOARD 7
#define PT_BOARD 7
/********************************************************/
/* Area.type */
@ -147,26 +147,26 @@ enum ARCmailExt { ARCDigits = 0, ARCHex, ARCAlpha };
#define AREA_NETMAIL 1
#define AREA_LOCAL 2
#define AREA_BADMAILBOARD 3
#define AREA_DUPEBOARD 4
#define AREA_DUPEBOARD 4
/********************************************************/
/* Node.flags */
/********************************************************/
#define DDDD 0x0001
#define TOSSCAN 0x0002
#define DIRECT 0x0004
#define CRASH 0x0008
#define UMLAUT_NET 0x0010
#define TOSSCAN 0x0002
#define DIRECT 0x0004
#define CRASH 0x0008
#define UMLAUT_NET 0x0010
#define ALLOW_AF_REMOTE 0x0020
#define RESCANDISABLED 0x0040
#define HOLD 0x0080
#define ARCMAIL060 0x0200
#define PASSIVE 0x0400
#define HOLD 0x0080
#define ARCMAIL060 0x0200
#define PASSIVE 0x0400
#define ALLOWAREACREATE 0x0800
#define PACKER 0xF000
#define PACKS(x) (int)(((x)&PACKER)>>12) /* Index of used Packer */
/* 0xf = .PKT, don't pack */
/* 0xf = .PKT, don't pack */
/********************************************************/
/* Node.advflags */
@ -175,7 +175,7 @@ enum ARCmailExt { ARCDigits = 0, ARCHex, ARCAlpha };
#define NOT_NOTIFY 0x0002
#define NOT_HELP 0x0004
#define NOATTACH 0x0008
#define NET_HOLD 0x0010
#define NET_HOLD 0x0010
#define NET_CRASH 0x0020
#define NET_DIRECT 0x0040
@ -224,7 +224,7 @@ typedef struct CONFIGURATION5
{
char tag[4];
char name[_MAXPATH-2];
char list[2]; /* List prefix character */
char list[2]; /* List prefix character */
} Packer[8];
struct
{
@ -279,7 +279,7 @@ typedef struct CONFIGURATION5
char AreaFixLog[_MAXPATH];
char TempInBound[_MAXPATH];
word maxPKTmsgs;
word RouteCnt; /* # of PackRoute records */
word RouteCnt; /* # of PackRoute records */
char resv2[822];
word MaxAreas,MaxNodes; /* Current max values for this config */
word NodeRecSize; /* For internal use only, the 'Node'
@ -288,7 +288,7 @@ typedef struct CONFIGURATION5
used size will be held in memory
while FE & FESetup is running */
dword offset; /* This is the offset from the current
file-pointer to the 1st Node */
file-pointer to the 1st Node */
} CONFIG5;
/* To directly access the 'Nodes' and/or 'Areas' while bypassing the */
@ -298,7 +298,7 @@ typedef struct CONFIGURATION5
typedef struct
{
Address addr;
Address arcdest; /* destination for ARCmail file attaches */
Address arcdest; /* destination for ARCmail file attaches */
byte aka; /* 0 ... MAX_AKAS-1 */
byte autopassive; /* # of days */
byte newgroup; /* Default group for new areas */
@ -306,12 +306,12 @@ typedef struct
word flags;
word sec_level;
char password[9]; /* .PKT password */
char areafixpw[9]; /* AreaFix password */
char areafixpw[9]; /* AreaFix password */
dword groups; /* Bit-field, Byte 0/Bit 7 = 'A' etc. */
/* false means group is active */
/* false means group is active */
dword resv;
byte areas[MAX_AREAS/8]; /* Bit-field with MAX_AREAS bits, Byte 0/Bit 7 */
/* is conference 0, etc. */
/* is conference 0, etc. */
} FeNode5;
typedef struct
@ -342,7 +342,7 @@ typedef struct
word keepsysop : 1;
word killread : 1;
word disablepsv : 1;
word resv : 7;
word resv : 7;
} advflags;
word seenbys; /* LSB = Aka0, MSB = Aka15 */
short recvdays;
@ -453,8 +453,8 @@ typedef struct
#define EH_RA111_MSG 0x0100 /* Original records of BBS systems */
#define EH_QBBS_MSG 0x0101
#define EH_SBBS_MSG 0x0102
#define EH_PB122_MSG 0x0103 /* obsolete */
#define EH_TAG_MSG 0x0104
#define EH_PB122_MSG 0x0103 /* obsolete */
#define EH_TAG_MSG 0x0104
#define EH_RA200_MSG 0x0105 /* See BBS package's documentation */
#define EH_PB200_MSG 0x0106 /* for details */

View File

@ -197,7 +197,7 @@ typedef struct {
byte audio_end_hour;
byte audio_end_minute;
/* --- Minimum cost to process undialable */
/* --- Minimum cost to process undialable */
word min_undial_cost;

View File

@ -398,8 +398,8 @@ struct _PRM
word matrix_mask;
word MinNetBaud; /* minimum baud rate for remote netmail */
byte exit_mailer; /* Exit when mailer is running */
byte num_crashes; /* Number of tries when sending crash */
byte exit_mailer; /* Exit when mailer is running */
byte num_crashes; /* Number of tries when sending crash */
struct class_rec Class[MAXCLASS];
struct _FOSREGS FosRegs[10];
@ -420,30 +420,30 @@ struct _PRM
byte sylno; /* Def Sysop Language no. (0-5) */
byte uslno; /* Def User Language no. (0-5) */
byte relog_exit; /* Exit after -o relog */
word Scrn_Size; /* Local monitor's size, high byte = len */
word Scrn_Size; /* Local monitor's size, high byte = len */
/* New for version 18 */
word default_expire_days; /* Number of days before new users */
word default_expire_mins; /* Number of days before new users */
long default_keys; /* New user's default keys */
long default_section; /* New user's default section */
word Point_Net; /* My point net */
word Boss_Node; /* My point net */
byte NoPwd_Priv; /* Priv if you want to allow users without password */
byte Local_Exit; /* Exit after local messages */
byte Upload_Exit; /* Exit after an upload for checking */
byte ExtMail_Exit; /* Exit for externmail */
byte Max_Echo; /* Longest echomail message to handle 3-60k */
byte WhoPriv; /* Priv to see who uploaded a file */
word default_expire_days; /* Number of days before new users */
word default_expire_mins; /* Number of days before new users */
long default_keys; /* New user's default keys */
long default_section; /* New user's default section */
word Point_Net; /* My point net */
word Boss_Node; /* My point net */
byte NoPwd_Priv; /* Priv if you want to allow users without password */
byte Local_Exit; /* Exit after local messages */
byte Upload_Exit; /* Exit after an upload for checking */
byte ExtMail_Exit; /* Exit for externmail */
byte Max_Echo; /* Longest echomail message to handle 3-60k */
byte WhoPriv; /* Priv to see who uploaded a file */
ADDR GUUCP; /* Where to send gated UUCP messages */
ADDR GUUCP; /* Where to send gated UUCP messages */
long making_section;
byte ListSysop; /* Privilege neeeded to see sysops in net list */
byte rawpriv; /* Privilege needed to see/download files not listed */
byte uucp_priv; /* Privilege needed to turn off uucp addresses */
byte Flags3; /* More flags. */
byte Mail_Exit; /* Exit after mail connect */
byte ListSysop; /* Privilege neeeded to see sysops in net list */
byte rawpriv; /* Privilege needed to see/download files not listed */
byte uucp_priv; /* Privilege needed to turn off uucp addresses */
byte Flags3; /* More flags. */
byte Mail_Exit; /* Exit after mail connect */
byte byte_fill;
word PRM_FILL3[18];
@ -533,39 +533,39 @@ struct _PRM
OFS xtexpd; /* Expired due-to-Time used OEC BBS */
OFS lang[12]; /* 12 Language File Root Name pointers */
OFS badpath; /* Path for unrecognized echo names */
OFS badpath; /* Path for unrecognized echo names */
/*--------------------------------------------------------------------------*/
/* New for version 18 */
/*--------------------------------------------------------------------------*/
OFS ConfHelp; /* Help file for newuser configure */
OFS Mainmenu; /* ASCII menu at MAIN */
OFS Confmenu; /* ASCII menu at Config */
OFS Sectmenu; /* ASCII menu at Section menu */
OFS Sysopmenu; /* ASCII menu at Sysop menu */
OFS ConfHelp; /* Help file for newuser configure */
OFS Mainmenu; /* ASCII menu at MAIN */
OFS Confmenu; /* ASCII menu at Config */
OFS Sectmenu; /* ASCII menu at Section menu */
OFS Sysopmenu; /* ASCII menu at Sysop menu */
OFS Echotoss; /* Where to find EchoToss.Log */
OFS MDM_Answer; /* String to force autoanswer */
OFS BAD_PWD; /* File shown to users who've forgottent thiers */
OFS BAD_PWD; /* File shown to users who've forgottent thiers */
OFS charset; /* File that contains character translation tables */
OFS DL_Log; /* Who's downloaded what */
OFS UL_Log; /* Who uploaded what */
OFS Name_Filter; /* Old USERNAME.TXT */
OFS Bad_Name; /* What to show user if filter catches them */
OFS CUSTOM1_menu; /* What to show before CUSTOM1 menu */
OFS CUSTOM2_menu; /* What to show before CUSTOM2 menu */
OFS CUSTOM3_menu; /* What to show before CUSTOM3 menu */
OFS CUSTOM4_menu; /* What to show before CUSTOM4 menu */
OFS CUSTOM5_menu; /* What to show before CUSTOM5 menu */
OFS CUSTOM6_menu; /* What to show before CUSTOM6 menu */
OFS EXT_mail_string; /* What we see when UUCP is coming */
OFS MaybeNew; /* File shown if didn't find user name */
OFS Histmenu; /* ASCII menu at History */
OFS My_Question; /* Sysop configured question */
OFS HLP_make; /* How to make a section */
OFS MDM_FDial[4]; /* Special dialing instructions */
OFS Yell; /* Yell OEC */
OFS HLP_Macro; /* Help for macro menu */
OFS UUCP_list; /* Address list for UUCP */
OFS HLP_IChat; /* Interline chat help */
OFS DL_Log; /* Who's downloaded what */
OFS UL_Log; /* Who uploaded what */
OFS Name_Filter; /* Old USERNAME.TXT */
OFS Bad_Name; /* What to show user if filter catches them */
OFS CUSTOM1_menu; /* What to show before CUSTOM1 menu */
OFS CUSTOM2_menu; /* What to show before CUSTOM2 menu */
OFS CUSTOM3_menu; /* What to show before CUSTOM3 menu */
OFS CUSTOM4_menu; /* What to show before CUSTOM4 menu */
OFS CUSTOM5_menu; /* What to show before CUSTOM5 menu */
OFS CUSTOM6_menu; /* What to show before CUSTOM6 menu */
OFS EXT_mail_string; /* What we see when UUCP is coming */
OFS MaybeNew; /* File shown if didn't find user name */
OFS Histmenu; /* ASCII menu at History */
OFS My_Question; /* Sysop configured question */
OFS HLP_make; /* How to make a section */
OFS MDM_FDial[4]; /* Special dialing instructions */
OFS Yell; /* Yell OEC */
OFS HLP_Macro; /* Help for macro menu */
OFS UUCP_list; /* Address list for UUCP */
OFS HLP_IChat; /* Interline chat help */
OFS protocols[MAX_EXTERN]; /* external file protocol programs */
/*v18*/ OFS OFS_Filler[7];
@ -586,13 +586,13 @@ struct _PRM
char buf[CTLSIZE];
end;
#define ASK_PHONE 0x01 /* Used with xuflags */
#define ASK_ALIAS 0x02 /* Used with xuflags */
#define ASK_REAL 0x04 /* Used with xuflags */
#define ASK_CITY 0x08 /* Used with xuflags */
#define CAN_ALIAS 0x10 /* Allow ALIAS' in some situations */
#define ASK_BDAY 0x20 /* Ask user for birthday */
#define ASK_ADDRESS 0x40 /* Ask user for street address */
#define ASK_PHONE 0x01 /* Used with xuflags */
#define ASK_ALIAS 0x02 /* Used with xuflags */
#define ASK_REAL 0x04 /* Used with xuflags */
#define ASK_CITY 0x08 /* Used with xuflags */
#define CAN_ALIAS 0x10 /* Allow ALIAS' in some situations */
#define ASK_BDAY 0x20 /* Ask user for birthday */
#define ASK_ADDRESS 0x40 /* Ask user for street address */
/* Means no privilege level is set and/or applicable At LOGON, */
/* for example, it means system is for PRE-REGISTERED users only. */
@ -603,8 +603,8 @@ struct _common_data {
char Opus[16]; /* "OPUS-CBCS 1.20" */
long QuotePosition; /* Quote file position */
long CallerCount; /* Number of callers */
long Caller_ID; /* ID of current newest user */
long MSG_ID; /* Last used MSGID */
long Caller_ID; /* ID of current newest user */
long MSG_ID; /* Last used MSGID */
word FILLER[15]; /* RESERVED - do not use */
word MAX_task; /* Highest task number */
};
@ -642,15 +642,15 @@ struct _common_data {
#define MATRIX_CHANGED 0x0001 /* Changed matrix area. Scan */
#define LOCAL_CHANGED 0x0002 /* Changed Local area. */
#define GOT_BUNDLE 0x0100 /* Received a PKT file */
#define GOT_ARCMAIL 0x0200 /* Received an archived file */
#define GOT_REQUESTS 0x0400 /* Got file requests to handle */
#define GOT_ECHOMAIL 0x1000 /* Received Echomail */
#define GOT_BUNDLE 0x0100 /* Received a PKT file */
#define GOT_ARCMAIL 0x0200 /* Received an archived file */
#define GOT_REQUESTS 0x0400 /* Got file requests to handle */
#define GOT_ECHOMAIL 0x1000 /* Received Echomail */
/*--------------------------------------------------------------------------*/
/* INTERLINE FLAGS */
/*--------------------------------------------------------------------------*/
#define CAN_CHAT 0x01 /* Multiline systems can do chats */
#define CAN_CHAT 0x01 /* Multiline systems can do chats */
// END OF SUB-INCLUDE PRM18.H ////////////////////////////////////////////////////
@ -678,7 +678,7 @@ struct _common_data {
#define STEADY 0x02 /* never change baud rate 0000 0010 */
#define ECHOSCAN 0x04 /* automatically scan echo's 0000 0100 */
#define ECHO_GUARD 0x08 /* no toss un-pwd echo arc 0000 1000 */
#define LEAVE_ESCN 0x10 /* Leave echotoss.log after Scanning 0001 0000 */
#define LEAVE_ESCN 0x10 /* Leave echotoss.log after Scanning 0001 0000 */
#define DO_MSGID 0x20 /* Put MSGID lines into echomail 0010 0000 */
#define F_NOCRASH 0x40 /* Don't accept crash mail 0100 0000 */
#define F_UNPK 0x80 /* Unpack incomming arcmail 1000 0000 */
@ -700,11 +700,11 @@ struct _common_data {
/*--------------------------------------------------------------------------*/
/* FLAGS 3 */
/*--------------------------------------------------------------------------*/
#define F3STEADY 0x01 /* Can do ARQ steady. &B2 */
#define F3GMENU 0x02 /* Will let users do graphics menus */
#define F3LOGOFF 0x04 /* Collect logoff messages */
#define F3NOALIAS 0x08 /* Don't put alias' in SEEN-BY */
#define F3HINAMES 0x10 /* Allow users with hi-bit names */
#define F3STEADY 0x01 /* Can do ARQ steady. &B2 */
#define F3GMENU 0x02 /* Will let users do graphics menus */
#define F3LOGOFF 0x04 /* Collect logoff messages */
#define F3NOALIAS 0x08 /* Don't put alias' in SEEN-BY */
#define F3HINAMES 0x10 /* Allow users with hi-bit names */
/*--------------------------------------------------------------------------*/
/* FWDflags (bits to control IN TRANSIT messages) */
@ -713,9 +713,9 @@ struct _common_data {
#define FWD_PWD 0x02 /* IN TRANSIT by pwd only 0000 0010 */
#define FWD_TONET 0x04 /* Accept IN TRANSIT only to my net 0000 0100 */
#define FWD_NOBITS 0x08 /* No IN TRANSIT if extended bits used 0000 1000 */
#define FWD_HOST 0x10 /* Send mail to host if can't find. */
#define VERSION6 0x40 /* Use Version 6 nodelist */
#define IMAPOINT 0x80 /* This is a point */
#define FWD_HOST 0x10 /* Send mail to host if can't find. */
#define VERSION6 0x40 /* Use Version 6 nodelist */
#define IMAPOINT 0x80 /* This is a point */
/*--------------------------------------------------------------------------*/
/* LOG FLAGS */
@ -731,7 +731,7 @@ struct _common_data {
#define M_SNOOP 0x01 /* sysop display on 0000 0001 */
#define MOUSE 0x02 /* sysop mouse on 0000 0010 */
#define M_BRKCLEAR 0x04 /* Use BREAK to clear outbound buffer 0000 0100 */
#define SLOW_MODEM 0x08 /* Slow modem and fast computer */
#define SLOW_MODEM 0x08 /* Slow modem and fast computer */
/*--------------------------------------------------------------------------*/
/* STYLE FLAGS */
@ -739,11 +739,11 @@ struct _common_data {
#define SF_PATH 0x01 /* use path, not Dir.Bbs 0000 0001 */
#define SF_KILL 0x02 /* Kill rec'd pvt messages 0000 0010 */
#define SF_ASKKILL 0x04 /* ASK about killing msgs 0000 0100 */
#define SF_EUROPE 0x08 /* European date strings */
#define SF_TIME 0x10 /* Show time remaining on menu 0001 0000 */
#define SF_NOFLAG 0x20 /* Don't allow user config at logon 0010 0000 */
#define SF_HANDHOLD 0x40 /* Track user's errors and add help 0100 0000 */
#define SF_NOHIGH 0x80 /* Track user's errors and add help 0100 0000 */
#define SF_EUROPE 0x08 /* European date strings */
#define SF_TIME 0x10 /* Show time remaining on menu 0001 0000 */
#define SF_NOFLAG 0x20 /* Don't allow user config at logon 0010 0000 */
#define SF_HANDHOLD 0x40 /* Track user's errors and add help 0100 0000 */
#define SF_NOHIGH 0x80 /* Track user's errors and add help 0100 0000 */
#define SET_FLAG(x,y) ((x)|=(y))
@ -770,7 +770,7 @@ struct _common_data {
/* THE USER DATABASE */
/*--------------------------------------------------------------------------*/
#define MAX_USEC 80 /* Maximum number of areas in "user" section */
#define MAX_USEC 80 /* Maximum number of areas in "user" section */
struct _usr
{
@ -858,20 +858,20 @@ struct _common_data {
uint32_t messages_read; /* Total number of messages read */
int32_t messages_sent; /* Number of messages entered by user */
word my_section[MAX_USEC]; /* This is just a block of area */
/* numbers in the user's Section */
/* Message areas are first, then */
/* file areas. The first file */
/* area is at my_section[msecs] */
word my_section[MAX_USEC]; /* This is just a block of area */
/* numbers in the user's Section */
/* Message areas are first, then */
/* file areas. The first file */
/* area is at my_section[msecs] */
word big_fill[40]; /* Fill out to 512 bytes */
word Opus_Flags; /* Stores Opus temporary configuration */
word big_fill[40]; /* Fill out to 512 bytes */
word Opus_Flags; /* Stores Opus temporary configuration */
byte byte_fill;
byte Default_Protocol; /* Default transfer protocol */
byte User_MMacro[16]; /* Message User's keyboard Macro */
byte User_FMacro[16]; /* File User's keyboard Macro */
byte User_DMacro[16]; /* Default User's keyboard Macro */
byte Sysop_Comment[80]; /* Anything you want to say about 'em */
byte Default_Protocol; /* Default transfer protocol */
byte User_MMacro[16]; /* Message User's keyboard Macro */
byte User_FMacro[16]; /* File User's keyboard Macro */
byte User_DMacro[16]; /* Default User's keyboard Macro */
byte Sysop_Comment[80]; /* Anything you want to say about 'em */
#endif
uint32_t OPUS_id;
@ -917,10 +917,10 @@ struct _common_data {
#define HOTKEYS 0x0001 /* Wants HotKeys at all help levels */
#define QMENU 0x0002 /* Wants to return to last menu instead of MAIN */
#define ASKGRAPH 0x0004 /* Wants to be asked about graphics every logon */
#define ASCIIMENU 0x0008 /* Wants long tedious graphics menus */
#define SHOW_TIME 0x0010 /* Show time remaining at prompts */
#define BLOCKCHAT 0x4000 /* User doesn't want to be sociable. */
#define INCRITAREA 0x8000 /* Opus is in critical area */
#define ASCIIMENU 0x0008 /* Wants long tedious graphics menus */
#define SHOW_TIME 0x0010 /* Show time remaining at prompts */
#define BLOCKCHAT 0x4000 /* User doesn't want to be sociable. */
#define INCRITAREA 0x8000 /* Opus is in critical area */
/*--------------------------------------------------------------------------*/
@ -944,11 +944,11 @@ struct _common_data {
/*--------------------------------------------------------------------------*/
/* Flags for After_Externs */
/*--------------------------------------------------------------------------*/
#define NEW_ECHOS 0x0001 /* New Echomail entered by user */
#define NEW_MATRIX 0x0002 /* New Matrix entered by user */
#define NEW_LOCAL 0x0004 /* New Local mail entered by user */
#define UPLOADED 0x0008 /* User uploaded something */
#define DUP_UPLOAD 0x0010 /* User uploaded a duplicate file */
#define NEW_ECHOS 0x0001 /* New Echomail entered by user */
#define NEW_MATRIX 0x0002 /* New Matrix entered by user */
#define NEW_LOCAL 0x0004 /* New Local mail entered by user */
#define UPLOADED 0x0008 /* User uploaded something */
#define DUP_UPLOAD 0x0010 /* User uploaded a duplicate file */
/*--------------------------------------------------------------------------*/
/* LASTUSER.BBS file structure */
@ -1251,64 +1251,64 @@ struct _Hello
struct _filesys {
char Area_Name[32]; /* Area's primary name */
char Area_Name[32]; /* Area's primary name */
word Area_Number; /* area number */
word Area_Menu; /* which menu? */
word Area_Number; /* area number */
word Area_Menu; /* which menu? */
word Total_Size;
byte Area_Priv; /* Area Privilege */
byte Down_Priv; /* Download Privilege */
byte Area_Priv; /* Area Privilege */
byte Down_Priv; /* Download Privilege */
byte Up_Priv;
byte Priv_Up; /* Uploads from users with Priv>= Priv_Up */
byte Ratio_Priv; /* Privilege where u/d ratios start */
byte Priv_Up; /* Uploads from users with Priv>= Priv_Up */
byte Ratio_Priv; /* Privilege where u/d ratios start */
byte New_Priv;
byte fill_byte1[2];
/* 48 */
word Attrib; /* Area Attribute */
word Status; /* Area Status, extended Attribute? */
word Attrib; /* Area Attribute */
word Status; /* Area Status, extended Attribute? */
long Start_Pos; /* start of Area in sysfile.dat */
long Start_Pos; /* start of Area in sysfile.dat */
/* 56 */
long Area_Lock; /* Area Lock */
long Area_Lock; /* Area Lock */
long Up_Lock;
long Down_Lock; /* edit Lock */
long Down_Lock; /* edit Lock */
long Priv_Key; /* Private Key path */
long Priv_Key; /* Private Key path */
/* 72 */
long Section; /* edit Lock */
long Section; /* edit Lock */
long fill_long[2];
byte Title_Len; /* length of Title */
byte Prefiles_Len; /* files shown at Area access like Areainfo */
byte Title_Len; /* length of Title */
byte Prefiles_Len; /* files shown at Area access like Areainfo */
byte Downpath_Len; /* length of path */
byte Uppath_Len; /* length of path */
byte Downpath_Len; /* length of path */
byte Uppath_Len; /* length of path */
/* 88 */
byte Barricade_Len; /* Barricade length if used */
byte Barricade_Len; /* Barricade length if used */
byte Rules_Len;
byte Privkey_Len; /* Uploads from users with "key" go here */
byte PrivUp_Len; /* Private Upload path */
byte Menu_Len; /* file name for this area's ascii menu */
byte Vol_Len; /* Length of volume name */
byte Help_Len; /* Length of help name for this area */
byte Privkey_Len; /* Uploads from users with "key" go here */
byte PrivUp_Len; /* Private Upload path */
byte Menu_Len; /* file name for this area's ascii menu */
byte Vol_Len; /* Length of volume name */
byte Help_Len; /* Length of help name for this area */
byte fill_byte2[5]; /* more filler */
byte fill_byte2[5]; /* more filler */
/* 100 */
word Other_Len; /* external programs use this number bytes */
word Other_Len; /* external programs use this number bytes */
word Def_Upload; /* Area number for default uploads */
word Priv_Upload; /* Area number for Priv uploads */
word Key_Upload; /* Area number for Lock uploads */
word Def_Upload; /* Area number for default uploads */
word Priv_Upload; /* Area number for Priv uploads */
word Key_Upload; /* Area number for Lock uploads */
word fill_word[10]; /* more filler to 128 bytes*/
word fill_word[10]; /* more filler to 128 bytes*/
};
/* Title */
@ -1332,31 +1332,31 @@ struct _filesys {
struct _msgsys {
char Area_Name[32]; /* Area's primary name */
char Echo_Name[32]; /* Area's echo name */
word Area_Number; /* Area number */
word Area_Menu; /* which menu? */
word Total_Size; /* Total size of this Area in SYSMSG.DAT */
char Area_Name[32]; /* Area's primary name */
char Echo_Name[32]; /* Area's echo name */
word Area_Number; /* Area number */
word Area_Menu; /* which menu? */
word Total_Size; /* Total size of this Area in SYSMSG.DAT */
byte Area_Priv; /* Area Privilege */
byte Edit_Priv; /* Edit Privilege */
byte Private_Priv; /* Privilege to read Private messages*/
byte Area_Priv; /* Area Privilege */
byte Edit_Priv; /* Edit Privilege */
byte Private_Priv; /* Privilege to read Private messages*/
byte Upload_Priv;
byte fill_0[3];
byte Translate; /* Which character set to use 1, 2.... */
byte Translate; /* Which character set to use 1, 2.... */
/* 80 */
long Area_Lock; /* Area Lock */
long Edit_Lock; /* Edit Lock */
long Area_Lock; /* Area Lock */
long Edit_Lock; /* Edit Lock */
long Private_Lock; /* Lock to read Private messages*/
long Private_Lock; /* Lock to read Private messages*/
long Upload_Lock;
word Attrib; /* Area Attribute */
word Status; /* Area Status, extended Attribute? */
word Attrib; /* Area Attribute */
word Status; /* Area Status, extended Attribute? */
long Start_Pos; /* start of Area in sysmsg.dat */
long Start_Pos; /* start of Area in sysmsg.dat */
long Section;
byte Max_Lines; /* Maximum number of lines in messages */
byte Max_Lines; /* Maximum number of lines in messages */
byte fill_1[3];
/* 112 */
@ -1365,21 +1365,21 @@ struct _msgsys {
word Node;
word Point;
byte Path_Len; /* length of Path */
byte Title_Len; /* length of Title */
byte Path_Len; /* length of Path */
byte Title_Len; /* length of Title */
byte Barricade_Len; /* Barricade length if used */
byte Origin_Len; /* non-default Origin line */
byte Barricade_Len; /* Barricade length if used */
byte Origin_Len; /* non-default Origin line */
byte Domain_Len; /* Domain (if used) length */
byte Menu_Len; /* file name for this area's ascii menu */
byte Vol_Len; /* Length of volume name */
byte Help_Len; /* Length of help name for this area */
byte Domain_Len; /* Domain (if used) length */
byte Menu_Len; /* file name for this area's ascii menu */
byte Vol_Len; /* Length of volume name */
byte Help_Len; /* Length of help name for this area */
/* 144 */
byte Scan_Len; /* number of boards that Area is Scanned to */
byte Scan_Pos; /* where Opus is in the Scan right now */
word Other_Len; /* external programs use this number bytes */
byte Scan_Len; /* number of boards that Area is Scanned to */
byte Scan_Pos; /* where Opus is in the Scan right now */
word Other_Len; /* external programs use this number bytes */
word Extern_Flags;
word word_fill[5];
/* 160 */
@ -1388,7 +1388,7 @@ struct _msgsys {
/*--------------------------------------------------------------------------*/
/* Then some strings/structures follow as needed */
/*--------------------------------------------------------------------------*/
/* Path string */
/* Path string */
/* Title string */
/* Barricade string */
/* Origin string */
@ -1404,7 +1404,7 @@ struct _msgsys {
/*--------------------------------------------------------------------------*/
struct _ascan { /* structure of address for echoScanning */
struct _ascan { /* structure of address for echoScanning */
word Net;
word Node;
};
@ -1430,8 +1430,8 @@ struct _lf {
/* File Area attributes (limit or describe the behavior of an area) */
/*--------------------------------------------------------------------------*/
#define F_DUPE 0x0001 /* Allow duplicate uploads in this area */
#define F_FREE 0x0002 /* Downloads from this area area all 0K */
#define F_DUPE 0x0001 /* Allow duplicate uploads in this area */
#define F_FREE 0x0002 /* Downloads from this area area all 0K */
/*--------------------------------------------------------------------------*/
@ -1443,9 +1443,9 @@ struct _lf {
#define NOPRIVATE 0x08 /* OPUS: Disallow private messages */
#define ANON_OK 0x10 /* OPUS: Enable anonymous messages */
#define _ECHOMAIL 0x20 /* OPUS: Set=Echomail Clear=Not Echomail */
#define USEALIAS 0x40 /* OPUS: Use user's alias in this area if..... */
#define USEALIAS 0x40 /* OPUS: Use user's alias in this area if..... */
//#define PASSTHROUGH 0x80 /* OPUS: Allow high-bit characters in echo area */
#define INBOUND 0x0100 /* Inbound Only area */
#define INBOUND 0x0100 /* Inbound Only area */
/*--------------------------------------------------------------------------*/
@ -1456,22 +1456,22 @@ struct _lf {
/* programs MAY have conflicting uses. */
/*--------------------------------------------------------------------------*/
#define RENUMBER 0x0001 /* This area gets renumbered */
#define MAILCHECK 0x0002 /* The mail check program will do this area */
#define RESERVED2 0x0004 /* Reserved for Opus-defined flags */
#define RESERVED3 0x0008 /* Reserved for Opus-defined flags */
#define RESERVED4 0x0010 /* Reserved for Opus-defined flags */
#define RESERVED5 0x0020 /* Reserved for Opus-defined flags */
#define RESERVED6 0x0040 /* Reserved for Opus-defined flags */
#define RESERVED7 0x0080 /* Reserved for Opus-defined flags */
#define EXTERN1 0x0100 /* Undefined! Meaning varies for each program*/
#define EXTERN2 0x0200 /* Undefined! Meaning varies for each program*/
#define EXTERN3 0x0400 /* Undefined! Meaning varies for each program*/
#define EXTERN4 0x0800 /* Undefined! Meaning varies for each program*/
#define EXTERN5 0x1000 /* Undefined! Meaning varies for each program*/
#define EXTERN6 0x2000 /* Undefined! Meaning varies for each program*/
#define EXTERN7 0x4000 /* Undefined! Meaning varies for each program*/
#define EXTERN8 0x8000 /* Undefined! Meaning varies for each program*/
#define RENUMBER 0x0001 /* This area gets renumbered */
#define MAILCHECK 0x0002 /* The mail check program will do this area */
#define RESERVED2 0x0004 /* Reserved for Opus-defined flags */
#define RESERVED3 0x0008 /* Reserved for Opus-defined flags */
#define RESERVED4 0x0010 /* Reserved for Opus-defined flags */
#define RESERVED5 0x0020 /* Reserved for Opus-defined flags */
#define RESERVED6 0x0040 /* Reserved for Opus-defined flags */
#define RESERVED7 0x0080 /* Reserved for Opus-defined flags */
#define EXTERN1 0x0100 /* Undefined! Meaning varies for each program*/
#define EXTERN2 0x0200 /* Undefined! Meaning varies for each program*/
#define EXTERN3 0x0400 /* Undefined! Meaning varies for each program*/
#define EXTERN4 0x0800 /* Undefined! Meaning varies for each program*/
#define EXTERN5 0x1000 /* Undefined! Meaning varies for each program*/
#define EXTERN6 0x2000 /* Undefined! Meaning varies for each program*/
#define EXTERN7 0x4000 /* Undefined! Meaning varies for each program*/
#define EXTERN8 0x8000 /* Undefined! Meaning varies for each program*/
// ------------------------------------------------------------------

View File

@ -91,11 +91,11 @@ void gareafile::ReadSynchronet(char* tag) {
std::cout << "* Reading " << file << std::endl;
// Skip header:
// max_qwkmsgs 4
// mail_maxcrcs 4
// mail_maxage 2
// unused (NULL) 512
// unused (0xff) 512
// max_qwkmsgs 4
// mail_maxcrcs 4
// mail_maxage 2
// unused (NULL) 512
// unused (0xff) 512
fseek(in, 1034, SEEK_CUR);
if(fread(&shrt, sizeof(uint16_t), 1, in) == 1) {

View File

@ -22,7 +22,7 @@
/* Enable GNU extensions in fnmatch.h. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
# define _GNU_SOURCE 1
#endif
#include <errno.h>
@ -107,12 +107,12 @@
# else
# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
# define IS_CHAR_CLASS(string) \
(STREQ (string, "alpha") || STREQ (string, "upper") \
|| STREQ (string, "lower") || STREQ (string, "digit") \
|| STREQ (string, "alnum") || STREQ (string, "xdigit") \
|| STREQ (string, "space") || STREQ (string, "print") \
|| STREQ (string, "punct") || STREQ (string, "graph") \
# define IS_CHAR_CLASS(string) \
(STREQ (string, "alpha") || STREQ (string, "upper") \
|| STREQ (string, "lower") || STREQ (string, "digit") \
|| STREQ (string, "alnum") || STREQ (string, "xdigit") \
|| STREQ (string, "space") || STREQ (string, "print") \
|| STREQ (string, "punct") || STREQ (string, "graph") \
|| STREQ (string, "cntrl") || STREQ (string, "blank"))
# endif
@ -150,222 +150,222 @@ fnmatch (pattern, string, flags)
c = FOLD (c);
switch (c)
{
case '?':
if (*n == '\0')
return FNM_NOMATCH;
else if ((flags & FNM_FILE_NAME) && *n == '/')
return FNM_NOMATCH;
else if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH;
break;
{
case '?':
if (*n == '\0')
return FNM_NOMATCH;
else if ((flags & FNM_FILE_NAME) && *n == '/')
return FNM_NOMATCH;
else if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH;
break;
case '\\':
if (!(flags & FNM_NOESCAPE))
{
c = *p++;
if (c == '\0')
/* Trailing \ loses. */
return FNM_NOMATCH;
c = FOLD (c);
}
if (FOLD (*n) != c)
return FNM_NOMATCH;
break;
case '\\':
if (!(flags & FNM_NOESCAPE))
{
c = *p++;
if (c == '\0')
/* Trailing \ loses. */
return FNM_NOMATCH;
c = FOLD (c);
}
if (FOLD (*n) != c)
return FNM_NOMATCH;
break;
case '*':
if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH;
case '*':
if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH;
for (c = *p++; c == '?' || c == '*'; c = *p++)
{
if ((flags & FNM_FILE_NAME) && *n == '/')
/* A slash does not match a wildcard under FNM_FILE_NAME. */
return FNM_NOMATCH;
else if (c == '?')
{
/* A ? needs to match one character. */
if (*n == '\0')
/* There isn't another character; no match. */
return FNM_NOMATCH;
else
/* One character of the string is consumed in matching
this ? wildcard, so *??? won't match if there are
less than three characters. */
++n;
}
}
for (c = *p++; c == '?' || c == '*'; c = *p++)
{
if ((flags & FNM_FILE_NAME) && *n == '/')
/* A slash does not match a wildcard under FNM_FILE_NAME. */
return FNM_NOMATCH;
else if (c == '?')
{
/* A ? needs to match one character. */
if (*n == '\0')
/* There isn't another character; no match. */
return FNM_NOMATCH;
else
/* One character of the string is consumed in matching
this ? wildcard, so *??? won't match if there are
less than three characters. */
++n;
}
}
if (c == '\0')
return 0;
if (c == '\0')
return 0;
{
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
c1 = FOLD (c1);
for (--p; *n != '\0'; ++n)
if ((c == '[' || FOLD (*n) == c1) &&
fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
return 0;
return FNM_NOMATCH;
}
{
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
c1 = FOLD (c1);
for (--p; *n != '\0'; ++n)
if ((c == '[' || FOLD (*n) == c1) &&
fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
return 0;
return FNM_NOMATCH;
}
case '[':
{
/* Nonzero if the sense of the character class is inverted. */
static int posixly_correct;
register int not;
char cold;
case '[':
{
/* Nonzero if the sense of the character class is inverted. */
static int posixly_correct;
register int not;
char cold;
if (posixly_correct == 0)
posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
if (posixly_correct == 0)
posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
if (*n == '\0')
return FNM_NOMATCH;
if (*n == '\0')
return FNM_NOMATCH;
if (*n == '.' && (flags & FNM_PERIOD) &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH;
if (*n == '.' && (flags & FNM_PERIOD) &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH;
if (*n == '/' && (flags & FNM_FILE_NAME))
/* `/' cannot be matched. */
return FNM_NOMATCH;
if (*n == '/' && (flags & FNM_FILE_NAME))
/* `/' cannot be matched. */
return FNM_NOMATCH;
not = (*p == '!' || (posixly_correct < 0 && *p == '^'));
if (not)
++p;
not = (*p == '!' || (posixly_correct < 0 && *p == '^'));
if (not)
++p;
c = *p++;
for (;;)
{
int fn = FOLD (*n);
c = *p++;
for (;;)
{
int fn = FOLD (*n);
if (!(flags & FNM_NOESCAPE) && c == '\\')
{
if (*p == '\0')
return FNM_NOMATCH;
c = FOLD (*p++);
if (!(flags & FNM_NOESCAPE) && c == '\\')
{
if (*p == '\0')
return FNM_NOMATCH;
c = FOLD (*p++);
if (c == fn)
goto matched;
}
else if (c == '[' && *p == ':')
{
/* Leave room for the null. */
char str[CHAR_CLASS_MAX_LENGTH + 1];
size_t c1 = 0;
if (c == fn)
goto matched;
}
else if (c == '[' && *p == ':')
{
/* Leave room for the null. */
char str[CHAR_CLASS_MAX_LENGTH + 1];
size_t c1 = 0;
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
wctype_t wt;
wctype_t wt;
# endif
for (;;)
{
if (c1 == CHAR_CLASS_MAX_LENGTH)
/* The name is too long and therefore the pattern
is ill-formed. */
return FNM_NOMATCH;
for (;;)
{
if (c1 == CHAR_CLASS_MAX_LENGTH)
/* The name is too long and therefore the pattern
is ill-formed. */
return FNM_NOMATCH;
c = *++p;
if (c == ':' && p[1] == ']')
{
p += 2;
break;
}
str[c1++] = 'c';
}
str[c1] = '\0';
c = *++p;
if (c == ':' && p[1] == ']')
{
p += 2;
break;
}
str[c1++] = 'c';
}
str[c1] = '\0';
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
wt = IS_CHAR_CLASS (str);
if (wt == 0)
/* Invalid character class name. */
return FNM_NOMATCH;
wt = IS_CHAR_CLASS (str);
if (wt == 0)
/* Invalid character class name. */
return FNM_NOMATCH;
if (__iswctype (__btowc (*n), wt))
goto matched;
if (__iswctype (__btowc (*n), wt))
goto matched;
# else
if ((STREQ (str, "alnum") && ISALNUM (*n))
|| (STREQ (str, "alpha") && ISALPHA (*n))
|| (STREQ (str, "blank") && ISBLANK (*n))
|| (STREQ (str, "cntrl") && ISCNTRL (*n))
|| (STREQ (str, "digit") && ISDIGIT (*n))
|| (STREQ (str, "graph") && ISGRAPH (*n))
|| (STREQ (str, "lower") && ISLOWER (*n))
|| (STREQ (str, "print") && ISPRINT (*n))
|| (STREQ (str, "punct") && ISPUNCT (*n))
|| (STREQ (str, "space") && ISSPACE (*n))
|| (STREQ (str, "upper") && ISUPPER (*n))
|| (STREQ (str, "xdigit") && ISXDIGIT (*n)))
goto matched;
if ((STREQ (str, "alnum") && ISALNUM (*n))
|| (STREQ (str, "alpha") && ISALPHA (*n))
|| (STREQ (str, "blank") && ISBLANK (*n))
|| (STREQ (str, "cntrl") && ISCNTRL (*n))
|| (STREQ (str, "digit") && ISDIGIT (*n))
|| (STREQ (str, "graph") && ISGRAPH (*n))
|| (STREQ (str, "lower") && ISLOWER (*n))
|| (STREQ (str, "print") && ISPRINT (*n))
|| (STREQ (str, "punct") && ISPUNCT (*n))
|| (STREQ (str, "space") && ISSPACE (*n))
|| (STREQ (str, "upper") && ISUPPER (*n))
|| (STREQ (str, "xdigit") && ISXDIGIT (*n)))
goto matched;
# endif
}
else if (c == '\0')
/* [ (unterminated) loses. */
return FNM_NOMATCH;
else if (FOLD (c) == fn)
goto matched;
}
else if (c == '\0')
/* [ (unterminated) loses. */
return FNM_NOMATCH;
else if (FOLD (c) == fn)
goto matched;
cold = c;
c = *p++;
cold = c;
c = *p++;
if (c == '-' && *p != ']')
{
/* It is a range. */
char cend = *p++;
if (!(flags & FNM_NOESCAPE) && cend == '\\')
cend = *p++;
if (cend == '\0')
return FNM_NOMATCH;
if (c == '-' && *p != ']')
{
/* It is a range. */
char cend = *p++;
if (!(flags & FNM_NOESCAPE) && cend == '\\')
cend = *p++;
if (cend == '\0')
return FNM_NOMATCH;
if (cold <= fn && fn <= FOLD (cend))
goto matched;
if (cold <= fn && fn <= FOLD (cend))
goto matched;
c = *p++;
}
if (c == ']')
break;
}
c = *p++;
}
if (c == ']')
break;
}
if (!not)
return FNM_NOMATCH;
break;
if (!not)
return FNM_NOMATCH;
break;
matched:
/* Skip the rest of the [...] that already matched. */
while (c != ']')
{
if (c == '\0')
/* [... (unterminated) loses. */
return FNM_NOMATCH;
matched:
/* Skip the rest of the [...] that already matched. */
while (c != ']')
{
if (c == '\0')
/* [... (unterminated) loses. */
return FNM_NOMATCH;
c = *p++;
if (!(flags & FNM_NOESCAPE) && c == '\\')
{
if (*p == '\0')
return FNM_NOMATCH;
/* XXX 1003.2d11 is unclear if this is right. */
++p;
}
else if (c == '[' && *p == ':')
{
do
if (*++p == '\0')
return FNM_NOMATCH;
while (*p != ':' || p[1] == ']');
p += 2;
c = *p;
}
}
if (not)
return FNM_NOMATCH;
}
break;
c = *p++;
if (!(flags & FNM_NOESCAPE) && c == '\\')
{
if (*p == '\0')
return FNM_NOMATCH;
/* XXX 1003.2d11 is unclear if this is right. */
++p;
}
else if (c == '[' && *p == ':')
{
do
if (*++p == '\0')
return FNM_NOMATCH;
while (*p != ':' || p[1] == ']');
p += 2;
c = *p;
}
}
if (not)
return FNM_NOMATCH;
}
break;
default:
if (c != FOLD (*n))
return FNM_NOMATCH;
}
default:
if (c != FOLD (*n))
return FNM_NOMATCH;
}
++n;
}
@ -382,4 +382,4 @@ fnmatch (pattern, string, flags)
# undef FOLD
}
#endif /* _LIBC or not __GNU_LIBRARY__. */
#endif /* _LIBC or not __GNU_LIBRARY__. */

View File

@ -16,21 +16,21 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _FNMATCH_H
#define _FNMATCH_H 1
#ifndef _FNMATCH_H
#define _FNMATCH_H 1
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
#endif
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32 || defined _WIN32
# if !defined __GLIBC__ || !defined __P
# undef __P
# define __P(protos) protos
# undef __P
# define __P(protos) protos
# endif
#else /* Not C++ or ANSI C. */
# undef __P
# define __P(protos) ()
# undef __P
# define __P(protos) ()
/* We can get away without defining `const' here only because in this file
it is used only inside the prototype for `fnmatch', which is elided in
non-ANSI C where `const' is problematical. */
@ -38,7 +38,7 @@ extern "C" {
#ifndef const
# if (defined __STDC__ && __STDC__) || defined __cplusplus
# define __const const
# define __const const
# else
# define __const
# endif
@ -46,38 +46,38 @@ extern "C" {
/* We #undef these before defining them because some losing systems
(HP-UX A.08.07 for example) define these in <unistd.h>. */
#undef FNM_PATHNAME
#undef FNM_NOESCAPE
#undef FNM_PERIOD
#undef FNM_PATHNAME
#undef FNM_NOESCAPE
#undef FNM_PERIOD
/* Bits set in the FLAGS argument to `fnmatch'. */
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
#define FNM_NOMATCH 1
#define FNM_NOMATCH 1
/* This value is returned if the implementation does not support
`fnmatch'. Since this is not the case here it will never be
returned but the conformance test suites still require the symbol
to be defined. */
#ifdef _XOPEN_SOURCE
# define FNM_NOSYS (-1)
# define FNM_NOSYS (-1)
#endif
/* Match STRING against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch __P ((__const char *__pattern, __const char *__string,
int __flags));
int __flags));
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -15,34 +15,34 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _GLOB_H
#define _GLOB_H 1
#ifndef _GLOB_H
#define _GLOB_H 1
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
#endif
#undef __ptr_t
#undef __ptr_t
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32 || defined _WIN32
# if !defined __GLIBC__ || !defined __P
# undef __P
# undef __PMT
# define __P(protos) protos
# define __PMT(protos) protos
# define __P(protos) protos
# define __PMT(protos) protos
# if !defined __GNUC__ || __GNUC__ < 2
# undef __const
# define __const const
# endif
# endif
# define __ptr_t void *
# define __ptr_t void *
#else /* Not C++ or ANSI C. */
# undef __P
# undef __P
# undef __PMT
# define __P(protos) ()
# define __PMT(protos) ()
# undef __const
# define __P(protos) ()
# define __PMT(protos) ()
# undef __const
# define __const
# define __ptr_t char *
# define __ptr_t char *
#endif /* C++ or ANSI C. */
/* We need `size_t' for the following definitions. */
@ -61,40 +61,40 @@ typedef unsigned long int __size_t;
#endif
/* Bits set in the FLAGS argument to `glob'. */
#define GLOB_ERR (1 << 0)/* Return on read errors. */
#define GLOB_MARK (1 << 1)/* Append a slash to each name. */
#define GLOB_NOSORT (1 << 2)/* Don't sort the names. */
#define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
#define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */
#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
#define GLOB_ERR (1 << 0)/* Return on read errors. */
#define GLOB_MARK (1 << 1)/* Append a slash to each name. */
#define GLOB_NOSORT (1 << 2)/* Don't sort the names. */
#define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
#define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */
#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
#if (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \
|| defined _GNU_SOURCE)
# define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
# define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
# define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
# define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
# define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
# define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
# define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
# define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
if the user name is not available. */
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
if the user name is not available. */
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
#else
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
GLOB_PERIOD)
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
GLOB_PERIOD)
#endif
/* Error returns from `glob'. */
#define GLOB_NOSPACE 1 /* Ran out of memory. */
#define GLOB_ABORTED 2 /* Read error. */
#define GLOB_NOMATCH 3 /* No matches found. */
#define GLOB_NOSYS 4 /* Not implemented. */
#define GLOB_NOSPACE 1 /* Ran out of memory. */
#define GLOB_ABORTED 2 /* Read error. */
#define GLOB_NOMATCH 3 /* No matches found. */
#define GLOB_NOSYS 4 /* Not implemented. */
#ifdef _GNU_SOURCE
/* Previous versions of this file defined GLOB_ABEND instead of
GLOB_ABORTED. Provide a compatibility definition here. */
@ -107,10 +107,10 @@ struct stat;
#endif
typedef struct
{
__size_t gl_pathc; /* Count of paths matched by the pattern. */
char **gl_pathv; /* List of matched pathnames. */
__size_t gl_offs; /* Slots to reserve in `gl_pathv'. */
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
__size_t gl_pathc; /* Count of paths matched by the pattern. */
char **gl_pathv; /* List of matched pathnames. */
__size_t gl_offs; /* Slots to reserve in `gl_pathv'. */
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
are used instead of the normal file access functions. */
@ -150,16 +150,16 @@ typedef struct
Otherwise, `glob' returns zero. */
#if _FILE_OFFSET_BITS != 64
extern int glob __P ((__const char *__pattern, int __flags,
int (*__errfunc) (__const char *, int),
glob_t *__pglob));
int (*__errfunc) (__const char *, int),
glob_t *__pglob));
/* Free storage allocated in PGLOB by a previous `glob' call. */
extern void globfree __P ((glob_t *__pglob));
#else
# if __GNUC__ >= 2
extern int glob __P ((__const char *__pattern, int __flags,
int (*__errfunc) (__const char *, int),
glob_t *__pglob)) __asm__ ("glob64");
int (*__errfunc) (__const char *, int),
glob_t *__pglob)) __asm__ ("glob64");
extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64");
# else
@ -170,8 +170,8 @@ extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64");
#ifdef _LARGEFILE64_SOURCE
extern int glob64 __P ((__const char *__pattern, int __flags,
int (*__errfunc) (__const char *, int),
glob64_t *__pglob));
int (*__errfunc) (__const char *, int),
glob64_t *__pglob));
extern void globfree64 __P ((glob64_t *__pglob));
#endif
@ -187,7 +187,7 @@ extern int __glob_pattern_p __P ((__const char *__pattern, int __quote));
extern int glob_pattern_p __P ((__const char *__pattern, int __quote));
#endif
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -174,33 +174,33 @@ extern reg_syntax_t re_syntax_options;
/* [[[begin syntaxes]]] */
#define RE_SYNTAX_EMACS 0
#define RE_SYNTAX_AWK \
(RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
| RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
#define RE_SYNTAX_AWK \
(RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
| RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
| RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
#define RE_SYNTAX_GNU_AWK \
((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
#define RE_SYNTAX_GNU_AWK \
((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
& ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS))
#define RE_SYNTAX_POSIX_AWK \
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
| RE_INTERVALS | RE_NO_GNU_OPS)
#define RE_SYNTAX_POSIX_AWK \
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
| RE_INTERVALS | RE_NO_GNU_OPS)
#define RE_SYNTAX_GREP \
(RE_BK_PLUS_QM | RE_CHAR_CLASSES \
| RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
#define RE_SYNTAX_GREP \
(RE_BK_PLUS_QM | RE_CHAR_CLASSES \
| RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
| RE_NEWLINE_ALT)
#define RE_SYNTAX_EGREP \
(RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
| RE_NEWLINE_ALT | RE_NO_BK_PARENS \
#define RE_SYNTAX_EGREP \
(RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
| RE_NEWLINE_ALT | RE_NO_BK_PARENS \
| RE_NO_BK_VBAR)
#define RE_SYNTAX_POSIX_EGREP \
#define RE_SYNTAX_POSIX_EGREP \
(RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
@ -209,32 +209,32 @@ extern reg_syntax_t re_syntax_options;
#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
/* Syntax bits common to both basic and extended POSIX regex syntax. */
#define _RE_SYNTAX_POSIX_COMMON \
(RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
#define _RE_SYNTAX_POSIX_COMMON \
(RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
| RE_INTERVALS | RE_NO_EMPTY_RANGES)
#define RE_SYNTAX_POSIX_BASIC \
#define RE_SYNTAX_POSIX_BASIC \
(_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
isn't minimal, since other operators, such as \`, aren't disabled. */
#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
(_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
#define RE_SYNTAX_POSIX_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
| RE_NO_BK_PARENS | RE_NO_BK_VBAR \
#define RE_SYNTAX_POSIX_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
| RE_NO_BK_PARENS | RE_NO_BK_VBAR \
| RE_UNMATCHED_RIGHT_PAREN_ORD)
/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
/* [[[end syntaxes]]] */
/* Maximum number of duplicates an interval can allow. Some systems
@ -285,31 +285,31 @@ extern reg_syntax_t re_syntax_options;
typedef enum
{
#ifdef _XOPEN_SOURCE
REG_ENOSYS = -1, /* This will never happen for this implementation. */
REG_ENOSYS = -1, /* This will never happen for this implementation. */
#endif
REG_NOERROR = 0, /* Success. */
REG_NOMATCH, /* Didn't find a match (for regexec). */
REG_NOERROR = 0, /* Success. */
REG_NOMATCH, /* Didn't find a match (for regexec). */
/* POSIX regcomp return error codes. (In the order listed in the
standard.) */
REG_BADPAT, /* Invalid pattern. */
REG_ECOLLATE, /* Not implemented. */
REG_ECTYPE, /* Invalid character class name. */
REG_EESCAPE, /* Trailing backslash. */
REG_ESUBREG, /* Invalid back reference. */
REG_EBRACK, /* Unmatched left bracket. */
REG_EPAREN, /* Parenthesis imbalance. */
REG_EBRACE, /* Unmatched \{. */
REG_BADBR, /* Invalid contents of \{\}. */
REG_ERANGE, /* Invalid range end. */
REG_ESPACE, /* Ran out of memory. */
REG_BADRPT, /* No preceding re for repetition op. */
REG_BADPAT, /* Invalid pattern. */
REG_ECOLLATE, /* Not implemented. */
REG_ECTYPE, /* Invalid character class name. */
REG_EESCAPE, /* Trailing backslash. */
REG_ESUBREG, /* Invalid back reference. */
REG_EBRACK, /* Unmatched left bracket. */
REG_EPAREN, /* Parenthesis imbalance. */
REG_EBRACE, /* Unmatched \{. */
REG_BADBR, /* Invalid contents of \{\}. */
REG_ERANGE, /* Invalid range end. */
REG_ESPACE, /* Ran out of memory. */
REG_BADRPT, /* No preceding re for repetition op. */
/* Error codes we've added. */
REG_EEND, /* Premature end. */
REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
REG_EEND, /* Premature end. */
REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
} reg_errcode_t;
/* This data structure represents a compiled pattern. Before calling
@ -325,15 +325,15 @@ typedef enum
struct re_pattern_buffer
{
/* [[[begin pattern_buffer]]] */
/* Space that holds the compiled pattern. It is declared as
/* Space that holds the compiled pattern. It is declared as
`unsigned char *' because its elements are
sometimes used as array indexes. */
unsigned char *buffer;
/* Number of bytes to which `buffer' points. */
/* Number of bytes to which `buffer' points. */
unsigned long int allocated;
/* Number of bytes actually used in `buffer'. */
/* Number of bytes actually used in `buffer'. */
unsigned long int used;
/* Syntax setting with which the pattern was compiled. */
@ -350,7 +350,7 @@ struct re_pattern_buffer
when it is matched. */
RE_TRANSLATE_TYPE translate;
/* Number of subexpressions found by the compiler. */
/* Number of subexpressions found by the compiler. */
size_t re_nsub;
/* Zero if this pattern cannot match the empty string, one else.
@ -539,21 +539,21 @@ extern int re_exec _RE_ARGS ((const char *));
/* POSIX compatibility. */
extern int __regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern,
int __cflags));
int __cflags));
extern int regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern,
int __cflags));
int __cflags));
extern int __regexec _RE_ARGS ((const regex_t *__preg,
const char *__string, size_t __nmatch,
regmatch_t __pmatch[], int __eflags));
const char *__string, size_t __nmatch,
regmatch_t __pmatch[], int __eflags));
extern int regexec _RE_ARGS ((const regex_t *__preg,
const char *__string, size_t __nmatch,
regmatch_t __pmatch[], int __eflags));
const char *__string, size_t __nmatch,
regmatch_t __pmatch[], int __eflags));
extern size_t __regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
char *__errbuf, size_t __errbuf_size));
char *__errbuf, size_t __errbuf_size));
extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
char *__errbuf, size_t __errbuf_size));
char *__errbuf, size_t __errbuf_size));
extern void __regfree _RE_ARGS ((regex_t *__preg));
extern void regfree _RE_ARGS ((regex_t *__preg));
@ -561,7 +561,7 @@ extern void regfree _RE_ARGS ((regex_t *__preg));
#ifdef __cplusplus
}
#endif /* C++ */
#endif /* C++ */
#endif /* regex.h */

View File

@ -81,7 +81,7 @@ const uint GLINE_POSI = 0x0100;
const uint GLINE_HIGH = 0x0200;
const uint GLINE_TAGL = 0x0400;
const uint GLINE_SIGN = 0x0800;
const uint GLINE_NOAL = 0x1000; // text is not allocated
const uint GLINE_NOAL = 0x1000; // text is not allocated
const uint GLINE_KLUDGE = GLINE_HIDD | GLINE_KLUD;
const uint GLINE_ALL = GLINE_HIDD | GLINE_KLUD | GLINE_QUOT;

View File

@ -150,15 +150,15 @@ long fsize(const char *filename)
if (ff)
{
#ifndef UNIX
ret = ff->ff_fsize;
if (ret != -1L) {
ret = ff->ff_fsize;
if (ret != -1L) {
#endif
fp = fopen(filename, "rb");
fseek(fp, 0, SEEK_END);
ret = ftell(fp);
fclose(fp);
fp = fopen(filename, "rb");
fseek(fp, 0, SEEK_END);
ret = ftell(fp);
fclose(fp);
#ifndef UNIX
};
};
#endif
FFindClose(ff);
}

View File

@ -139,11 +139,11 @@ FFIND *FFindOpen(const char *filespec, uint16_t attribute)
strcpy(ff->lastbit, filespec);
}
else if (p == filespec)
{
strcpy(ff->firstbit, "/");
strcpy(ff->lastbit, filespec+1);
}
else
{
strcpy(ff->firstbit, "/");
strcpy(ff->lastbit, filespec+1);
}
else
{
memcpy(ff->firstbit, filespec, p - filespec);
ff->firstbit[p - filespec] = '\0';
@ -168,9 +168,9 @@ FFIND *FFindOpen(const char *filespec, uint16_t attribute)
{
strncpy(ff->ff_name, de->d_name, sizeof ff->ff_name);
ff->ff_name[sizeof(ff->ff_name) - 1] = '\0';
ff->ff_fsize = -1L; /* All who wants to know it's size
* must read it by himself
*/
ff->ff_fsize = -1L; /* All who wants to know it's size
* must read it by himself
*/
fin = 1;
}
}
@ -341,10 +341,10 @@ int FFindNext(FFIND * ff)
{
strncpy(ff->ff_name, de->d_name, sizeof ff->ff_name);
ff->ff_name[sizeof(ff->ff_name) - 1] = '\0';
ff->ff_fsize = -1L; /* All who wants to know it's size
* must read it by himself
*/
fin = 1;
ff->ff_fsize = -1L; /* All who wants to know it's size
* must read it by himself
*/
fin = 1;
rc = 0;
}
}

View File

@ -46,138 +46,138 @@
#include "hsksupp.h"
#include "ffind.h"
#define MAX_OUTRUN (3ul*365*24*60*60) /* 3 year */
#define MAX_OUTRUN (3ul*365*24*60*60) /* 3 year */
#define GenMsgIdErr(a) { if (errstr!=NULL) { *errstr = a; } }
dword oldGenMsgId(void)
{
dword seq = (dword)time(NULL);
sleep(1);
return seq;
dword seq = (dword)time(NULL);
sleep(1);
return seq;
}
dword GenMsgIdEx(char *seqdir, unsigned long max_outrun, dword (*altGenMsgId)(void), char **errstr)
{
dword seq, n, curtime;
FFIND *ff;
char *seqpath, max_fname[13], *new_fname, *pname, *p;
int h, try;
dword seq, n, curtime;
FFIND *ff;
char *seqpath, max_fname[13], *new_fname, *pname, *p;
int h, try;
if (altGenMsgId == NULL)
altGenMsgId = oldGenMsgId;
GenMsgIdErr(NULL);
if (altGenMsgId == NULL)
altGenMsgId = oldGenMsgId;
GenMsgIdErr(NULL);
if (seqdir == NULL || *seqdir == '\0') {
seqdir = getenv("SEQDIR");
if (seqdir == NULL || *seqdir == '\0') {
/* warning: no SEQDIR defined, fall to ugly old algorythm */
GenMsgIdErr("no SEQDIR defined");
return (*altGenMsgId)();
}
}
seqpath = malloc(strlen(seqdir)+13);
strcpy(seqpath, seqdir);
pname = seqpath + strlen(seqpath);
if (*seqpath && strchr("/\\", seqpath[strlen(seqpath)-1]) == NULL)
*pname++ = PATH_DELIM;
new_fname = NULL;
if (max_outrun == 0) {
p = getenv("SEQOUT");
if ( p && isdigit((int)(*p)) ) {
max_outrun = (unsigned long)atol(p);
switch (tolower(p[strlen(p) - 1])) {
case 'y': max_outrun *= 365;
case 'd': max_outrun *= 24;
case 'h': max_outrun *= 60*60;
break;
case 'w': max_outrun *= (7l*24*60*60);
break;
case 'm': max_outrun *= (31l*24*60*60);
break;
}
}
else max_outrun = MAX_OUTRUN;
}
for (try=0;;try++) {
curtime = (dword)time(NULL);
seq = 0;
max_fname[0] = '\0';
strcpy(pname, "*.*");
ff = FFindOpen(seqpath, 0);
if (ff == NULL) { /* file not found */
*pname = '\0';
if (try == 0) {
if (direxist(seqpath))
goto emptydir; /* directory exist & empty */
else if (_createDirectoryTree(seqpath) == 0)
goto emptydir; /* directory created */
} /* if directory not created at 1st time then use old alghorithm */
free(seqpath);
if (new_fname) free(new_fname);
GenMsgIdErr("can't open/create SEQDIR directory");
return (*altGenMsgId)();
}
do {
for (p=ff->ff_name; isxdigit((int)(*p)); p++);
if (stricmp(p, ".seq") != 0) continue;
if (strlen(ff->ff_name) > 12) continue;
n = strtol(ff->ff_name, NULL, 16);
if (n > curtime && n - curtime > max_outrun) {
/* counter too large, remove */
strcpy(pname, ff->ff_name);
unlink(seqpath);
continue;
}
if (n >= seq) {
if (max_fname[0]) {
strcpy(pname, max_fname);
unlink(seqpath);
}
strcpy(max_fname, ff->ff_name);
seq = n;
} else {
strcpy(pname, ff->ff_name);
unlink(seqpath);
}
} while (FFindNext(ff) == 0);
if (ff) FFindClose(ff);
if (seqdir == NULL || *seqdir == '\0') {
seqdir = getenv("SEQDIR");
if (seqdir == NULL || *seqdir == '\0') {
/* warning: no SEQDIR defined, fall to ugly old algorythm */
GenMsgIdErr("no SEQDIR defined");
return (*altGenMsgId)();
}
}
seqpath = malloc(strlen(seqdir)+13);
strcpy(seqpath, seqdir);
pname = seqpath + strlen(seqpath);
if (*seqpath && strchr("/\\", seqpath[strlen(seqpath)-1]) == NULL)
*pname++ = PATH_DELIM;
new_fname = NULL;
if (max_outrun == 0) {
p = getenv("SEQOUT");
if ( p && isdigit((int)(*p)) ) {
max_outrun = (unsigned long)atol(p);
switch (tolower(p[strlen(p) - 1])) {
case 'y': max_outrun *= 365;
case 'd': max_outrun *= 24;
case 'h': max_outrun *= 60*60;
break;
case 'w': max_outrun *= (7l*24*60*60);
break;
case 'm': max_outrun *= (31l*24*60*60);
break;
}
}
else max_outrun = MAX_OUTRUN;
}
for (try=0;;try++) {
curtime = (dword)time(NULL);
seq = 0;
max_fname[0] = '\0';
strcpy(pname, "*.*");
ff = FFindOpen(seqpath, 0);
if (ff == NULL) { /* file not found */
*pname = '\0';
if (try == 0) {
if (direxist(seqpath))
goto emptydir; /* directory exist & empty */
else if (_createDirectoryTree(seqpath) == 0)
goto emptydir; /* directory created */
} /* if directory not created at 1st time then use old alghorithm */
free(seqpath);
if (new_fname) free(new_fname);
GenMsgIdErr("can't open/create SEQDIR directory");
return (*altGenMsgId)();
}
do {
for (p=ff->ff_name; isxdigit((int)(*p)); p++);
if (stricmp(p, ".seq") != 0) continue;
if (strlen(ff->ff_name) > 12) continue;
n = strtol(ff->ff_name, NULL, 16);
if (n > curtime && n - curtime > max_outrun) {
/* counter too large, remove */
strcpy(pname, ff->ff_name);
unlink(seqpath);
continue;
}
if (n >= seq) {
if (max_fname[0]) {
strcpy(pname, max_fname);
unlink(seqpath);
}
strcpy(max_fname, ff->ff_name);
seq = n;
} else {
strcpy(pname, ff->ff_name);
unlink(seqpath);
}
} while (FFindNext(ff) == 0);
if (ff) FFindClose(ff);
emptydir:
if (seq < curtime) seq = curtime;
if (new_fname == NULL)
new_fname = malloc(strlen(seqpath) + 13);
*pname = '\0';
sprintf(new_fname, "%s%08lx.seq", seqpath, (unsigned long)(seq + 1));
if (max_fname[0] == '\0') {
/* No files found, create new */
h = open(new_fname, O_CREAT|O_BINARY|O_EXCL, 0666);
if (h != -1) {
/* ok, scan again */
close(h);
continue;
}
/* error creating file */
if (errno == EEXIST) continue;
free(seqpath);
free(new_fname);
GenMsgIdErr("error creating file in SEQDIR directory");
return (*altGenMsgId)();
}
/* rename max_fname to new_fname */
strcpy(pname, max_fname);
if (rename(seqpath, new_fname) == 0) {
free(seqpath);
free(new_fname);
return seq;
}
if (errno == ENOENT || errno == EEXIST ||
((errno == EPERM || errno == EACCES) && try < 16))
continue;
free(seqpath);
free(new_fname);
GenMsgIdErr("can't rename .seq file");
return (*altGenMsgId)();
}
if (seq < curtime) seq = curtime;
if (new_fname == NULL)
new_fname = malloc(strlen(seqpath) + 13);
*pname = '\0';
sprintf(new_fname, "%s%08lx.seq", seqpath, (unsigned long)(seq + 1));
if (max_fname[0] == '\0') {
/* No files found, create new */
h = open(new_fname, O_CREAT|O_BINARY|O_EXCL, 0666);
if (h != -1) {
/* ok, scan again */
close(h);
continue;
}
/* error creating file */
if (errno == EEXIST) continue;
free(seqpath);
free(new_fname);
GenMsgIdErr("error creating file in SEQDIR directory");
return (*altGenMsgId)();
}
/* rename max_fname to new_fname */
strcpy(pname, max_fname);
if (rename(seqpath, new_fname) == 0) {
free(seqpath);
free(new_fname);
return seq;
}
if (errno == ENOENT || errno == EEXIST ||
((errno == EPERM || errno == EACCES) && try < 16))
continue;
free(seqpath);
free(new_fname);
GenMsgIdErr("can't rename .seq file");
return (*altGenMsgId)();
}
}
dword GenMsgId(char *seqdir, unsigned long max_outrun)

View File

@ -56,7 +56,7 @@
#ifdef SYSTEM_WINDLL
BOOL _export WINAPI
DllEntryPoint (HINSTANCE hInstance, DWORD seginfo,
LPVOID lpCmdLine)
LPVOID lpCmdLine)
{
/* Don't do anything, so just return true */
return TRUE;
@ -187,8 +187,8 @@ _FP_strstr (char *str1, char *str2)
while (*(ptr1=str1)) {
for (ptr2=str2;
*ptr1 && *ptr2 && *ptr1==*ptr2;
ptr1++, ptr2++)
*ptr1 && *ptr2 && *ptr1==*ptr2;
ptr1++, ptr2++)
/* empty loop */ ;
if (*ptr2 == '\0')
@ -211,7 +211,7 @@ _FP_strpbrk (char *str, char *accept)
for (; *str; str++)
for (ptr=accept; *ptr; ptr++)
if (*str == *ptr)
return str;
return str;
return NULL;
}
@ -237,10 +237,10 @@ _FP_strtok (char *str1, char *str2)
return NULL;
}
while (*optr && strchr (str2, *optr)) /* look for beginning of token */
while (*optr && strchr (str2, *optr)) /* look for beginning of token */
optr++;
if (*optr == '\0') /* no token found */
if (*optr == '\0') /* no token found */
return NULL;
ptr = optr;
@ -269,8 +269,8 @@ _FP_stristr (char *str1, char *str2)
while (*(ptr1=str1)) {
for (ptr2=str2;
*ptr1 && *ptr2 && tolower(*ptr1)==tolower(*ptr2);
ptr1++, ptr2++)
*ptr1 && *ptr2 && tolower(*ptr1)==tolower(*ptr2);
ptr1++, ptr2++)
/* empty loop */ ;
if (*ptr2 == '\0')
@ -371,9 +371,9 @@ _FP_strmatch (char *string, char *pattern)
}
else if (*p2 == '*') {
if (*++p2 == '\0')
return 1;
return 1;
while (*p1 && *p1 != *p2)
p1++;
p1++;
}
else if (*p1 == *p2) {
p1++; p2++;
@ -447,12 +447,12 @@ _FP_fgets (char *buf, int n, FILE *stream)
while (--n) {
if ((c = fgetc (stream)) == EOF) {
if (ferror (stream))
return NULL;
return NULL;
else {
if (obp == buf)
return NULL;
*buf = '\0';
return obp;
if (obp == buf)
return NULL;
*buf = '\0';
return obp;
}
}
if (c == '\015') { /* CR */
@ -462,8 +462,8 @@ _FP_fgets (char *buf, int n, FILE *stream)
* to the manual page
*/
if ((c = fgetc (stream)) != '\012')
if (!feof (stream))
ungetc (c, stream);
if (!feof (stream))
ungetc (c, stream);
*buf++ = '\012';
*buf = '\0';
return obp;

View File

@ -18,9 +18,9 @@
#ifndef _ANSI_ARGS_
#ifdef PROTOTYPES
#define _ANSI_ARGS_(c) c
#define _ANSI_ARGS_(c) c
#else
#define _ANSI_ARGS_(c) ()
#define _ANSI_ARGS_(c) ()
#endif
#endif
@ -32,27 +32,27 @@
extern "C" {
#endif
void TOOLEXPORT _FP_free _ANSI_ARGS_((void *));
char * TOOLEXPORT _FP_strdup _ANSI_ARGS_((char *));
char * TOOLEXPORT _FP_strncpy _ANSI_ARGS_((char *, char *, int));
void * TOOLEXPORT _FP_memdup _ANSI_ARGS_((void *, int));
int TOOLEXPORT _FP_stricmp _ANSI_ARGS_((char *, char *));
int TOOLEXPORT _FP_strnicmp _ANSI_ARGS_((char *, char *, int));
char * TOOLEXPORT _FP_strrstr _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_stoupper _ANSI_ARGS_((char *));
char * TOOLEXPORT _FP_stolower _ANSI_ARGS_((char *));
int TOOLEXPORT _FP_strmatch _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_strstr _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_stristr _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_strirstr _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_strrchr _ANSI_ARGS_((char *, int));
char * TOOLEXPORT _FP_fgets _ANSI_ARGS_((char *, int, FILE *));
char * TOOLEXPORT _FP_strpbrk _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_strtok _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_cutdir _ANSI_ARGS_((char *));
void TOOLEXPORT _FP_free _ANSI_ARGS_((void *));
char * TOOLEXPORT _FP_strdup _ANSI_ARGS_((char *));
char * TOOLEXPORT _FP_strncpy _ANSI_ARGS_((char *, char *, int));
void * TOOLEXPORT _FP_memdup _ANSI_ARGS_((void *, int));
int TOOLEXPORT _FP_stricmp _ANSI_ARGS_((char *, char *));
int TOOLEXPORT _FP_strnicmp _ANSI_ARGS_((char *, char *, int));
char * TOOLEXPORT _FP_strrstr _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_stoupper _ANSI_ARGS_((char *));
char * TOOLEXPORT _FP_stolower _ANSI_ARGS_((char *));
int TOOLEXPORT _FP_strmatch _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_strstr _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_stristr _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_strirstr _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_strrchr _ANSI_ARGS_((char *, int));
char * TOOLEXPORT _FP_fgets _ANSI_ARGS_((char *, int, FILE *));
char * TOOLEXPORT _FP_strpbrk _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_strtok _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_cutdir _ANSI_ARGS_((char *));
#if 0
char * TOOLEXPORT _FP_strerror _ANSI_ARGS_((int));
char * TOOLEXPORT _FP_tempnam _ANSI_ARGS_((char *, char *));
char * TOOLEXPORT _FP_strerror _ANSI_ARGS_((int));
char * TOOLEXPORT _FP_tempnam _ANSI_ARGS_((char *, char *));
#endif
#ifdef __cplusplus

View File

@ -60,15 +60,15 @@ char * uucheck_id = "$Id$";
* store for our have-parts and missing-parts lists
*/
#define MAXPLIST 256
#define MAXPLIST 256
/*
* forward declarations of local functions
*/
static char * UUGetFileName _ANSI_ARGS_((char *, char *, char *));
static int UUGetPartNo _ANSI_ARGS_((char *, char **, char **));
static char * UUGetFileName _ANSI_ARGS_((char *, char *, char *));
static int UUGetPartNo _ANSI_ARGS_((char *, char **, char **));
/*
* State of Scanner function and PreProcessPart
@ -164,9 +164,9 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
iter++;
count = length = alflag = 0;
while (iter[count] &&
(isalnum (iter[count]) || strchr (uufnchars, iter[count])!=NULL)) {
(isalnum (iter[count]) || strchr (uufnchars, iter[count])!=NULL)) {
if (isalpha (iter[count]))
alflag++;
alflag++;
count++;
}
if (count<4 || alflag==0) {
@ -195,17 +195,17 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
ptr = subject;
while ((iter = strchr (ptr, '/')) != NULL) {
if (iter >= ptonum && iter <= ptonend) {
ptr = iter + 1;
continue;
ptr = iter + 1;
continue;
}
count = length = 0;
iter++;
while (iter[count] &&
(isalnum(iter[count])||strchr(uufnchars, iter[count])!=NULL))
count++;
(isalnum(iter[count])||strchr(uufnchars, iter[count])!=NULL))
count++;
if (iter[count] == ' ' && length > 4) {
length = count;
break;
length = count;
break;
}
ptr = iter + ((count)?count:1);
}
@ -223,83 +223,83 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
count = length = alflag = 0;
if (_FP_strnicmp (ptr, "ftp", 3) == 0) {
/* hey, that's an ftp address */
while (isalpha (*ptr) || isdigit (*ptr) || *ptr == '.')
ptr++;
continue;
/* hey, that's an ftp address */
while (isalpha (*ptr) || isdigit (*ptr) || *ptr == '.')
ptr++;
continue;
}
while ((isalnum(*iter)||strchr(uufnchars, *iter)!=NULL||
*iter=='/') && *iter && iter != ptonum && *iter != '.') {
if (isalpha (*iter))
alflag = 1;
count++; iter++;
*iter=='/') && *iter && iter != ptonum && *iter != '.') {
if (isalpha (*iter))
alflag = 1;
count++; iter++;
}
if (*iter == '\0' || iter == ptonum) {
if (iter == ptonum)
ptr = ptonend;
else
ptr = iter;
if (iter == ptonum)
ptr = ptonend;
else
ptr = iter;
length = 0;
continue;
length = 0;
continue;
}
if (*iter++ != '.' || count > 32 || alflag == 0) {
ptr = iter;
length = 0;
continue;
ptr = iter;
length = 0;
continue;
}
if (_FP_strnicmp (iter, "edu", 3) == 0 ||
_FP_strnicmp (iter, "gov", 3) == 0) {
/* hey, that's an ftp address */
while (isalpha (*iter) || isdigit (*iter) || *iter == '.')
iter++;
ptr = iter;
length = 0;
continue;
_FP_strnicmp (iter, "gov", 3) == 0) {
/* hey, that's an ftp address */
while (isalpha (*iter) || isdigit (*iter) || *iter == '.')
iter++;
ptr = iter;
length = 0;
continue;
}
length += count + 1;
count = 0;
while ((isalnum(iter[count])||strchr(uufnchars, iter[count])!=NULL||
iter[count]=='/') && iter[count] && iter[count] != '.')
count++;
iter[count]=='/') && iter[count] && iter[count] != '.')
count++;
if (iter[count]==':' && iter[count+1]=='/') {
/* looks like stuff from a mail server */
ptr = iter + 1;
length = 0;
continue;
/* looks like stuff from a mail server */
ptr = iter + 1;
length = 0;
continue;
}
if (count > 8 || iter == ptonum) {
ptr = iter;
length = 0;
continue;
ptr = iter;
length = 0;
continue;
}
if (iter[count] != '.') {
length += count;
break;
length += count;
break;
}
while (iter[count] &&
(isalnum(iter[count])||strchr(uufnchars, iter[count])!=NULL||
iter[count]=='/'))
count++;
(isalnum(iter[count])||strchr(uufnchars, iter[count])!=NULL||
iter[count]=='/'))
count++;
if (iter[count]==':' && iter[count+1]=='/') {
/* looks like stuff from a mail server */
ptr = iter + 1;
length = 0;
continue;
/* looks like stuff from a mail server */
ptr = iter + 1;
length = 0;
continue;
}
if (count < 12 && iter != ptonum) {
length += count;
break;
length += count;
break;
}
ptr = iter;
@ -314,22 +314,22 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
ptr++;
while ((isalnum(ptr[length])||strchr(uufnchars,ptr[length])!=NULL||
ptr[length] == '/') &&
ptr[length] && ptr+length!=part && ptr+length!=ptonum)
ptr[length] == '/') &&
ptr[length] && ptr+length!=part && ptr+length!=ptonum)
length++;
if (length) {
if (ptr[length] == '\0' || ptr[length] == 0x0a || ptr[length] == 0x0d) {
length--;
/*
* I used to cut off digits from the end of the string, but
* let's try to live without. We want to distinguish
* DUTCH951 from DUTCH952
*
/*
* I used to cut off digits from the end of the string, but
* let's try to live without. We want to distinguish
* DUTCH951 from DUTCH952
*
* while ((ptr[length] == ' ' || isdigit (ptr[length])) && length > 0)
* length--;
*/
*/
}
else {
length--;
@ -348,7 +348,7 @@ UUGetFileName (char *subject, char *ptonum, char *ptonend)
if ((result = (char *) malloc (length + 1)) == NULL) {
UUMessage (uucheck_id, __LINE__, UUMSG_ERROR,
uustring (S_OUT_OF_MEMORY), length+1);
uustring (S_OUT_OF_MEMORY), length+1);
return NULL;
}
@ -402,43 +402,43 @@ UUGetPartNo (char *subject, char **where, char **whend)
count = length = 0; iter++;
while (*iter == ' ' || *iter == '#')
iter++;
iter++;
if (!isdigit (*iter)) {
ptr = iter;
continue;
ptr = iter;
continue;
}
while (isdigit (iter[count]))
count++;
count++;
length = count;
if (iter[count] == '\0' || iter[count+1] == '\0') {
iter += count;
length = 0;
break;
iter += count;
length = 0;
break;
}
if (iter[count] == brackchr[uu_bracket_policy][bpc+1]) {
*where = iter;
bdel[0] = brackchr[uu_bracket_policy][bpc+1];
delim = bdel;
break;
*where = iter;
bdel[0] = brackchr[uu_bracket_policy][bpc+1];
delim = bdel;
break;
}
while (iter[count] == ' ' || iter[count] == '#' ||
iter[count] == '/' || iter[count] == '\\') count++;
iter[count] == '/' || iter[count] == '\\') count++;
if (_FP_strnicmp (iter + count, "of", 2) == 0)
count += 2;
count += 2;
while (iter[count] == ' ') count++;
while (isdigit (iter[count])) count++;
while (iter[count] == ' ') count++;
if (iter[count] == brackchr[uu_bracket_policy][bpc+1]) {
*where = iter;
bdel[0] = brackchr[uu_bracket_policy][bpc+1];
delim = bdel;
break;
*where = iter;
bdel[0] = brackchr[uu_bracket_policy][bpc+1];
delim = bdel;
break;
}
length = 0;
@ -458,33 +458,33 @@ UUGetPartNo (char *subject, char **where, char **whend)
iter += 5;
while (isspace (*iter) || *iter == '.' || *iter == '-')
iter++;
iter++;
while (isdigit (iter[length]))
length++;
if (length == 0) {
if (_FP_strnicmp (iter, "one", 3) == 0) length = 1;
else if (_FP_strnicmp (iter, "two", 3) == 0) length = 2;
else if (_FP_strnicmp (iter, "three", 5) == 0) length = 3;
else if (_FP_strnicmp (iter, "four", 4) == 0) length = 4;
else if (_FP_strnicmp (iter, "five", 4) == 0) length = 5;
else if (_FP_strnicmp (iter, "six", 3) == 0) length = 6;
else if (_FP_strnicmp (iter, "seven", 5) == 0) length = 7;
else if (_FP_strnicmp (iter, "eight", 5) == 0) length = 8;
else if (_FP_strnicmp (iter, "nine", 4) == 0) length = 9;
else if (_FP_strnicmp (iter, "ten", 3) == 0) length = 10;
if (_FP_strnicmp (iter, "one", 3) == 0) length = 1;
else if (_FP_strnicmp (iter, "two", 3) == 0) length = 2;
else if (_FP_strnicmp (iter, "three", 5) == 0) length = 3;
else if (_FP_strnicmp (iter, "four", 4) == 0) length = 4;
else if (_FP_strnicmp (iter, "five", 4) == 0) length = 5;
else if (_FP_strnicmp (iter, "six", 3) == 0) length = 6;
else if (_FP_strnicmp (iter, "seven", 5) == 0) length = 7;
else if (_FP_strnicmp (iter, "eight", 5) == 0) length = 8;
else if (_FP_strnicmp (iter, "nine", 4) == 0) length = 9;
else if (_FP_strnicmp (iter, "ten", 3) == 0) length = 10;
if (length && (*whend = strchr (iter, ' '))) {
*where = iter;
return length;
}
else
length = 0;
if (length && (*whend = strchr (iter, ' '))) {
*where = iter;
return length;
}
else
length = 0;
}
else {
*where = iter;
delim = "of";
*where = iter;
delim = "of";
}
}
}
@ -499,33 +499,33 @@ UUGetPartNo (char *subject, char **where, char **whend)
iter += 4;
while (isspace (*iter) || *iter == '.' || *iter == '-')
iter++;
iter++;
while (isdigit (iter[length]))
length++;
if (length == 0) {
if (_FP_strnicmp (iter, "one", 3) == 0) length = 1;
else if (_FP_strnicmp (iter, "two", 3) == 0) length = 2;
else if (_FP_strnicmp (iter, "three", 5) == 0) length = 3;
else if (_FP_strnicmp (iter, "four", 4) == 0) length = 4;
else if (_FP_strnicmp (iter, "five", 4) == 0) length = 5;
else if (_FP_strnicmp (iter, "six", 3) == 0) length = 6;
else if (_FP_strnicmp (iter, "seven", 5) == 0) length = 7;
else if (_FP_strnicmp (iter, "eight", 5) == 0) length = 8;
else if (_FP_strnicmp (iter, "nine", 4) == 0) length = 9;
else if (_FP_strnicmp (iter, "ten", 3) == 0) length = 10;
if (_FP_strnicmp (iter, "one", 3) == 0) length = 1;
else if (_FP_strnicmp (iter, "two", 3) == 0) length = 2;
else if (_FP_strnicmp (iter, "three", 5) == 0) length = 3;
else if (_FP_strnicmp (iter, "four", 4) == 0) length = 4;
else if (_FP_strnicmp (iter, "five", 4) == 0) length = 5;
else if (_FP_strnicmp (iter, "six", 3) == 0) length = 6;
else if (_FP_strnicmp (iter, "seven", 5) == 0) length = 7;
else if (_FP_strnicmp (iter, "eight", 5) == 0) length = 8;
else if (_FP_strnicmp (iter, "nine", 4) == 0) length = 9;
else if (_FP_strnicmp (iter, "ten", 3) == 0) length = 10;
if (length && (*whend = strchr (iter, ' '))) {
*where = iter;
return length;
}
else
length = 0;
if (length && (*whend = strchr (iter, ' '))) {
*where = iter;
return length;
}
else
length = 0;
}
else {
*where = iter;
delim = "of";
*where = iter;
delim = "of";
}
}
}
@ -537,19 +537,19 @@ UUGetPartNo (char *subject, char **where, char **whend)
if (length == 0) {
if ((iter = _FP_strirstr (subject, "of")) != NULL) {
while (iter>subject && isspace (*(iter-1)))
iter--;
iter--;
if (isdigit(*(iter-1))) {
while (iter>subject && isdigit (*(iter-1)))
iter--;
if (!isdigit (*iter) && !isalpha (*iter) && *iter != '.')
iter++;
ptr = iter;
while (iter>subject && isdigit (*(iter-1)))
iter--;
if (!isdigit (*iter) && !isalpha (*iter) && *iter != '.')
iter++;
ptr = iter;
while (isdigit (*ptr)) {
ptr++; length++;
}
*where = iter;
delim = "of";
while (isdigit (*ptr)) {
ptr++; length++;
}
*where = iter;
delim = "of";
}
}
}
@ -563,23 +563,23 @@ UUGetPartNo (char *subject, char **where, char **whend)
while (*ptr && length==0) {
while (*ptr && !isdigit (*ptr))
ptr++;
ptr++;
if (isdigit (*ptr) && (ptr==subject || *ptr==' ' || *ptr=='/')) {
while (isdigit (ptr[length]))
length++;
if (ptr[length]!='\0' && ptr[length]!=' ' && ptr[length]!='/') {
ptr += length;
length = 0;
}
else {
iter = ptr;
bdel[0] = ptr[length];
delim = bdel;
}
while (isdigit (ptr[length]))
length++;
if (ptr[length]!='\0' && ptr[length]!=' ' && ptr[length]!='/') {
ptr += length;
length = 0;
}
else {
iter = ptr;
bdel[0] = ptr[length];
delim = bdel;
}
}
else {
while (isdigit (*ptr))
ptr++;
while (isdigit (*ptr))
ptr++;
}
}
}
@ -596,19 +596,19 @@ UUGetPartNo (char *subject, char **where, char **whend)
while (count > 0) {
if (!isdigit(ptr[count])||isalpha(ptr[count+1])||ptr[count+1] == '.') {
count--;
continue;
count--;
continue;
}
length = 0;
while (count >= 0 && isdigit (ptr[count])) {
count--; length++;
count--; length++;
}
if (count>=0 && ((isalpha (ptr[count]) &&
(ptr[count] != 's' || ptr[count+1] != 't') &&
(ptr[count] != 'n' || ptr[count+1] != 'd')) ||
ptr[count] == '/' || ptr[count] == '.' ||
ptr[count] == '-' || ptr[count] == '_')) {
(ptr[count] != 's' || ptr[count+1] != 't') &&
(ptr[count] != 'n' || ptr[count+1] != 'd')) ||
ptr[count] == '/' || ptr[count] == '.' ||
ptr[count] == '-' || ptr[count] == '_')) {
length = 0;
continue;
}
@ -616,8 +616,8 @@ UUGetPartNo (char *subject, char **where, char **whend)
iter = ptr + count;
if (length > 4) {
length = 0;
continue;
length = 0;
continue;
}
*where = iter;
delim = "of";
@ -656,7 +656,7 @@ UUGetPartNo (char *subject, char **where, char **whend)
length = 0;
}
if (iter == NULL || length == 0) /* should be equivalent */
if (iter == NULL || length == 0) /* should be equivalent */
return -1;
*where = iter;
@ -666,12 +666,12 @@ UUGetPartNo (char *subject, char **where, char **whend)
ptr = (*whend += strlen (delim));
while (*ptr == ' ')
ptr++;
ptr++;
if (isdigit (*ptr)) {
*whend = ptr;
while (isdigit (**whend))
*whend += 1;
*whend = ptr;
while (isdigit (**whend))
*whend += 1;
}
}
else {
@ -697,7 +697,7 @@ UUPreProcessPart (fileread *data, int *ret)
if ((result = (uufile *) malloc (sizeof (uufile))) == NULL) {
UUMessage (uucheck_id, __LINE__, UUMSG_ERROR,
uustring (S_OUT_OF_MEMORY), sizeof (uufile));
uustring (S_OUT_OF_MEMORY), sizeof (uufile));
*ret = UURET_NOMEM;
return NULL;
}
@ -720,8 +720,8 @@ UUPreProcessPart (fileread *data, int *ret)
if (data->filename != NULL) {
if ((result->filename = _FP_strdup (data->filename)) == NULL) {
UUMessage (uucheck_id, __LINE__, UUMSG_ERROR,
uustring (S_OUT_OF_MEMORY),
strlen (data->filename)+1);
uustring (S_OUT_OF_MEMORY),
strlen (data->filename)+1);
*ret = UURET_NOMEM;
UUkillfile (result);
return NULL;
@ -754,11 +754,11 @@ UUPreProcessPart (fileread *data, int *ret)
result->subfname = _FP_strdup (result->filename);
if (result->filename == NULL ||
result->subfname == NULL) {
result->subfname == NULL) {
UUMessage (uucheck_id, __LINE__, UUMSG_ERROR,
uustring (S_OUT_OF_MEMORY),
(result->filename==NULL)?
(strlen(temp)+1):(strlen(result->filename)+1));
uustring (S_OUT_OF_MEMORY),
(result->filename==NULL)?
(strlen(temp)+1):(strlen(result->filename)+1));
*ret = UURET_NOMEM;
UUkillfile(result);
return NULL;
@ -769,7 +769,7 @@ UUPreProcessPart (fileread *data, int *ret)
else if (result->subfname == NULL && data->uudet &&
(data->begin || result->partno == 1 ||
(!uu_dumbness && result->partno == -1 &&
(data->subject != NULL || result->filename != NULL)))) {
(data->subject != NULL || result->filename != NULL)))) {
/*
* If it's the first part of something and has some valid data, but
* no subject or anything, initialize lastvalid
@ -788,9 +788,9 @@ UUPreProcessPart (fileread *data, int *ret)
*/
if (result->subfname == NULL) {
UUMessage (uucheck_id, __LINE__, UUMSG_ERROR,
uustring (S_OUT_OF_MEMORY),
(result->filename)?
(strlen(result->filename)+1):(strlen(temp)+1));
uustring (S_OUT_OF_MEMORY),
(result->filename)?
(strlen(result->filename)+1):(strlen(temp)+1));
*ret = UURET_NOMEM;
UUkillfile (result);
return NULL;
@ -838,12 +838,12 @@ UUPreProcessPart (fileread *data, int *ret)
result->subfname = _FP_strdup (temp);
}
if (result->subfname == NULL) {
UUMessage (uucheck_id, __LINE__, UUMSG_ERROR,
uustring (S_OUT_OF_MEMORY),
(result->filename)?
(strlen(result->filename)+1):(strlen(temp)+1));
*ret = UURET_NOMEM;
UUkillfile (result);
UUMessage (uucheck_id, __LINE__, UUMSG_ERROR,
uustring (S_OUT_OF_MEMORY),
(result->filename)?
(strlen(result->filename)+1):(strlen(temp)+1));
*ret = UURET_NOMEM;
UUkillfile (result);
return NULL;
}
lastvalid = 0;
@ -856,7 +856,7 @@ UUPreProcessPart (fileread *data, int *ret)
* if it's the last part, invalidate lastvalid
*/
if (data->end || (data->partno && data->partno == data->maxpno))
lastvalid = 0;
lastvalid = 0;
}
else if (data->partno != -1 && result->filename) {
result->subfname = _FP_strdup (result->filename);
@ -919,7 +919,7 @@ UUPreProcessPart (fileread *data, int *ret)
result->partno = ++lastpart;
if (data->end)
lastvalid = 0;
lastvalid = 0;
}
else {
/*
@ -999,30 +999,30 @@ UUInsertPartToList (uufile *data)
else if ((_FP_stricmp (data->subfname, iter->subfname) == 0 ||
(data->mimeid && iter->mimeid &&
strcmp (data->mimeid, iter->mimeid) == 0)) &&
!(iter->begin && data->data->begin) &&
!(iter->end && data->data->end) &&
!(data->mimeid && iter->mimeid &&
strcmp (data->mimeid, iter->mimeid) != 0) &&
!(data->filename && iter->filename &&
strcmp (data->filename, iter->filename) != 0) &&
!(iter->flags & FL_SINGLE)) {
!(iter->begin && data->data->begin) &&
!(iter->end && data->data->end) &&
!(data->mimeid && iter->mimeid &&
strcmp (data->mimeid, iter->mimeid) != 0) &&
!(data->filename && iter->filename &&
strcmp (data->filename, iter->filename) != 0) &&
!(iter->flags & FL_SINGLE)) {
/*
* if we already have this part, don't try to insert it
*/
for (fiter=iter->thisfile;
fiter && (data->partno>fiter->partno) && !fiter->data->end;
fiter=fiter->NEXT)
/* empty loop */ ;
fiter && (data->partno>fiter->partno) && !fiter->data->end;
fiter=fiter->NEXT)
/* empty loop */ ;
if (fiter &&
(data->partno==fiter->partno ||
(data->partno > fiter->partno && fiter->data->end)))
goto goahead;
(data->partno==fiter->partno ||
(data->partno > fiter->partno && fiter->data->end)))
goto goahead;
if (iter->filename == NULL && data->filename != NULL) {
if ((iter->filename = _FP_strdup (data->filename)) == NULL)
return UURET_NOMEM;
return UURET_NOMEM;
}
/*
@ -1031,18 +1031,18 @@ UUInsertPartToList (uufile *data)
*/
if (data->data->uudet == B64ENCODED &&
iter->uudet == XX_ENCODED && iter->begin) {
data->data->uudet = XX_ENCODED;
iter->uudet == XX_ENCODED && iter->begin) {
data->data->uudet = XX_ENCODED;
}
else if (data->data->uudet == XX_ENCODED && data->data->begin &&
iter->uudet == B64ENCODED) {
iter->uudet = XX_ENCODED;
iter->uudet == B64ENCODED) {
iter->uudet = XX_ENCODED;
fiter = iter->thisfile;
while (fiter) {
fiter->data->uudet = XX_ENCODED;
fiter = fiter->NEXT;
}
fiter = iter->thisfile;
while (fiter) {
fiter->data->uudet = XX_ENCODED;
fiter = fiter->NEXT;
}
}
/*
@ -1050,14 +1050,14 @@ UUInsertPartToList (uufile *data)
* iter->uudet from the first part
*/
if (data->data->flags & FL_PARTIAL) {
if (data->partno == 1) {
iter->uudet = data->data->uudet;
iter->flags = data->data->flags;
}
if (data->partno == 1) {
iter->uudet = data->data->uudet;
iter->flags = data->data->flags;
}
}
else {
if (data->data->uudet) iter->uudet = data->data->uudet;
if (data->data->flags) iter->flags = data->data->flags;
if (data->data->uudet) iter->uudet = data->data->uudet;
if (data->data->flags) iter->flags = data->data->flags;
}
if (iter->mode == 0 && data->data->mode != 0)
@ -1066,8 +1066,8 @@ UUInsertPartToList (uufile *data)
if (data->data->end) iter->end = (data->partno)?data->partno:1;
if (data->mimetype) {
_FP_free (iter->mimetype);
iter->mimetype = _FP_strdup (data->mimetype);
_FP_free (iter->mimetype);
iter->mimetype = _FP_strdup (data->mimetype);
}
/*
@ -1075,36 +1075,36 @@ UUInsertPartToList (uufile *data)
*/
if (data->partno != -1 && data->partno < iter->thisfile->partno) {
iter->state = UUFILE_READ;
data->NEXT = iter->thisfile;
iter->thisfile = data;
return UURET_OK;
iter->state = UUFILE_READ;
data->NEXT = iter->thisfile;
iter->thisfile = data;
return UURET_OK;
}
/*
* insert part somewhere else
*/
iter->state = UUFILE_READ; /* prepare for re-checking */
iter->state = UUFILE_READ; /* prepare for re-checking */
fiter = iter->thisfile;
last = NULL;
while (fiter) {
/*
* if we find the same part no again, check which one looks better
*/
if (data->partno == fiter->partno) {
/*
* if we find the same part no again, check which one looks better
*/
if (data->partno == fiter->partno) {
if (fiter->data->subject == NULL)
return UURET_NODATA;
else if (_FP_stristr (fiter->data->subject, "repost") != NULL &&
_FP_stristr (data->data->subject, "repost") == NULL)
return UURET_NODATA;
else if (_FP_stristr (fiter->data->subject, "repost") != NULL &&
_FP_stristr (data->data->subject, "repost") == NULL)
return UURET_NODATA;
else if (fiter->data->uudet && !data->data->uudet)
return UURET_NODATA;
else {
/*
* replace
*/
/*
* replace
*/
data->NEXT = fiter->NEXT;
fiter->NEXT = NULL;
UUkillfile (fiter);
@ -1118,22 +1118,22 @@ UUInsertPartToList (uufile *data)
}
}
/*
* if at the end of the part list, add it
*/
/*
* if at the end of the part list, add it
*/
if (fiter->NEXT == NULL ||
(data->partno != -1 && data->partno < fiter->NEXT->partno)) {
data->NEXT = fiter->NEXT;
fiter->NEXT = data;
if (fiter->NEXT == NULL ||
(data->partno != -1 && data->partno < fiter->NEXT->partno)) {
data->NEXT = fiter->NEXT;
fiter->NEXT = data;
if (data->partno == -1)
data->partno = fiter->partno + 1;
if (data->partno == -1)
data->partno = fiter->partno + 1;
return UURET_OK;
}
return UURET_OK;
}
last = fiter;
fiter = fiter->NEXT;
fiter = fiter->NEXT;
}
return UURET_OK; /* Shouldn't get here */
@ -1249,12 +1249,12 @@ UUCheckGlobalList (void)
continue;
}
else if ((liter->uudet == QP_ENCODED ||
liter->uudet == PT_ENCODED) &&
(liter->flags & FL_SINGLE)) {
liter->uudet == PT_ENCODED) &&
(liter->flags & FL_SINGLE)) {
if ((liter->flags&FL_PROPER)==0)
liter->size = -1;
liter->size = -1;
else
liter->size = liter->thisfile->data->length;
liter->size = liter->thisfile->data->length;
liter->state = UUFILE_OK;
continue;
@ -1281,7 +1281,7 @@ UUCheckGlobalList (void)
while (fiter && !fiter->data->uudet) {
if (havecount<MAXPLIST) {
haveparts[havecount++] = fiter->partno;
haveparts[havecount++] = fiter->partno;
}
fiter = fiter->NEXT;
}
@ -1298,8 +1298,8 @@ UUCheckGlobalList (void)
if ((part = fiter->partno) > 1) {
if (!fiter->data->begin) {
for (count=1; count < part && miscount < MAXPLIST; count++)
misparts[miscount++] = count;
for (count=1; count < part && miscount < MAXPLIST; count++)
misparts[miscount++] = count;
}
}
@ -1314,8 +1314,8 @@ UUCheckGlobalList (void)
}
if (liter->uudet == B64ENCODED ||
liter->uudet == QP_ENCODED ||
liter->uudet == PT_ENCODED)
liter->uudet == QP_ENCODED ||
liter->uudet == PT_ENCODED)
flag |= 3; /* Don't need begin or end with Base64 or plain text*/
if (fiter->data->begin) flag |= 1;
@ -1346,12 +1346,12 @@ UUCheckGlobalList (void)
while (fiter != NULL) {
for (count=part+1; count<fiter->partno && miscount<MAXPLIST; count++)
misparts[miscount++] = count;
misparts[miscount++] = count;
part = fiter->partno;
if (havecount<MAXPLIST)
haveparts[havecount++]=part;
haveparts[havecount++]=part;
if (fiter->data->begin) flag |= 1;
if (fiter->data->end) flag |= 2;
@ -1360,22 +1360,22 @@ UUCheckGlobalList (void)
switch (fiter->data->uudet) {
case UU_ENCODED:
case XX_ENCODED:
thesize += 3*fiter->data->length/4;
thesize -= 3*fiter->data->length/124; /* substract 2 of 62 chars */
break;
thesize += 3*fiter->data->length/4;
thesize -= 3*fiter->data->length/124; /* substract 2 of 62 chars */
break;
case B64ENCODED:
thesize += 3*fiter->data->length/4;
thesize -= fiter->data->length/52; /* substract 2 of 78 chars */
break;
thesize += 3*fiter->data->length/4;
thesize -= fiter->data->length/52; /* substract 2 of 78 chars */
break;
case QP_ENCODED:
case PT_ENCODED:
thesize += fiter->data->length;
break;
thesize += fiter->data->length;
break;
}
if (fiter->data->end)
break;
break;
fiter = fiter->NEXT;
}
@ -1386,7 +1386,7 @@ UUCheckGlobalList (void)
*/
if (uu_fast_scanning && (flag & 0x01) && (flag & 0x04) &&
(liter->uudet == UU_ENCODED || liter->uudet == XX_ENCODED))
(liter->uudet == UU_ENCODED || liter->uudet == XX_ENCODED))
flag |= 2;
/*
@ -1401,15 +1401,15 @@ UUCheckGlobalList (void)
if (havecount) {
if ((liter->haveparts=(int*)malloc((havecount+1)*sizeof(int)))!=NULL) {
memcpy (liter->haveparts, haveparts, havecount*sizeof(int));
liter->haveparts[havecount] = 0;
memcpy (liter->haveparts, haveparts, havecount*sizeof(int));
liter->haveparts[havecount] = 0;
}
}
if (miscount) {
if ((liter->misparts=(int*)malloc((miscount+1)*sizeof(int)))!=NULL) {
memcpy (liter->misparts, misparts, miscount*sizeof(int));
liter->misparts[miscount] = 0;
memcpy (liter->misparts, misparts, miscount*sizeof(int));
liter->misparts[miscount] = 0;
}
liter->state |= UUFILE_MISPART;
}

View File

@ -26,9 +26,9 @@
#ifndef _ANSI_ARGS_
#ifdef PROTOTYPES
#define _ANSI_ARGS_(c) c
#define _ANSI_ARGS_(c) c
#else
#define _ANSI_ARGS_(c) ()
#define _ANSI_ARGS_(c) ()
#endif
#endif
@ -36,75 +36,75 @@
* Message Types
*/
#define UUMSG_MESSAGE (0) /* just a message, nothing important */
#define UUMSG_NOTE (1) /* something that should be noticed */
#define UUMSG_WARNING (2) /* important msg, processing continues */
#define UUMSG_ERROR (3) /* processing has been terminated */
#define UUMSG_FATAL (4) /* decoder cannot process further requests */
#define UUMSG_PANIC (5) /* recovery impossible, app must terminate */
#define UUMSG_MESSAGE (0) /* just a message, nothing important */
#define UUMSG_NOTE (1) /* something that should be noticed */
#define UUMSG_WARNING (2) /* important msg, processing continues */
#define UUMSG_ERROR (3) /* processing has been terminated */
#define UUMSG_FATAL (4) /* decoder cannot process further requests */
#define UUMSG_PANIC (5) /* recovery impossible, app must terminate */
/*
* Return Values
*/
#define UURET_OK (0) /* everything went fine */
#define UURET_IOERR (1) /* I/O Error - examine errno */
#define UURET_NOMEM (2) /* not enough memory */
#define UURET_ILLVAL (3) /* illegal value for operation */
#define UURET_NODATA (4) /* decoder didn't find any data */
#define UURET_NOEND (5) /* encoded data wasn't ended properly */
#define UURET_UNSUP (6) /* unsupported function (encoding) */
#define UURET_EXISTS (7) /* file exists (decoding) */
#define UURET_CONT (8) /* continue -- special from ScanPart */
#define UURET_CANCEL (9) /* operation canceled */
#define UURET_OK (0) /* everything went fine */
#define UURET_IOERR (1) /* I/O Error - examine errno */
#define UURET_NOMEM (2) /* not enough memory */
#define UURET_ILLVAL (3) /* illegal value for operation */
#define UURET_NODATA (4) /* decoder didn't find any data */
#define UURET_NOEND (5) /* encoded data wasn't ended properly */
#define UURET_UNSUP (6) /* unsupported function (encoding) */
#define UURET_EXISTS (7) /* file exists (decoding) */
#define UURET_CONT (8) /* continue -- special from ScanPart */
#define UURET_CANCEL (9) /* operation canceled */
/*
* File states, may be OR'ed
*/
#define UUFILE_READ (0) /* Read in, but not further processed */
#define UUFILE_MISPART (1) /* Missing Part(s) detected */
#define UUFILE_NOBEGIN (2) /* No 'begin' found */
#define UUFILE_NOEND (4) /* No 'end' found */
#define UUFILE_NODATA (8) /* File does not contain valid uudata */
#define UUFILE_OK (16) /* All Parts found, ready to decode */
#define UUFILE_ERROR (32) /* Error while decoding */
#define UUFILE_DECODED (64) /* Successfully decoded */
#define UUFILE_TMPFILE (128) /* Temporary decoded file exists */
#define UUFILE_READ (0) /* Read in, but not further processed */
#define UUFILE_MISPART (1) /* Missing Part(s) detected */
#define UUFILE_NOBEGIN (2) /* No 'begin' found */
#define UUFILE_NOEND (4) /* No 'end' found */
#define UUFILE_NODATA (8) /* File does not contain valid uudata */
#define UUFILE_OK (16) /* All Parts found, ready to decode */
#define UUFILE_ERROR (32) /* Error while decoding */
#define UUFILE_DECODED (64) /* Successfully decoded */
#define UUFILE_TMPFILE (128) /* Temporary decoded file exists */
/*
* Encoding Types
*/
#define UU_ENCODED (1) /* UUencoded data */
#define B64ENCODED (2) /* Mime-Base64 data */
#define XX_ENCODED (3) /* XXencoded data */
#define BH_ENCODED (4) /* Binhex encoded */
#define PT_ENCODED (5) /* Plain-Text encoded (MIME) */
#define QP_ENCODED (6) /* Quoted-Printable (MIME) */
#define YENC_ENCODED (7) /* yEnc encoded */
#define UU_ENCODED (1) /* UUencoded data */
#define B64ENCODED (2) /* Mime-Base64 data */
#define XX_ENCODED (3) /* XXencoded data */
#define BH_ENCODED (4) /* Binhex encoded */
#define PT_ENCODED (5) /* Plain-Text encoded (MIME) */
#define QP_ENCODED (6) /* Quoted-Printable (MIME) */
#define YENC_ENCODED (7) /* yEnc encoded */
/*
* Option indices for GetOption / SetOption
*/
#define UUOPT_VERSION (0) /* version number MAJOR.MINORplPATCH (ro) */
#define UUOPT_FAST (1) /* assumes only one part per file */
#define UUOPT_DUMBNESS (2) /* switch off the program's intelligence */
#define UUOPT_BRACKPOL (3) /* give numbers in [] higher precendence */
#define UUOPT_VERBOSE (4) /* generate informative messages */
#define UUOPT_DESPERATE (5) /* try to decode incomplete files */
#define UUOPT_IGNREPLY (6) /* ignore RE:plies (off by default) */
#define UUOPT_OVERWRITE (7) /* whether it's OK to overwrite ex. files */
#define UUOPT_SAVEPATH (8) /* prefix to save-files on disk */
#define UUOPT_IGNMODE (9) /* ignore the original file mode */
#define UUOPT_DEBUG (10) /* print messages with FILE/LINE info */
#define UUOPT_ERRNO (14) /* get last error code for UURET_IOERR (ro) */
#define UUOPT_PROGRESS (15) /* retrieve progress information */
#define UUOPT_USETEXT (16) /* handle text messages */
#define UUOPT_PREAMB (17) /* handle Mime preambles/epilogues */
#define UUOPT_TINYB64 (18) /* detect short B64 outside of Mime */
#define UUOPT_ENCEXT (19) /* extension for single-part encoded files */
#define UUOPT_VERSION (0) /* version number MAJOR.MINORplPATCH (ro) */
#define UUOPT_FAST (1) /* assumes only one part per file */
#define UUOPT_DUMBNESS (2) /* switch off the program's intelligence */
#define UUOPT_BRACKPOL (3) /* give numbers in [] higher precendence */
#define UUOPT_VERBOSE (4) /* generate informative messages */
#define UUOPT_DESPERATE (5) /* try to decode incomplete files */
#define UUOPT_IGNREPLY (6) /* ignore RE:plies (off by default) */
#define UUOPT_OVERWRITE (7) /* whether it's OK to overwrite ex. files */
#define UUOPT_SAVEPATH (8) /* prefix to save-files on disk */
#define UUOPT_IGNMODE (9) /* ignore the original file mode */
#define UUOPT_DEBUG (10) /* print messages with FILE/LINE info */
#define UUOPT_ERRNO (14) /* get last error code for UURET_IOERR (ro) */
#define UUOPT_PROGRESS (15) /* retrieve progress information */
#define UUOPT_USETEXT (16) /* handle text messages */
#define UUOPT_PREAMB (17) /* handle Mime preambles/epilogues */
#define UUOPT_TINYB64 (18) /* detect short B64 outside of Mime */
#define UUOPT_ENCEXT (19) /* extension for single-part encoded files */
#define UUOPT_REMOVE (20) /* remove input files after decoding */
#define UUOPT_MOREMIME (21) /* strict MIME adherence */
@ -112,11 +112,11 @@
* Code for the "action" in the progress structure
*/
#define UUACT_IDLE (0) /* we don't do anything */
#define UUACT_SCANNING (1) /* scanning an input file */
#define UUACT_DECODING (2) /* decoding into a temp file */
#define UUACT_COPYING (3) /* copying temp to target */
#define UUACT_ENCODING (4) /* encoding a file */
#define UUACT_IDLE (0) /* we don't do anything */
#define UUACT_SCANNING (1) /* scanning an input file */
#define UUACT_DECODING (2) /* decoding into a temp file */
#define UUACT_COPYING (3) /* copying temp to target */
#define UUACT_ENCODING (4) /* encoding a file */
/*
* forward definition
@ -132,30 +132,30 @@ struct _uufile;
*/
typedef struct _uulist {
short state; /* Status as described by the macros above */
short mode; /* file mode as found on begin line */
short state; /* Status as described by the macros above */
short mode; /* file mode as found on begin line */
int begin; /* part number where begin was detected */
int end; /* part number where end was detected */
int begin; /* part number where begin was detected */
int end; /* part number where end was detected */
short uudet; /* Encoding type (see macros above) */
int flags; /* flags, especially for single-part files */
short uudet; /* Encoding type (see macros above) */
int flags; /* flags, especially for single-part files */
long size; /* approximate size of resulting file */
char *filename; /* malloc'ed file name */
char *subfname; /* malloc'ed ID from subject line */
char *mimeid; /* malloc'ed MIME-ID, if available */
char *mimetype; /* malloc'ed Content-Type, if available */
long size; /* approximate size of resulting file */
char *filename; /* malloc'ed file name */
char *subfname; /* malloc'ed ID from subject line */
char *mimeid; /* malloc'ed MIME-ID, if available */
char *mimetype; /* malloc'ed Content-Type, if available */
char *binfile; /* name of temp file, if already decoded */
char *binfile; /* name of temp file, if already decoded */
struct _uufile *thisfile; /* linked list of this file's parts */
struct _uufile *thisfile; /* linked list of this file's parts */
int *haveparts; /* the parts we have (max. 256 are listed) */
int *misparts; /* list of missing parts (max. 256) */
int *haveparts; /* the parts we have (max. 256 are listed) */
int *misparts; /* list of missing parts (max. 256) */
struct _uulist *NEXT; /* next item of the list */
struct _uulist *PREV; /* previous item of the list */
struct _uulist *NEXT; /* next item of the list */
struct _uulist *PREV; /* previous item of the list */
} uulist;
/*
@ -163,14 +163,14 @@ typedef struct _uulist {
*/
typedef struct {
int action; /* see UUACT_* definitions above */
char curfile[256]; /* the file we are working on, incl. path */
int partno; /* part we're currently decoding */
int numparts; /* total number of parts of this file */
long fsize; /* size of the current file */
int percent; /* % of _current part_ */
long foffset; /* file offset -- internal use only */
long totsize; /* file total size -- internal use only */
int action; /* see UUACT_* definitions above */
char curfile[256]; /* the file we are working on, incl. path */
int partno; /* part we're currently decoding */
int numparts; /* total number of parts of this file */
long fsize; /* size of the current file */
int percent; /* % of _current part_ */
long foffset; /* file offset -- internal use only */
long totsize; /* file total size -- internal use only */
} uuprogress;
@ -186,76 +186,76 @@ typedef struct {
extern "C" {
#endif
int UUEXPORT UUInitialize _ANSI_ARGS_((void));
int UUEXPORT UUGetOption _ANSI_ARGS_((int, int *, char *, int));
int UUEXPORT UUSetOption _ANSI_ARGS_((int, int, char *));
char * UUEXPORT UUstrerror _ANSI_ARGS_((int));
int UUEXPORT UUSetMsgCallback _ANSI_ARGS_((void *,
void (*) (void *,
char *,
int)));
int UUEXPORT UUSetBusyCallback _ANSI_ARGS_((void *,
int (*) (void *,
uuprogress *),
long));
int UUEXPORT UUSetFileCallback _ANSI_ARGS_((void *,
int (*) (void *, char *,
char *, int)));
int UUEXPORT UUSetFNameFilter _ANSI_ARGS_((void *,
char * (*) (void *,
char *)));
char * UUEXPORT UUFNameFilter _ANSI_ARGS_((char *));
int UUEXPORT UULoadFile _ANSI_ARGS_((char *, char *, int));
uulist *UUEXPORT UUGetFileListItem _ANSI_ARGS_((int));
int UUEXPORT UURenameFile _ANSI_ARGS_((uulist *, char *));
int UUEXPORT UUDecodeToTemp _ANSI_ARGS_((uulist *));
int UUEXPORT UURemoveTemp _ANSI_ARGS_((uulist *));
int UUEXPORT UUDecodeFile _ANSI_ARGS_((uulist *, char *));
int UUEXPORT UUInfoFile _ANSI_ARGS_((uulist *, void *,
int (*) (void *,
char *)));
int UUEXPORT UUSmerge _ANSI_ARGS_((int));
int UUEXPORT UUCleanUp _ANSI_ARGS_((void));
int UUEXPORT UUInitialize _ANSI_ARGS_((void));
int UUEXPORT UUGetOption _ANSI_ARGS_((int, int *, char *, int));
int UUEXPORT UUSetOption _ANSI_ARGS_((int, int, char *));
char * UUEXPORT UUstrerror _ANSI_ARGS_((int));
int UUEXPORT UUSetMsgCallback _ANSI_ARGS_((void *,
void (*) (void *,
char *,
int)));
int UUEXPORT UUSetBusyCallback _ANSI_ARGS_((void *,
int (*) (void *,
uuprogress *),
long));
int UUEXPORT UUSetFileCallback _ANSI_ARGS_((void *,
int (*) (void *, char *,
char *, int)));
int UUEXPORT UUSetFNameFilter _ANSI_ARGS_((void *,
char * (*) (void *,
char *)));
char * UUEXPORT UUFNameFilter _ANSI_ARGS_((char *));
int UUEXPORT UULoadFile _ANSI_ARGS_((char *, char *, int));
uulist *UUEXPORT UUGetFileListItem _ANSI_ARGS_((int));
int UUEXPORT UURenameFile _ANSI_ARGS_((uulist *, char *));
int UUEXPORT UUDecodeToTemp _ANSI_ARGS_((uulist *));
int UUEXPORT UURemoveTemp _ANSI_ARGS_((uulist *));
int UUEXPORT UUDecodeFile _ANSI_ARGS_((uulist *, char *));
int UUEXPORT UUInfoFile _ANSI_ARGS_((uulist *, void *,
int (*) (void *,
char *)));
int UUEXPORT UUSmerge _ANSI_ARGS_((int));
int UUEXPORT UUCleanUp _ANSI_ARGS_((void));
int UUEXPORT UUQuickDecode _ANSI_ARGS_((FILE *, FILE *,
char *, long));
int UUEXPORT UUQuickDecode _ANSI_ARGS_((FILE *, FILE *,
char *, long));
int UUEXPORT UUEncodeMulti _ANSI_ARGS_((FILE *, FILE *,
char *, int,
char *, char *, int));
int UUEXPORT UUEncodePartial _ANSI_ARGS_((FILE *, FILE *,
char *, int,
char *, char *,
int, int, long,
unsigned long*));
int UUEXPORT UUEncodeToStream _ANSI_ARGS_((FILE *, FILE *,
char *, int,
char *, int));
int UUEXPORT UUEncodeToFile _ANSI_ARGS_((FILE *, char *, int,
char *, char *, long));
int UUEXPORT UUE_PrepSingle _ANSI_ARGS_((FILE *, FILE *,
char *, int,
char *, int,
char *, char *,
char *, int));
int UUEXPORT UUE_PrepPartial _ANSI_ARGS_((FILE *, FILE *,
char *, int,
char *, int,
int, long, long, char *,
char *, char *, int));
int UUEXPORT UUEncodeMulti _ANSI_ARGS_((FILE *, FILE *,
char *, int,
char *, char *, int));
int UUEXPORT UUEncodePartial _ANSI_ARGS_((FILE *, FILE *,
char *, int,
char *, char *,
int, int, long,
unsigned long*));
int UUEXPORT UUEncodeToStream _ANSI_ARGS_((FILE *, FILE *,
char *, int,
char *, int));
int UUEXPORT UUEncodeToFile _ANSI_ARGS_((FILE *, char *, int,
char *, char *, long));
int UUEXPORT UUE_PrepSingle _ANSI_ARGS_((FILE *, FILE *,
char *, int,
char *, int,
char *, char *,
char *, int));
int UUEXPORT UUE_PrepPartial _ANSI_ARGS_((FILE *, FILE *,
char *, int,
char *, int,
int, long, long, char *,
char *, char *, int));
int UUEXPORT UUE_PrepSingleExt _ANSI_ARGS_((FILE *, FILE *,
char *, int,
char *, int,
char *, char *,
char *, char *,
int));
int UUEXPORT UUE_PrepPartialExt _ANSI_ARGS_((FILE *, FILE *,
char *, int,
char *, int,
int, long, long, char *,
char *, char *, char *,
int));
int UUEXPORT UUE_PrepSingleExt _ANSI_ARGS_((FILE *, FILE *,
char *, int,
char *, int,
char *, char *,
char *, char *,
int));
int UUEXPORT UUE_PrepPartialExt _ANSI_ARGS_((FILE *, FILE *,
char *, int,
char *, int,
int, long, long, char *,
char *, char *, char *,
int));
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -27,9 +27,9 @@
#ifndef _ANSI_ARGS_
#ifdef PROTOTYPES
#define _ANSI_ARGS_(c) c
#define _ANSI_ARGS_(c) c
#else
#define _ANSI_ARGS_(c) ()
#define _ANSI_ARGS_(c) ()
#endif
#endif
@ -37,24 +37,24 @@
* Busy Polls will be made after processing ... lines
*/
#define BUSY_LINE_TICKS 50
#define BUSY_LINE_TICKS 50
/*
* States of MIME scanner
*/
#define MS_HEADERS 1 /* still inside of headers */
#define MS_BODY 2 /* body of `simple' messages */
#define MS_PREAMBLE 3 /* preamble of Multipart/Mixed */
#define MS_SUBPART 4 /* within one of the Multiparts */
#define MS_EPILOGUE 5 /* epilogue of Multipart/Mixed */
#define MS_HEADERS 1 /* still inside of headers */
#define MS_BODY 2 /* body of `simple' messages */
#define MS_PREAMBLE 3 /* preamble of Multipart/Mixed */
#define MS_SUBPART 4 /* within one of the Multiparts */
#define MS_EPILOGUE 5 /* epilogue of Multipart/Mixed */
/*
* Number of subsequent encoded lines we require to believe this
* is valid data.
*/
#define ELC_COUNT 4
#define ELC_COUNT 4
/*
* Flags a part may have. FL_PROPER means that we are sure about the file's
@ -62,11 +62,11 @@
* coding.
*/
#define FL_NONE 0 /* no flag, just plain normal */
#define FL_SINGLE 1 /* standalone MSG, do not mix */
#define FL_PARTIAL 2 /* from Message/Partial */
#define FL_PROPER 4 /* proper MIME part */
#define FL_TOEND 8 /* part continues to EOF */
#define FL_NONE 0 /* no flag, just plain normal */
#define FL_SINGLE 1 /* standalone MSG, do not mix */
#define FL_PARTIAL 2 /* from Message/Partial */
#define FL_PROPER 4 /* proper MIME part */
#define FL_TOEND 8 /* part continues to EOF */
/*
* Auxiliary macro: compute the percentage of a against b.
@ -75,8 +75,8 @@
* by zero for b<100 and the result doesn't become larger than 100%
*/
#define UUPERCENT(a,b) ((int) ((unsigned long)(a) / \
(((unsigned long)(b)/100)+1)))
#define UUPERCENT(a,b) ((int) ((unsigned long)(a) / \
(((unsigned long)(b)/100)+1)))
/*
* Make the Busy Callback easier. The macro returns true if the BusyCallback
@ -93,9 +93,9 @@ extern unsigned long uuyctr;
*/
typedef struct {
int restart; /* restarting after a MIME body (not subpart) */
int afterdata; /* after we had useful data in freestyle mode */
int afternl; /* after an empty line in freestyle mode */
int restart; /* restarting after a MIME body (not subpart) */
int afterdata; /* after we had useful data in freestyle mode */
int afternl; /* after an empty line in freestyle mode */
} headercount;
extern headercount hlcount;
@ -107,18 +107,18 @@ extern headercount hlcount;
*/
typedef struct _headers {
char *from; /* From: */
char *subject; /* Subject: */
char *rcpt; /* To: */
char *date; /* Date: */
char *mimevers; /* MIME-Version: */
char *ctype; /* Content-Type: */
char *ctenc; /* Content-Transfer-Encoding: */
char *fname; /* Potential Filename from Content-Type Parameter */
char *boundary; /* MIME-Boundary from Content-Type Parameter */
char *mimeid; /* MIME-Id for Message/Partial */
int partno; /* part number for Message/Partial */
int numparts; /* number of parts for Message/Partial */
char *from; /* From: */
char *subject; /* Subject: */
char *rcpt; /* To: */
char *date; /* Date: */
char *mimevers; /* MIME-Version: */
char *ctype; /* Content-Type: */
char *ctenc; /* Content-Transfer-Encoding: */
char *fname; /* Potential Filename from Content-Type Parameter */
char *boundary; /* MIME-Boundary from Content-Type Parameter */
char *mimeid; /* MIME-Id for Message/Partial */
int partno; /* part number for Message/Partial */
int numparts; /* number of parts for Message/Partial */
} headers;
/*
@ -126,12 +126,12 @@ typedef struct _headers {
*/
typedef struct _scanstate {
int isfolder; /* if we think this is a valid email folder */
int ismime; /* if we are within a valid MIME message */
int mimestate; /* state of MIME scanner */
int mimeenc; /* encoding of this MIME file */
char *source; /* source filename */
headers envelope; /* mail envelope headers */
int isfolder; /* if we think this is a valid email folder */
int ismime; /* if we are within a valid MIME message */
int mimestate; /* state of MIME scanner */
int mimeenc; /* encoding of this MIME file */
char *source; /* source filename */
headers envelope; /* mail envelope headers */
} scanstate;
/*
@ -145,23 +145,23 @@ typedef struct _scanstate {
**/
typedef struct _fileread {
char *subject; /* Whole subject line */
char *filename; /* Only filled in if begin detected */
char *origin; /* Whole 'From:' line */
char *mimeid; /* the ID for Mime-encoded files */
char *mimetype; /* Content-Type */
short mode; /* Mode of File (from 'begin') */
int begin; /* begin detected */
int end; /* end detected */
int flags; /* associated flags */
char *subject; /* Whole subject line */
char *filename; /* Only filled in if begin detected */
char *origin; /* Whole 'From:' line */
char *mimeid; /* the ID for Mime-encoded files */
char *mimetype; /* Content-Type */
short mode; /* Mode of File (from 'begin') */
int begin; /* begin detected */
int end; /* end detected */
int flags; /* associated flags */
short uudet; /* valid encoded data. value indicates encoding */
short partno; /* Mime-files have a part number within */
short maxpno; /* ... plus the total number of parts */
short uudet; /* valid encoded data. value indicates encoding */
short partno; /* Mime-files have a part number within */
short maxpno; /* ... plus the total number of parts */
char *sfname; /* Associated source file */
long startpos; /* ftell() position where data starts */
long length; /* length of data */
char *sfname; /* Associated source file */
long startpos; /* ftell() position where data starts */
long length; /* length of data */
} fileread;
/*
@ -275,64 +275,64 @@ extern char * (*uu_FNameFilter) _ANSI_ARGS_((void *, char *));
*/
#if defined(STDC_HEADERS) || defined(HAVE_STDARG_H)
int UUMessage _ANSI_ARGS_((char *, int,
int, char *, ...));
int UUMessage _ANSI_ARGS_((char *, int,
int, char *, ...));
#else
int UUMessage ();
int UUMessage ();
#endif
int UUBusyPoll _ANSI_ARGS_((void));
int UUBusyPoll _ANSI_ARGS_((void));
/*
* Functions from uucheck.c
*/
uufile * UUPreProcessPart _ANSI_ARGS_((fileread *, int *));
int UUInsertPartToList _ANSI_ARGS_((uufile *));
uulist * UUCheckGlobalList _ANSI_ARGS_((void));
uufile * UUPreProcessPart _ANSI_ARGS_((fileread *, int *));
int UUInsertPartToList _ANSI_ARGS_((uufile *));
uulist * UUCheckGlobalList _ANSI_ARGS_((void));
/*
* Functions from uuutil.c
*/
void UUkillfread _ANSI_ARGS_((fileread *));
void UUkillfile _ANSI_ARGS_((uufile *));
void UUkilllist _ANSI_ARGS_((uulist *));
void UUkillheaders _ANSI_ARGS_((headers *));
void UUkillfread _ANSI_ARGS_((fileread *));
void UUkillfile _ANSI_ARGS_((uufile *));
void UUkilllist _ANSI_ARGS_((uulist *));
void UUkillheaders _ANSI_ARGS_((headers *));
fileread * ScanPart _ANSI_ARGS_((FILE *, char *, int *));
fileread * ScanPart _ANSI_ARGS_((FILE *, char *, int *));
int UUbhdecomp _ANSI_ARGS_((char *, char *,
char *, int *,
size_t, size_t,
size_t *));
size_t UUbhwrite _ANSI_ARGS_((char *, size_t, size_t,
FILE *));
int UUbhdecomp _ANSI_ARGS_((char *, char *,
char *, int *,
size_t, size_t,
size_t *));
size_t UUbhwrite _ANSI_ARGS_((char *, size_t, size_t,
FILE *));
/*
* Functions from uunconc.c
*/
int UURepairData _ANSI_ARGS_((FILE *, char *,
int, int *));
int UURepairData _ANSI_ARGS_((FILE *, char *,
int, int *));
void UUInitConc _ANSI_ARGS_((void));
int UUValidData _ANSI_ARGS_((char *, int, int *));
size_t UUDecodeLine _ANSI_ARGS_((char *, char *, int));
int UUDecodePart _ANSI_ARGS_((FILE *, FILE *, int *,
long, int, int, char *));
int UUDecode _ANSI_ARGS_((uulist *));
void UUInitConc _ANSI_ARGS_((void));
int UUValidData _ANSI_ARGS_((char *, int, int *));
size_t UUDecodeLine _ANSI_ARGS_((char *, char *, int));
int UUDecodePart _ANSI_ARGS_((FILE *, FILE *, int *,
long, int, int, char *));
int UUDecode _ANSI_ARGS_((uulist *));
/*
* Message retrieval from uustring.c
*/
char * uustring _ANSI_ARGS_((int));
char * uustring _ANSI_ARGS_((int));
/*
* From uuscan.c
*/
int UUScanHeader _ANSI_ARGS_((FILE *, headers *));
int UUScanHeader _ANSI_ARGS_((FILE *, headers *));
#ifdef __cplusplus
}

View File

@ -86,7 +86,7 @@ char * uulib_id = "$Id$";
#ifdef SYSTEM_WINDLL
BOOL _export WINAPI
DllEntryPoint (HINSTANCE hInstance, DWORD seginfo,
LPVOID lpCmdLine)
LPVOID lpCmdLine)
{
/* Don't do anything, so just return true */
return TRUE;
@ -128,24 +128,24 @@ void *uu_FFCBArg = NULL;
* Global variables
*/
int uu_fast_scanning = 0; /* assumes at most 1 part per file */
int uu_bracket_policy = 0; /* gives part numbers in [] higher priority */
int uu_verbose = 1; /* enables/disables messages&notes */
int uu_desperate = 0; /* desperate mode */
int uu_ignreply = 0; /* ignore replies */
int uu_debug = 0; /* debugging mode (print __FILE__/__LINE__) */
int uu_errno = 0; /* the errno that caused this UURET_IOERR */
int uu_dumbness = 0; /* switch off the program's intelligence */
int uu_overwrite = 1; /* whether it's ok to overwrite ex. files */
int uu_ignmode = 0; /* ignore the original file mode */
int uu_handletext = 0; /* do we want text/plain messages */
int uu_usepreamble = 0; /* do we want Mime preambles/epilogues */
int uu_tinyb64 = 0; /* detect short B64 outside of MIME */
int uu_fast_scanning = 0; /* assumes at most 1 part per file */
int uu_bracket_policy = 0; /* gives part numbers in [] higher priority */
int uu_verbose = 1; /* enables/disables messages&notes */
int uu_desperate = 0; /* desperate mode */
int uu_ignreply = 0; /* ignore replies */
int uu_debug = 0; /* debugging mode (print __FILE__/__LINE__) */
int uu_errno = 0; /* the errno that caused this UURET_IOERR */
int uu_dumbness = 0; /* switch off the program's intelligence */
int uu_overwrite = 1; /* whether it's ok to overwrite ex. files */
int uu_ignmode = 0; /* ignore the original file mode */
int uu_handletext = 0; /* do we want text/plain messages */
int uu_usepreamble = 0; /* do we want Mime preambles/epilogues */
int uu_tinyb64 = 0; /* detect short B64 outside of MIME */
int uu_remove_input = 0; /* remove input files after decoding */
int uu_more_mime = 0; /* strictly adhere to MIME headers */
headercount hlcount = {
3, /* restarting after a MIME body */
3, /* restarting after a MIME body */
2, /* after useful data in freestyle mode */
1 /* after useful data and an empty line */
};
@ -186,9 +186,9 @@ uulist *UUGlobalFileList = NULL;
* time values for BusyCallback. msecs is MILLIsecs here
*/
static long uu_busy_msecs = 0; /* call callback function each msecs */
static long uu_last_secs = 0; /* secs of last call to callback */
static long uu_last_usecs = 0; /* usecs of last call to callback */
static long uu_busy_msecs = 0; /* call callback function each msecs */
static long uu_last_secs = 0; /* secs of last call to callback */
static long uu_last_usecs = 0; /* usecs of last call to callback */
/*
* progress information
@ -228,7 +228,7 @@ typedef struct {
static allomap toallocate[] = {
{ &uugen_fnbuffer, 1024 }, /* generic filename buffer */
{ &uugen_inbuffer, 1024 }, /* generic input data buffer */
{ &uucheck_lastname, 256 }, /* from uucheck.c */
{ &uucheck_lastname, 256 }, /* from uucheck.c */
{ &uucheck_tempname, 256 },
{ &uuestr_itemp, 256 }, /* from uuencode.c:UUEncodeStream() */
{ &uuestr_otemp, 1024 },
@ -392,7 +392,7 @@ UUInitialize (void)
* areas (uulib_msgstring) in UUMessage()
*/
for (aiter=toallocate; aiter->ptr; aiter++) {
_FP_free (*(aiter->ptr));
_FP_free (*(aiter->ptr));
}
return UURET_NOMEM;
}
@ -575,7 +575,7 @@ UUstrerror (int code)
int UUEXPORT
UUSetMsgCallback (void *opaque,
void (*func) _ANSI_ARGS_((void *, char *, int)))
void (*func) _ANSI_ARGS_((void *, char *, int)))
{
uu_MsgCallback = func;
uu_MsgCBArg = opaque;
@ -585,8 +585,8 @@ UUSetMsgCallback (void *opaque,
int UUEXPORT
UUSetBusyCallback (void *opaque,
int (*func) _ANSI_ARGS_((void *, uuprogress *)),
long msecs)
int (*func) _ANSI_ARGS_((void *, uuprogress *)),
long msecs)
{
uu_BusyCallback = func;
uu_BusyCBArg = opaque;
@ -597,7 +597,7 @@ UUSetBusyCallback (void *opaque,
int UUEXPORT
UUSetFileCallback (void *opaque,
int (*func) _ANSI_ARGS_((void *, char *, char *, int)))
int (*func) _ANSI_ARGS_((void *, char *, char *, int)))
{
uu_FileCallback = func;
uu_FileCBArg = opaque;
@ -607,7 +607,7 @@ UUSetFileCallback (void *opaque,
int UUEXPORT
UUSetFNameFilter (void *opaque,
char * (*func) _ANSI_ARGS_((void *, char *)))
char * (*func) _ANSI_ARGS_((void *, char *)))
{
uu_FNameFilter = func;
uu_FFCBArg = opaque;
@ -664,15 +664,15 @@ UULoadFile (char *filename, char *fileid, int delflag)
if ((datei = fopen (filename, "rb")) == NULL) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_OPEN_SOURCE),
filename, strerror (uu_errno = errno));
uustring (S_NOT_OPEN_SOURCE),
filename, strerror (uu_errno = errno));
return UURET_IOERR;
}
if (fstat (fileno(datei), &finfo) == -1) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_STAT_FILE),
filename, strerror (uu_errno = errno));
uustring (S_NOT_STAT_FILE),
filename, strerror (uu_errno = errno));
fclose (datei);
return UURET_IOERR;
}
@ -684,11 +684,11 @@ UULoadFile (char *filename, char *fileid, int delflag)
if (delflag && fileid==NULL) {
if ((killem = (itbd *) malloc (sizeof (itbd))) == NULL) {
UUMessage (uulib_id, __LINE__, UUMSG_WARNING,
uustring (S_OUT_OF_MEMORY), sizeof (itbd));
uustring (S_OUT_OF_MEMORY), sizeof (itbd));
}
else if ((killem->fname = _FP_strdup (filename)) == NULL) {
UUMessage (uulib_id, __LINE__, UUMSG_WARNING,
uustring (S_OUT_OF_MEMORY), strlen(filename)+1);
uustring (S_OUT_OF_MEMORY), strlen(filename)+1);
_FP_free (killem);
}
else {
@ -704,9 +704,9 @@ UULoadFile (char *filename, char *fileid, int delflag)
progress.percent = 0;
progress.foffset = 0;
_FP_strncpy (progress.curfile,
(strlen(filename)>255)?
(filename+strlen(filename)-255):filename,
256);
(strlen(filename)>255)?
(filename+strlen(filename)-255):filename,
256);
progress.action = UUACT_SCANNING;
if (fileid == NULL)
@ -724,24 +724,24 @@ UULoadFile (char *filename, char *fileid, int delflag)
if ((loaded = ScanPart (datei, fileid, &sr)) == NULL) {
if (sr != UURET_NODATA && sr != UURET_OK && sr != UURET_CONT) {
UUkillfread (loaded);
if (sr != UURET_CANCEL) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_READ_ERROR), filename,
strerror (uu_errno));
}
UUCheckGlobalList ();
progress.action = 0;
fclose (datei);
return sr;
UUkillfread (loaded);
if (sr != UURET_CANCEL) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_READ_ERROR), filename,
strerror (uu_errno));
}
UUCheckGlobalList ();
progress.action = 0;
fclose (datei);
return sr;
}
continue;
}
if (ferror (datei)) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_READ_ERROR), filename,
strerror (uu_errno = errno));
uustring (S_READ_ERROR), filename,
strerror (uu_errno = errno));
UUCheckGlobalList ();
progress.action = 0;
fclose (datei);
@ -749,8 +749,8 @@ UULoadFile (char *filename, char *fileid, int delflag)
}
if ((loaded->uudet == QP_ENCODED || loaded->uudet == PT_ENCODED) &&
(loaded->filename == NULL || *(loaded->filename) == '\0') &&
!uu_handletext && (loaded->flags&FL_PARTIAL)==0) {
(loaded->filename == NULL || *(loaded->filename) == '\0') &&
!uu_handletext && (loaded->flags&FL_PARTIAL)==0) {
/*
* Don't want text
*/
@ -759,9 +759,9 @@ UULoadFile (char *filename, char *fileid, int delflag)
}
if ((loaded->subject == NULL || *(loaded->subject) == '\0') &&
(loaded->mimeid == NULL || *(loaded->mimeid) == '\0') &&
(loaded->filename== NULL || *(loaded->filename)== '\0') &&
(loaded->uudet == 0)) {
(loaded->mimeid == NULL || *(loaded->mimeid) == '\0') &&
(loaded->filename== NULL || *(loaded->filename)== '\0') &&
(loaded->uudet == 0)) {
/*
* no useful data here
*/
@ -775,9 +775,9 @@ UULoadFile (char *filename, char *fileid, int delflag)
* no useful data found
*/
if (res != UURET_NODATA) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_READ_ERROR), filename,
(res==UURET_IOERR)?strerror(uu_errno):UUstrerror(res));
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_READ_ERROR), filename,
(res==UURET_IOERR)?strerror(uu_errno):UUstrerror(res));
}
UUkillfread (loaded);
if (uu_fast_scanning && sr != UURET_CONT) break;
@ -785,19 +785,19 @@ UULoadFile (char *filename, char *fileid, int delflag)
}
if ((loaded->subject && *(loaded->subject)) ||
(loaded->mimeid && *(loaded->mimeid)) ||
(loaded->filename&& *(loaded->filename))||
(loaded->uudet)) {
(loaded->mimeid && *(loaded->mimeid)) ||
(loaded->filename&& *(loaded->filename))||
(loaded->uudet)) {
UUMessage (uulib_id, __LINE__, UUMSG_MESSAGE,
uustring (S_LOADED_PART),
filename,
(loaded->subject) ? loaded->subject : "",
(fload->subfname) ? fload->subfname : "",
(loaded->filename) ? loaded->filename : "",
fload->partno,
(loaded->begin) ? "begin" : "",
(loaded->end) ? "end" : "",
codenames[loaded->uudet]);
uustring (S_LOADED_PART),
filename,
(loaded->subject) ? loaded->subject : "",
(fload->subfname) ? fload->subfname : "",
(loaded->filename) ? loaded->filename : "",
fload->partno,
(loaded->begin) ? "begin" : "",
(loaded->end) ? "end" : "",
codenames[loaded->uudet]);
}
if ((res = UUInsertPartToList (fload))) {
@ -807,13 +807,13 @@ UULoadFile (char *filename, char *fileid, int delflag)
UUkillfile (fload);
if (res != UURET_NODATA) {
UUCheckGlobalList ();
progress.action = 0;
fclose (datei);
return res;
UUCheckGlobalList ();
progress.action = 0;
fclose (datei);
return res;
}
if (uu_fast_scanning && sr != UURET_CONT)
break;
break;
continue;
}
@ -833,7 +833,7 @@ UULoadFile (char *filename, char *fileid, int delflag)
if (!uu_fast_scanning && count==0) {
UUMessage (uulib_id, __LINE__, UUMSG_NOTE,
uustring (S_NO_DATA_FOUND), filename);
uustring (S_NO_DATA_FOUND), filename);
}
progress.action = 0;
@ -873,14 +873,14 @@ UUDecodeFile (uulist *thefile, char *destname)
if (thefile->binfile == NULL) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NO_BIN_FILE));
uustring (S_NO_BIN_FILE));
return UURET_IOERR;
}
if ((source = fopen (thefile->binfile, "rb")) == NULL) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_OPEN_FILE),
thefile->binfile, strerror (uu_errno = errno));
uustring (S_NOT_OPEN_FILE),
thefile->binfile, strerror (uu_errno = errno));
return UURET_IOERR;
}
@ -890,8 +890,8 @@ UUDecodeFile (uulist *thefile, char *destname)
if ((thefile->mode & 0777) != thefile->mode) {
UUMessage (uulib_id, __LINE__, UUMSG_NOTE,
uustring (S_STRIPPED_SETUID),
destname, (int)thefile->mode);
uustring (S_STRIPPED_SETUID),
destname, (int)thefile->mode);
thefile->mode &= 0777;
}
@ -910,9 +910,9 @@ UUDecodeFile (uulist *thefile, char *destname)
strcpy (uugen_fnbuffer, destname);
else {
sprintf (uugen_fnbuffer, "%s%s",
(uusavepath)?uusavepath:"",
UUFNameFilter ((thefile->filename)?
thefile->filename:"unknown.xxx"));
(uusavepath)?uusavepath:"",
UUFNameFilter ((thefile->filename)?
thefile->filename:"unknown.xxx"));
}
/*
@ -922,7 +922,7 @@ UUDecodeFile (uulist *thefile, char *destname)
if (!uu_overwrite) {
if (stat (uugen_fnbuffer, &finfo) == 0) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_TARGET_EXISTS), uugen_fnbuffer);
uustring (S_TARGET_EXISTS), uugen_fnbuffer);
fclose (source);
return UURET_EXISTS;
}
@ -930,17 +930,17 @@ UUDecodeFile (uulist *thefile, char *destname)
if (fstat (fileno(source), &finfo) == -1) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_STAT_FILE),
thefile->binfile, strerror (uu_errno = errno));
uustring (S_NOT_STAT_FILE),
thefile->binfile, strerror (uu_errno = errno));
fclose (source);
return UURET_IOERR;
}
progress.action = 0;
_FP_strncpy (progress.curfile,
(strlen(uugen_fnbuffer)>255)?
(uugen_fnbuffer+strlen(uugen_fnbuffer)-255):uugen_fnbuffer,
256);
(strlen(uugen_fnbuffer)>255)?
(uugen_fnbuffer+strlen(uugen_fnbuffer)-255):uugen_fnbuffer,
256);
progress.partno = 0;
progress.numparts = 1;
progress.fsize = (long) ((finfo.st_size)?finfo.st_size:-1);
@ -953,8 +953,8 @@ UUDecodeFile (uulist *thefile, char *destname)
(uu_ignmode)?0666:thefile->mode)) == -1) {
progress.action = 0;
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_OPEN_TARGET),
uugen_fnbuffer, strerror (uu_errno = errno));
uustring (S_NOT_OPEN_TARGET),
uugen_fnbuffer, strerror (uu_errno = errno));
fclose (source);
return UURET_IOERR;
}
@ -962,8 +962,8 @@ UUDecodeFile (uulist *thefile, char *destname)
if ((target = fdopen (fildes, "wb")) == NULL) {
progress.action = 0;
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_IO_ERR_TARGET),
uugen_fnbuffer, strerror (uu_errno = errno));
uustring (S_IO_ERR_TARGET),
uugen_fnbuffer, strerror (uu_errno = errno));
fclose (source);
close (fildes);
return UURET_IOERR;
@ -973,7 +973,7 @@ UUDecodeFile (uulist *thefile, char *destname)
if (UUBUSYPOLL(ftell(source),progress.fsize)) {
UUMessage (uulib_id, __LINE__, UUMSG_NOTE,
uustring (S_DECODE_CANCEL));
uustring (S_DECODE_CANCEL));
fclose (source);
fclose (target);
unlink (uugen_fnbuffer);
@ -985,8 +985,8 @@ UUDecodeFile (uulist *thefile, char *destname)
if (ferror (source) || (bytes == 0 && !feof (source))) {
progress.action = 0;
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_READ_ERROR),
thefile->binfile, strerror (uu_errno = errno));
uustring (S_READ_ERROR),
thefile->binfile, strerror (uu_errno = errno));
fclose (source);
fclose (target);
unlink (uugen_fnbuffer);
@ -995,8 +995,8 @@ UUDecodeFile (uulist *thefile, char *destname)
if (fwrite (uugen_inbuffer, 1, bytes, target) != bytes) {
progress.action = 0;
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_WR_ERR_TARGET),
uugen_fnbuffer, strerror (uu_errno = errno));
uustring (S_WR_ERR_TARGET),
uugen_fnbuffer, strerror (uu_errno = errno));
fclose (source);
fclose (target);
unlink (uugen_fnbuffer);
@ -1013,9 +1013,9 @@ UUDecodeFile (uulist *thefile, char *destname)
if (unlink (thefile->binfile)) {
UUMessage (uulib_id, __LINE__, UUMSG_WARNING,
uustring (S_TMP_NOT_REMOVED),
thefile->binfile,
strerror (uu_errno = errno));
uustring (S_TMP_NOT_REMOVED),
thefile->binfile,
strerror (uu_errno = errno));
}
_FP_free (thefile->binfile);
thefile->binfile = NULL;
@ -1033,7 +1033,7 @@ UUDecodeFile (uulist *thefile, char *destname)
int UUEXPORT
UUInfoFile (uulist *thefile, void *opaque,
int (*func) _ANSI_ARGS_((void *, char *)))
int (*func) _ANSI_ARGS_((void *, char *)))
{
int errflag=0, res, bhflag=0, dd;
long maxpos;
@ -1045,25 +1045,25 @@ UUInfoFile (uulist *thefile, void *opaque,
if (uu_FileCallback) {
if ((res = (*uu_FileCallback) (uu_FileCBArg,
thefile->thisfile->data->sfname,
uugen_fnbuffer,
1)) != UURET_OK)
thefile->thisfile->data->sfname,
uugen_fnbuffer,
1)) != UURET_OK)
return res;
if ((inpfile = fopen (uugen_fnbuffer, "rb")) == NULL) {
(*uu_FileCallback) (uu_FileCBArg, thefile->thisfile->data->sfname,
uugen_fnbuffer, 0);
uugen_fnbuffer, 0);
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_OPEN_FILE), uugen_fnbuffer,
strerror (uu_errno = errno));
uustring (S_NOT_OPEN_FILE), uugen_fnbuffer,
strerror (uu_errno = errno));
return UURET_IOERR;
}
}
else {
if ((inpfile = fopen (thefile->thisfile->data->sfname, "rb")) == NULL) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_OPEN_FILE),
thefile->thisfile->data->sfname,
strerror (uu_errno=errno));
uustring (S_NOT_OPEN_FILE),
thefile->thisfile->data->sfname,
strerror (uu_errno=errno));
return UURET_IOERR;
}
_FP_strncpy (uugen_fnbuffer, thefile->thisfile->data->sfname, 1024);
@ -1077,7 +1077,7 @@ UUInfoFile (uulist *thefile, void *opaque,
maxpos = thefile->thisfile->data->startpos + thefile->thisfile->data->length;
while (!feof (inpfile) &&
(uu_fast_scanning || ftell(inpfile) < maxpos)) {
(uu_fast_scanning || ftell(inpfile) < maxpos)) {
if (_FP_fgets (uugen_inbuffer, 511, inpfile) == NULL)
break;
uugen_inbuffer[511] = '\0';
@ -1092,10 +1092,10 @@ UUInfoFile (uulist *thefile, void *opaque,
else if (thefile->uudet == BH_ENCODED && bhflag)
break;
else if ((thefile->uudet == UU_ENCODED || thefile->uudet == XX_ENCODED) &&
strncmp (uugen_inbuffer, "begin ", 6) == 0)
strncmp (uugen_inbuffer, "begin ", 6) == 0)
break;
else if (thefile->uudet == YENC_ENCODED &&
strncmp (uugen_inbuffer, "=ybegin ", 8) == 0)
strncmp (uugen_inbuffer, "=ybegin ", 8) == 0)
break;
if ((*func) (opaque, uugen_inbuffer))
@ -1104,8 +1104,8 @@ UUInfoFile (uulist *thefile, void *opaque,
if (ferror (inpfile)) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_READ_ERROR),
uugen_fnbuffer, strerror (uu_errno = errno));
uustring (S_READ_ERROR),
uugen_fnbuffer, strerror (uu_errno = errno));
errflag = 1;
}
@ -1113,15 +1113,15 @@ UUInfoFile (uulist *thefile, void *opaque,
if (uu_FileCallback)
(*uu_FileCallback) (uu_FileCBArg,
thefile->thisfile->data->sfname,
uugen_fnbuffer, 0);
thefile->thisfile->data->sfname,
uugen_fnbuffer, 0);
if (errflag)
return UURET_IOERR;
return UURET_OK;
}
int UUEXPORT
UURenameFile (uulist *thefile, char *newname)
{
@ -1134,8 +1134,8 @@ UURenameFile (uulist *thefile, char *newname)
if ((thefile->filename = _FP_strdup (newname)) == NULL) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_RENAME),
oldname, newname);
uustring (S_NOT_RENAME),
oldname, newname);
thefile->filename = oldname;
return UURET_NOMEM;
}
@ -1152,9 +1152,9 @@ UURemoveTemp (uulist *thefile)
if (thefile->binfile) {
if (unlink (thefile->binfile)) {
UUMessage (uulib_id, __LINE__, UUMSG_WARNING,
uustring (S_TMP_NOT_REMOVED),
thefile->binfile,
strerror (uu_errno = errno));
uustring (S_TMP_NOT_REMOVED),
thefile->binfile,
strerror (uu_errno = errno));
}
_FP_free (thefile->binfile);
thefile->binfile = NULL;
@ -1178,8 +1178,8 @@ UUCleanUp (void)
while (iter) {
if (unlink (iter->fname)) {
UUMessage (uulib_id, __LINE__, UUMSG_WARNING,
uustring (S_TMP_NOT_REMOVED),
iter->fname, strerror (uu_errno = errno));
uustring (S_TMP_NOT_REMOVED),
iter->fname, strerror (uu_errno = errno));
}
_FP_free (iter->fname);
ptr = iter;
@ -1197,17 +1197,17 @@ UUCleanUp (void)
liter = UUGlobalFileList;
while (liter) {
if (liter->state & UUFILE_DECODED) {
fiter = liter->thisfile;
while (fiter) {
if (fiter->data && fiter->data->sfname) {
/*
* Error code ignored. We might want to delete a file multiple
* times
*/
unlink (fiter->data->sfname);
}
fiter = fiter->NEXT;
}
fiter = liter->thisfile;
while (fiter) {
if (fiter->data && fiter->data->sfname) {
/*
* Error code ignored. We might want to delete a file multiple
* times
*/
unlink (fiter->data->sfname);
}
fiter = fiter->NEXT;
}
}
liter = liter->NEXT;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -124,7 +124,7 @@ char *uuretcodes[] = {
"Unexpected End of File",
"Unsupported function",
"File exists",
"Continue -- no error", /* only to be seen internally */
"Continue -- no error", /* only to be seen internally */
"Operation Canceled"
};
@ -162,8 +162,8 @@ uustring (int codeno)
}
UUMessage (uustring_id, __LINE__, UUMSG_ERROR,
"Could not retrieve string no %d",
codeno);
"Could not retrieve string no %d",
codeno);
return faileddef;
}

View File

@ -76,8 +76,8 @@ static char *knownexts[] = {
* forward declarations of local functions
*/
static int UUSMPKnownExt _ANSI_ARGS_((char *filename));
static uulist * UU_smparts_r _ANSI_ARGS_((uulist *, int));
static int UUSMPKnownExt _ANSI_ARGS_((char *filename));
static uulist * UU_smparts_r _ANSI_ARGS_((uulist *, int));
/*
* mallocable areas
@ -129,9 +129,9 @@ UUkilllist (uulist *data)
while (data) {
if (data->binfile != NULL)
if (unlink (data->binfile))
UUMessage (uuutil_id, __LINE__, UUMSG_WARNING,
uustring (S_TMP_NOT_REMOVED),
data->binfile, strerror (errno));
UUMessage (uuutil_id, __LINE__, UUMSG_WARNING,
uustring (S_TMP_NOT_REMOVED),
data->binfile, strerror (errno));
_FP_free (data->filename);
_FP_free (data->subfname);
@ -219,7 +219,7 @@ UUSMPKnownExt (char *filename)
int
UUbhdecomp (char *in, char *out, char *last, int *rpc,
size_t inc, size_t max, size_t *opc)
size_t inc, size_t max, size_t *opc)
{
size_t count, used=0, dummy;
char marker = '\220' /* '\x90' */;
@ -257,18 +257,18 @@ UUbhdecomp (char *in, char *out, char *last, int *rpc,
if (*in == marker) {
used++; in++;
if (used == inc) {
*rpc = -256;
return used;
*rpc = -256;
return used;
}
*rpc = (int) (unsigned char) *in++; used++;
if (*rpc == 0) {
*last = *out++ = marker;
max--; *opc+=1;
continue;
*last = *out++ = marker;
max--; *opc+=1;
continue;
}
else
*rpc -= 1;
*rpc -= 1;
count = (max > (size_t) *rpc) ? (size_t) *rpc : max;
memset (out, *last, count);
@ -307,7 +307,7 @@ UUbhwrite (char *ptr, size_t sel, size_t nel, FILE *file)
while (nel || (rpc != 0 && rpc != -256)) {
count = UUbhdecomp (ptr, tmpstring, &lc, &rpc,
nel, 256, &opc);
nel, 256, &opc);
if (fwrite (tmpstring, 1, opc, file) != opc)
return 0;
if (ferror (file))
@ -337,7 +337,7 @@ UU_smparts_r (uulist *addit, int pass)
continue;
}
if ((iter->begin && addit->begin) || (iter->end && addit->end) ||
(iter->uudet != addit->uudet)) {
(iter->uudet != addit->uudet)) {
iter = iter->NEXT;
continue;
}
@ -355,8 +355,8 @@ UU_smparts_r (uulist *addit, int pass)
while (temp) {
if (!(temp->data->uudet)) {
temp = temp->NEXT;
continue;
temp = temp->NEXT;
continue;
}
while (fiter && fiter->partno < temp->partno) {
@ -368,7 +368,7 @@ UU_smparts_r (uulist *addit, int pass)
break;
}
else {
flag = 1;
flag = 1;
count += ((dest) ? temp->partno - dest->partno - 1 : 0) +
((fiter) ? fiter->partno - temp->partno - 1 : 0);
}
@ -398,33 +398,33 @@ UU_smparts_r (uulist *addit, int pass)
flag = 0;
if (fiter->partno == iter->thisfile->partno ||
(dest->NEXT != NULL && fiter->partno == dest->NEXT->partno)) {
temp = fiter->NEXT;
fiter->NEXT = NULL;
(dest->NEXT != NULL && fiter->partno == dest->NEXT->partno)) {
temp = fiter->NEXT;
fiter->NEXT = NULL;
UUkillfile (fiter);
UUkillfile (fiter);
addit->thisfile= temp;
fiter = temp;
continue;
addit->thisfile= temp;
fiter = temp;
continue;
}
if (fiter->partno < iter->thisfile->partno) {
temp = fiter->NEXT;
fiter->NEXT = iter->thisfile;
iter->thisfile = fiter;
dest = fiter;
addit->thisfile= temp;
fiter = temp;
temp = fiter->NEXT;
fiter->NEXT = iter->thisfile;
iter->thisfile = fiter;
dest = fiter;
addit->thisfile= temp;
fiter = temp;
}
else if (dest->NEXT == NULL || fiter->partno < dest->NEXT->partno) {
temp = fiter->NEXT;
fiter->NEXT = dest->NEXT;
dest->NEXT = fiter;
addit->thisfile= temp;
fiter = temp;
temp = fiter->NEXT;
fiter->NEXT = dest->NEXT;
dest->NEXT = fiter;
addit->thisfile= temp;
fiter = temp;
}
else {
dest = dest->NEXT;
dest = dest->NEXT;
}
}
break;
@ -446,9 +446,9 @@ UUSmerge (int pass)
}
if ((res = UU_smparts_r (iter, pass)) != NULL) {
UUMessage (uuutil_id, __LINE__, UUMSG_MESSAGE,
uustring (S_SMERGE_MERGED),
(iter->subfname) ? iter->subfname : "",
(res->subfname) ? res->subfname : "", pass);
uustring (S_SMERGE_MERGED),
(iter->subfname) ? iter->subfname : "",
(res->subfname) ? res->subfname : "", pass);
temp = iter->NEXT;
iter->NEXT = NULL;
@ -457,12 +457,12 @@ UUSmerge (int pass)
flag++;
if (last == NULL) {
UUGlobalFileList = temp;
iter = temp;
UUGlobalFileList = temp;
iter = temp;
}
else {
last->NEXT = temp;
iter = temp;
last->NEXT = temp;
iter = temp;
}
continue;