home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
BTMTSRC3.ZIP
/
B_WHACK.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-08-15
|
6KB
|
134 lines
/*--------------------------------------------------------------------------*/
/* */
/* */
/* ------------ Bit-Bucket Software, Co. */
/* \ 10001101 / Writers and Distributors of */
/* \ 011110 / Freely Available<tm> Software. */
/* \ 1011 / */
/* ------ */
/* */
/* (C) Copyright 1987-90, Bit Bucket Software Co., a Delaware Corporation. */
/* */
/* */
/* This module was written by Bob Hartman */
/* */
/* */
/* BinkleyTerm FTSC Mail Session Routines */
/* */
/* */
/* For complete details of the licensing restrictions, please refer */
/* to the License agreement, which is published in its entirety in */
/* the MAKEFILE and BT.C, and also contained in the file LICENSE.240. */
/* */
/* USE OF THIS FILE IS SUBJECT TO THE RESTRICTIONS CONTAINED IN THE */
/* BINKLEYTERM LICENSING AGREEMENT. IF YOU DO NOT FIND THE TEXT OF */
/* THIS AGREEMENT IN ANY OF THE AFOREMENTIONED FILES, OR IF YOU DO */
/* NOT HAVE THESE FILES, YOU SHOULD IMMEDIATELY CONTACT BIT BUCKET */
/* SOFTWARE CO. AT ONE OF THE ADDRESSES LISTED BELOW. IN NO EVENT */
/* SHOULD YOU PROCEED TO USE THIS FILE WITHOUT HAVING ACCEPTED THE */
/* TERMS OF THE BINKLEYTERM LICENSING AGREEMENT, OR SUCH OTHER */
/* AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO. */
/* */
/* */
/* You can contact Bit Bucket Software Co. at any one of the following */
/* addresses: */
/* */
/* Bit Bucket Software Co. FidoNet 1:104/501, 1:132/491, 1:141/491 */
/* P.O. Box 460398 AlterNet 7:491/0 */
/* Aurora, CO 80046 BBS-Net 86:2030/1 */
/* Internet f491.n132.z1.fidonet.org */
/* */
/* Please feel free to contact us at any time to share your comments about */
/* our software and/or licensing policies. */
/* */
/*--------------------------------------------------------------------------*/
#include <stdio.h>
#include <ctype.h>
#include <conio.h>
#include <string.h>
#define WAZOO_SECTION
#define MATRIX_SECTION
#include "com.h"
#include "xfer.h"
#include "zmodem.h"
#include "keybd.h"
#include "sbuf.h"
#include "sched.h"
#include "externs.h"
#include "prototyp.h"
int Whack_CR ()
{
long t1, t2;
unsigned char j;
char m;
int l;
unsigned int i;
char buf[180];
t1 = timerset (3000); /* set 30 second timeout */
j = CR;
(void) strcpy (buf, msgtxt[M_INTRO]);
l = (int) strlen (buf);
m = 0;
while (!timeup (t1) && CARRIER) /* till then or CD lost */
{
/* Send either the CR or SPACE */
SENDBYTE (j);
/* Now switch to either CR or SPACE based on last output */
j = (unsigned char) (45 - j);
/* Now read what we get back to see if we get anything useful */
while (((i = (unsigned) TIMED_READ (0)) != (unsigned int)EOF) && (!timeup (t1)) && CARRIER)
{
if (i == CR)
{
if (m)
{
if (un_attended && fullscreen)
{
clear_filetransfer ();
sb_move (filewin, 1, 2);
sb_puts (filewin, (unsigned char *) buf);
sb_show ();
status_line ("*%s", buf);
}
else
{
set_xy (NULL);
scr_printf (buf);
}
/* We got what we wanted */
/* Now try to stop output on an Opus */
SENDBYTE ('');
return (0);
}
}
else if (i >= ' ')
{
buf[l++] = (char) (i & 0xff);
buf[l] = '\0';
if (l > SB_COLS - 6)
l = SB_COLS - 6;
m = 1;
}
}
/* Delay for a second */
t2 = timerset (100);
while (!timeup (t2))
time_release ();
}
if (CARRIER)
status_line (msgtxt[M_NOBODY_HOME]);
else
status_line (msgtxt[M_NO_CARRIER]);
return (-1);
}