home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
BTMTSRC3.ZIP
/
B_SBINIT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-07-02
|
10KB
|
247 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 originally written by Bob Hartman */
/* */
/* */
/* BinkleyTerm Initial Fullscreen Setup */
/* */
/* */
/* 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 <time.h>
#include <string.h>
#ifdef __TURBOC__
#include <alloc.h>
#else
#include <malloc.h>
#endif
#include "com.h"
#include "xfer.h"
#include "zmodem.h"
#include "keybd.h"
#include "sbuf.h"
#include "sched.h"
#include "externs.h"
#include "prototyp.h"
#include "vfossil.h"
extern VIOMODEINFO vfos_mode;
void b_sbinit ()
{
register int r;
char *savep;
savep = malloc (4096);
for (r = 0; r < 132; r++)
{
blanks[r * 2] = ' ';
blanks[r * 2 + 1] = 7;
}
vfossil_init ();
if (vfos_mode.col < 80)
vfos_mode.col = 80;
if (vfos_mode.row < 23)
vfos_mode.row = 23;
SB_ROWS = (int) vfos_mode.row - 1;
SB_COLS = (int) vfos_mode.col;
screen_clear ();
sb_init ();
free (savep);
wholewin = (REGIONP) sb_new (0, 0, SB_ROWS, SB_COLS);
settingswin = (REGIONP) sb_new (1, 1, 7, 22);
historywin = (REGIONP) sb_new (1, 23, 7, 23);
holdwin = (REGIONP) sb_new (1, 46, 7, SB_COLS - 47);
callwin = (REGIONP) sb_new (8, 1, SB_ROWS - 13, SB_COLS - 2);
filewin = (REGIONP) sb_new (SB_ROWS - 5, 1, 4, SB_COLS - 2);
sb_fill (wholewin, ' ', colors.background);
sb_fill (settingswin, ' ', colors.settings);
sb_fill (historywin, ' ', colors.history);
sb_fill (holdwin, ' ', colors.hold);
sb_fill (callwin, ' ', colors.call);
sb_fill (filewin, ' ', colors.file);
sb_box (settingswin, boxtype, colors.settings);
sb_box (historywin, boxtype, colors.history);
sb_box (holdwin, boxtype, colors.hold);
sb_box (callwin, boxtype, colors.call);
sb_box (filewin, boxtype, colors.file);
sb_move (settingswin, 0, 1);
sb_puts (settingswin, (unsigned char *) msgtxt[M_CURRENT_SETTINGS]);
sb_move (historywin, 0, 1);
sb_puts (historywin, (unsigned char *) msgtxt[M_TODAY_GLANCE]);
sb_move (holdwin, 0, 1);
sb_puts (holdwin, (unsigned char *) msgtxt[M_PENDING_OUTBOUND]);
sb_move (holdwin, 3, 7);
sb_puts (holdwin, (unsigned char *) msgtxt[M_INITIALIZING_SYSTEM]);
sb_move (callwin, 0, 1);
sb_puts (callwin, (unsigned char *) msgtxt[M_RECENT_ACTIVITY]);
sb_move (filewin, 0, 1);
sb_puts (filewin, (unsigned char *) msgtxt[M_TRANSFER_STATUS]);
sb_move (wholewin, 0, 1);
(void) sprintf (junk, msgtxt[M_NODE_COLON], Full_Addr_Str (&my_addr));
sb_puts (wholewin, (unsigned char *) junk);
sb_move (wholewin, 0, SB_COLS - 1 - (int) strlen (system_name));
sb_puts (wholewin, (unsigned char *) system_name);
bottom_line ();
sb_move (settingswin, SET_EVNT_ROW, 2);
sb_puts (settingswin, (unsigned char *) msgtxt[M_EVENT_COLON]);
sb_move (settingswin, SET_PORT_ROW, 2);
sb_puts (settingswin, (unsigned char *) msgtxt[M_PORT_COLON]);
sb_move (settingswin, SET_STAT_ROW, 2);
sb_puts (settingswin, (unsigned char *) msgtxt[M_STATUS_INIT]);
do_today ();
settingswin->sr0 = settingswin->r0 + 1;
settingswin->sr1 = settingswin->r1 - 1;
settingswin->sc0 = settingswin->c0 + 1;
settingswin->sc1 = settingswin->c1 - 1;
historywin->sr0 = historywin->r0 + 1;
historywin->sr1 = historywin->r1 - 1;
historywin->sc0 = historywin->c0 + 1;
historywin->sc1 = historywin->c1 - 1;
holdwin->sr0 = holdwin->r0 + 1;
holdwin->sr1 = holdwin->r1 - 1;
holdwin->sc0 = holdwin->c0 + 1;
holdwin->sc1 = holdwin->c1 - 1;
callwin->sr0 = callwin->r0 + 1;
callwin->sr1 = callwin->r1 - 1;
callwin->sc0 = callwin->c0 + 1;
callwin->sc1 = callwin->c1 - 1;
filewin->sr0 = filewin->r0 + 1;
filewin->sr1 = filewin->r1 - 1;
filewin->sc0 = filewin->c0 + 1;
filewin->sc1 = filewin->c1 - 1;
}
void do_today ()
{
char j[30];
ADDR tmp;
if (fullscreen)
{
sb_move (historywin, HIST_BBS_ROW, 2);
sb_puts (historywin, (unsigned char *) msgtxt[M_BBS_MAIL]);
(void) sprintf (j, "%d/%d", hist.bbs_calls, hist.mail_calls);
(void) sprintf (junk, "%-8.8s", j);
sb_puts (historywin, (unsigned char *) junk);
sb_move (historywin, HIST_ATT_ROW, 2);
sb_puts (historywin, (unsigned char *) msgtxt[M_CALLS_OUT]);
(void) sprintf (junk, "%-6d", hist.calls_made);
sb_puts (historywin, (unsigned char *) junk);
sb_move (historywin, HIST_CONN_ROW, 2);
sb_puts (historywin, (unsigned char *) msgtxt[M_GOOD_COST]);
(void) sprintf (j, "%d/%ld", hist.connects, hist.callcost);
(void) sprintf (junk, "%-8.8s", j);
sb_puts (historywin, (unsigned char *) junk);
sb_move (historywin, HIST_FILE_ROW, 2);
sb_puts (historywin, (unsigned char *) msgtxt[M_FILES_IO]);
(void) sprintf (j, "%d/%d", hist.files_in, hist.files_out);
(void) sprintf (junk, "%-8.8s", j);
sb_puts (historywin, (unsigned char *) junk);
sb_move (historywin, HIST_LAST_ROW, 2);
sb_puts (historywin, (unsigned char *) msgtxt[M_LAST]);
}
tmp.Zone = hist.last_zone;
tmp.Net = hist.last_net;
tmp.Node = hist.last_node;
tmp.Point = 0;
tmp.Domain = NULL;
last_type (hist.last_caller, &tmp);
}
void bottom_line ()
{
if (fullscreen)
{
sb_move (wholewin, SB_ROWS - 1, 0);
(void) sb_putc (wholewin, ' ');
sb_puts (wholewin, (unsigned char *) ANNOUNCE);
#ifdef OVERLAYS
sb_puts (wholewin, (unsigned char *) "-Overlay");
#endif
sb_move (wholewin, SB_ROWS - 1, SB_COLS - 23);
sb_puts (wholewin, (unsigned char *) msgtxt[M_ALTF10]);
}
}
void put_up_time ()
{
struct tm *tp;
time_t ltime;
if (fullscreen && (un_attended || doing_poll))
{
(void) time (<ime);
tp = localtime (<ime);
sb_move (settingswin, SET_TIME_ROW, SET_TIME_COL);
(void) sprintf (junk, "%s %s %02d @ %02d:%02d",
wkday[tp->tm_wday], mtext[tp->tm_mon], tp->tm_mday,
tp->tm_hour, tp->tm_min);
sb_puts (settingswin, (unsigned char *) junk);
sb_show ();
}
}