Moved ForceProtocol function

This commit is contained in:
Michiel Broek 2004-11-05 21:14:04 +00:00
parent 071bbbf8a8
commit b16389981e
7 changed files with 68 additions and 30 deletions

View File

@ -109,7 +109,7 @@ newuser.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h funcs.h inp
pinfo.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h pinfo.h input.h term.h ttyio.h pinfo.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h pinfo.h input.h term.h ttyio.h
timecheck.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h timecheck.h funcs.h bye.h exitinfo.h language.h input.h term.h ttyio.h timecheck.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h timecheck.h funcs.h bye.h exitinfo.h language.h input.h term.h ttyio.h
change.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h change.h dispfile.h funcs.h input.h language.h misc.h timeout.h exitinfo.h bye.h term.h ttyio.h change.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h change.h dispfile.h funcs.h input.h language.h misc.h timeout.h exitinfo.h bye.h term.h ttyio.h
transfer.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h transfer.h transfer.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h transfer.h change.h
exitinfo.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h funcs.h input.h language.h oneline.h misc.h bye.h timeout.h timecheck.h exitinfo.h exitinfo.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h funcs.h input.h language.h oneline.h misc.h bye.h timeout.h timecheck.h exitinfo.h
mbsebbs.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msg.h mbsebbs.h user.h dispfile.h language.h menu.h misc.h bye.h timeout.h funcs.h term.h ttyio.h openport.h mbsebbs.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msg.h mbsebbs.h user.h dispfile.h language.h menu.h misc.h bye.h timeout.h funcs.h term.h ttyio.h openport.h
menu.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h oneline.h mail.h bbslist.h change.h chat.h file.h funcs.h input.h misc.h timeout.h menu.h page.h pinfo.h bye.h timecheck.h whoson.h language.h offline.h email.h door.h dispfile.h userlist.h timestats.h logentry.h morefile.h lastcallers.h signature.h term.h ttyio.h menu.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h oneline.h mail.h bbslist.h change.h chat.h file.h funcs.h input.h misc.h timeout.h menu.h page.h pinfo.h bye.h timecheck.h whoson.h language.h offline.h email.h door.h dispfile.h userlist.h timestats.h logentry.h morefile.h lastcallers.h signature.h term.h ttyio.h
@ -117,9 +117,9 @@ pop3.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/mbinet.
lastcallers.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h input.h language.h lastcallers.h term.h ttyio.h lastcallers.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h input.h language.h lastcallers.h term.h ttyio.h
timeout.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msg.h timeout.h funcs.h bye.h filesub.h language.h term.h timeout.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msg.h timeout.h funcs.h bye.h filesub.h language.h term.h
chat.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h chat.h funcs.h input.h language.h misc.h whoson.h term.h ttyio.h chat.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h chat.h funcs.h input.h language.h misc.h whoson.h term.h ttyio.h
file.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/mbsedb.h filesub.h file.h funcs.h input.h language.h misc.h timeout.h exitinfo.h whoson.h change.h dispfile.h term.h ttyio.h openport.h file.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/mbsedb.h filesub.h file.h funcs.h input.h language.h misc.h timeout.h exitinfo.h whoson.h change.h dispfile.h term.h ttyio.h openport.h transfer.h
misc.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msg.h funcs.h input.h language.h misc.h timeout.h exitinfo.h ttyio.h term.h misc.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msg.h funcs.h input.h language.h misc.h timeout.h exitinfo.h ttyio.h term.h
offline.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/bluewave.h ../lib/msgtext.h ../lib/msg.h mail.h funcs.h input.h language.h file.h filesub.h exitinfo.h timeout.h msgutil.h pop3.h offline.h whoson.h term.h ttyio.h openport.h offline.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/bluewave.h ../lib/msgtext.h ../lib/msg.h mail.h funcs.h input.h language.h file.h filesub.h exitinfo.h timeout.h msgutil.h pop3.h offline.h whoson.h term.h ttyio.h openport.h transfer.h
user.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h timeout.h user.h dispfile.h funcs.h input.h misc.h bye.h file.h mail.h change.h menu.h exitinfo.h language.h offline.h email.h term.h ttyio.h user.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h timeout.h user.h dispfile.h funcs.h input.h misc.h bye.h file.h mail.h change.h menu.h exitinfo.h language.h offline.h email.h term.h ttyio.h
mbnewusr.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h mbnewusr.h funcs.h input.h language.h misc.h timeout.h newuser.h term.h ttyio.h openport.h mbnewusr.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h mbnewusr.h funcs.h input.h language.h misc.h timeout.h newuser.h term.h ttyio.h openport.h
input.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h input.h timeout.h language.h term.h ttyio.h input.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h input.h timeout.h language.h term.h ttyio.h

