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; port_id pid = 0;
status_t status = look_for_port(file_handle, false, &pid); status_t status = look_for_port(file_handle, false, &pid);
if(status == B_BUSY) if(status == B_BUSY)
status = delete_port(pid); status = delete_port(pid);
return status; return status;
} }

View File

@ -39,7 +39,7 @@ can be used for any purposes in any form without any warranties.
4) Create such port. 4) Create such port.
pid = create_port(1, name); pid = create_port(1, name);
} }
else 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. =-( * It's also not possible to use setlocale() to change it's behaviour. =-(
*/ */
#undef iscntrl #undef iscntrl
# define iscntrl(c) ((c < 0x7f) ? __isctype((c), _IScntrl) : 0) # define iscntrl(c) ((c < 0x7f) ? __isctype((c), _IScntrl) : 0)
#endif /* __BEOS__ */ #endif /* __BEOS__ */
/* --------------------------------------------------------------- */ /* --------------------------------------------------------------- */

View File

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

View File

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

View File

@ -40,10 +40,10 @@
#undef SH_COMPAT #undef SH_COMPAT
#endif #endif
#elif !defined(SH_DENYNO) #elif !defined(SH_DENYNO)
#define SH_DENYRW 0x10 // Deny read/write #define SH_DENYRW 0x10 // Deny read/write
#define SH_DENYWR 0x20 // Deny write #define SH_DENYWR 0x20 // Deny write
#define SH_DENYRD 0x30 // Deny read #define SH_DENYRD 0x30 // Deny read
#define SH_DENYNO 0x40 // Deny nothing #define SH_DENYNO 0x40 // Deny nothing
#endif #endif
#ifndef SH_COMPAT #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) { inline void tokenize(gstrarray& array, const char* str, const char* delim = NULL) {
if(delim == NULL) if(delim == NULL)
delim = ", \t"; delim = ", \t";
char* tmp = throw_xstrdup(str); char* tmp = throw_xstrdup(str);
char* token = strtok(tmp, delim); char* token = strtok(tmp, delim);
while(token) { while(token) {
array.push_back(token); array.push_back(token);
token = strtok(NULL, delim); token = strtok(NULL, delim);
} }
throw_xfree(tmp); 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. */ /* Step 1. Try to toggle alignment check flag; does not exist on 386. */
"pushfl\n\t" "pushfl\n\t"
"popl %%eax\n\t" "popl %%eax\n\t"
"movl %%eax,%%ecx\n\t" "movl %%eax,%%ecx\n\t"
"orl $0x00040000,%%eax\n\t" /* sets a alignment check flag */ "orl $0x00040000,%%eax\n\t" /* sets a alignment check flag */
"pushl %%eax\n\t" "pushl %%eax\n\t"
"popfl\n\t" "popfl\n\t"
"pushfl\n\t" "pushfl\n\t"
"popl %%eax\n\t" "popl %%eax\n\t"
"xorl %%ecx,%%eax\n\t" "xorl %%ecx,%%eax\n\t"
"andl $0x00040000,%%eax\n\t" /* test alignment check flag */ "andl $0x00040000,%%eax\n\t" /* test alignment check flag */
"pushl %%ecx\n\t" "pushl %%ecx\n\t"
"popfl\n\t" "popfl\n\t"
"testl %%eax,%%eax\n\t" /* alignment check flag is set? */ "testl %%eax,%%eax\n\t" /* alignment check flag is set? */
"jnz try486\n\t" "jnz try486\n\t"
/* NexGen CPU does not have aligment check flag. */ /* NexGen CPU does not have aligment check flag. */
"pushfl\n\t" "pushfl\n\t"
"movl $0x5555, %%eax\n\t" "movl $0x5555, %%eax\n\t"
"xorl %%edx, %%edx\n\t" "xorl %%edx, %%edx\n\t"
"movl $2, %%ecx\n\t" "movl $2, %%ecx\n\t"
"clc\n\t" "clc\n\t"
"divl %%ecx\n\t" "divl %%ecx\n\t"
"jz nexgen\n\t" "jz nexgen\n\t"
"popfl\n\t" "popfl\n\t"
"movl $3,%0\n\t" /* CPU 386 */ "movl $3,%0\n\t" /* CPU 386 */
"jmp end\n" "jmp end\n"
"nexgen:" "nexgen:"
"popfl\n\t" "popfl\n\t"
"movl $5,%0\n\t" /* CPU NX586 */ "movl $5,%0\n\t" /* CPU NX586 */
"movl $0x4778654e,%1\n\t" /* store vendor string */ "movl $0x4778654e,%1\n\t" /* store vendor string */
"movl $0x72446e65,%1+4\n\t" /* "NexGenDriven" */ "movl $0x72446e65,%1+4\n\t" /* "NexGenDriven" */
"movl $0x6e657669,%1+8\n\t" "movl $0x6e657669,%1+8\n\t"
// "movl $0,%1+12\n\t" // vendor is zero-filled already // "movl $0,%1+12\n\t" // vendor is zero-filled already
"jmp end\n" "jmp end\n"
/* Step2. Try to toggle identification flag; does not exist on early 486s.*/ /* Step2. Try to toggle identification flag; does not exist on early 486s.*/
"try486:" "try486:"
"pushfl\n\t" "pushfl\n\t"
"popl %%eax\n\t" "popl %%eax\n\t"
"movl %%eax,%%ecx\n\t" "movl %%eax,%%ecx\n\t"
"xorl $0x00200000,%%eax\n\t" /* sets a identification bit */ "xorl $0x00200000,%%eax\n\t" /* sets a identification bit */
"pushl %%eax\n\t" "pushl %%eax\n\t"
"popfl\n\t" "popfl\n\t"
"pushfl\n\t" "pushfl\n\t"
"popl %%eax\n\t" "popl %%eax\n\t"
"xorl %%ecx,%%eax\n\t" "xorl %%ecx,%%eax\n\t"
"andl $0x00200000,%%eax\n\t" /* test identification bit */ "andl $0x00200000,%%eax\n\t" /* test identification bit */
"pushl %%ecx\n\t" "pushl %%ecx\n\t"
"popfl\n\t" "popfl\n\t"
"testl %%eax,%%eax\n\t" /* if identification flag is set then cpuid CPU's command may be used */ "testl %%eax,%%eax\n\t" /* if identification flag is set then cpuid CPU's command may be used */
"jnz trycpuid\n\t" "jnz trycpuid\n\t"
"movl $4,%0\n\t" /* CPU 486 */ "movl $4,%0\n\t" /* CPU 486 */
/* /*
* Check Cyrix CPU * Check Cyrix CPU
@ -362,14 +362,14 @@ char *gcpuid(char *_cpuname)
* Note: CPUID is enabled on M2, so it passes another way. * Note: CPUID is enabled on M2, so it passes another way.
*/ */
"pushfl\n\t" "pushfl\n\t"
"movl $0x5555, %%eax\n\t" "movl $0x5555, %%eax\n\t"
"xorl %%edx, %%edx\n\t" "xorl %%edx, %%edx\n\t"
"movl $2, %%ecx\n\t" "movl $2, %%ecx\n\t"
"clc\n\t" "clc\n\t"
"divl %%ecx\n\t" "divl %%ecx\n\t"
"jnc trycyrix\n\t" "jnc trycyrix\n\t"
"popfl\n\t" "popfl\n\t"
"jmp end\n" /* You may use Intel CPU */ "jmp end\n" /* You may use Intel CPU */
"trycyrix:" "trycyrix:"
"popfl\n\t" "popfl\n\t"
@ -379,44 +379,44 @@ char *gcpuid(char *_cpuname)
* CPU, we couldn't distinguish it from Cyrix's (including IBM * CPU, we couldn't distinguish it from Cyrix's (including IBM
* brand of Cyrix CPUs). * brand of Cyrix CPUs).
*/ */
"movl $0x69727943,%1\n\t" /* store vendor string */ "movl $0x69727943,%1\n\t" /* store vendor string */
"movl $0x736e4978,%1+4\n\t" /* "CyrixInstead" */ "movl $0x736e4978,%1+4\n\t" /* "CyrixInstead" */
"movl $0x64616574,%1+8\n\t" "movl $0x64616574,%1+8\n\t"
"jmp end\n" "jmp end\n"
/* Step 3. Use the `cpuid' instruction. */ /* Step 3. Use the `cpuid' instruction. */
"trycpuid:" "trycpuid:"
"xorl %%eax,%%eax\n\t" "xorl %%eax,%%eax\n\t"
".byte 0x0f,0xa2\n\t" /* cpuid 0 */ ".byte 0x0f,0xa2\n\t" /* cpuid 0 */
"movl %%eax,%2\n\t" /* "cpuid 1" capability */ "movl %%eax,%2\n\t" /* "cpuid 1" capability */
"movl %%ebx,%1\n\t" /* store vendor string */ "movl %%ebx,%1\n\t" /* store vendor string */
"movl %%edx,%1+4\n\t" "movl %%edx,%1+4\n\t"
"movl %%ecx,%1+8\n\t" "movl %%ecx,%1+8\n\t"
// "movb $0,%1+12\n\t" // vendor is zero-filled already // "movb $0,%1+12\n\t" // vendor is zero-filled already
"andl %%eax,%%eax\n\t" /* "cpuid 1" is allowed? (eax==1?) */ "andl %%eax,%%eax\n\t" /* "cpuid 1" is allowed? (eax==1?) */
"jz i586\n\t" /* no, skip "cpuid 1" */ "jz i586\n\t" /* no, skip "cpuid 1" */
"movl $1,%%eax\n\t" "movl $1,%%eax\n\t"
".byte 0x0f,0xa2\n\t" // cpuid 1 ".byte 0x0f,0xa2\n\t" // cpuid 1
// "movl %%eax,%6\n\t" // store cpu_id // "movl %%eax,%6\n\t" // store cpu_id
// "movl %%edx,%7\n\t" // store cpu_feature // "movl %%edx,%7\n\t" // store cpu_feature
"movb %%al,%%bl\n\t" "movb %%al,%%bl\n\t"
"shrb $4,%%bl\n\t" // extract CPU model "shrb $4,%%bl\n\t" // extract CPU model
"movb %%bl,%4\n\t" // store model "movb %%bl,%4\n\t" // store model
"andl $0x0F0F,%%eax\n\t" // extract CPU family type and stepping "andl $0x0F0F,%%eax\n\t" // extract CPU family type and stepping
"movb %%al,%5\n\t" // store stepping "movb %%al,%5\n\t" // store stepping
"movb %%ah,%3\n\t" // store family "movb %%ah,%3\n\t" // store family
"cmpb $5,%%ah\n\t" "cmpb $5,%%ah\n\t"
"jae i586\n\t" "jae i586\n\t"
/* less than Pentium; must be 486 */ /* less than Pentium; must be 486 */
"movl $4,%0\n\t" /* CPU 486 */ "movl $4,%0\n\t" /* CPU 486 */
"jmp end\n" "jmp end\n"
"i586:\n\t" /* Pentium and greater. Store family type into CPU type var */ "i586:\n\t" /* Pentium and greater. Store family type into CPU type var */
"movb %%ah,%0\n" "movb %%ah,%0\n"
"end:\n\t" "end:\n\t"
"nop\n\t" "nop\n\t"

View File

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

View File

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

View File

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

View File

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

View File

@ -22,7 +22,7 @@
/* Enable GNU extensions in fnmatch.h. */ /* Enable GNU extensions in fnmatch.h. */
#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
# define _GNU_SOURCE 1 # define _GNU_SOURCE 1
#endif #endif
#include <errno.h> #include <errno.h>
@ -107,12 +107,12 @@
# else # else
# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */ # define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
# define IS_CHAR_CLASS(string) \ # define IS_CHAR_CLASS(string) \
(STREQ (string, "alpha") || STREQ (string, "upper") \ (STREQ (string, "alpha") || STREQ (string, "upper") \
|| STREQ (string, "lower") || STREQ (string, "digit") \ || STREQ (string, "lower") || STREQ (string, "digit") \
|| STREQ (string, "alnum") || STREQ (string, "xdigit") \ || STREQ (string, "alnum") || STREQ (string, "xdigit") \
|| STREQ (string, "space") || STREQ (string, "print") \ || STREQ (string, "space") || STREQ (string, "print") \
|| STREQ (string, "punct") || STREQ (string, "graph") \ || STREQ (string, "punct") || STREQ (string, "graph") \
|| STREQ (string, "cntrl") || STREQ (string, "blank")) || STREQ (string, "cntrl") || STREQ (string, "blank"))
# endif # endif
@ -150,222 +150,222 @@ fnmatch (pattern, string, flags)
c = FOLD (c); c = FOLD (c);
switch (c) switch (c)
{ {
case '?': case '?':
if (*n == '\0') if (*n == '\0')
return FNM_NOMATCH; return FNM_NOMATCH;
else if ((flags & FNM_FILE_NAME) && *n == '/') else if ((flags & FNM_FILE_NAME) && *n == '/')
return FNM_NOMATCH; return FNM_NOMATCH;
else if ((flags & FNM_PERIOD) && *n == '.' && else if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH; return FNM_NOMATCH;
break; break;
case '\\': case '\\':
if (!(flags & FNM_NOESCAPE)) if (!(flags & FNM_NOESCAPE))
{ {
c = *p++; c = *p++;
if (c == '\0') if (c == '\0')
/* Trailing \ loses. */ /* Trailing \ loses. */
return FNM_NOMATCH; return FNM_NOMATCH;
c = FOLD (c); c = FOLD (c);
} }
if (FOLD (*n) != c) if (FOLD (*n) != c)
return FNM_NOMATCH; return FNM_NOMATCH;
break; break;
case '*': case '*':
if ((flags & FNM_PERIOD) && *n == '.' && if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH; return FNM_NOMATCH;
for (c = *p++; c == '?' || c == '*'; c = *p++) for (c = *p++; c == '?' || c == '*'; c = *p++)
{ {
if ((flags & FNM_FILE_NAME) && *n == '/') if ((flags & FNM_FILE_NAME) && *n == '/')
/* A slash does not match a wildcard under FNM_FILE_NAME. */ /* A slash does not match a wildcard under FNM_FILE_NAME. */
return FNM_NOMATCH; return FNM_NOMATCH;
else if (c == '?') else if (c == '?')
{ {
/* A ? needs to match one character. */ /* A ? needs to match one character. */
if (*n == '\0') if (*n == '\0')
/* There isn't another character; no match. */ /* There isn't another character; no match. */
return FNM_NOMATCH; return FNM_NOMATCH;
else else
/* One character of the string is consumed in matching /* One character of the string is consumed in matching
this ? wildcard, so *??? won't match if there are this ? wildcard, so *??? won't match if there are
less than three characters. */ less than three characters. */
++n; ++n;
} }
} }
if (c == '\0') if (c == '\0')
return 0; return 0;
{ {
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
c1 = FOLD (c1); c1 = FOLD (c1);
for (--p; *n != '\0'; ++n) for (--p; *n != '\0'; ++n)
if ((c == '[' || FOLD (*n) == c1) && if ((c == '[' || FOLD (*n) == c1) &&
fnmatch (p, n, flags & ~FNM_PERIOD) == 0) fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
return 0; return 0;
return FNM_NOMATCH; return FNM_NOMATCH;
} }
case '[': case '[':
{ {
/* Nonzero if the sense of the character class is inverted. */ /* Nonzero if the sense of the character class is inverted. */
static int posixly_correct; static int posixly_correct;
register int not; register int not;
char cold; char cold;
if (posixly_correct == 0) if (posixly_correct == 0)
posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
if (*n == '\0') if (*n == '\0')
return FNM_NOMATCH; return FNM_NOMATCH;
if (*n == '.' && (flags & FNM_PERIOD) && if (*n == '.' && (flags & FNM_PERIOD) &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH; return FNM_NOMATCH;
if (*n == '/' && (flags & FNM_FILE_NAME)) if (*n == '/' && (flags & FNM_FILE_NAME))
/* `/' cannot be matched. */ /* `/' cannot be matched. */
return FNM_NOMATCH; return FNM_NOMATCH;
not = (*p == '!' || (posixly_correct < 0 && *p == '^')); not = (*p == '!' || (posixly_correct < 0 && *p == '^'));
if (not) if (not)
++p; ++p;
c = *p++; c = *p++;
for (;;) for (;;)
{ {
int fn = FOLD (*n); int fn = FOLD (*n);
if (!(flags & FNM_NOESCAPE) && c == '\\') if (!(flags & FNM_NOESCAPE) && c == '\\')
{ {
if (*p == '\0') if (*p == '\0')
return FNM_NOMATCH; return FNM_NOMATCH;
c = FOLD (*p++); c = FOLD (*p++);
if (c == fn) if (c == fn)
goto matched; goto matched;
} }
else if (c == '[' && *p == ':') else if (c == '[' && *p == ':')
{ {
/* Leave room for the null. */ /* Leave room for the null. */
char str[CHAR_CLASS_MAX_LENGTH + 1]; char str[CHAR_CLASS_MAX_LENGTH + 1];
size_t c1 = 0; size_t c1 = 0;
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) # if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
wctype_t wt; wctype_t wt;
# endif # endif
for (;;) for (;;)
{ {
if (c1 == CHAR_CLASS_MAX_LENGTH) if (c1 == CHAR_CLASS_MAX_LENGTH)
/* The name is too long and therefore the pattern /* The name is too long and therefore the pattern
is ill-formed. */ is ill-formed. */
return FNM_NOMATCH; return FNM_NOMATCH;
c = *++p; c = *++p;
if (c == ':' && p[1] == ']') if (c == ':' && p[1] == ']')
{ {
p += 2; p += 2;
break; break;
} }
str[c1++] = 'c'; str[c1++] = 'c';
} }
str[c1] = '\0'; str[c1] = '\0';
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) # if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
wt = IS_CHAR_CLASS (str); wt = IS_CHAR_CLASS (str);
if (wt == 0) if (wt == 0)
/* Invalid character class name. */ /* Invalid character class name. */
return FNM_NOMATCH; return FNM_NOMATCH;
if (__iswctype (__btowc (*n), wt)) if (__iswctype (__btowc (*n), wt))
goto matched; goto matched;
# else # else
if ((STREQ (str, "alnum") && ISALNUM (*n)) if ((STREQ (str, "alnum") && ISALNUM (*n))
|| (STREQ (str, "alpha") && ISALPHA (*n)) || (STREQ (str, "alpha") && ISALPHA (*n))
|| (STREQ (str, "blank") && ISBLANK (*n)) || (STREQ (str, "blank") && ISBLANK (*n))
|| (STREQ (str, "cntrl") && ISCNTRL (*n)) || (STREQ (str, "cntrl") && ISCNTRL (*n))
|| (STREQ (str, "digit") && ISDIGIT (*n)) || (STREQ (str, "digit") && ISDIGIT (*n))
|| (STREQ (str, "graph") && ISGRAPH (*n)) || (STREQ (str, "graph") && ISGRAPH (*n))
|| (STREQ (str, "lower") && ISLOWER (*n)) || (STREQ (str, "lower") && ISLOWER (*n))
|| (STREQ (str, "print") && ISPRINT (*n)) || (STREQ (str, "print") && ISPRINT (*n))
|| (STREQ (str, "punct") && ISPUNCT (*n)) || (STREQ (str, "punct") && ISPUNCT (*n))
|| (STREQ (str, "space") && ISSPACE (*n)) || (STREQ (str, "space") && ISSPACE (*n))
|| (STREQ (str, "upper") && ISUPPER (*n)) || (STREQ (str, "upper") && ISUPPER (*n))
|| (STREQ (str, "xdigit") && ISXDIGIT (*n))) || (STREQ (str, "xdigit") && ISXDIGIT (*n)))
goto matched; goto matched;
# endif # endif
} }
else if (c == '\0') else if (c == '\0')
/* [ (unterminated) loses. */ /* [ (unterminated) loses. */
return FNM_NOMATCH; return FNM_NOMATCH;
else if (FOLD (c) == fn) else if (FOLD (c) == fn)
goto matched; goto matched;
cold = c; cold = c;
c = *p++; c = *p++;
if (c == '-' && *p != ']') if (c == '-' && *p != ']')
{ {
/* It is a range. */ /* It is a range. */
char cend = *p++; char cend = *p++;
if (!(flags & FNM_NOESCAPE) && cend == '\\') if (!(flags & FNM_NOESCAPE) && cend == '\\')
cend = *p++; cend = *p++;
if (cend == '\0') if (cend == '\0')
return FNM_NOMATCH; return FNM_NOMATCH;
if (cold <= fn && fn <= FOLD (cend)) if (cold <= fn && fn <= FOLD (cend))
goto matched; goto matched;
c = *p++; c = *p++;
} }
if (c == ']') if (c == ']')
break; break;
} }
if (!not) if (!not)
return FNM_NOMATCH; return FNM_NOMATCH;
break; break;
matched: matched:
/* Skip the rest of the [...] that already matched. */ /* Skip the rest of the [...] that already matched. */
while (c != ']') while (c != ']')
{ {
if (c == '\0') if (c == '\0')
/* [... (unterminated) loses. */ /* [... (unterminated) loses. */
return FNM_NOMATCH; return FNM_NOMATCH;
c = *p++; c = *p++;
if (!(flags & FNM_NOESCAPE) && c == '\\') if (!(flags & FNM_NOESCAPE) && c == '\\')
{ {
if (*p == '\0') if (*p == '\0')
return FNM_NOMATCH; return FNM_NOMATCH;
/* XXX 1003.2d11 is unclear if this is right. */ /* XXX 1003.2d11 is unclear if this is right. */
++p; ++p;
} }
else if (c == '[' && *p == ':') else if (c == '[' && *p == ':')
{ {
do do
if (*++p == '\0') if (*++p == '\0')
return FNM_NOMATCH; return FNM_NOMATCH;
while (*p != ':' || p[1] == ']'); while (*p != ':' || p[1] == ']');
p += 2; p += 2;
c = *p; c = *p;
} }
} }
if (not) if (not)
return FNM_NOMATCH; return FNM_NOMATCH;
} }
break; break;
default: default:
if (c != FOLD (*n)) if (c != FOLD (*n))
return FNM_NOMATCH; return FNM_NOMATCH;
} }
++n; ++n;
} }
@ -382,4 +382,4 @@ fnmatch (pattern, string, flags)
# undef FOLD # 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, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#ifndef _FNMATCH_H #ifndef _FNMATCH_H
#define _FNMATCH_H 1 #define _FNMATCH_H 1
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32 || defined _WIN32 #if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32 || defined _WIN32
# if !defined __GLIBC__ || !defined __P # if !defined __GLIBC__ || !defined __P
# undef __P # undef __P
# define __P(protos) protos # define __P(protos) protos
# endif # endif
#else /* Not C++ or ANSI C. */ #else /* Not C++ or ANSI C. */
# undef __P # undef __P
# define __P(protos) () # define __P(protos) ()
/* We can get away without defining `const' here only because in this file /* 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 it is used only inside the prototype for `fnmatch', which is elided in
non-ANSI C where `const' is problematical. */ non-ANSI C where `const' is problematical. */
@ -38,7 +38,7 @@ extern "C" {
#ifndef const #ifndef const
# if (defined __STDC__ && __STDC__) || defined __cplusplus # if (defined __STDC__ && __STDC__) || defined __cplusplus
# define __const const # define __const const
# else # else
# define __const # define __const
# endif # endif
@ -46,38 +46,38 @@ extern "C" {
/* We #undef these before defining them because some losing systems /* We #undef these before defining them because some losing systems
(HP-UX A.08.07 for example) define these in <unistd.h>. */ (HP-UX A.08.07 for example) define these in <unistd.h>. */
#undef FNM_PATHNAME #undef FNM_PATHNAME
#undef FNM_NOESCAPE #undef FNM_NOESCAPE
#undef FNM_PERIOD #undef FNM_PERIOD
/* Bits set in the FLAGS argument to `fnmatch'. */ /* Bits set in the FLAGS argument to `fnmatch'. */
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE #if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ # define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ # define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ # define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif #endif
/* Value returned by `fnmatch' if STRING does not match PATTERN. */ /* 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 /* This value is returned if the implementation does not support
`fnmatch'. Since this is not the case here it will never be `fnmatch'. Since this is not the case here it will never be
returned but the conformance test suites still require the symbol returned but the conformance test suites still require the symbol
to be defined. */ to be defined. */
#ifdef _XOPEN_SOURCE #ifdef _XOPEN_SOURCE
# define FNM_NOSYS (-1) # define FNM_NOSYS (-1)
#endif #endif
/* Match STRING against the filename pattern PATTERN, /* Match STRING against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */ returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch __P ((__const char *__pattern, __const char *__string, extern int fnmatch __P ((__const char *__pattern, __const char *__string,
int __flags)); int __flags));
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #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, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#ifndef _GLOB_H #ifndef _GLOB_H
#define _GLOB_H 1 #define _GLOB_H 1
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#undef __ptr_t #undef __ptr_t
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32 || defined _WIN32 #if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32 || defined _WIN32
# if !defined __GLIBC__ || !defined __P # if !defined __GLIBC__ || !defined __P
# undef __P # undef __P
# undef __PMT # undef __PMT
# define __P(protos) protos # define __P(protos) protos
# define __PMT(protos) protos # define __PMT(protos) protos
# if !defined __GNUC__ || __GNUC__ < 2 # if !defined __GNUC__ || __GNUC__ < 2
# undef __const # undef __const
# define __const const # define __const const
# endif # endif
# endif # endif
# define __ptr_t void * # define __ptr_t void *
#else /* Not C++ or ANSI C. */ #else /* Not C++ or ANSI C. */
# undef __P # undef __P
# undef __PMT # undef __PMT
# define __P(protos) () # define __P(protos) ()
# define __PMT(protos) () # define __PMT(protos) ()
# undef __const # undef __const
# define __const # define __const
# define __ptr_t char * # define __ptr_t char *
#endif /* C++ or ANSI C. */ #endif /* C++ or ANSI C. */
/* We need `size_t' for the following definitions. */ /* We need `size_t' for the following definitions. */
@ -61,40 +61,40 @@ typedef unsigned long int __size_t;
#endif #endif
/* Bits set in the FLAGS argument to `glob'. */ /* Bits set in the FLAGS argument to `glob'. */
#define GLOB_ERR (1 << 0)/* Return on read errors. */ #define GLOB_ERR (1 << 0)/* Return on read errors. */
#define GLOB_MARK (1 << 1)/* Append a slash to each name. */ #define GLOB_MARK (1 << 1)/* Append a slash to each name. */
#define GLOB_NOSORT (1 << 2)/* Don't sort the names. */ #define GLOB_NOSORT (1 << 2)/* Don't sort the names. */
#define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */ #define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
#define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */ #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_APPEND (1 << 5)/* Append to results of a previous call. */
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */ #define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */ #define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
#if (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \ #if (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \
|| defined _GNU_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_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
# define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */ # 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_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
# define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */ # define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */ # define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error # define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
if the user name is not available. */ if the user name is not available. */
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \ # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \ GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK) GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
#else #else
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \ # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
GLOB_PERIOD) GLOB_PERIOD)
#endif #endif
/* Error returns from `glob'. */ /* Error returns from `glob'. */
#define GLOB_NOSPACE 1 /* Ran out of memory. */ #define GLOB_NOSPACE 1 /* Ran out of memory. */
#define GLOB_ABORTED 2 /* Read error. */ #define GLOB_ABORTED 2 /* Read error. */
#define GLOB_NOMATCH 3 /* No matches found. */ #define GLOB_NOMATCH 3 /* No matches found. */
#define GLOB_NOSYS 4 /* Not implemented. */ #define GLOB_NOSYS 4 /* Not implemented. */
#ifdef _GNU_SOURCE #ifdef _GNU_SOURCE
/* Previous versions of this file defined GLOB_ABEND instead of /* Previous versions of this file defined GLOB_ABEND instead of
GLOB_ABORTED. Provide a compatibility definition here. */ GLOB_ABORTED. Provide a compatibility definition here. */
@ -107,10 +107,10 @@ struct stat;
#endif #endif
typedef struct typedef struct
{ {
__size_t gl_pathc; /* Count of paths matched by the pattern. */ __size_t gl_pathc; /* Count of paths matched by the pattern. */
char **gl_pathv; /* List of matched pathnames. */ char **gl_pathv; /* List of matched pathnames. */
__size_t gl_offs; /* Slots to reserve in `gl_pathv'. */ __size_t gl_offs; /* Slots to reserve in `gl_pathv'. */
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */ int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
/* If the GLOB_ALTDIRFUNC flag is set, the following functions /* If the GLOB_ALTDIRFUNC flag is set, the following functions
are used instead of the normal file access functions. */ are used instead of the normal file access functions. */
@ -150,16 +150,16 @@ typedef struct
Otherwise, `glob' returns zero. */ Otherwise, `glob' returns zero. */
#if _FILE_OFFSET_BITS != 64 #if _FILE_OFFSET_BITS != 64
extern int glob __P ((__const char *__pattern, int __flags, extern int glob __P ((__const char *__pattern, int __flags,
int (*__errfunc) (__const char *, int), int (*__errfunc) (__const char *, int),
glob_t *__pglob)); glob_t *__pglob));
/* Free storage allocated in PGLOB by a previous `glob' call. */ /* Free storage allocated in PGLOB by a previous `glob' call. */
extern void globfree __P ((glob_t *__pglob)); extern void globfree __P ((glob_t *__pglob));
#else #else
# if __GNUC__ >= 2 # if __GNUC__ >= 2
extern int glob __P ((__const char *__pattern, int __flags, extern int glob __P ((__const char *__pattern, int __flags,
int (*__errfunc) (__const char *, int), int (*__errfunc) (__const char *, int),
glob_t *__pglob)) __asm__ ("glob64"); glob_t *__pglob)) __asm__ ("glob64");
extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64"); extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64");
# else # else
@ -170,8 +170,8 @@ extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64");
#ifdef _LARGEFILE64_SOURCE #ifdef _LARGEFILE64_SOURCE
extern int glob64 __P ((__const char *__pattern, int __flags, extern int glob64 __P ((__const char *__pattern, int __flags,
int (*__errfunc) (__const char *, int), int (*__errfunc) (__const char *, int),
glob64_t *__pglob)); glob64_t *__pglob));
extern void globfree64 __P ((glob64_t *__pglob)); extern void globfree64 __P ((glob64_t *__pglob));
#endif #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)); extern int glob_pattern_p __P ((__const char *__pattern, int __quote));
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #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]]] */ /* [[[begin syntaxes]]] */
#define RE_SYNTAX_EMACS 0 #define RE_SYNTAX_EMACS 0
#define RE_SYNTAX_AWK \ #define RE_SYNTAX_AWK \
(RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
| RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \ | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
| RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS) | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
#define RE_SYNTAX_GNU_AWK \ #define RE_SYNTAX_GNU_AWK \
((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \ ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
& ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS)) & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS))
#define RE_SYNTAX_POSIX_AWK \ #define RE_SYNTAX_POSIX_AWK \
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
| RE_INTERVALS | RE_NO_GNU_OPS) | RE_INTERVALS | RE_NO_GNU_OPS)
#define RE_SYNTAX_GREP \ #define RE_SYNTAX_GREP \
(RE_BK_PLUS_QM | RE_CHAR_CLASSES \ (RE_BK_PLUS_QM | RE_CHAR_CLASSES \
| RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \ | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
| RE_NEWLINE_ALT) | RE_NEWLINE_ALT)
#define RE_SYNTAX_EGREP \ #define RE_SYNTAX_EGREP \
(RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \ (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \ | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
| RE_NEWLINE_ALT | RE_NO_BK_PARENS \ | RE_NEWLINE_ALT | RE_NO_BK_PARENS \
| RE_NO_BK_VBAR) | RE_NO_BK_VBAR)
#define RE_SYNTAX_POSIX_EGREP \ #define RE_SYNTAX_POSIX_EGREP \
(RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES) (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */ /* 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 #define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
/* Syntax bits common to both basic and extended POSIX regex syntax. */ /* Syntax bits common to both basic and extended POSIX regex syntax. */
#define _RE_SYNTAX_POSIX_COMMON \ #define _RE_SYNTAX_POSIX_COMMON \
(RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
| RE_INTERVALS | RE_NO_EMPTY_RANGES) | RE_INTERVALS | RE_NO_EMPTY_RANGES)
#define RE_SYNTAX_POSIX_BASIC \ #define RE_SYNTAX_POSIX_BASIC \
(_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM) (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes /* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
isn't minimal, since other operators, such as \`, aren't disabled. */ 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) (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
#define RE_SYNTAX_POSIX_EXTENDED \ #define RE_SYNTAX_POSIX_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
| RE_NO_BK_PARENS | RE_NO_BK_VBAR \ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
| RE_UNMATCHED_RIGHT_PAREN_ORD) | RE_UNMATCHED_RIGHT_PAREN_ORD)
/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS /* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */ replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \ #define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \ | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD) | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
/* [[[end syntaxes]]] */ /* [[[end syntaxes]]] */
/* Maximum number of duplicates an interval can allow. Some systems /* Maximum number of duplicates an interval can allow. Some systems
@ -285,31 +285,31 @@ extern reg_syntax_t re_syntax_options;
typedef enum typedef enum
{ {
#ifdef _XOPEN_SOURCE #ifdef _XOPEN_SOURCE
REG_ENOSYS = -1, /* This will never happen for this implementation. */ REG_ENOSYS = -1, /* This will never happen for this implementation. */
#endif #endif
REG_NOERROR = 0, /* Success. */ REG_NOERROR = 0, /* Success. */
REG_NOMATCH, /* Didn't find a match (for regexec). */ REG_NOMATCH, /* Didn't find a match (for regexec). */
/* POSIX regcomp return error codes. (In the order listed in the /* POSIX regcomp return error codes. (In the order listed in the
standard.) */ standard.) */
REG_BADPAT, /* Invalid pattern. */ REG_BADPAT, /* Invalid pattern. */
REG_ECOLLATE, /* Not implemented. */ REG_ECOLLATE, /* Not implemented. */
REG_ECTYPE, /* Invalid character class name. */ REG_ECTYPE, /* Invalid character class name. */
REG_EESCAPE, /* Trailing backslash. */ REG_EESCAPE, /* Trailing backslash. */
REG_ESUBREG, /* Invalid back reference. */ REG_ESUBREG, /* Invalid back reference. */
REG_EBRACK, /* Unmatched left bracket. */ REG_EBRACK, /* Unmatched left bracket. */
REG_EPAREN, /* Parenthesis imbalance. */ REG_EPAREN, /* Parenthesis imbalance. */
REG_EBRACE, /* Unmatched \{. */ REG_EBRACE, /* Unmatched \{. */
REG_BADBR, /* Invalid contents of \{\}. */ REG_BADBR, /* Invalid contents of \{\}. */
REG_ERANGE, /* Invalid range end. */ REG_ERANGE, /* Invalid range end. */
REG_ESPACE, /* Ran out of memory. */ REG_ESPACE, /* Ran out of memory. */
REG_BADRPT, /* No preceding re for repetition op. */ REG_BADRPT, /* No preceding re for repetition op. */
/* Error codes we've added. */ /* Error codes we've added. */
REG_EEND, /* Premature end. */ REG_EEND, /* Premature end. */
REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */ REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
} reg_errcode_t; } reg_errcode_t;
/* This data structure represents a compiled pattern. Before calling /* This data structure represents a compiled pattern. Before calling
@ -325,15 +325,15 @@ typedef enum
struct re_pattern_buffer struct re_pattern_buffer
{ {
/* [[[begin 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 `unsigned char *' because its elements are
sometimes used as array indexes. */ sometimes used as array indexes. */
unsigned char *buffer; unsigned char *buffer;
/* Number of bytes to which `buffer' points. */ /* Number of bytes to which `buffer' points. */
unsigned long int allocated; unsigned long int allocated;
/* Number of bytes actually used in `buffer'. */ /* Number of bytes actually used in `buffer'. */
unsigned long int used; unsigned long int used;
/* Syntax setting with which the pattern was compiled. */ /* Syntax setting with which the pattern was compiled. */
@ -350,7 +350,7 @@ struct re_pattern_buffer
when it is matched. */ when it is matched. */
RE_TRANSLATE_TYPE translate; RE_TRANSLATE_TYPE translate;
/* Number of subexpressions found by the compiler. */ /* Number of subexpressions found by the compiler. */
size_t re_nsub; size_t re_nsub;
/* Zero if this pattern cannot match the empty string, one else. /* 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. */ /* POSIX compatibility. */
extern int __regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern, 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, extern int regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern,
int __cflags)); int __cflags));
extern int __regexec _RE_ARGS ((const regex_t *__preg, extern int __regexec _RE_ARGS ((const regex_t *__preg,
const char *__string, size_t __nmatch, const char *__string, size_t __nmatch,
regmatch_t __pmatch[], int __eflags)); regmatch_t __pmatch[], int __eflags));
extern int regexec _RE_ARGS ((const regex_t *__preg, extern int regexec _RE_ARGS ((const regex_t *__preg,
const char *__string, size_t __nmatch, const char *__string, size_t __nmatch,
regmatch_t __pmatch[], int __eflags)); regmatch_t __pmatch[], int __eflags));
extern size_t __regerror _RE_ARGS ((int __errcode, const regex_t *__preg, 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, 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));
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 #ifdef __cplusplus
} }
#endif /* C++ */ #endif /* C++ */
#endif /* regex.h */ #endif /* regex.h */

View File

@ -81,7 +81,7 @@ const uint GLINE_POSI = 0x0100;
const uint GLINE_HIGH = 0x0200; const uint GLINE_HIGH = 0x0200;
const uint GLINE_TAGL = 0x0400; const uint GLINE_TAGL = 0x0400;
const uint GLINE_SIGN = 0x0800; 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_KLUDGE = GLINE_HIDD | GLINE_KLUD;
const uint GLINE_ALL = GLINE_HIDD | GLINE_KLUD | GLINE_QUOT; const uint GLINE_ALL = GLINE_HIDD | GLINE_KLUD | GLINE_QUOT;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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