View File

@ -47,6 +47,7 @@
#include "term.h" #include "term.h"
#include "ttyio.h" #include "ttyio.h"
#include "openport.h" #include "openport.h"
#include "transfer.h"

View File

@ -89,26 +89,6 @@ void SetTag(_Tag tag)
int ForceProtocol()
{
/*
* If user has no default protocol, make sure he has one.
*/
if (strcmp(sProtName, "") == 0) {
Chg_Protocol();
/*
* If the user didn't pick a protocol, quit.
*/
if (strcmp(sProtName, "") == 0) {
return FALSE;
}
}
return TRUE;
}
/* /*
* Get string, no newline afterwards. * Get string, no newline afterwards.
*/ */

View File

@ -4,7 +4,6 @@
/* $Id$ */ /* $Id$ */
FILE *OpenFareas(int); FILE *OpenFareas(int);
int ForceProtocol(void);
int CheckBytesAvailable(long); int CheckBytesAvailable(long);
int iLC(int); int iLC(int);
void Header(void); void Header(void);

View File

@ -50,6 +50,7 @@
#include "term.h" #include "term.h"
#include "ttyio.h" #include "ttyio.h"
#include "openport.h" #include "openport.h"
#include "transfer.h"

View File

@ -33,7 +33,7 @@
#include "../lib/mbse.h" #include "../lib/mbse.h"
#include "../lib/users.h" #include "../lib/users.h"
#include "transfer.h" #include "transfer.h"
#include "change.h"
/* /*
@ -57,14 +57,69 @@
*/ */
int download(down_list **download_list)
int ForceProtocol()
{ {
return 0; /*
* If user has no default protocol, make sure he has one.
*/
if (strcmp(sProtName, "") == 0) {
Chg_Protocol();
/*
* If the user didn't pick a protocol, quit.
*/
if (strcmp(sProtName, "") == 0) {
return FALSE;
}
}
return TRUE;
} }
int upload(up_list **upload_list)
/*
* Download files to the user.
* Returns:
* 0 - All seems well
* 1 - No tranfer protocol selected
*/
int download(down_list *download_list)
{ {
down_list *tmpf;
int rc, maxrc = 0;
/*
* If user has no default protocol, make sure he has one.
*/
if (!ForceProtocol()) {
return 1;
}
for (tmpf = download_list; tmpf && (maxrc < 2); tmpf = tmpf->next) {
}
return 0;
}
/*
* Upload files from the user.
* Returns:
* 0 - All seems well
* 1 - No transfer protocol selected.
*/
int upload(up_list *upload_list)
{
/*
* If user has no default protocol, make sure he has one.
*/
if (!ForceProtocol()) {
return 1;
}
return 0; return 0;
} }

View File

@ -13,6 +13,7 @@ typedef struct _down_list {
char *local; /* Local filename */ char *local; /* Local filename */
char *remote; /* Remove filename */ char *remote; /* Remove filename */
long cps; /* CPS after sent */ long cps; /* CPS after sent */
unsigned long size; /* File size */
unsigned kfs : 1; /* Kill File Sent */ unsigned kfs : 1; /* Kill File Sent */
unsigned sent : 1; /* File is Sent */ unsigned sent : 1; /* File is Sent */
} down_list; } down_list;
@ -29,9 +30,10 @@ typedef struct _up_list {
unsigned success : 1; /* If received Ok. */ unsigned success : 1; /* If received Ok. */
} up_list; } up_list;
int ForceProtocol(void);
int download(down_list **); int download(down_list *);
int upload(up_list **); int upload(up_list *);
#endif #endif